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

Add pre-commit #209

Merged
merged 3 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ci:
autoupdate_schedule: "monthly"
repos:
- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
files: ^physical_validation
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
files: ^physical_validation
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
files: ^physical_validation
2 changes: 1 addition & 1 deletion physical_validation/tests/test_data_lammps_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_read_lammps() -> None:
lammps_files = database.lammps_files(system_name)
parser = pv.data.LammpsParser()
ensemble = pv.data.EnsembleData(
ensemble="NVT", natoms=100 * 3, volume=20 ** 3, temperature=300
ensemble="NVT", natoms=100 * 3, volume=20**3, temperature=300
)
lammps_simulation_data = parser.get_simulation_data(
ensemble=ensemble,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"liquid": pv.data.EnsembleData(
ensemble="NVE",
natoms=1000,
volume=3.60140 ** 3,
volume=3.60140**3,
energy=1,
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# Hack ensemble to also distinguish trajectories
ensemble={
"NVT": pv.data.EnsembleData(
ensemble="NVT", natoms=100 * 3, volume=20 ** 3, temperature=300
ensemble="NVT", natoms=100 * 3, volume=20**3, temperature=300
),
},
description="100 water molecules, energy and trajectory data",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
# Hack ensemble to also distinguish trajectories
ensemble={
"NVT full trajectory": pv.data.EnsembleData(
ensemble="NVT", natoms=5 * 3, volume=1.86210 ** 3, temperature=300
ensemble="NVT", natoms=5 * 3, volume=1.86210**3, temperature=300
),
"NVT last frame only": pv.data.EnsembleData(
ensemble="NVT", natoms=5 * 3, volume=1.86210 ** 3, temperature=300
ensemble="NVT", natoms=5 * 3, volume=1.86210**3, temperature=300
),
"NPT full trajectory": pv.data.EnsembleData(
ensemble="NPT", natoms=5 * 3, pressure=1, temperature=300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
"NVT-low": pv.data.EnsembleData(
ensemble="NVT",
natoms=900 * 3,
volume=3.01125 ** 3,
volume=3.01125**3,
temperature=298.15,
),
"NVT-high": pv.data.EnsembleData(
ensemble="NVT",
natoms=900 * 3,
volume=3.01125 ** 3,
volume=3.01125**3,
temperature=308.15,
),
"NPT-lowT-lowP": pv.data.EnsembleData(
Expand Down
2 changes: 1 addition & 1 deletion physical_validation/util/gromacs_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def _check_exe(self, quiet: bool = False, exe: Optional[str] = None) -> bool:
else:
raise e
# check that output is as expected
return bool(re.search(br":-\) GROMACS - gmx.* \(-:", exe_out))
return bool(re.search(rb":-\) GROMACS - gmx.* \(-:", exe_out))

def _run(
self,
Expand Down
2 changes: 1 addition & 1 deletion physical_validation/util/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def check_convergence(
results[dt][0],
results[dt][1],
results[dt][2],
prev[0] ** 2 / dt ** 2,
prev[0] ** 2 / dt**2,
prev[1] / results[dt][1],
)
)
Expand Down