Skip to content

Commit

Permalink
Merge pull request #10 from chrisjonesBSU/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
chrisjonesBSU authored Aug 24, 2023
2 parents 0658f92 + 35c41df commit f17dc5c
Show file tree
Hide file tree
Showing 61 changed files with 8,322 additions and 1,635 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Build environment
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environment-cpu.yml
miniforge-variant: Mambaforge
miniforge-version: 4.9.2-4
use-mamba: true

- name: Install package
shell: bash -l {0}
run: pip install -e .

- name: Run pytest with coverage report
shell: bash -l {0}
run: python -m pytest -rs -v --cov=./ --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# IDE files
.idea/
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: 'hoomd_polymers/tests/assets/.* | hoomd_polymers/assets/.*'
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
args: [--line-length=80]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args:
[--profile=black, --line-length=80]
exclude: 'cmeuitls/tests/assets/.* '

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
args:
- --max-line-length=80
exclude: '__init__.py'

#- repo: https://github.com/pycqa/pydocstyle
# rev: '6.3.0'
# hooks:
# - id: pydocstyle
# exclude: ^(cmeuitls/tests/|setup.py)
# args: [--convention=numpy]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
[![codecov](https://codecov.io/gh/chrisjonesBSU/hoomd-polymers/branch/main/graph/badge.svg?token=86LY9WHSH6)](https://codecov.io/gh/chrisjonesBSU/hoomd-polymers)
## About

Wrapper for [MoSDeF](https://github.com/mosdef-hub) packages and [Hoomd-Blue](https://github.com/glotzerlab/hoomd-blue) with
Wrapper for [MoSDeF](https://github.com/mosdef-hub) packages and [Hoomd-Blue](https://github.com/glotzerlab/hoomd-blue) with
a focus on simulating soft matter systems.

## Installation

### 1. Clone this repository: ###
### 1. Clone this repository: ###

```
git clone [email protected]:chrisjonesbsu/hoomd-polymers.git
cd hoomd-polymers
git clone [email protected]:chrisjonesbsu/hoomd-polymers.git
cd hoomd-polymers
```

### 2. Set up and activate environment: ###
### 2. Set up and activate environment: ###
#### a. Using HOOMD-blue from conda:
```
conda env create -f environment-cpu.yml
conda activate hoomd-polymers
conda env create -f environment-cpu.yml
conda activate hoomd-polymers
python -m pip install .
```
```

## Basic Usage
#### Using the built in molecules, systems and forcefields:
Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ comment:
- "main"
ignore:
- "hoomd-polymers/tests"
- "hoomd-polymers/library/*"
- "hoomd-polymers/logs"
- "hoomd-polymers/assets"
- "hoomd-polymers/__version__.py"
- "tutorials"
- "setup.py"
17 changes: 12 additions & 5 deletions environment-cpu.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: hoomd-polymers
name: hoomd-polymers
channels:
- conda-forge
dependencies:
- boltons
- foyer
- freud
- gsd
- hoomd>3.7=*cpu*
# - gmso>=0.11.0
- gsd<3.0
- hoomd=3.11=*cpu*
- mbuild
- numpy
- openbabel
- pip
- py3Dmol
- pydantic
- pytest
- pytest-cov
- python=3.9
- signac=1.7.0
- signac-flow=0.18.1
- symengine
- python-symengine
- unyt
- pip:
- git+https://github.com/cmelab/cmeutils.git@master
- git+https://github.com/cmelab/grits.git@main
- git+https://github.com/mosdef-hub/gmso@main
23 changes: 23 additions & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: hoomd-polymers-dev
channels:
- conda-forge
dependencies:
- foyer
- freud
#- gmso >= 0.11.0
- gsd<3.0
- hoomd=3.11=*gpu*
- mbuild
- numpy
- openbabel
- pip
- py3Dmol
- pytest
- pytest-cov
- python=3.9
- unyt
- pre-commit
- pip:
- git+https://github.com/cmelab/cmeutils.git@master
- git+https://github.com/cmelab/grits.git@main
- git+https://github.com/mosdef-hub/gmso@main
17 changes: 12 additions & 5 deletions environment-gpu.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: hoomd-polymers
name: hoomd-polymers
channels:
- conda-forge
dependencies:
- boltons
- foyer
- freud
- gsd
- hoomd>3.0=*gpu*
# - gmso>=0.11.0
- gsd<3.0
- hoomd=3.11=*gpu*
- mbuild
- numpy
- openbabel
- pip
- py3Dmol
- pydantic
- pytest
- pytest-cov
- python=3.9
- signac=1.7.0
- signac-flow=0.18.1
- symengine
- python-symengine
- unyt
- pip:
- git+https://github.com/cmelab/cmeutils.git@master
- git+https://github.com/cmelab/grits.git@main
- git+https://github.com/mosdef-hub/gmso@main
18 changes: 0 additions & 18 deletions environment-nohoomd.yml

This file was deleted.

11 changes: 9 additions & 2 deletions hoomd_polymers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
from hoomd_polymers.sim import simulation
from hoomd_polymers.modules import welding
from .base import (
CoPolymer,
Lattice,
Molecule,
Pack,
Polymer,
Simulation,
System,
)
2 changes: 2 additions & 0 deletions hoomd_polymers/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .forcefields import FF_DIR
from .molecule_files import MON_DIR
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os


FF_DIR = os.path.abspath(os.path.dirname(__file__))
23 changes: 23 additions & 0 deletions hoomd_polymers/assets/forcefields/benzene_opls.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<ForceField name="OPLS-AA" version="0.0.3" combining_rule="geometric">
<AtomTypes>
<Type name="ha" class="HA" element="H" mass="1.008" def="[H][C;%ca]" desc="benzene H" overrides=""/>
<Type name="ca" class="CA" element="C" mass="12.011" def="[C;X3;r6]1[C;X3;r6][C;X3;r6][C;X3;r6][C;X3;r6][C;X3;r6]1" desc="" overrides=""/>
</AtomTypes>
<HarmonicBondForce>
<Bond class1="CA" class2="CA" length="0.14" k="392459.2"/>
<Bond class1="CA" class2="HA" length="0.108" k="307105.6"/>
</HarmonicBondForce>
<HarmonicAngleForce>
<Angle class1="CA" class2="CA" class3="CA" angle="2.09439510239" k="527.184"/>
<Angle class1="CA" class2="CA" class3="HA" angle="2.09439510239" k="292.88"/>
</HarmonicAngleForce>
<RBTorsionForce>
<Proper class1="CA" class2="CA" class3="CA" class4="CA" c0="30.334" c1="0.0" c2="-30.334" c3="0.0" c4="0.0" c5="0.0"/>
<Proper class1="CA" class2="CA" class3="CA" class4="HA" c0="30.334" c1="0.0" c2="-30.334" c3="0.0" c4="0.0" c5="0.0"/>
<Proper class1="HA" class2="CA" class3="CA" class4="HA" c0="30.334" c1="0.0" c2="-30.334" c3="0.0" c4="0.0" c5="0.0"/>
</RBTorsionForce>
<NonbondedForce coulomb14scale="0.5" lj14scale="0.5">
<Atom type="ha" charge="0.115" sigma="0.242" epsilon="0.12552"/>
<Atom type="ca" charge="-0.115" sigma="0.355" epsilon="0.29288"/>
</NonbondedForce>
</ForceField>
25 changes: 25 additions & 0 deletions hoomd_polymers/assets/forcefields/dimethylether_opls.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<ForceField name="OPLS-AA" version="0.0.3" combining_rule="geometric">
<AtomTypes>
<Type name="ct" class="CT" element="C" mass="12.011" def="[C;X4]([O;%os])(H)(H)H" desc="C(H3OR), methyl ether" overrides=""/>
<Type name="os" class="OS" element="O" mass="15.999" def="[O;X2](C)C" desc="O, dialkyl ether" overrides=""/>
<Type name="hc" class="HC" element="C" mass="12.011" def="HC[O;%os]" desc="H(COR), alpha H ether" overrides=""/>
</AtomTypes>
<HarmonicBondForce>
<Bond class1="OS" class2="CT" length="0.141" k="267776.0"/>
<Bond class1="CT" class2="OS" length="0.141" k="267776.0"/>
<Bond class1="CT" class2="HC" length="0.109" k="284512.0"/>
</HarmonicBondForce>
<HarmonicAngleForce>
<Angle class1="OS" class2="CT" class3="HC" angle="1.91113553093" k="292.88"/>
<Angle class1="CT" class2="OS" class3="CT" angle="1.91113553093" k="502.08"/>
<Angle class1="HC" class2="CT" class3="HC" angle="1.88146493365" k="276.144"/>
</HarmonicAngleForce>
<RBTorsionForce>
<Proper class1="CT" class2="OS" class3="CT" class4="HC" c0="1.58992" c1="4.76976" c2="0.0" c3="-6.35968" c4="0.0" c5="0.0"/>
</RBTorsionForce>
<NonbondedForce coulomb14scale="0.5" lj14scale="0.5">
<Atom type="ct" charge="0.11" sigma="0.35" epsilon="0.276144"/>
<Atom type="os" charge="-0.4" sigma="0.29" epsilon="0.58576"/>
<Atom type="hc" charge="0.03" sigma="0.25" epsilon="0.12552"/>
</NonbondedForce>
</ForceField>
File renamed without changes.
Loading

0 comments on commit f17dc5c

Please sign in to comment.