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

MSIBI Revamp #39

Open
wants to merge 620 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
620 commits
Select commit Hold shift + click to select a range
8bc38ee
update tests
chrisjonesBSU Apr 4, 2022
e3d5bbc
place-holder error for tail exp correction
chrisjonesBSU Apr 4, 2022
e9f3460
updated tutorial
chrisjonesBSU Apr 4, 2022
826d05f
Merge pull request #27 from chrisjonesBSU/bonds_ibi
chrisjonesBSU Apr 4, 2022
954c73d
update version
chrisjonesBSU Apr 4, 2022
d27dd79
pass in the normalize parameter to bond and angle distribution func c…
chrisjonesBSU May 25, 2022
639717b
Merge pull request #30 from chrisjonesBSU/master
chrisjonesBSU May 26, 2022
2e68ed3
saved smoothed final potential after last iteration
chrisjonesBSU May 27, 2022
b676f7e
add nlist exclusions param
chrisjonesBSU May 31, 2022
847493e
fix typo
chrisjonesBSU May 31, 2022
8b1a6e4
save target distributions, save a smoothed final pair potential
chrisjonesBSU Jun 1, 2022
70646c5
Merge branch 'smooth_final_pot' into add/nlist
chrisjonesBSU Jun 1, 2022
b1f9172
add print statements to bond and angle iterations
chrisjonesBSU Jun 1, 2022
5049b9e
update doc strings
chrisjonesBSU Jun 1, 2022
da166b2
add nlist param to tests
chrisjonesBSU Jun 1, 2022
6292e9e
update tests
chrisjonesBSU Jun 1, 2022
0ce3166
fix rdf variables in tests
chrisjonesBSU Jun 1, 2022
fa20498
add to print statement during opt loop
chrisjonesBSU Jun 1, 2022
5a2b241
Merge pull request #31 from chrisjonesBSU/add/nlist
chrisjonesBSU Jun 8, 2022
503b57e
add dihedral class
chrisjonesBSU Sep 16, 2022
63d3ef0
add import and table entry for dihedrals
chrisjonesBSU Sep 16, 2022
e4ffe7f
add dihedral optimization func
chrisjonesBSU Sep 16, 2022
0c6e54b
add dihedrals to runscript func
chrisjonesBSU Sep 16, 2022
d952c64
add dihedral entrys
chrisjonesBSU Sep 16, 2022
c4f132e
add dihedral to imports
chrisjonesBSU Sep 16, 2022
9ec4135
fix variable name
chrisjonesBSU Sep 16, 2022
1cc9abe
fix variable names, update dihedral pot file in optimize
chrisjonesBSU Sep 16, 2022
de5fd56
pass in dihedrals to state run script func
chrisjonesBSU Sep 18, 2022
a0b20f9
fix variable names
chrisjonesBSU Sep 18, 2022
147382e
comment out setting pair.rswitch
chrisjonesBSU Sep 18, 2022
db2d6ab
fix typo
chrisjonesBSU Sep 18, 2022
4c8930d
add tests for Angle class
chrisjonesBSU Sep 18, 2022
43c21c5
syntax fixes for consistency
chrisjonesBSU Sep 29, 2022
2cdebed
add 1 to iteration print statement
chrisjonesBSU Sep 29, 2022
905ef7c
couple of minor fixes
chrisjonesBSU Oct 6, 2022
44ea103
Merge branch 'add/dihedrals' of github.com:chrisjonesBSU/msibi into a…
chrisjonesBSU Oct 6, 2022
8f785ad
move exclude_bonded parameter to Pair's init func
chrisjonesBSU Oct 6, 2022
41af2e2
move exclude bonded param to State init func
chrisjonesBSU Oct 6, 2022
0cbe3c6
use LJ table func for table pots instead of mie
chrisjonesBSU Oct 10, 2022
234f1d6
move max_frames parameter from global (opt) to state specific
chrisjonesBSU Oct 18, 2022
b316a28
add optional param for setting num target frames different than max_f…
chrisjonesBSU Oct 24, 2022
0dd9d1c
add rmin and rmax attributes when setting Pair from a file
chrisjonesBSU Oct 25, 2022
96d3d11
add dr attribute for pair when setting from file
chrisjonesBSU Oct 25, 2022
717de8d
fix typo
chrisjonesBSU Oct 25, 2022
abe865c
add 1 to iteration num in ffit printout
chrisjonesBSU Oct 26, 2022
f298a36
making smoothing of pot during iterations optional
chrisjonesBSU Oct 26, 2022
d3df58c
add smoothing window as a parameter
chrisjonesBSU Oct 26, 2022
4e89256
copy file to potentials dir when starting from a file
chrisjonesBSU Oct 27, 2022
47e4480
clean up smoothing func calls
chrisjonesBSU Oct 27, 2022
b669379
add smoothing window param
chrisjonesBSU Nov 1, 2022
250f8b7
add missing parameter
chrisjonesBSU Nov 1, 2022
baf9f10
pass in missing parameters
chrisjonesBSU Nov 1, 2022
8f8b5ef
add missing parameter
chrisjonesBSU Nov 1, 2022
1cf0ffe
cleaning up doc strings and comments
chrisjonesBSU Nov 15, 2022
887d864
fix unit tests
chrisjonesBSU Nov 16, 2022
8599811
fix some unit tests
chrisjonesBSU Nov 16, 2022
bff073c
update some unit tests
chrisjonesBSU Nov 17, 2022
314b114
fix variable name
chrisjonesBSU Nov 30, 2022
3167e74
fix variable name
chrisjonesBSU Nov 30, 2022
58ddcd6
remove mdtraj check from set up
chrisjonesBSU Feb 23, 2023
866f7ce
fix indentation in initializing angles
chrisjonesBSU Feb 23, 2023
0d1dd84
hidden func to manually set target dist
chrisjonesBSU Mar 2, 2023
d4aa3c9
fix dl in bonds, change slope window
chrisjonesBSU Mar 22, 2023
0be9868
update version
chrisjonesBSU Mar 29, 2023
58bd5f0
create forces.py with Force class, change name in env files
chrisjonesBSU Mar 29, 2023
883852f
updating some attributes
chrisjonesBSU Mar 29, 2023
9bc929d
Merge branch 'add/dihedrals' into refactor
chrisjonesBSU Mar 29, 2023
9013ced
create Pair class
chrisjonesBSU Mar 29, 2023
a4bc14f
clean up optimize fucns, add state in force classes
chrisjonesBSU Mar 29, 2023
5b10250
cleaning up optimize functions
chrisjonesBSU Apr 1, 2023
0efc0c3
creating hoomd3 templates
chrisjonesBSU Apr 1, 2023
3da1a38
keeping track of formatting
chrisjonesBSU Apr 1, 2023
7d687ed
adding some fixes
chrisjonesBSU Apr 1, 2023
b0fe6be
set n_frames property in State
chrisjonesBSU Apr 5, 2023
fc21023
move add_state call location; add plotting function to Force
chrisjonesBSU Apr 5, 2023
84b155b
fix variable names
chrisjonesBSU Apr 5, 2023
efe2bc0
add optimize parameter to Force classes
chrisjonesBSU Apr 5, 2023
26aa530
updating variable names
chrisjonesBSU Apr 6, 2023
3d32ea0
use the nbins property
chrisjonesBSU Apr 6, 2023
5b89c7f
set correction func attribute, fix variable names
chrisjonesBSU Apr 6, 2023
cc398d3
remove old files, syntax changes
chrisjonesBSU Apr 6, 2023
c74b608
fix init imports
chrisjonesBSU Apr 6, 2023
01d0137
set only one add_ function in MSIBI class
chrisjonesBSU Apr 6, 2023
0d82877
Add repr functions, new force attributes in optimize
chrisjonesBSU Apr 7, 2023
8410191
fixing _initialize func
chrisjonesBSU Apr 7, 2023
e5b3c86
fix update_potential func, smoothing checks
chrisjonesBSU Apr 7, 2023
ec114ee
fix smoothing check
chrisjonesBSU Apr 7, 2023
2d3a2d0
add some to dos
chrisjonesBSU Apr 7, 2023
b4a423d
store history of head and tail corrections
chrisjonesBSU Apr 7, 2023
71236b7
finish set_harmonic functions
chrisjonesBSU Apr 7, 2023
4c7708c
finish set_harmonic funcs for all classes
chrisjonesBSU Apr 7, 2023
bed82ab
cleaning up some of the odd files sitting around
chrisjonesBSU Apr 7, 2023
110204b
re-arranging script stuff for hoomd3
chrisjonesBSU Apr 7, 2023
a53784d
adding more to hoomd script
chrisjonesBSU Apr 7, 2023
10fa58e
more work on simulation script
chrisjonesBSU Apr 7, 2023
7da8b78
update env files
chrisjonesBSU Apr 7, 2023
a75d4f4
update force init and entry attributes
chrisjonesBSU Apr 8, 2023
73359ad
fix force init attrs, add matplotlib to envs
chrisjonesBSU Apr 8, 2023
5da2879
updating MSIBI class
chrisjonesBSU Apr 8, 2023
2d6f1a2
fixes for hoomd script
chrisjonesBSU Apr 8, 2023
2c94027
adding some comments
chrisjonesBSU Apr 9, 2023
faab1a6
fix smoothing of target dist when adding a state
chrisjonesBSU Apr 10, 2023
b3533be
pin gsd version
chrisjonesBSU Aug 23, 2023
b264176
use hoomd4
chrisjonesBSU Feb 21, 2024
c78c747
fix param arg, add cuda version to env
chrisjonesBSU Feb 21, 2024
76c9771
add creation of thermostat
chrisjonesBSU Feb 21, 2024
635adda
make sure dist and potential have same shape
chrisjonesBSU Feb 22, 2024
a7210c3
use _table_entry instead of force_entry for forces that use tables
chrisjonesBSU Feb 22, 2024
ee9a635
add some plotting functions
chrisjonesBSU Feb 22, 2024
77a7663
remove old env files, move tutorials dir
chrisjonesBSU Feb 23, 2024
e684423
change env name
chrisjonesBSU Feb 23, 2024
f082627
Merge pull request #33 from chrisjonesBSU/hoomd3
chrisjonesBSU Feb 23, 2024
5ffc056
move n_steps from init to run_optimize
marjanalbooyeh Feb 23, 2024
f973e22
add jupyter to env
marjanalbooyeh Feb 23, 2024
ecb2762
Merge pull request #34 from cmelab/update-n-steps
marjanalbooyeh Feb 23, 2024
bf49919
fix doc strings
chrisjonesBSU Feb 23, 2024
5fcf80e
clean up params and doc strings in state.py
chrisjonesBSU Feb 23, 2024
cc64e40
add more doc strings
chrisjonesBSU Feb 24, 2024
8abbf63
Merge branch 'master' of github.com:cmelab/msibi into clean-up
chrisjonesBSU Feb 24, 2024
63ec403
add more doc strings
chrisjonesBSU Feb 25, 2024
289370e
fix tabs
chrisjonesBSU Feb 25, 2024
9f0546d
no longer create potentials dir and save table potential files, add n…
chrisjonesBSU Feb 25, 2024
f4da326
add method to get distribution history
chrisjonesBSU Feb 25, 2024
dde2196
fix bugs in Angle class
chrisjonesBSU Feb 25, 2024
31a5bb7
fix more angle bugs, table width and setting correction func
chrisjonesBSU Feb 25, 2024
2998a23
adding more doc strings
chrisjonesBSU Feb 25, 2024
cc50a4f
remove some unused attributes
chrisjonesBSU Feb 25, 2024
5c9d4c8
Merge pull request #35 from chrisjonesBSU/clean-up
chrisjonesBSU Feb 25, 2024
b500cfb
set python minimum to 3.9
chrisjonesBSU Feb 25, 2024
b505214
doc string improvements, add type hints
chrisjonesBSU Feb 25, 2024
4853974
fix imports
chrisjonesBSU Feb 25, 2024
cd36e43
more doc string touch ups
chrisjonesBSU Feb 25, 2024
7a2b2da
move force obj creation into optimize, set special pair name
chrisjonesBSU Feb 26, 2024
e8bc609
change how hoomd objs are passed into MSIBI, update doc strings, clea…
chrisjonesBSU Feb 26, 2024
6477af6
fix some typos and syntax errors
chrisjonesBSU Feb 26, 2024
f58ad45
add smoothing method and saving method to Forces
chrisjonesBSU Feb 26, 2024
e5fe52f
save force data to csv.
marjanalbooyeh Feb 26, 2024
58fc5b4
remove getattr() for hoomd nlist call
chrisjonesBSU Feb 26, 2024
40bded4
Merge branch 'cmelab:master' into master
marjanalbooyeh Feb 26, 2024
1749970
use pandas to save and load table files
chrisjonesBSU Feb 26, 2024
a431156
Use pandas to save and write table pots, add lj pot setter
chrisjonesBSU Feb 26, 2024
65ecfd6
fix some bugs in set lj pair method
chrisjonesBSU Feb 26, 2024
7115954
Fix gsd rdf call
chrisjonesBSU Feb 26, 2024
1ac507a
fix params in lj table entry
chrisjonesBSU Feb 26, 2024
d0ce2a8
Merge pull request #36 from chrisjonesBSU/save-forces
marjanalbooyeh Feb 27, 2024
792e63b
use scipy curve_fit for head and tail correction
Feb 27, 2024
a7bdd7a
fix pair correction function, rename correction func attrs
chrisjonesBSU Feb 28, 2024
63c1ac4
Merge pull request #37 from chrisjonesBSU/fix-pairs
chrisjonesBSU Feb 28, 2024
5a8f744
fix variable name in Dihedral._get_distribution
chrisjonesBSU Feb 29, 2024
bd003bb
add correction func attr to Dihedral class
chrisjonesBSU Feb 29, 2024
c6e1b3d
Add adjustments for set_quadratic and dihedrals
chrisjonesBSU Feb 29, 2024
2e5dc64
rework base test
chrisjonesBSU Mar 1, 2024
7b3c543
resolve conflicts
Mar 1, 2024
5ff141b
add pytest fixtures, start with Force tests
chrisjonesBSU Mar 1, 2024
019af63
new plot functions in force
Mar 1, 2024
9b1f985
merge with main
marjanalbooyeh Mar 1, 2024
11fee82
fix typo
marjanalbooyeh Mar 1, 2024
5d7c5fa
update plot legend position
marjanalbooyeh Mar 1, 2024
a1f4ad8
fix unit tests, make dev env file
chrisjonesBSU Mar 1, 2024
b97793d
Merge remote-tracking branch 'origin/fix-dihedrals' into unit-tests
chrisjonesBSU Mar 1, 2024
76c0189
finish dihedral unit tests
chrisjonesBSU Mar 1, 2024
c5d7b67
remove force specific test files
chrisjonesBSU Mar 2, 2024
9d56a35
new tests for forces, add .idea dir to gitignore
chrisjonesBSU Mar 2, 2024
449ef56
more tests for Force
chrisjonesBSU Mar 2, 2024
61845d5
add tests for optimize
chrisjonesBSU Mar 2, 2024
fe5d437
rename test file, add more optimize tests
chrisjonesBSU Mar 2, 2024
06a8e9c
rm old asset files
chrisjonesBSU Mar 2, 2024
884b8d0
remove old test files
chrisjonesBSU Mar 2, 2024
496cae0
remove container builders, update pytest yml and setup.py
chrisjonesBSU Mar 2, 2024
747684e
remove tutorials dir
chrisjonesBSU Mar 2, 2024
32b6332
remove containers dir
chrisjonesBSU Mar 2, 2024
535f681
remove unused utils
chrisjonesBSU Mar 2, 2024
e2d7107
add BaseTest to tests init
chrisjonesBSU Mar 2, 2024
61704a6
clean up setup.py
chrisjonesBSU Mar 2, 2024
f1e0c78
add 2 small gsd files for unit testing
chrisjonesBSU Mar 3, 2024
4fa8c0c
add gsd files to states in base test, add run test
chrisjonesBSU Mar 3, 2024
9d9da9d
add more run tests, fix conditional in Force init
chrisjonesBSU Mar 3, 2024
2ccf8f1
remove blank lines
chrisjonesBSU Mar 3, 2024
5f0534e
fix mamba version
chrisjonesBSU Mar 4, 2024
ea322fe
fix pytest arg
chrisjonesBSU Mar 4, 2024
0c88a17
update paths in pytest yml
chrisjonesBSU Mar 4, 2024
e6c5263
add pytest-cov to dev env
chrisjonesBSU Mar 4, 2024
f9f2e36
Merge pull request #38 from chrisjonesBSU/unit-tests
chrisjonesBSU Mar 4, 2024
3b9fa05
add more unit tests
chrisjonesBSU Mar 4, 2024
cc15447
add more tests, check for smoothing params greater than 0
chrisjonesBSU Mar 4, 2024
0cb6975
add more tests
chrisjonesBSU Mar 4, 2024
e9559de
remove old files
chrisjonesBSU Mar 4, 2024
c5e2589
pin freud version in env files
chrisjonesBSU Mar 4, 2024
599af10
Merge pull request #39 from chrisjonesBSU/unit-tests
chrisjonesBSU Mar 4, 2024
95a6634
resolve merge conflicts
marjanalbooyeh Mar 4, 2024
842755b
add func to save potenial history and save state data
marjanalbooyeh Mar 4, 2024
7193871
add xlim and ylim for plot methods
marjanalbooyeh Mar 4, 2024
53fafe1
add saved file format to docstring
marjanalbooyeh Mar 4, 2024
efa2851
fix syntax error
marjanalbooyeh Mar 4, 2024
19f46a7
Merge pull request #40 from marjanalbooyeh/master
marjanalbooyeh Mar 6, 2024
9f44d73
start adding alpha array capabilities
chrisjonesBSU Jun 20, 2024
87a69ed
update package versions in yml file, finish setting up alpha array usage
chrisjonesBSU Jun 23, 2024
558b68c
update current tests
chrisjonesBSU Jun 23, 2024
faa7e8b
add new tests for alpha array
chrisjonesBSU Jun 23, 2024
9b4bc9c
remove form check from potentials util func
chrisjonesBSU Jun 23, 2024
1dbb6d1
add check to state.alpha(), add test for it
chrisjonesBSU Jun 23, 2024
009ba5e
create matrix for testing
chrisjonesBSU Jun 23, 2024
9dfd369
fix ci workflow
chrisjonesBSU Jun 23, 2024
a223ae0
copy over pytest workflow from flowermd'
chrisjonesBSU Jun 23, 2024
c65a97d
make branches in ci consistent
chrisjonesBSU Jun 23, 2024
514edc1
make alpha linear form work when xmin isn't zero
chrisjonesBSU Jun 24, 2024
bf7e36c
fix unit test
chrisjonesBSU Jun 24, 2024
caa3f33
remove docs for now
chrisjonesBSU Jun 24, 2024
22da4e3
remove rtd build workflow
chrisjonesBSU Jun 24, 2024
bf93e93
Merge pull request #41 from chrisjonesBSU/alpha-func
chrisjonesBSU Jun 26, 2024
4dd802c
update doc strings, update docs build
chrisjonesBSU Jul 3, 2024
72b6ceb
update images
chrisjonesBSU Jul 3, 2024
95ad33e
update env files
chrisjonesBSU Jul 3, 2024
cecb6c1
change verison, update install instructions
chrisjonesBSU Jul 3, 2024
58b1e1e
fix name for setting polynomial table pots
chrisjonesBSU Jul 3, 2024
448e9fd
add pairs to forces docs
chrisjonesBSU Jul 3, 2024
2371b00
use math notation
chrisjonesBSU Jul 6, 2024
b32b14b
add precommit
chrisjonesBSU Jul 6, 2024
793dad6
update ci workflow
chrisjonesBSU Jul 6, 2024
86e6360
update branch name
chrisjonesBSU Jul 6, 2024
e0b0205
update pytest args
chrisjonesBSU Jul 6, 2024
6460566
fix mamba error
chrisjonesBSU Jul 6, 2024
7babdf6
change shell command
chrisjonesBSU Jul 6, 2024
5c9abb6
use old pytest file
chrisjonesBSU Jul 6, 2024
c64d4f7
add rtd yml file
chrisjonesBSU Jul 6, 2024
f7dc840
fix imports
chrisjonesBSU Jul 6, 2024
37d9aa1
precommit fix'
chrisjonesBSU Jul 6, 2024
de80e0a
precommit fix'
chrisjonesBSU Jul 6, 2024
f548bd2
fix precommit file
chrisjonesBSU Jul 6, 2024
c304fe4
fix savit smooth func
chrisjonesBSU Jul 6, 2024
d75c5a1
fix conf path
chrisjonesBSU Jul 6, 2024
d6c4467
fix rtd typo
chrisjonesBSU Jul 6, 2024
b2fd9a3
Merge pull request #42 from chrisjonesBSU/docs
chrisjonesBSU Jul 6, 2024
d0a7011
Update README.md
chrisjonesBSU Jul 6, 2024
48899de
use CI file from mosdef repos
chrisjonesBSU Jul 20, 2024
229e881
remove python 3.9
chrisjonesBSU Jul 20, 2024
2ec6f9b
Touch up doc strings, add unit test, update ruff version
chrisjonesBSU Aug 21, 2024
682ad62
Add simple example to README, bump py version in env files
chrisjonesBSU Aug 22, 2024
82f205a
update readme
chrisjonesBSU Aug 22, 2024
8236948
add 1 more example
chrisjonesBSU Aug 22, 2024
d5a7aac
clean up README
chrisjonesBSU Aug 22, 2024
bfb8452
move DOI badge to the top
chrisjonesBSU Aug 22, 2024
519eecb
update CI, readthedocs
chrisjonesBSU Aug 22, 2024
b35fc3d
add codeql yml, update branches in workflows
chrisjonesBSU Aug 22, 2024
1c6e1c9
update README
chrisjonesBSU Aug 22, 2024
2d81521
update README
chrisjonesBSU Aug 22, 2024
d4b87e6
more notes about Hoomd
chrisjonesBSU Aug 22, 2024
4fb7d40
remove tutorials stuff from gitignore
chrisjonesBSU Aug 22, 2024
7390912
change cmelab to mosdef-hub in docs
chrisjonesBSU Aug 22, 2024
52480ae
fix typos in README
chrisjonesBSU Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
branches: # branch names that can post comment
- "main"
ignore:
- "msibi/tests"
- "setup.py"
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * *"

