Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with running test.py: AttributeError: module 'numpy.fft' has no attribute 'fftpack' #29

Open
ReallyCoolBean opened this issue Feb 8, 2023 · 5 comments

Comments

@ReallyCoolBean
Copy link

ReallyCoolBean commented Feb 8, 2023

Hello,
I would like to work with CNmodel to run some simulations, but I am facing issues with installation. I run toy_model.py with no issues, but running test.py results in the following error:
image
I work on Ubuntu 22.04.1 LTS, I created a virtual environment with PyCharm, where I use a Python 3.7.16 interpreter. I followed the installation instructions here and ended up with the following list of packages (from pip freeze):
asteval==0.9.28
attrs==22.2.0
-e git+https://github.com/cnmodel/cnmodel.git@ff705f650e765142775f4ae0e3c3159e30af8944#egg=cnmodel
cochlea==2
cycler==0.11.0
Cython==0.29.33
exceptiongroup==1.1.0
future==0.18.3
importlib-metadata==6.0.0
iniconfig==2.0.0
kiwisolver==1.4.4
llvmlite==0.39.1
lmfit==0.9.11
matplotlib==3.0.3
NEURON==8.2.2
nose==1.3.7
numba==0.56.4
numpy==1.21.6
packaging==23.0
pandas==1.3.5
pluggy==1.0.0
pyparsing==3.0.9
PyQt5==5.15.9
PyQt5-Qt5==5.15.2
PyQt5-sip==12.11.1
pyqtgraph==0.11.0
pytest==7.2.1
pytest-faulthandler==2.0.1
python-dateutil==2.8.2
pytz==2022.7.1
resampy==0.4.2
scipy==1.1.0
six==1.16.0
tomli==2.0.1
typing_extensions==4.4.0
uncertainties==3.1.7
zipp==3.12.1

I suspect I need a different version of Numpy, but when I downgrade to 1.14.3, I get a warning from PyCharm, that numpy>=1.1 is required and I get tonnes of other errors when running test.py. Any help would be much appreciated!

Best wishes,
Sabina

@pbmanis
Copy link
Contributor

pbmanis commented Feb 9, 2023 via email

@ReallyCoolBean
Copy link
Author

Dear Paul,

Thank you for your prompt reply! I installed the latest version of cochlea package from PyPi, not from GitHub, so maybe I have not the most up-to-date version. Anyway, I followed your advice and commented out the if statement that was causing the error (line 120 and 121 in file cochlea/zilany2014/init.py). The attribute error disappeared, but I still have many assertion errors from other tests. I copied the output from running test.py below. I also have an error from test_matlab.py and I realised it is because I do not have matlabengine package. I wanted to install it, but it was not possible in my environment. As I have MatLab2022b, I need one of the newer versions of matalabengine, that are not compatible with Python 3.7. My system Python is actually 3.10, so not a problem for me to get a new virtual environment with Python 3.10 if, as you mentioned, CNmodel works with 3.10 as well. I only got Python 3.7, because it was one of the requirements mentioned in the documentation. But is MatLab necessary to run models with CNmodel? I understood from the documentation, that it is optional to use MatLab, as one can use cochlea Python package to simulate AN inputs, instead of using Matlab-based model from Zilany. Or am I wrong?
Many thanks for your help so far!

Best wishes,
Sabina Nowakowska

Testing with flags: -v --tb=short cnmodel/ --ignore=cnmodel/an_model/cache/
===================================================================================================== test session starts =====================================================================================================
platform linux -- Python 3.7.16, pytest-7.2.1, pluggy-1.0.0 -- /home/sabina/Documents/PhD/CNModel/venv/python/bin/python
cachedir: .pytest_cache
rootdir: /home/sabina/Documents/PhD/CNModel/cnmodel
collected 38 items

