Skip to content

Commit

Permalink
add load method to Hdf5AmiciHistory (#1370)
Browse files Browse the repository at this point in the history
* add load method to Hdf5AmiciHistory
  • Loading branch information
plakrisenko committed May 6, 2024
1 parent ccc7f72 commit d9aa042
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pypesto/history/amici.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ def __init__(
):
super().__init__(id, file, options=options)

@staticmethod
def load(
id: str,
file: Union[str, Path],
options: Union[HistoryOptions, dict] = None,
) -> "Hdf5AmiciHistory":
"""Load the History object from memory."""
history = Hdf5AmiciHistory(id=id, file=file, options=options)
if options is None:
history.recover_options(file)
return history

@staticmethod
def _simulation_to_values(x, result, used_time):
values = Hdf5History._simulation_to_values(x, result, used_time)
Expand Down

0 comments on commit d9aa042

Please sign in to comment.