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

Use of derived_param argument option in intiating mode causes NameError when using R0 function. #64

Open
m-d-grunnill opened this issue Aug 31, 2022 · 0 comments

Comments

@m-d-grunnill
Copy link

If derived_param argument is used when intiating a model, the later use of the pygom.model.epi_analysis.R0 can cause a NameError. So for example if the term 'lambda__' was being used for transmission instead of the full force of infection equation the following error would be thrown when using pygom.model.epi_analysis.R0:

Traceback (most recent call last):
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\IPython\core\interactiveshell.py", line 3444, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-13-e9cf6dd5a5ac>", line 7, in <module>
    model_R0 = R0(mg_model,disease_states)
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\epi_analysis.py", line 75, in R0
    F, V = disease_progression_matrices(ode, disease_state)
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\epi_analysis.py", line 159, in disease_progression_matrices
    ode2 = SimulateOde(ode.state_list, ode.param_list, transition=FList)
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\simulate.py", line 79, in __init__
    super(SimulateOde, self).__init__(state,
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\deterministic.py", line 71, in __init__
    super(DeterministicOde, self).__init__(state,
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\base_ode_model.py", line 172, in __init__
    self._transitionVector = self._computeTransitionVector()
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\base_ode_model.py", line 964, in _computeTransitionVector
    _f, _t, eqn = self._unrollTransitionList(self._getAllTransition())
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\base_ode_model.py", line 1092, in _unrollTransitionList
    eqn_list = checkEquation(eqn_list, *self._getListOfVariablesDict())
  File "C:\Users\mdgru\anaconda3\envs\amr\lib\site-packages\pygom-0.18-py3.9-win-amd64.egg\pygom\model\_model_verification.py", line 101, in checkEquation
    _eqn = eval(_inputStr)
  File "<string>", line 1, in <module>
NameError: name 'lambda__' is not defined
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

1 participant