Skip to content

Commit

Permalink
Make hoomd import optional.
Browse files Browse the repository at this point in the history
For use in CI which tests project init, but doesn't execute any
simulations.
  • Loading branch information
joaander committed Aug 20, 2024
1 parent e3ec78a commit eb13512
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 7 deletions.
6 changes: 5 additions & 1 deletion hoomd_validation/alj_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import math
import os

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

import matplotlib
import matplotlib.figure
import matplotlib.style
Expand Down
6 changes: 4 additions & 2 deletions hoomd_validation/custom_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

"""This file contains all custom actions needed for this project."""

import hoomd

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

class ComputeDensity(hoomd.custom.Action):
"""Compute the density of particles in the system.
Expand Down
6 changes: 5 additions & 1 deletion hoomd_validation/hard_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import json
import os

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

import matplotlib
import matplotlib.figure
import matplotlib.style
Expand Down
6 changes: 5 additions & 1 deletion hoomd_validation/lj_fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
import math
import os

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

import matplotlib
import matplotlib.figure
import matplotlib.style
Expand Down
6 changes: 5 additions & 1 deletion hoomd_validation/lj_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
import math
import os

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

import matplotlib
import matplotlib.figure
import matplotlib.style
Expand Down
5 changes: 4 additions & 1 deletion hoomd_validation/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
import os

import h5py
import hoomd
import numpy
import signac

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

def get_job_filename(sim_mode, device, name, file_type):
"""Construct a job filename."""
Expand Down

0 comments on commit eb13512

Please sign in to comment.