jobs:
test:
if: github.event.pull_request.draft == false
name: MSIBI Tests (python)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request

- name: Install Mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
create-args: >-
python=${{ matrix.python-version }}

- name: Install Package
run: python -m pip install -e .

- name: Test (OS -> ${{ matrix.os }} / Python -> ${{ matrix.python-version }})
run: python -m pytest -v --cov=msibi --cov-report=xml --cov-append --cov-config=setup.cfg --color yes --pyargs msibi

- name: Upload Coverage Report
uses: codecov/codecov-action@v4
with:
name: MSIBI-Coverage
verbose: true

arch-test:
if: github.event.pull_request.draft == false
name: MSIBI Tests (arch)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, macOS-13, ubuntu-latest]
python-version: ["3.12"]

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
name: Checkout Branch / Pull Request

- name: Install Mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
create-args: >-
python=${{ matrix.python-version }}

- name: Install Package
run: python -m pip install -e .

- name: Test (OS -> ${{ matrix.os }} / Python -> ${{ matrix.python-version }})
run: python -m pytest -v --color yes --pyargs msibi
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "50 6 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ python ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Default files
*.ipynb
*.pyc
*.dcd
.DS_Store
*.egg-info

*.idea/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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/astral-sh/ruff-pre-commit
rev: v0.6.1 # Ruff version
hooks:
- id: ruff
args: [--fix, --extend-ignore=E203]
- id: ruff-format
args: [--line-length=80]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: 'msibi/tests/assets/.*'
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args:
[ --profile=black, --line-length=80 ]
exclude: 'msibi/tests/assets/.* '
16 changes: 16 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
formats:
- htmlzip
- pdf
build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"

