Skip to content

Commit

Permalink
fix None conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
marjanalbooyeh committed Mar 18, 2024
1 parent 27a2d74 commit 17b6043
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flowermd/base/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,16 +402,16 @@ def _temperature_to_kT(self, temperature):
return float(kT)

def _setup_temperature(self, kT=None, temperature=None):
if kT and temperature:
if kT is not None and temperature is not None:
raise ValueError(
"Both kT and temperature are provided. Please provide only one."
)
if not kT and not temperature:
if kT is None and temperature is None:
raise ValueError(
"Either kT or temperature must be "
"provided for the simulation."
)
if kT:
if kT is not None:
return kT
else:
return self._temperature_to_kT(temperature)
Expand All @@ -428,17 +428,17 @@ def _time_length_to_n_steps(self, time_length):
return int(time_length / real_timestep)

Check warning on line 428 in flowermd/base/simulation.py

View check run for this annotation

Codecov / codecov/patch

flowermd/base/simulation.py#L426-L428

Added lines #L426 - L428 were not covered by tests

def _setup_n_steps(self, n_steps=None, time_length=None):
if n_steps and time_length:
if n_steps is not None and time_length is not None:
raise ValueError(

Check warning on line 432 in flowermd/base/simulation.py

View check run for this annotation

Codecov / codecov/patch

flowermd/base/simulation.py#L432

Added line #L432 was not covered by tests
"Both n_steps and time_length are provided. Please provide only"
" one."
)
if not n_steps and not time_length:
if n_steps is None and time_length is None:
raise ValueError(

Check warning on line 437 in flowermd/base/simulation.py

View check run for this annotation

Codecov / codecov/patch

flowermd/base/simulation.py#L437

Added line #L437 was not covered by tests
"Either n_steps or time_length must be provided for the "
"simulation."
)
if n_steps:
if n_steps is not None:
return n_steps
else:
return self._time_length_to_n_steps(time_length)

Check warning on line 444 in flowermd/base/simulation.py

View check run for this annotation

Codecov / codecov/patch

flowermd/base/simulation.py#L444

Added line #L444 was not covered by tests
Expand Down

0 comments on commit 17b6043

Please sign in to comment.