Skip to content

Commit

Permalink
update docstring, raise error if both box length and density are prov…
Browse files Browse the repository at this point in the history
…ided
  • Loading branch information
marjanalbooyeh committed Sep 12, 2023
1 parent df941e1 commit 1f03e36
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions hoomd_organics/base/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def __init__(

@classmethod
def from_system(cls, system, **kwargs):
"""Initialize a simulation from a system object."""
"""Initialize a simulation from a `hoomd_organics.base.System`
object."""

if system.hoomd_forcefield:
return cls(
Expand Down Expand Up @@ -435,7 +436,11 @@ def run_update_volume(
"""
if final_box_lengths is None and final_density is None:
raise ValueError(
"Must provide either final_box_lengths or final_density"
"Must provide either `final_box_lengths` or `final_density`"
)
if final_box_lengths is not None and final_density is not None:
raise ValueError(
"Cannot provide both `final_box_lengths` and `final_density`."
)
if final_box_lengths is not None:
final_box = hoomd.Box(
Expand Down Expand Up @@ -687,7 +692,7 @@ def _add_hoomd_writers(self):
)

logger = hoomd.logging.Logger(categories=["scalar", "string"])
logger.add(self, quantities=["timestep", "tps"])
logger.add(self, quantitietes=["timestep", "tps"])
thermo_props = hoomd.md.compute.ThermodynamicQuantities(
filter=self.integrate_group
)
Expand Down

0 comments on commit 1f03e36

Please sign in to comment.