conda:
environment: docs/environment-docs.yml

sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: false
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

117 changes: 104 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,114 @@
MultiState Iterative Boltzmann Inversion
<img src="/docs/images/msibi.png" height="300">

# MultiState Iterative Boltzmann Inversion (MS-IBI)
----------------------------------------
[![Build Status](https://travis-ci.org/mosdef-hub/msibi.svg?branch=master)](https://travis-ci.org/mosdef-hub/msibi)
[![Coverage Status](https://coveralls.io/repos/ctk3b/msibi/badge.svg?branch=master)](https://coveralls.io/r/ctk3b/msibi?branch=master)
[![pytest](https://github.com/mosdef-hub/msibi/actions/workflows/pytest.yml/badge.svg)](https://github.com/mosdef-hub/msibi/actions/workflows/pytest.yml)
[![codecov](https://codecov.io/gh/mosdef-hub/msibi/branch/main/graph/badge.svg?token=7NFPBMBN0I)](https://codecov.io/gh/mosdef-hub/msibi)
[![Citing MSIBI](https://img.shields.io/badge/DOI-10.1063%2F1.4880555-blue.svg)](http://dx.doi.org/10.1063/1.4880555)

A package to help you manage and run pair potential optimizations using
multistate iterative Boltzmann inversion.
A package to help you manage and run coarse-grain potential optimizations using multistate iterative Boltzmann inversion.

Install from source:
```python
## Installing MSIBI

### Install from conda-forge (Coming soon):
```
mamba install -c conda-forge msibi
```

### Install from source:
```bash
git clone https://github.com/mosdef-hub/msibi.git
cd msibi
mamba env create -f environment.yml
mamba activate msibi
pip install .
```

## Using MSIBI
The MSIBI package is designed to be very object oriented. Any force optimization runs requires at least one `msibi.state.State` instance, `msibi.force.Force` instance and `msibi.optimize.MSIBI` instance. More state and forces can be added as needed. Multiple forces can be added with some held fixed while others are being optimized after each iteation. MSIBI is designed to allow for optimization of both intra-molecular and inter-molecular potentials.

MSIBI uses [Hoomd-Blue](https://hoomd-blue.readthedocs.io/en/latest/) to run optimization simulations. It is not required that you be familiar with Hoomd to use MSIBI as the simulation script is automatically generated and ran. However, it is required that you pass in the choice of [Hoomd method](https://hoomd-blue.readthedocs.io/en/latest/module-md-methods.html), [Hoomd neighbor list](https://hoomd-blue.readthedocs.io/en/latest/module-md-nlist.html), and [Hoomd thermostat](https://hoomd-blue.readthedocs.io/en/latest/module-md-methods-thermostats.html) to the `msibi.optimize.MSIBI` class. Since MSIBI utilizes Hoomd-Blue, this means that MSIBI can run on GPUs, see [Hoomd's installation guide](https://hoomd-blue.readthedocs.io/en/latest/installation.html) for instructions on ensuring your environment includes a GPU build of hoomd.

### Example: Single state, single force
- Here is an example of learning a pair potential using a single state point with only one bead type.

```python
import hoomd
from msibi import MSIBI, State, Pair

optimizer = MSIBI(
nlist=hoomd.md.nlist.Cell,
integrator=hoomd.md.methods.ConstantVolume,
thermostat=hoomd.md.methods.thermostats.MTTK,
dt=0.0001,
gsd_period=int(1e4)
)

# Create a State instance, pass in a path to the target trajectory
stateA = State(name="A", kT=2.0, traj_file="stateA.gsd", alpha=1.0, n_frames=50)
optimizer.add_state(stateA)

# Create a Pair instance to be optimized
pairAA = Pair(type1="A", type2="A", optimize=True, r_cut=3.0, nbins=100)
# Call the set_lj() method to set an initial guess potential
pairAA.set_lj(r_min=0.001, r_cut=3.0, epsilon=1.0, sigma=1.0)
optimizer.add_force(pairAA)

# Run 20 MSIBI iterations
optimizer.run_optimization(n_steps=2e6, n_iterations=20)
pairAA.save_potential("pairAA.csv")
```

#### Citation [![Citing MSIBI](https://img.shields.io/badge/DOI-10.1063%2F1.4880555-blue.svg)](http://dx.doi.org/10.1063/1.4880555)
### Example: Multiple states, multiple forces
- Here is an example of learning a pair potential using multiple state points and forces.
- In this example, we set fixed bond and angle potentials that are included during iteration simulations.
- The bond potential will set a fixed harmonic force, while the angle potential will be set from a table potential file.
- This illustrates a use case of stringing together multiple MSIBI optimizations.
- For example, one MSIBI optimization can be used to learn and obtain a coarse-grained angle potnetial table file which can then be set and held fixed while learning pair potentials in a subsequent MSIBI optimization.

```python
import hoomd
from msibi import MSIBI, State, Pair, Bond, Angle

optimizer = MSIBI(
nlist=hoomd.md.nlist.Cell,
integrator=hoomd.md.methods.ConstantVolume,
thermostat=hoomd.md.methods.thermostats.MTTK,
dt=0.0001,
gsd_period=int(1e4)
)

# Create 3 State instances, pass in a path to the target trajectory
stateA = State(name="A", kT=2.0, traj_file="stateA.gsd", alpha=0.2, n_frames=50)
stateB = State(name="B", kT=4.0, traj_file="stateB.gsd", alpha=0.5, n_frames=50)
stateC = State(name="C", kT=6.0, traj_file="stateC.gsd", alpha=0.3, n_frames=50)
optimizer.add_state(stateA)
optimizer.add_state(stateB)
optimizer.add_state(stateC)

# Add bond and set a harmonic force (e.g. fit to Boltzmann inverse of the distribtion)
bondAA = Bond(type1="A", type2="A", optimize=False)
bondAA.set_harmonic(r0=1.4, k=200)
optimize.add_force(bondAA)

# Add angle and load previously obtained table potential
angleAA = Angle(type1="A", type2="A", type3="A", optimize=False)
angleAA.set_from_file("angleAA.csv")
optimize.add_force(angleAA)

# Create a Pair instance to be optimized.
pairAA = Pair(type1="A", type2="A", optimize=True, r_cut=3.0, nbins=100)
# Call the set_lj() method to set an initial guess potential
pairAA.set_lj(r_min=0.001, r_cut=3.0, epsilon=1.0, sigma=1.0)
optimizer.add_force(pairAA)

# Run 20 MSIBI iterations
optimizer.run_optimization(n_steps=2e6, n_iterations=20)
pairAA.save_potential("pairAA.csv")
```


## Citing MSIBI
Details of the underlying method and its validation can be found [here](http://dx.doi.org/10.1063/1.4880555).

If you use this package, please cite the above paper. The BibTeX reference is
Expand All @@ -25,10 +119,7 @@ If you use this package, please cite the above paper. The BibTeX reference is
journal = "The Journal of Chemical Physics",
year = "2014",
volume = "140",
number = "22",
doi = "http://dx.doi.org/10.1063/1.4880555"
number = "22",
doi = "http://dx.doi.org/10.1063/1.4880555"
}
```



17 changes: 0 additions & 17 deletions devtools/travis-ci/install.sh

This file was deleted.

Loading