tvb-root icon indicating copy to clipboard operation
tvb-root copied to clipboard

nvar property returns length of state variables

Open geeythree opened this issue 3 years ago • 5 comments

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)

geeythree avatar Apr 14 '22 15:04 geeythree

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. 😃

geeythree avatar Apr 14 '22 15:04 geeythree

Thanks for your contribution. Hope to see you on some of the other issues 👍

maedoc avatar Apr 14 '22 20:04 maedoc

@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 avatar Apr 28 '22 07:04 maedoc

@maedoc Sure, I can do that. Shall I update these changes in the same PR?

geeythree avatar Apr 28 '22 08:04 geeythree

Yes, please just push more commits.

maedoc avatar Apr 28 '22 08:04 maedoc

closing for #720 which has the rest of the changes requested

maedoc avatar May 30 '24 08:05 maedoc