tvb-root
tvb-root copied to clipboard
nvar property returns length of state variables
This PR resolves issue #549
Previously the Models could specify incorrect _nvar. The nvar property is now updated and returns the length of state_variables.
Existing behavior:
class Model:
_nvar = 3
state_variables = 'r', 'V'
m = Model()
m.nvar() != len(m.state_variables)
New behavior:
class Model:
state_variables = 'r', 'V'
m = Model()
m.nvar() == len(m.state_variables)
Hello, I am new to this community and would love to engage and contribute further. As I am still learning the TVB code base, I had chosen issue #549 to familiarise myself with the same. I request the maintainers to kindly go through the PR. 😃
Thanks for your contribution. Hope to see you on some of the other issues 👍
@geeythree can you additionally go through the different model classes and remove their custom _nvar defintions. For instance, this line can be removed.
Also note the rateML generated models currently generate an _nvar attribute which can also be removed.
@maedoc Sure, I can do that. Shall I update these changes in the same PR?
Yes, please just push more commits.
closing for #720 which has the rest of the changes requested