Skip to content

Commit

Permalink
change class name to
Browse files Browse the repository at this point in the history
  • Loading branch information
marjanalbooyeh committed Sep 12, 2023
1 parent 7f11cec commit bc69f94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hoomd_organics/base/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def from_system(cls, system, **kwargs):
)

@classmethod
def from_state(cls, initial_state, forcefield, **kwargs):
def from_snapshot_forces(cls, initial_state, forcefield, **kwargs):
"""Initialize a simulation from an initial state object and a
list of HOOMD forces."""
return cls(initial_state=initial_state, forcefield=forcefield, **kwargs)
Expand Down
8 changes: 5 additions & 3 deletions hoomd_organics/tests/base/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def test_initialize_from_system_missing_ff(self, benzene_cg_system):
Simulation.from_system(benzene_cg_system)

def test_initialize_from_state(self, benzene_system):
Simulation.from_state(
Simulation.from_snapshot_forces(
initial_state=benzene_system.hoomd_snapshot,
forcefield=benzene_system.hoomd_forcefield,
reference_values=benzene_system.reference_values,
)

def test_no_reference_values(self, benzene_system):
sim = Simulation.from_state(
sim = Simulation.from_snapshot_forces(
initial_state=benzene_system.hoomd_snapshot,
forcefield=benzene_system.hoomd_forcefield,
)
Expand Down Expand Up @@ -202,6 +202,8 @@ def test_save_restart_gsd(self, benzene_system):
sim.pickle_forcefield("forcefield.pickle")
f = open("forcefield.pickle", "rb")
hoomd_ff = pickle.load(f)
Simulation.from_state(initial_state="restart.gsd", forcefield=hoomd_ff)
Simulation.from_snapshot_forces(
initial_state="restart.gsd", forcefield=hoomd_ff
)
os.remove("forcefield.pickle")
os.remove("restart.gsd")

0 comments on commit bc69f94

Please sign in to comment.