Skip to content

Commit

Permalink
- fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Sep 25, 2023
1 parent dc25a57 commit 8368e99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions copasi_petab_importer/convert_petab.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def write_experiments(self, experiments, petab):
for col in petab.independent_columns:
output.write('\t')
try:
output.write(str(float(conditions[col])))
output.write(str(float(conditions[col].iloc[0])))
except ValueError:
# output.write(str(conditions[col]))
if not current_exp['condition'] in self.ignore_independent:
Expand Down Expand Up @@ -591,7 +591,7 @@ def create_mapping(self, experiments, petab):
cn = obj.getInitialValueReference().getCN()

# if value is set to NaN, it is not supposed to be used as condition, but actually to be estimated
cond_value = float(petab.condition_data.loc[petab.condition_data.conditionId == cond][cond_cols[i]])
cond_value = float(petab.condition_data.loc[petab.condition_data.conditionId == cond][cond_cols[i]].iloc[0])
if not np.isnan(cond_value):
# now map to independent, as the value is not NaN
role = COPASI.CExperiment.independent
Expand Down Expand Up @@ -720,7 +720,7 @@ def add_fit_items(self, parameters):
value = float(current['nominalValue'])

obj = dm.findObjectByDisplayName(str('Values[' + name + ']'))
if obj is None:
if obj is None and 'parameterName' in current:
obj = dm.findObjectByDisplayName(str('Values[' + current.parameterName + ']'))
if estimate == 0:
# update the initial value but don't create an item for it
Expand Down

0 comments on commit 8368e99

Please sign in to comment.