PEtab-dev / PEtab

PEtab - an SBML and TSV based data format for parameter estimation problems in systems biology
https://petab.readthedocs.io
MIT License
59 stars 12 forks source link

Error in merge_preeq_and_sim_pars_condition #433

Closed LeonardSchmiester closed 4 years ago

LeonardSchmiester commented 4 years ago

par_sim / par_preeq in merge_preeq_and_sim_pars_condition can be strings in some cases leading to the error:

Traceback (most recent call last):
  File "/mnt/generate_h5_jerry.py", line 15, in <module>
    h5gen.generate_file(hdf5_file_name)
  File "/root/parPE/python/parpe/hdf5_pe_input.py", line 121, in generate_file
    self._generate_simulation_to_optimization_parameter_mapping()
  File "/root/parPE/python/parpe/hdf5_pe_input.py", line 424, in _generate_simulation_to_optimization_parameter_mapping
    condition_idx)
  File "/root/parPE/build/venv/lib/python3.7/site-packages/petab/parameter_mapping.py", line 513, in merge_preeq_and_sim_pars_condition
    and not (np.isnan(par_sim) and np.isnan(par_preeq)):
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Should be fixable by replacing np.isnan with core.is_empty I think.

yannikschaelte commented 4 years ago

agreed