Skip to content

Commit

Permalink
Update pandas.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FFroehlich committed Mar 5, 2024
1 parent e8852be commit 959b5f5
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion python/sdist/amici/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,20 @@ def _fill_conditions_dict(
]
else:
datadict[par + "_presim"] = np.nan

for i_par, par in enumerate(

Check warning on line 414 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L414

Added line #L414 was not covered by tests
_get_names_or_ids(model, "Parameter", by_id=by_id)
):
if len(edata.parameters):
datadict[par] = edata.parameters[i_par]

Check warning on line 418 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L417-L418

Added lines #L417 - L418 were not covered by tests
else:
datadict[par] = model.getParameters()[i_par]

Check warning on line 420 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L420

Added line #L420 was not covered by tests

if len(edata.pscale):
datadict[par + "_scale"] = edata.pscale[i_par]

Check warning on line 423 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L422-L423

Added lines #L422 - L423 were not covered by tests
else:
datadict[par + "_scale"] = model.getParameterScale()[i_par]

Check warning on line 425 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L425

Added line #L425 was not covered by tests

return datadict


Expand Down Expand Up @@ -641,7 +655,7 @@ def constructEdataFromDataFrame(
Model instance.
:param condition:
pd.Series with FixedParameter Names/Ids as columns.
pd.Series with (Fixed)Parameter Names/Ids as columns.
Preequilibration conditions may be specified by appending
'_preeq' as suffix. Presimulation conditions may be specified by
appending '_presim' as suffix.
Expand Down Expand Up @@ -681,6 +695,19 @@ def constructEdataFromDataFrame(
.values
)

# fill in parameters
edata.parameters = (

Check warning on line 699 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L699

Added line #L699 was not covered by tests
condition[_get_names_or_ids(model, "Parameter", by_id=by_id)]
.astype(float)
.values
)

edata.pscale = (

Check warning on line 705 in python/sdist/amici/pandas.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/pandas.py#L705

Added line #L705 was not covered by tests
condition[_get_names_or_ids(model, "ParameterScale", by_id=by_id)]
.astype(int)
.values
)

# fill in preequilibration parameters
if any(
[overwrite_preeq[key] != condition[key] for key in overwrite_preeq]
Expand Down

0 comments on commit 959b5f5

Please sign in to comment.