Skip to content

Commit

Permalink
Remove redundant is_equilibrated method
Browse files Browse the repository at this point in the history
  • Loading branch information
fjclark committed Jun 17, 2024
1 parent dd2d044 commit 37de921
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 44 deletions.
26 changes: 2 additions & 24 deletions a3fe/run/_simulation_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,30 +697,6 @@ def failed_simulations(self) -> _List[SimulationRunner]:
for failure in sub_sim_runner.failed_simulations
]

def is_equilibrated(self, run_nos: _Optional[_List[int]] = None) -> bool:
f"""
Whether the {self.__class__.__name__} is equilibrated. This updates
the _equilibrated and _equil_time attributes of the lambda windows,
which are accessed by the equilibrated and equil_time properties.
Parameters
----------
run_nos : List[int], Optional, default=None
A list of the run numbers to check for equilibration. If None, all runs are analysed.
Returns
-------
equilibrated : bool
Whether the {self.__class__.__name__} is equilibrated.
"""
run_nos = self._get_valid_run_nos(run_nos)
return all(
[
sub_sim_runner.is_equilibrated(run_nos=run_nos)
for sub_sim_runner in self._sub_sim_runners
]
)

@property
def equilibrated(self) -> float:
f"""Whether the {self.__class__.__name__} is equilibrated."""
Expand Down Expand Up @@ -807,6 +783,8 @@ def recursively_set_attr(
attr=attr, value=value, force=force, silent=silent
)

def set_

def update_paths(self, old_sub_path: str, new_sub_path: str) -> None:
"""
Replace the old sub-path with the new sub-path in the base, input, and output directory
Expand Down
20 changes: 0 additions & 20 deletions a3fe/run/lambda_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,26 +260,6 @@ def get_tot_gpu_time(self, run_nos: _Optional[_List[int]] = None) -> float:
run_nos = self._get_valid_run_nos(run_nos)
return sum([self.sims[run_no - 1].get_tot_gpu_time() for run_no in run_nos])

def is_equilibrated(self, run_nos: _Optional[_List[int]] = None) -> bool:
"""
Check if the ensemble of simulations at the lambda window is
equilibrated, based on the run numbers specified and the
equilibration detection method. Store the equilibration status
and time in private variables if so.
Parameters
----------
run_nos : List[int], Optional, default: None
The run numbers to equilibration detection. If None, all runs will be used.
Returns
-------
equilibrated : bool
True if the simulation is equilibrated, False otherwise.
"""
self._equilibrated, self._equil_time = self.check_equil(self, run_nos=run_nos)
return self._equilibrated

@property
def equilibrated(self) -> bool:
"""Whether equilibration has been achieved."""
Expand Down

0 comments on commit 37de921

Please sign in to comment.