Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #600

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -20,26 +20,26 @@ repos:
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.4
# hooks:
# - id: codespell
# additional_dependencies: ["tomli"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.267'
rev: 'v0.7.2'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.18
hooks:
- id: mdformat
args: ["--wrap=80"]
3 changes: 3 additions & 0 deletions CI/functional_tests/test_molten_salts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
-------
Perform a functional test on two molten salts.
"""

from typing import Tuple

import pytest
Expand Down Expand Up @@ -73,6 +74,7 @@ def mdsuite_project(traj_files, tmp_path) -> mds.Project:
-------
project: mdsuite.Project
An MDSuite project to be tested.

"""
project = mds.Project(storage_path=tmp_path.as_posix())

Expand Down Expand Up @@ -114,6 +116,7 @@ def test_analysis(mdsuite_project):
-----
See the link below for similar data for CNs for molten salts.
https://link.springer.com/article/10.1007/s10800-018-1197-z

"""
NaCl_experiment = mdsuite_project.experiments.NaCl
KCl_experiment = mdsuite_project.experiments.KCl
Expand Down
3 changes: 3 additions & 0 deletions CI/functional_tests/test_water_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
-------
Functional test for the analysis of a GROMACS water simulation.
"""

from typing import List

import pytest
Expand Down Expand Up @@ -65,6 +66,7 @@ def mdsuite_project(traj_files, tmp_path) -> mdsuite.Project:
-------
project: mdsuite.Project
An MDSuite project to be tested.

"""
gmx_units = Units(
time=1e-12,
Expand Down Expand Up @@ -102,6 +104,7 @@ def test_water_analysis(mdsuite_project):
-----
The diffusion, angle, and eventually coordination data tested here are comparable
with values taken from experiment and published studies.

"""
water = mdsuite_project.experiments["water_sim"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import json
import os
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import json
import os
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import json
import os
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import json
import os
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import dataclasses
import os

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
values.

"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down Expand Up @@ -61,6 +62,7 @@ def test_project(traj_file, true_values, tmp_path, desired_memory):
Notes
-----
Test uncertainty is very high!

"""
with mds.utils.helpers.change_memory_fraction(desired_memory=desired_memory):
os.chdir(tmp_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import dataclasses
import os

Expand Down Expand Up @@ -103,9 +104,7 @@ def test_calculator(tmp_path, desired_memory):
time_should_be = time_step * np.arange(0, vacf_range) * units.time
thermal_vel_SI = np.sqrt(3 * kT / mass) * units.length / units.time
relaxation_time_SI = relaxation_time * units.time
vacf_should_be = thermal_vel_SI**2 * np.exp(
-time_should_be / relaxation_time_SI
)
vacf_should_be = thermal_vel_SI**2 * np.exp(-time_should_be / relaxation_time_SI)
diff_coeff_should_be = diff_coeff * units.length**2 / units.time

np.testing.assert_allclose(res["time"], time_should_be, atol=1e-6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import os

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
-------
Test the outcome of molecular mapping.
"""

from typing import List, Tuple

import pytest
Expand Down Expand Up @@ -73,6 +74,7 @@ def mdsuite_project(traj_files, tmp_path) -> mdsuite.Project:
-------
project: mdsuite.Project
An MDSuite project to be tested.

"""
water_files = traj_files[0]
bmim_file = traj_files[1]
Expand Down Expand Up @@ -138,6 +140,7 @@ def test_water_molecule_smiles(self, mdsuite_project):
-------
Tests that the molecule groups detected are done so correctly and that the
constructed trajectory is also correct.

"""
reference_molecules = {
"water": MoleculeInfo(
Expand Down Expand Up @@ -187,6 +190,7 @@ def test_water_molecule_reference_dict(self, mdsuite_project):
-------
Tests that the molecule groups detected are done so correctly and that the
constructed trajectory is also correct.

"""
mdsuite_project.experiments["ligand_water"].species["OW"].mass = [15.999]
mdsuite_project.experiments["ligand_water"].species["HW1"].mass = [1.00784]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def test_from_project(mdsuite_project):
Notes
-----
Does not check actual values just runs the transformation.

"""
mdsuite_project.run.CoordinateUnwrapper()

Expand All @@ -57,6 +58,7 @@ def test_from_project_twice(mdsuite_project):
Notes
-----
Does not check actual values just runs the transformation.

"""
mdsuite_project.run.CoordinateUnwrapper()
mdsuite_project.run.CoordinateUnwrapper()
Expand All @@ -69,6 +71,7 @@ def test_from_experiment(mdsuite_project):
Notes
-----
Does not check actual values just runs the transformation.

"""
mdsuite_project.experiments.NaCl.run.CoordinateUnwrapper()

Expand All @@ -81,6 +84,7 @@ def test_from_experiment_twice(mdsuite_project):
Notes
-----
Does not check actual values just runs the transformation.

"""
mdsuite_project.experiments.NaCl.run.CoordinateUnwrapper()
mdsuite_project.experiments.NaCl.run.CoordinateUnwrapper()
Expand Down
2 changes: 2 additions & 0 deletions CI/integration_tests/visualizer/znvis_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
-------
Test that the visualizer runs.
"""

import os
import tempfile
import time
Expand Down Expand Up @@ -54,6 +55,7 @@ def test_run(self):
test isn't prematurely closed and passes when it should have failed. For now
120 seconds is more than enough time for this test but we can think of some
improvements later.

"""
process = MDSuiteProcess(target=self._run_app)
process.start()
Expand Down
1 change: 1 addition & 0 deletions CI/unit_tests/database/test_experiment_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Summary
-------
"""

import dataclasses
import os

Expand Down
1 change: 1 addition & 0 deletions CI/unit_tests/database/test_file_read.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test MDSuite file reading."""

import numpy as np

import mdsuite
Expand Down
6 changes: 6 additions & 0 deletions CI/unit_tests/database/test_simulation_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
-------
Test for module for the simulation database.
"""

import os
import tempfile
import unittest
Expand All @@ -43,6 +44,7 @@ def test_build_path_input(self):
Returns
-------
Asserts that the correct path is generated for a given input.

"""
temp_dir = tempfile.TemporaryDirectory()
os.chdir(temp_dir.name)
Expand Down Expand Up @@ -70,6 +72,7 @@ def test_add_dataset(self):
Returns
-------
Assert that a dataset of the correct size is built.

"""
temp_dir = tempfile.TemporaryDirectory()
os.chdir(temp_dir.name)
Expand All @@ -93,6 +96,7 @@ def test_resize_array(self):
Returns
-------
Resizes a built dataset and checks that the size is now correct.

"""
temp_dir = tempfile.TemporaryDirectory()
os.chdir(temp_dir.name)
Expand All @@ -118,6 +122,7 @@ def test_database_exists(self):
Returns
-------
Checks for a False and then True result.

"""
temp_dir = tempfile.TemporaryDirectory()
os.chdir(temp_dir.name)
Expand All @@ -135,6 +140,7 @@ def test_check_existence(self):
Returns
-------
Checks for a True and False result.

"""
temp_dir = tempfile.TemporaryDirectory()
os.chdir(temp_dir.name)
Expand Down
1 change: 1 addition & 0 deletions CI/unit_tests/experiment/test_Experiment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test MDSuite Experiment class."""

import pytest

from mdsuite.experiment.experiment import Experiment
Expand Down
1 change: 1 addition & 0 deletions CI/unit_tests/experiment/test_run_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

Description:
"""

from unittest.mock import Mock

from mdsuite.experiment.run import RunComputation
Expand Down
Loading
Loading