Skip to content

Commit

Permalink
bugfix win libsbml
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskoenig committed Jul 14, 2023
1 parent 7cde994 commit c620990
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions src/sbmlsim/simulator/simulation_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def set_model(self, state: bytes) -> None:
with tempfile.NamedTemporaryFile("wb") as f_temp:
f_temp.write(state)
filename = f_temp.name
print(f"load state: {filename}")
self.r.loadState(str(filename))

def set_timecourse_selections(self, selections: Iterator[str]):
Expand Down Expand Up @@ -119,20 +118,16 @@ def __init__(self, model=None, **kwargs):

def set_model(self, model):
"""Set model."""
print("SimulatorParallel.set_model")
super(SimulatorParallel, self).set_model(model)
if model:
if not self.model.state_path:
raise ValueError("State path does not exist.")

# read state only once
print("Read state")
with open(self.model.state_path, "rb") as f_state:
state = f_state.read()
print("Set remote state")
for simulator in self.simulators:
simulator.set_model.remote(state)
print("Set timecourse selection")
self.set_timecourse_selections(self.r.selections)

# FIXME: set integrator settings
Expand Down
2 changes: 1 addition & 1 deletion src/sbmlsim/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def from_sbml_doc(
uid: Optional[str] = None
udef_test: libsbml.UnitDefinition
for udef_test in model.getListOfUnitDefinitions():
if libsbml.UnitDefinition_areEquivalent(udef_test, udef):
if libsbml.UnitDefinition.areEquivalent(udef_test, udef):
uid = udef_test.getId()
break

Expand Down

0 comments on commit c620990

Please sign in to comment.