diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef1a5cc..67f45ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,12 +2,12 @@ ci: autoupdate_schedule: "quarterly" repos: - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.3.0 hooks: - id: black files: ^physical_validation - repo: https://github.com/PyCQA/isort - rev: 5.11.4 + rev: 5.12.0 hooks: - id: isort files: ^physical_validation diff --git a/physical_validation/data/unit_data.py b/physical_validation/data/unit_data.py index 8f4b258..defff9f 100644 --- a/physical_validation/data/unit_data.py +++ b/physical_validation/data/unit_data.py @@ -47,7 +47,6 @@ def __init__( pressure_str: str = "PRESS", time_str: str = "TIME", ): - self.__kb = float(kb) self.__energy_str = str(energy_str) self.__energy_conversion = float(energy_conversion) diff --git a/physical_validation/tests/test_data_observable_data.py b/physical_validation/tests/test_data_observable_data.py index 10ba4c1..6ba8dd2 100644 --- a/physical_validation/tests/test_data_observable_data.py +++ b/physical_validation/tests/test_data_observable_data.py @@ -21,7 +21,6 @@ def test_observable_data_getters_and_setters() -> None: - # Check that newly created observable data object has `None` frames observable_data = ObservableData() assert observable_data.nframes is None diff --git a/physical_validation/tests/test_data_trajectory_data.py b/physical_validation/tests/test_data_trajectory_data.py index 16cdf19..3916430 100644 --- a/physical_validation/tests/test_data_trajectory_data.py +++ b/physical_validation/tests/test_data_trajectory_data.py @@ -21,7 +21,6 @@ def test_trajectory_data_getters_and_setters() -> None: - num_frames = 3 num_atoms = 5 position = np.random.random((num_frames, num_atoms, 3)) diff --git a/physical_validation/util/ensemble.py b/physical_validation/util/ensemble.py index d67877c..0e9a143 100644 --- a/physical_validation/util/ensemble.py +++ b/physical_validation/util/ensemble.py @@ -84,7 +84,6 @@ def chemical_potential_energy( def generate_histograms( traj1: np.ndarray, traj2: np.ndarray, g1: float, g2: float, bins: np.ndarray ) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: - n1 = np.size(traj1) n2 = np.size(traj2) @@ -110,7 +109,6 @@ def do_linear_fit( xlabel: str, ylabel: str, ) -> Tuple[np.ndarray, np.ndarray]: - h1, h2, dh1, dh2 = generate_histograms(traj1, traj2, g1, g2, bins) # v copied from checkensemble.py v @@ -187,7 +185,6 @@ def do_max_likelihood_fit( init_params: np.ndarray, verbose: bool, ) -> Tuple[np.ndarray, np.ndarray]: - # ============================================================= # # Define (negative) log-likelihood function and its derivatives # # ============================================================= # @@ -1136,7 +1133,6 @@ def check_1d( trajectory.bootstrap(traj2, bootstrap_repetitions), ) ): - # use overlap region t1, t2, min_ene, max_ene = trajectory.overlap(traj1=t1, traj2=t2) # calculate inefficiency diff --git a/physical_validation/util/gromacs_interface.py b/physical_validation/util/gromacs_interface.py index 70015b5..35165aa 100644 --- a/physical_validation/util/gromacs_interface.py +++ b/physical_validation/util/gromacs_interface.py @@ -41,7 +41,6 @@ def __init__( dp: bool = False, includepath: Optional[Union[str, List[str]]] = None, ): - self._exe = None self._dp = False self._includepath = None @@ -110,7 +109,6 @@ def get_quantities( end: Optional[float] = None, args: Optional[List[str]] = None, ) -> Dict[str, np.ndarray]: - if args is None: args = [] diff --git a/physical_validation/util/integrator.py b/physical_validation/util/integrator.py index f11ec98..e08344f 100644 --- a/physical_validation/util/integrator.py +++ b/physical_validation/util/integrator.py @@ -53,7 +53,6 @@ def check_convergence( screen: bool, filename: Optional[str], ) -> float: - assert isinstance(const_traj, dict) assert len(const_traj) >= 2 diff --git a/physical_validation/util/plot.py b/physical_validation/util/plot.py index 7c026d9..646406d 100644 --- a/physical_validation/util/plot.py +++ b/physical_validation/util/plot.py @@ -35,7 +35,6 @@ def plot( filename: Optional[str] = None, screen: bool = True, ) -> None: - try: import matplotlib as mpl import matplotlib.pyplot as plt