Skip to content

Commit

Permalink
Merge branch 'develop' into expdata_equality
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Nov 15, 2023
2 parents dcbd4a3 + eccdc1f commit 5db4596
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/sdist/amici/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ def __getitem__(

return super().__getitem__(item)

def __repr__(self):
status = amici.simulation_status_to_str(self._swigptr.status)
return f"<{self.__class__.__name__}(id={self._swigptr.id!r}, status={status})>"

def by_id(
self, entity_id: str, field: str = None, model: Model = None
) -> np.array:
Expand Down Expand Up @@ -343,6 +347,7 @@ class ExpDataView(SwigPtrView):
"""

_field_names = [
"ts",
"observedData",
"observedDataStdDev",
"observedEvents",
Expand All @@ -363,7 +368,9 @@ def __init__(self, edata: Union[ExpDataPtr, ExpData]):
f"Unsupported pointer {type(edata)}, must be"
f"amici.ExpDataPtr!"
)
self._field_dimensions = { # observables
self._field_dimensions = {
"ts": [edata.nt()],
# observables
"observedData": [edata.nt(), edata.nytrue()],
"observedDataStdDev": [edata.nt(), edata.nytrue()],
# event observables
Expand All @@ -378,6 +385,7 @@ def __init__(self, edata: Union[ExpDataPtr, ExpData]):
len(edata.fixedParametersPreequilibration)
],
}
edata.ts = edata.ts_
edata.observedData = edata.getObservedData()
edata.observedDataStdDev = edata.getObservedDataStdDev()
edata.observedEvents = edata.getObservedEvents()
Expand Down

0 comments on commit 5db4596

Please sign in to comment.