pyrates-neuroscience / PyRates

Open-source, graph-based Python code generator and analysis toolbox for dynamical systems (pre-implemented and custom models). Most pre-implemented models belong to the family of neural population models.
https://pyrates.readthedocs.io/en/latest/
GNU General Public License v3.0
74 stars 8 forks source link

error running jansenrit.py (jrc.compile) on MacOS #29

Closed julama closed 2 years ago

julama commented 2 years ago

Hi, I have an issue when running the example jansenrit.py. I'm using a conda environment and MacOS. Any ideas how to resolve the error?

Traceback (most recent call last):
  File "/Users/julian/Simulations/pyrates/jansenrit.py", line 113, in <module>
    jrc_compiled = jrc.compile(backend='numpy', step_size=1e-4, solver='scipy')
  File "/Users/julian/opt/miniconda3/envs/ADL/lib/python3.7/site-packages/pyrates/ir/circuit.py", line 1491, in compile
    squeeze=squeeze_vars)
  File "/Users/julian/opt/miniconda3/envs/ADL/lib/python3.7/site-packages/pyrates/backend/parser.py", line 800, in parse_equations
    instantaneous=instantaneous, **kwargs.copy())
TypeError: Can't instantiate abstract class ExpressionParser with abstract methods _generateDefaultName

Thank you

Richert commented 2 years ago

Dear Julian,

thank you for your interest in PyRates! I suspect that this error is caused by a version conflict with pyparsing, since the ExpressionParser class inherits from pyparsing.ParserElement. Can you tell me which version you have installed in your Python environment? Personally, I am running PyRates with pyparsing == 2.4.6 without running into that issue. If that solves the problem, let me know so I can update our dependencies accordingly or make the ExpressionParser compatible with the latest pyparsing version.

Just as a heads-up: I am currently working on a larger upgrade to PyRates which will replace the current mathematical expression parsing with expression parsing based on sympy besides other improvements. I expect to merge these changes into the master branch in January and upgrade the PyRates pypi version soon after.

Best, Richard

julama commented 2 years ago

Dear Richard,

I downgraded pyparsing==3.0.6 to pyparsing==2.4.6 which resolved the issue.

Thank you for the quick help!

Richert commented 2 years ago

Dear Julian,

glad I could help! I will close this issue then.