Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 28, 2024
1 parent 455b2ec commit 7156c79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion flowermd/base/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def dt(self, value):
def real_time_length(self):
"""The simulation time length in nanoseconds."""
return (self.timestep * self.real_timestep).to("ns")

@property
def real_timestep(self):
"""The simulation timestep in femtoseconds."""
Expand Down Expand Up @@ -442,6 +443,7 @@ def real_temperature(self):
energy = 1 * Units.J
temperature = (self._kT * energy) / u.boltzmann_constant_mks
return temperature

@property
def real_pressure(self):
"""The pressure of the simulation in Pascals."""
Expand Down Expand Up @@ -485,7 +487,6 @@ def _pressure_to_reduced_pressure(self, pressure):
reduced_pressure = (pressure * (length**3)) / energy
return float(reduced_pressure)


def _setup_temperature(self, temperature):
if isinstance(temperature, (float, int)):
# assuming temperature is kT
Expand All @@ -494,6 +495,7 @@ def _setup_temperature(self, temperature):
return self._temperature_to_kT(
validate_unit(temperature, u.dimensions.temperature)
)

def _setup_pressure(self, pressure):
if isinstance(pressure, (float, int)):
# assuming pressure is in reduced units.
Expand Down Expand Up @@ -522,6 +524,7 @@ def _setup_n_steps(self, duration):
return self._time_length_to_n_steps(
validate_unit(duration, u.dimensions.time)
)

def _setup_period(self, period):
if isinstance(period, int):
return period
Expand Down
2 changes: 1 addition & 1 deletion flowermd/internal/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Units:
# density units
g_cm3 = u.g / u.cm**3
kg_m3 = u.kg / u.m**3
amu_A3 = u.amu / u.angstrom ** 3
amu_A3 = u.amu / u.angstrom**3

# pressure units
atm = u.atm
Expand Down
2 changes: 1 addition & 1 deletion flowermd/internal/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import unyt
import unyt as u

from flowermd.internal.exceptions import UnitError
from flowermd.internal import Units
from flowermd.internal.exceptions import UnitError

"""utils.py
Internal utility methods for flowerMD.
Expand Down

0 comments on commit 7156c79

Please sign in to comment.