Skip to content

Commit

Permalink
Install packages required for CI checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Aug 21, 2024
1 parent eb13512 commit 481a82b
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 33 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/requirements-test.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
h5py
matplotlib
numpy
rtoml
scipy
signac
49 changes: 44 additions & 5 deletions .github/workflows/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
h5py==3.10.0
gsd==3.2.1
numpy==1.26.4
PyYAML==6.0.1
# This file was autogenerated by uv via the following command:
# uv pip compile requirements-test.in
contourpy==1.2.1
# via matplotlib
cycler==0.12.1
# via matplotlib
filelock==3.15.4
# via signac
fonttools==4.53.1
# via matplotlib
h5py==3.11.0
# via -r requirements-test.in
kiwisolver==1.4.5
# via matplotlib
matplotlib==3.9.2
# via -r requirements-test.in
numpy==2.1.0
# via
# -r requirements-test.in
# contourpy
# h5py
# matplotlib
# scipy
packaging==24.1
# via
# matplotlib
# signac
pillow==10.4.0
# via matplotlib
pyparsing==3.1.2
# via matplotlib
python-dateutil==2.9.0.post0
# via matplotlib
rtoml==0.11.0
# via -r requirements-test.in
scipy==1.14.1
# via -r requirements-test.in
signac==2.2.0
signac-flow==0.28.0
# via -r requirements-test.in
six==1.16.0
# via python-dateutil
synced-collections==1.0.0
# via signac
tqdm==4.66.5
# via signac
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: Unit test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
43 changes: 24 additions & 19 deletions hoomd_validation/custom_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,35 @@

try:
import hoomd
except ModuleNotFoundError as e:
print(f"Warning: {e}")

class ComputeDensity(hoomd.custom.Action):
"""Compute the density of particles in the system.
class ComputeDensity(hoomd.custom.Action):
"""Compute the density of particles in the system.
The density computed is a number density.
The density computed is a number density.
Args:
N: When not None, Use N instead of the number of particles when
computing the density.
"""

Args:
N: When not None, Use N instead of the number of particles when
computing the density.
"""
def __init__(self, N=None):
self.N = N

def __init__(self, N=None):
self.N = N
@hoomd.logging.log
def density(self):
"""float: The density of the system."""
if self.N is None:
return self._state.N_particles / self._state.box.volume

@hoomd.logging.log
def density(self):
"""float: The density of the system."""
if self.N is None:
return self._state.N_particles / self._state.box.volume
return self.N / self._state.box.volume

return self.N / self._state.box.volume
def act(self, timestep):
"""Dummy act method."""
pass
except ModuleNotFoundError as e:
print(f"Warning: {e}")

def act(self, timestep):
"""Dummy act method."""
# This workaround is to allow `python project.py init` to succeed in CI checks
# without requiring a working HOOMD installation.
class ComputeDensity:
pass
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

0 comments on commit 481a82b

Please sign in to comment.