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

Models should not specify _nvar #549

Open
maedoc opened this issue Apr 12, 2022 · 1 comment
Open

Models should not specify _nvar #549

maedoc opened this issue Apr 12, 2022 · 1 comment
Labels
area/scilib bug Something isn't working good first issue Good for newcomers

Comments

@maedoc
Copy link
Member

maedoc commented Apr 12, 2022

Describe the bug

Models can specify incorrect _nvar.

Steps to reproduce

class Model:
    _nvar = 3
    state_variables = 'r', 'V'

m = Model()
m.nvar()  != len(m.state_variables)

Expected results

class Model:
    state_variables = 'r', 'V'

m = Model()
m.nvar()  == len(m.state_variables)

The nvar property should self._nvar = len(m.state_variables) and return that. Better if these become immutable attributes.

@Bikisome
Copy link

Hi @maedoc sir i am begginer , i would like to work on this issue, can you help me understand what needs to be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/scilib bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants