Skip to content

Commit 5c3cec1

Browse files
joaanderpre-commit-ci[bot]umesh-timalsina
authored
Support hoomd v3 (#871)
* Remove unneeded imports HOOMD imports most submodules and packages by default. This change allows `import mbuild` to work with hoomd v3 installed. * Remove unused imports This allows `hoomd_simulation.py` to import when HOOMD v3 is installed. * Add create_hoomd3_forcefield * Fix typos * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Mention both supported mixing rules in the error * Fix pre-commit errors * Document snapshot as `hoomd.Snapshot` * Wrap particles into the box for hoomd v3 * Document type of `hoomd_forcefield` * Add PPPM support * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename hoomd3_forcefield to hoomd_forcefield Recognize that hoomd v4 this code may not be incompatible with v4 or future major versions. * Fix a bug in to_snapshot with hoomd v3 The next line of code assumes that `box` is a numpy array. In HOOMD v3, it is a list. * Start preparing for separate hoomd v3/v2 tests Separate out mbuild tests that do not strongly depend on the HOOMD version into TestHOOMDAny. Place the v2 specific tests in TestHOOMDv2 and skip these tests when the HOOMD version is not 2. * Port create_simulation tests to create_forcefield Copy the relevant tests for create_simulation and modify them to test create_forcefield. * Run pre-commit * Fix doc build errors Don't check hoomd.__version__ on import. The sphinx autodoc mock doesn't seem to support this. * Add hoomd_forcefield to the documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Attempt to fix failing hoomd v2 tests * Attempt to fix readthedocs build warning * Install the CPU build of HOOMD This will reduce CI test time. The conda auto-selection is supposed to do this automatically when there is no GPU on the system, but the CI test rig for mbuild is currently installing the cuda toolkit. * Fix failing hoomd2 test * test hoomd-3 in Linux, python-3.7 * WIP- chnage displayName and use mamba update for hoomdv3. * Revert change to environment-dev.yml Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Umesh Timalsina <umesh.timalsina@vanderbilt.edu>
1 parent b2fea0e commit 5c3cec1

File tree

6 files changed

+637
-89
lines changed

6 files changed

+637
-89
lines changed

azure-pipelines.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ stages:
8888
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.8' ) )
8989
displayName: Upload Coverage Report
9090
91+
- bash: |
92+
source activate mbuild-dev
93+
mamba update -c conda-forge/label/hoomd_dev -c conda-forge hoomd
94+
python -m pytest -v --cov=mbuild --cov-report=html --color=yes mbuild/tests/test_hoomd.py
95+
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.8' ) )
96+
displayName: Run tests for hoomdv3
97+
9198
- task: PublishCodeCoverageResults@1
9299
inputs:
93100
codeCoverageTool: Cobertura
@@ -96,6 +103,12 @@ stages:
96103
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.7' ) )
97104
displayName: Publish Coverage Report
98105

106+
- bash: |
107+
source activate test-environment
108+
bash <(curl -s https://codecov.io/bash) -C $(Build.SourceVersion)
109+
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.8' ) )
110+
displayName: Upload Coverage Report
111+
99112
100113
- job: Windows_no_bleeding
101114
pool:

docs/getting_started/writers/HOOMD_blue_file_writers.rst

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,29 @@ HOOMD-blue File Writers
22
===========================
33

44

5-
Write GSD (General Simulation Data)
5+
Write GSD (General Simulation Data)
66
-----------------------------------
7-
Default data file format for HOOMD v2
8-
+++++++++++++++++++++++++++++++++++++
9-
10-
.. automodule:: mbuild.formats.gsdwriter
11-
:members:
7+
Default data file format for HOOMD-blue
8+
+++++++++++++++++++++++++++++++++++++++
129

10+
.. automodule:: mbuild.formats.gsdwriter
11+
:members:
1312

13+
Create HOOMD-blue force field (>= 3.0)
14+
--------------------------------------------------------
15+
16+
.. automodule:: mbuild.formats.hoomd_forcefield
17+
:members:
1418

15-
Create Hoomd Simulation
19+
Create HOOMD-blue Simulation (v2.x)
1620
--------------------------------------------------------
1721

18-
.. automodule:: mbuild.formats.hoomd_simulation
19-
:members:
22+
.. automodule:: mbuild.formats.hoomd_simulation
23+
:members:
2024

2125

22-
Hoomdsnapshot
26+
HOOMD-blue Snapshot
2327
--------------------------------------------------------
2428

25-
.. automodule:: mbuild.formats.hoomd_snapshot
26-
:members:
29+
.. automodule:: mbuild.formats.hoomd_snapshot
30+
:members:

0 commit comments

Comments
 (0)