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

elif language construct is not working #949

Closed
max-talanov opened this issue Sep 5, 2023 · 5 comments
Closed

elif language construct is not working #949

max-talanov opened this issue Sep 5, 2023 · 5 comments

Comments

@max-talanov
Copy link

Dear developers.
I'm trying to extend nest with muscle model.
Unfortunately I have hit the problem that if i use elif nestml language construct the compilation process crashes with the following error message:
File "/home/max/.local/lib/python3.10/site-packages/NESTML-5.3.0.post0.dev0-py3.10.egg/pynestml/cocos/co_co_user_defined_function_correctly_defined.py", line 67, in check_co_co
cls.__check_return_recursively(symbol.get_return_type(),
File "/home/max/.local/lib/python3.10/site-packages/NESTML-5.3.0.post0.dev0-py3.10.egg/pynestml/cocos/co_co_user_defined_function_correctly_defined.py", line 142, in __check_return_recursively
cls.__check_return_recursively(type_symbol, else_ifs.get_block().get_stmt(), ret_defined)
AttributeError: 'ASTBlock' object has no attribute 'get_stmt'. Did you mean: 'get_stmts'?

If I use nested ifs then compilation works fine.
Thank you so much in advance.

@pnbabu
Copy link
Contributor

pnbabu commented Sep 7, 2023

@max-talanov are you referring to the elif block in the update block?

# sending spikes: crossing 0 mV, pseudo-refractoriness and local maximum...
        if n_r > 0: # is refractory?
            n_r -= 1
        elif V_m > 0 mV and U_old > V_m: # threshold && maximum
            n_r = RefractoryCounts
            emit_spike()

Please provide the example code where elif doesn't work for you.

@max-talanov
Copy link
Author

I have created the file to reproduce an error please see line 359:
https://github.com/max-talanov/bypass/blob/main/nestML/muscle/nestmlmodule/hh_moto_5ht_muscle.nestml#L359

@pnbabu
Copy link
Contributor

pnbabu commented Sep 12, 2023

@max-talanov This was a typo in the function name and apparently, none of our tests caught it. Thank you for pointing this out. I have fixed this also in #950.

@max-talanov
Copy link
Author

@pnbabu thank you so much!

@clinssen
Copy link
Contributor

clinssen commented Oct 6, 2023

Fixed in #950.

@clinssen clinssen closed this as completed Oct 6, 2023
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

3 participants