AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
108 stars 30 forks source link

petab_objective: amici_model.getObservableIds() returns tuple, but create_edata_for_condition requires list #1266

Closed jvanhoefer closed 4 years ago

jvanhoefer commented 4 years ago

What did you expect to happen? I am currently importing a (validated) PEtab model using the pyPESTO PEtab import. During the creation of the objective function, I get an error (ValueError: tuple.index(x): x not in tuple) in https://github.com/AMICI-dev/AMICI/blob/7de964ffc8e07b2c4e89faa9fd4a7a20d229165b/python/amici/petab_objective.py#L613

I think the error originates, since amici_model.getObservableIds() in https://github.com/AMICI-dev/AMICI/blob/7de964ffc8e07b2c4e89faa9fd4a7a20d229165b/python/amici/petab_objective.py#L448 returns in my case a tuple of strings, but https://github.com/AMICI-dev/AMICI/blob/7de964ffc8e07b2c4e89faa9fd4a7a20d229165b/python/amici/petab_objective.py#L464 requires a list of strings.

To Reproduce Happy to share minimal example + PEtab

AMICI version and system environment

dweindl commented 4 years ago

Hi @jvanhoefer , I am relatively sure that this is not about list vs tuple. Are you sure that the IDs of amici_model.getObservableIds() match those referenced in the PEtab files?

jvanhoefer commented 4 years ago

That is a good point, no, they don't. And I do not have a clue, why... I will have a look.

jvanhoefer commented 4 years ago

Lotka_Volterra_PEtab.zip

dweindl commented 4 years ago

That is a good point, no, they don't. And I do not have a clue, why... I will have a look.

Given

Lotka_Volterra_PEtab.zip

for me they match.

Maybe a wrong model module is imported? (Same name, different location - check your sys.path)

jvanhoefer commented 4 years ago

Maybe a wrong model module is imported? (Same name, different location - check your sys.path)

Indeed a wrong model version was imported. Problem solved. Thank you for your help :)