pyPESTO: name 'ParameterMapping' is not defined
I 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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (10 by maintainers)
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)