cnmodel/an_model/tests/test_cache.py::test_cache PASSED [ 2%]
cnmodel/an_model/tests/test_cache.py::test_parallel PASSED [ 5%]
cnmodel/cells/tests/test_cells.py::test_bushy PASSED [ 7%]
cnmodel/cells/tests/test_cells.py::test_bushy21 PASSED [ 10%]
cnmodel/cells/tests/test_cells.py::test_bushy_mouse PASSED [ 13%]
cnmodel/cells/tests/test_cells.py::test_tstellate PASSED [ 15%]
cnmodel/cells/tests/test_cells.py::test_tstellate_mouse PASSED [ 18%]
cnmodel/cells/tests/test_cells.py::test_tstellatet PASSED [ 21%]
cnmodel/cells/tests/test_cells.py::test_dstellate PASSED [ 23%]
cnmodel/cells/tests/test_cells.py::test_dstellate_mouse PASSED [ 26%]
cnmodel/cells/tests/test_cells.py::test_octopus PASSED [ 28%]
cnmodel/cells/tests/test_cells.py::test_pyramidal PASSED [ 31%]
cnmodel/cells/tests/test_cells.py::test_pyramidal_ceballos PASSED [ 34%]
cnmodel/cells/tests/test_cells.py::test_tuberculoventral PASSED [ 36%]
cnmodel/cells/tests/test_cells.py::test_cartwheel PASSED [ 39%]
cnmodel/cells/tests/test_cells.py::test_sgc_basal_middle PASSED [ 42%]
cnmodel/cells/tests/test_cells.py::test_sgc_apical PASSED [ 44%]
cnmodel/cells/tests/test_cells.py::test_mso PASSED [ 47%]
cnmodel/data/tests/test_db.py::test_db PASSED [ 50%]
cnmodel/mechanisms/tests/test_mechanisms.py::test_max_open_probability FAILED [ 52%]
cnmodel/synapses/tests/test_psd.py::test_sgc_bushy_psd PASSED [ 55%]
cnmodel/synapses/tests/test_psd.py::test_sgc_tstellate_psd PASSED [ 57%]
cnmodel/synapses/tests/test_psd.py::test_sgc_dstellate_psd PASSED [ 60%]
cnmodel/synapses/tests/test_psd.py::test_sgc_octopus_psd PASSED [ 63%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_bushy FAILED [ 65%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate FAILED [ 68%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate2 FAILED [ 71%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_dstellate FAILED [ 73%]
cnmodel/synapses/tests/test_synapses.py::test_dstellate_bushy FAILED [ 76%]
cnmodel/synapses/tests/test_synapses.py::test_dstellate_tstellate FAILED [ 78%]
cnmodel/synapses/tests/test_synapses.py::test_dstellate_dstellate FAILED [ 81%]
cnmodel/util/tests/test_expfitting.py::test_fit1 PASSED [ 84%]
cnmodel/util/tests/test_expfitting.py::test_fit2 PASSED [ 86%]
cnmodel/util/tests/test_matlab.py::test_matlab FAILED [ 89%]
cnmodel/util/tests/test_sound.py::test_conversions PASSED [ 92%]
cnmodel/util/tests/test_sound.py::test_tonepip PASSED [ 94%]
cnmodel/util/tests/test_sound.py::test_noisepip PASSED [ 97%]
cnmodel/util/tests/test_stim.py::test_make_pulse PASSED [100%]

========================================================================================================== FAILURES ===========================================================================================================
__________________________________________________________________________________________________ test_max_open_probability __________________________________________________________________________________________________
cnmodel/mechanisms/tests/test_mechanisms.py:36: in test_max_open_probability
assert np.allclose(max(op[1]), npsd.MaxOpen)
E assert False
E + where False = <function allclose at 0x7f218a2be290>(4.461976908971173e-16, 0.0198889)
E + where <function allclose at 0x7f218a2be290> = np.allclose
E + and 4.461976908971173e-16 = max([0.0, 1.6665747465704637e-22, 4.27921634125633e-22, 4.0857545073757307e-22, 7.283389826508939e-22, 4.368899757669638e-17, ...])
E + and 0.0198889 = NMDA_Kampa[0].MaxOpen
_______________________________________________________________________________________________________ test_sgc_bushy ________________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:22: in test_sgc_bushy
SynapseTester('sgc', 'bushy')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 6.867311

Comparing data array, shapes match: True
Model tested: sgc_bushy, measure: rise time
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.13030221 0.12689413 0.15776253 0.12518961 0.15403892 0.15031173
0.14999838 0.14959451 0.15207041 0.14871827]
Array received: [0.12990024 0.12679544 0.15763125 0.12513097 0.15396506 0.15028471
0.1500004 0.14958562 0.15204367 0.14869695]
args[0]: sgc
args[0] is string: sgc
_____________________________________________________________________________________________________ test_sgc_tstellate ______________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:25: in test_sgc_tstellate
SynapseTester('sgc', 'tstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.689052

Comparing data array, shapes match: True
Model tested: sgc_tstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.69308864 0.79556712 0.74559008 0.77344193 0.77430411 0.82386196
0.74595242 0.8241403 0.77463667 0.7999326 ]
Array received: [0.69434415 0.79589992 0.74570349 0.77357376 0.77429169 0.82386061
0.74596277 0.8242256 0.77464264 0.79993472]
args[0]: sgc
args[0] is string: sgc
_____________________________________________________________________________________________________ test_sgc_tstellate2 _____________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:28: in test_sgc_tstellate2
SynapseTester('sgc', 'tstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.673543

Comparing data array, shapes match: True
Model tested: sgc_tstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.69308864 0.79556712 0.74559008 0.77344193 0.77430411 0.82386196
0.74595242 0.8241403 0.77463667 0.7999326 ]
Array received: [0.69434415 0.79589992 0.74570349 0.77357376 0.77429169 0.82386061
0.74596277 0.8242256 0.77464264 0.79993472]
args[0]: sgc
args[0] is string: sgc
_____________________________________________________________________________________________________ test_sgc_dstellate ______________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:31: in test_sgc_dstellate
SynapseTester('sgc', 'dstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.378907

Comparing data array, shapes match: True
Model tested: sgc_dstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.69758345 0.72334678 0.74589235 0.8474736 0.72313864 0.7938418
0.84974859 0.82062624 0.84822158 0.84544384]
Array received: [0.69895612 0.72346767 0.74590778 0.84750019 0.72314556 0.79468527
0.84976285 0.82063297 0.84822449 0.84545507]
args[0]: sgc
args[0] is string: sgc
____________________________________________________________________________________________________ test_dstellate_bushy _____________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:34: in test_dstellate_bushy
SynapseTester('dstellate', 'bushy')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.954070

Comparing data array, shapes match: True
Model tested: dstellate_bushy, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.79418947 0.84940772 0.87459424 0.87468865 0.87456684 0.92467369
0.92437739 0.94899433 0.94971789 0.92495172]
Array received: [0.76918947 0.82440772 0.84959424 0.84968865 0.84956684 0.89967369
0.89937739 0.92399433 0.92471789 0.89995172]
args[0]: dstellate
args[0] is string: dstellate
__________________________________________________________________________________________________ test_dstellate_tstellate ___________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:37: in test_dstellate_tstellate
SynapseTester('dstellate', 'tstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.753272

Comparing data array, shapes match: True
Model tested: dstellate_tstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.64526165 0.66481897 0.77401916 0.74851229 0.72098648 0.74244124
0.77376867 0.79760721 0.7985437 0.7484276 ]
Array received: [0.62026165 0.63981897 0.74901916 0.72351229 0.69598648 0.71744124
0.74876867 0.77260721 0.7735437 0.7234276 ]
args[0]: dstellate
args[0] is string: dstellate
__________________________________________________________________________________________________ test_dstellate_dstellate ___________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:40: in test_dstellate_dstellate
SynapseTester('dstellate', 'dstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:80: in compare_results
assert np.all(inans == enans)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.312217
_________________________________________________________________________________________________________ test_matlab _________________________________________________________________________________________________________
cnmodel/util/tests/test_matlab.py:14: in test_matlab
proc = matlab.engine.start_matlab()
E NameError: name 'matlab' is not defined
====================================================================================================== warnings summary =======================================================================================================
../venv/python/lib/python3.7/site-packages/scipy/linalg/init.py:212
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/linalg/init.py:212: DeprecationWarning: The module numpy.dual is deprecated. Instead of using dual, use the functions directly from numpy or scipy.
from numpy.dual import register_func

../venv/python/lib/python3.7/site-packages/scipy/special/orthogonal.py:81
../venv/python/lib/python3.7/site-packages/scipy/special/orthogonal.py:81
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/special/orthogonal.py:81: DeprecationWarning: np.int is a deprecated alias for the builtin int. To silence this warning, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
from numpy import (exp, inf, pi, sqrt, floor, sin, cos, around, int,

../venv/python/lib/python3.7/site-packages/scipy/spatial/_spherical_voronoi.py:15
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/spatial/_spherical_voronoi.py:15: PendingDeprecationWarning: Importing from numpy.matlib is deprecated since 1.19.0. The matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
import numpy.matlib

../venv/python/lib/python3.7/site-packages/scipy/io/matlab/mio5.py:98
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/io/matlab/mio5.py:98: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
from .mio5_utils import VarReader5

../venv/python/lib/python3.7/site-packages/matplotlib/init.py:186
../venv/python/lib/python3.7/site-packages/matplotlib/init.py:186
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/matplotlib/init.py:186: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
a = distutils.version.LooseVersion(a)

../venv/python/lib/python3.7/site-packages/matplotlib/init.py:187
../venv/python/lib/python3.7/site-packages/matplotlib/init.py:187
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/matplotlib/init.py:187: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
b = distutils.version.LooseVersion(b)

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/_arraytools.py:45: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
b = a[a_slice]

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/signaltools.py:1341: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
out_full[ind] += zi

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/signaltools.py:1344: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
out = out_full[ind]

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/signaltools.py:1350: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
zf = out_full[ind]

cnmodel/cells/tests/test_cells.py: 57743 warnings
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/lmfit/model.py:626: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
if diff.dtype == np.complex:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================================================== short test summary info ===================================================================================================
FAILED cnmodel/mechanisms/tests/test_mechanisms.py::test_max_open_probability - assert False
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_bushy - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate2 - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_dstellate - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_dstellate_bushy - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_dstellate_tstellate - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_dstellate_dstellate - AssertionError
FAILED cnmodel/util/tests/test_matlab.py::test_matlab - NameError: name 'matlab' is not defined
=================================================================================== 9 failed, 29 passed, 57756 warnings in 88.95s (0:01:28) ===================================================================================
(python) sabina@sabina-asuslaptop:~/Documents/PhD/CNModel/cnmodel$ python test.py
Testing with flags: -v --tb=short cnmodel/ --ignore=cnmodel/an_model/cache/
===================================================================================================== test session starts =====================================================================================================
platform linux -- Python 3.7.16, pytest-7.2.1, pluggy-1.0.0 -- /home/sabina/Documents/PhD/CNModel/venv/python/bin/python
cachedir: .pytest_cache
rootdir: /home/sabina/Documents/PhD/CNModel/cnmodel
collected 38 items

cnmodel/an_model/tests/test_cache.py::test_cache PASSED [ 2%]
cnmodel/an_model/tests/test_cache.py::test_parallel PASSED [ 5%]
cnmodel/cells/tests/test_cells.py::test_bushy PASSED [ 7%]
cnmodel/cells/tests/test_cells.py::test_bushy21 PASSED [ 10%]
cnmodel/cells/tests/test_cells.py::test_bushy_mouse PASSED [ 13%]
cnmodel/cells/tests/test_cells.py::test_tstellate PASSED [ 15%]
cnmodel/cells/tests/test_cells.py::test_tstellate_mouse PASSED [ 18%]
cnmodel/cells/tests/test_cells.py::test_tstellatet PASSED [ 21%]
cnmodel/cells/tests/test_cells.py::test_dstellate PASSED [ 23%]
cnmodel/cells/tests/test_cells.py::test_dstellate_mouse PASSED [ 26%]
cnmodel/cells/tests/test_cells.py::test_octopus PASSED [ 28%]
cnmodel/cells/tests/test_cells.py::test_pyramidal PASSED [ 31%]
cnmodel/cells/tests/test_cells.py::test_pyramidal_ceballos PASSED [ 34%]
cnmodel/cells/tests/test_cells.py::test_tuberculoventral PASSED [ 36%]
cnmodel/cells/tests/test_cells.py::test_cartwheel PASSED [ 39%]
cnmodel/cells/tests/test_cells.py::test_sgc_basal_middle PASSED [ 42%]
cnmodel/cells/tests/test_cells.py::test_sgc_apical PASSED [ 44%]
cnmodel/cells/tests/test_cells.py::test_mso PASSED [ 47%]
cnmodel/data/tests/test_db.py::test_db PASSED [ 50%]
cnmodel/mechanisms/tests/test_mechanisms.py::test_max_open_probability FAILED [ 52%]
cnmodel/synapses/tests/test_psd.py::test_sgc_bushy_psd PASSED [ 55%]
cnmodel/synapses/tests/test_psd.py::test_sgc_tstellate_psd PASSED [ 57%]
cnmodel/synapses/tests/test_psd.py::test_sgc_dstellate_psd PASSED [ 60%]
cnmodel/synapses/tests/test_psd.py::test_sgc_octopus_psd PASSED [ 63%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_bushy FAILED [ 65%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate FAILED [ 68%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate2 FAILED [ 71%]
cnmodel/synapses/tests/test_synapses.py::test_sgc_dstellate FAILED [ 73%]
cnmodel/synapses/tests/test_synapses.py::test_dstellate_bushy FAILED [ 76%]
cnmodel/synapses/tests/test_synapses.py::test_dstellate_tstellate FAILED [ 78%]
cnmodel/synapses/tests/test_synapses.py::test_dstellate_dstellate FAILED [ 81%]
cnmodel/util/tests/test_expfitting.py::test_fit1 PASSED [ 84%]
cnmodel/util/tests/test_expfitting.py::test_fit2 PASSED [ 86%]
cnmodel/util/tests/test_matlab.py::test_matlab FAILED [ 89%]
cnmodel/util/tests/test_sound.py::test_conversions PASSED [ 92%]
cnmodel/util/tests/test_sound.py::test_tonepip PASSED [ 94%]
cnmodel/util/tests/test_sound.py::test_noisepip PASSED [ 97%]
cnmodel/util/tests/test_stim.py::test_make_pulse PASSED [100%]

========================================================================================================== FAILURES ===========================================================================================================
__________________________________________________________________________________________________ test_max_open_probability __________________________________________________________________________________________________
cnmodel/mechanisms/tests/test_mechanisms.py:36: in test_max_open_probability
assert np.allclose(max(op[1]), npsd.MaxOpen)
E assert False
E + where False = <function allclose at 0x7fd87f456290>(4.461976908971173e-16, 0.0198889)
E + where <function allclose at 0x7fd87f456290> = np.allclose
E + and 4.461976908971173e-16 = max([0.0, 1.6665747465704637e-22, 4.27921634125633e-22, 4.0857545073757307e-22, 7.283389826508939e-22, 4.368899757669638e-17, ...])
E + and 0.0198889 = NMDA_Kampa[0].MaxOpen
_______________________________________________________________________________________________________ test_sgc_bushy ________________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:22: in test_sgc_bushy
SynapseTester('sgc', 'bushy')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 7.337993

Comparing data array, shapes match: True
Model tested: sgc_bushy, measure: rise time
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.13030221 0.12689413 0.15776253 0.12518961 0.15403892 0.15031173
0.14999838 0.14959451 0.15207041 0.14871827]
Array received: [0.12990024 0.12679544 0.15763125 0.12513097 0.15396506 0.15028471
0.1500004 0.14958562 0.15204367 0.14869695]
args[0]: sgc
args[0] is string: sgc
_____________________________________________________________________________________________________ test_sgc_tstellate ______________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:25: in test_sgc_tstellate
SynapseTester('sgc', 'tstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.612235

Comparing data array, shapes match: True
Model tested: sgc_tstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.69308864 0.79556712 0.74559008 0.77344193 0.77430411 0.82386196
0.74595242 0.8241403 0.77463667 0.7999326 ]
Array received: [0.69434415 0.79589992 0.74570349 0.77357376 0.77429169 0.82386061
0.74596277 0.8242256 0.77464264 0.79993472]
args[0]: sgc
args[0] is string: sgc
_____________________________________________________________________________________________________ test_sgc_tstellate2 _____________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:28: in test_sgc_tstellate2
SynapseTester('sgc', 'tstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.634601

Comparing data array, shapes match: True
Model tested: sgc_tstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.69308864 0.79556712 0.74559008 0.77344193 0.77430411 0.82386196
0.74595242 0.8241403 0.77463667 0.7999326 ]
Array received: [0.69434415 0.79589992 0.74570349 0.77357376 0.77429169 0.82386061
0.74596277 0.8242256 0.77464264 0.79993472]
args[0]: sgc
args[0] is string: sgc
_____________________________________________________________________________________________________ test_sgc_dstellate ______________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:31: in test_sgc_dstellate
SynapseTester('sgc', 'dstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.353511

Comparing data array, shapes match: True
Model tested: sgc_dstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.69758345 0.72334678 0.74589235 0.8474736 0.72313864 0.7938418
0.84974859 0.82062624 0.84822158 0.84544384]
Array received: [0.69895612 0.72346767 0.74590778 0.84750019 0.72314556 0.79468527
0.84976285 0.82063297 0.84822449 0.84545507]
args[0]: sgc
args[0] is string: sgc
____________________________________________________________________________________________________ test_dstellate_bushy _____________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:34: in test_dstellate_bushy
SynapseTester('dstellate', 'bushy')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.929721

Comparing data array, shapes match: True
Model tested: dstellate_bushy, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.79418947 0.84940772 0.87459424 0.87468865 0.87456684 0.92467369
0.92437739 0.94899433 0.94971789 0.92495172]
Array received: [0.76918947 0.82440772 0.84959424 0.84968865 0.84956684 0.89967369
0.89937739 0.92399433 0.92471789 0.89995172]
args[0]: dstellate
args[0] is string: dstellate
__________________________________________________________________________________________________ test_dstellate_tstellate ___________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:37: in test_dstellate_tstellate
SynapseTester('dstellate', 'tstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:94: in compare_results
assert np.allclose(info[mask], expect[mask], rtol=self.rtol)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 1.164371

Comparing data array, shapes match: True
Model tested: dstellate_tstellate, measure: 20% latency
args: ['add', 'class', 'contains', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'gt', 'hash', 'init', 'init_subclass', 'iter', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Array expected: [0.64526165 0.66481897 0.77401916 0.74851229 0.72098648 0.74244124
0.77376867 0.79760721 0.7985437 0.7484276 ]
Array received: [0.62026165 0.63981897 0.74901916 0.72351229 0.69598648 0.71744124
0.74876867 0.77260721 0.7735437 0.7234276 ]
args[0]: dstellate
args[0] is string: dstellate
__________________________________________________________________________________________________ test_dstellate_dstellate ___________________________________________________________________________________________________
cnmodel/synapses/tests/test_synapses.py:40: in test_dstellate_dstellate
SynapseTester('dstellate', 'dstellate')
cnmodel/synapses/tests/test_synapses.py:72: in init
UserTester.init(self, "%s_%s" % (pre, post), pre, post)
cnmodel/util/user_tester.py:35: in init
self.assert_test_info(*args, **kwds)
cnmodel/synapses/tests/test_synapses.py:108: in assert_test_info
super(SynapseTester, self).assert_test_info(*args, **kwds)
cnmodel/util/user_tester.py:154: in assert_test_info
self.compare_results(None, result, expect)
cnmodel/util/user_tester.py:67: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:70: in compare_results
self.compare_results(key, info[i], expect[i])
cnmodel/util/user_tester.py:97: in compare_results
self.compare_results(k, info[k], expect[k])
cnmodel/util/user_tester.py:80: in compare_results
assert np.all(inans == enans)
E AssertionError
---------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------
Elapsed time for 1 Repetitions: 0.359177
_________________________________________________________________________________________________________ test_matlab _________________________________________________________________________________________________________
cnmodel/util/tests/test_matlab.py:14: in test_matlab
proc = matlab.engine.start_matlab()
E NameError: name 'matlab' is not defined
====================================================================================================== warnings summary =======================================================================================================
../venv/python/lib/python3.7/site-packages/scipy/linalg/init.py:212
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/linalg/init.py:212: DeprecationWarning: The module numpy.dual is deprecated. Instead of using dual, use the functions directly from numpy or scipy.
from numpy.dual import register_func

../venv/python/lib/python3.7/site-packages/scipy/special/orthogonal.py:81
../venv/python/lib/python3.7/site-packages/scipy/special/orthogonal.py:81
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/special/orthogonal.py:81: DeprecationWarning: np.int is a deprecated alias for the builtin int. To silence this warning, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
from numpy import (exp, inf, pi, sqrt, floor, sin, cos, around, int,

../venv/python/lib/python3.7/site-packages/scipy/spatial/_spherical_voronoi.py:15
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/spatial/_spherical_voronoi.py:15: PendingDeprecationWarning: Importing from numpy.matlib is deprecated since 1.19.0. The matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
import numpy.matlib

../venv/python/lib/python3.7/site-packages/scipy/io/matlab/mio5.py:98
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/io/matlab/mio5.py:98: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
from .mio5_utils import VarReader5

../venv/python/lib/python3.7/site-packages/matplotlib/init.py:186
../venv/python/lib/python3.7/site-packages/matplotlib/init.py:186
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/matplotlib/init.py:186: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
a = distutils.version.LooseVersion(a)

../venv/python/lib/python3.7/site-packages/matplotlib/init.py:187
../venv/python/lib/python3.7/site-packages/matplotlib/init.py:187
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/matplotlib/init.py:187: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
b = distutils.version.LooseVersion(b)

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/_arraytools.py:45: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
b = a[a_slice]

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/signaltools.py:1341: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
out_full[ind] += zi

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/signaltools.py:1344: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
out = out_full[ind]

cnmodel/an_model/tests/test_cache.py::test_cache
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/scipy/signal/signaltools.py:1350: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
zf = out_full[ind]

cnmodel/cells/tests/test_cells.py: 57743 warnings
/home/sabina/Documents/PhD/CNModel/venv/python/lib/python3.7/site-packages/lmfit/model.py:626: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
if diff.dtype == np.complex:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================================================== short test summary info ===================================================================================================
FAILED cnmodel/mechanisms/tests/test_mechanisms.py::test_max_open_probability - assert False
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_bushy - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_tstellate2 - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_sgc_dstellate - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_dstellate_bushy - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_dstellate_tstellate - AssertionError
FAILED cnmodel/synapses/tests/test_synapses.py::test_dstellate_dstellate - AssertionError
FAILED cnmodel/util/tests/test_matlab.py::test_matlab - NameError: name 'matlab' is not defined

@pbmanis
Copy link
Contributor

pbmanis commented Feb 9, 2023 via email

@ReallyCoolBean
Copy link
Author

Dear Paul,

I removed the cnmodel repo that I cloned in my virtual environment and instead cloned the one from your private repository. Indeed, when running test.py I no longer got the matlab error, only the yellow SKIPPED. Otherwise, the output was the same: same assertion errors and deprecation warnings.
I tried setting up a virtual environment afresh following the instructions and using the shell script you provided on your private repo with an exception of changing one line in ./make_env.sh from python3.9 to python 3.10. (Btw. sharing such a script is super useful, thank you!) I then ran test.py. On a positive side, I no longer have errors related to the fftpack (without modifying anything in the code) or matlab (only the yellow SKIPPED) or any deprecation warnings. But I still have the same assertion errors resulting from the mismatch between expected and received array (it reproduced the same numbers as pasted in my previous reply).

If you have any suggestions of what I could do to help us track down the error, let me know. Otherwise, if you think it is ok to start working with it, then maybe I do that. I am only starting getting familiar with your package, so for now I will be just playing around and maybe along the way I trace the error.

Many thanks,
Sabina

@pbmanis
Copy link
Contributor

pbmanis commented Feb 20, 2023

I think it is ok to start working with it, but we will need to track down the discrepancy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants