name 'ParameterMapping' is not defined
See original GitHub issueI am just trying to reproduce the AMICI Python example “Boehm” from the documentation. However, in cell 14:
model.requireSensitivitiesForAllParameters()
solver.setSensitivityMethod(amici.SensitivityMethod_forward)
solver.setSensitivityOrder(amici.SensitivityOrder_first)
objective = pypesto.AmiciObjective(model, solver, [edata], 1)
I get the following error:
NameError Traceback (most recent call last)
<ipython-input-26-8453b4d05827> in <module>()
6
7
----> 8 objective = pypesto.AmiciObjective(model, solver, [edata], 1)
/media/sf_DPhil_Project/Project07_Parameter Fitting/pyPESTO/pypesto/objective/amici_objective.py in __init__(self, amici_model, amici_solver, edatas, max_sensi_order, x_ids, x_names, parameter_mapping, guess_steadystate, n_threads, amici_object_builder, calculator)
163 # use identity mapping for each condition
164 parameter_mapping = create_identity_parameter_mapping(
--> 165 amici_model, len(edatas))
166 self.parameter_mapping = parameter_mapping
167
/media/sf_DPhil_Project/Project07_Parameter Fitting/pyPESTO/pypesto/objective/amici_util.py in create_identity_parameter_mapping(amici_model, n_conditions)
98 x_ids = list(amici_model.getParameterIds())
99 x_scales = list(amici_model.getParameterScale())
--> 100 parameter_mapping = ParameterMapping()
101 for _ in range(n_conditions):
102 condition_map_sim_var = {x_id: x_id for x_id in x_ids}
NameError: name 'ParameterMapping' is not defined
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (10 by maintainers)
Top Results From Across the Web
getting syntax error name 'parameters' is not defined?
First thing is to be very careful with indentation; the code you have listed looks fine until the def execute . I hope...
Read more >python - Calling function from for loop - issue with parameters ...
The first way you did it works because you are passing the NAME of ... it with a row which gets defined in...
Read more >Variable not declared: <name> - HCL Product Documentation
This chapter describes the compile-time error messages in the LotusScript® language. Variable not declared: <name>.
Read more >User's Manual: Functions and Variables - Apache JMeter
JMeter thread variables will have not been fully set up when the functions are processed, so variable names passed as parameters will not...
Read more >How to fix the name error 'not defined' when trying to pass a ...
How do I fix the name error "not defined" when trying to pass a variable between functions in Python?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can also start jupyter/ipython from outside the virtual env and just select a different kernel for execution: https://doc.cocalc.com/howto/jupyter-kernel-selection.html
Make sure the notebook is using the kernel from the right virtual environment where the latest version of amici is installed (see https://ipython.readthedocs.io/en/stable/install/kernel_install.html)