-
Notifications
You must be signed in to change notification settings - Fork 11
Add unit class to FlowerMD and allow using real units in Simulation runs #137
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
Open
marjanalbooyeh
wants to merge
68
commits into
cmelab:main
Choose a base branch
from
marjanalbooyeh:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
d38aba8
calculate real T from kT
marjanalbooyeh 05d594e
unit test for real_temperature
marjanalbooyeh 0c47ee3
precommit reformat
marjanalbooyeh d2bad99
allow temperature to be passed to run methods instead of kT
marjanalbooyeh ee71094
test temperature for nvt runs
marjanalbooyeh 27a2d74
add time_length parameter to run methods
marjanalbooyeh 17b6043
fix None conditions
marjanalbooyeh 822861f
add tests for time length
marjanalbooyeh b422a11
update docstrings
marjanalbooyeh 4f44b55
Merge branch 'cmelab:main' into main
marjanalbooyeh e83b3c4
save reference values to pickle
marjanalbooyeh e4ce1c6
tests for save ref values
marjanalbooyeh 4d91a49
added more unit tests for temperature and time length
marjanalbooyeh 26af373
real temperature without energy unit
marjanalbooyeh 68777e1
Merge branch 'cmelab:main' into main
marjanalbooyeh b70dd70
add units class
marjanalbooyeh f17dc4b
add temperature and duration parameters
marjanalbooyeh 1cbfb07
Add an example to NVT docstring with real units for temperature and d…
marjanalbooyeh 45ee688
update docstrings
marjanalbooyeh 5521716
move units class to internal dir
marjanalbooyeh 73c7b97
use validate_unit function to validate units
marjanalbooyeh b33279d
Add a utils function to validate units.
marjanalbooyeh 2e4ea71
update system unit tests according to new changes in units
marjanalbooyeh 68c6d78
add new units
marjanalbooyeh eee22fd
update unit error messages
marjanalbooyeh 75cd5f4
update simulation unit tests according to units
marjanalbooyeh 6f9f04d
fix unit test bugs
marjanalbooyeh 6a9be73
remove validate_ref_value
marjanalbooyeh 419f2d1
use flowermd units instead of unyt and fix tests
marjanalbooyeh faa114f
update utils tests
marjanalbooyeh 8e72bec
add tests for validate_unit
marjanalbooyeh 0eda3d4
update Units docstrings.
marjanalbooyeh b5c24f2
add femtosecond
marjanalbooyeh d7e3f2d
merge changes from upstream.
marjanalbooyeh 2e7a4f8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a4fccd4
Add functionalitiy to handle real pressure units. Add properties for …
marjanalbooyeh dc13ebb
Add density and pressure units.
marjanalbooyeh 2ff5d79
Check for flowermd Units instance in unit validation.
marjanalbooyeh 455b2ec
Merge branch 'main' of github.com:marjanalbooyeh/flowerMD
marjanalbooyeh 7156c79
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5d70e13
Simplify functions.
marjanalbooyeh e8c70cb
Add reduced temperature and reduced pressure propoerties to sim.
marjanalbooyeh a194244
Merge branch 'main' of github.com:cmelab/flowerMD
marjanalbooyeh ae0d07d
updated pre-commit.
marjanalbooyeh 0199a8d
merge with main
marjanalbooyeh 0c93dc2
Test real units in simulations.
marjanalbooyeh 15a2e8e
Add number density units.
marjanalbooyeh 49e3657
Use flowermd Units class.
marjanalbooyeh 1035eb5
Use and explain new variable names (duration, temperature, etc) in tu…
marjanalbooyeh 06b35fb
Use correct unit import.
marjanalbooyeh 652fcc8
Use duration and temperature variable names in recipes and tests.
marjanalbooyeh 5f0def9
Fix variable names.
marjanalbooyeh b71ab0d
Temporary check for temperature Ramp.
marjanalbooyeh 628acec
Fix tutorials bugs.
marjanalbooyeh 6b754cd
pin hoomd <5.0, update unit test
12a555d
pin hoomd <5.0
d7b5bb2
remove macos-13 from test matrix
2839b50
fix image runner names
4d1909c
Minor change in tutorials.
marjanalbooyeh cca7195
Merge branch 'main' of github.com:marjanalbooyeh/flowerMD
marjanalbooyeh 1031738
Merge remote-tracking branch 'upstream/main'
marjanalbooyeh 0b3167f
update miniforge version
2aaf79c
Merge branch 'main' of github.com:marjanalbooyeh/flowerMD into marjan…
7ac4476
update miniforge version
8a01b5a
Merge branch 'main' into main
chrisjonesBSU 1426cc4
Merge branch 'main' into main
chrisjonesBSU 5ba23d3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 807fdea
Merge branch 'main' into main
chrisjonesBSU File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,5 +10,6 @@ | |
| Simulation, | ||
| System, | ||
| ) | ||
| from .internal.units import Units | ||
|
|
||
| __version__ = "1.3.1" | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # ruff: noqa: F401 | ||
| from .ff_utils import xml_to_gmso_ff | ||
| from .utils import check_return_iterable, validate_ref_value | ||
| from .units import Units | ||
| from .utils import check_return_iterable, validate_unit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| """FlowerMD Unit class.""" | ||
|
|
||
| import unyt as u | ||
|
|
||
|
|
||
| class Units: | ||
| """FlowerMD Unit class. | ||
|
|
||
| Example usage: | ||
| -------------- | ||
|
|
||
| :: | ||
| length = 1.0 * flowermd.internal.Units.angstrom | ||
| energy = 1.0 * flowermd.internal.Units.kcal_mol | ||
| mass = 1.0 * flowermd.internal.Units.amu | ||
| time = 1.0 * flowermd.internal.Units.ps | ||
| temperature = 1.0 * flowermd.internal.Units.K | ||
|
|
||
|
|
||
| """ | ||
|
|
||
| # length units | ||
| m = u.m | ||
| meter = u.m | ||
| cm = u.cm | ||
| centimeter = u.cm | ||
| nm = u.nm | ||
| nanometer = u.nm | ||
| pm = u.pm | ||
| picometer = u.pm | ||
| ang = u.angstrom | ||
| angstrom = u.angstrom | ||
|
|
||
| # energy units | ||
| J = u.J | ||
| Joule = u.J | ||
| kJ = u.kJ | ||
| cal = u.cal | ||
| kcal = u.kcal | ||
| kcal_mol = u.kcal / u.mol | ||
| kJ_mol = u.kJ / u.mol | ||
|
|
||
| # mass units | ||
| g = u.g | ||
| gram = u.g | ||
| amu = u.amu | ||
| kg = u.kg | ||
|
|
||
| mol = u.mol | ||
|
|
||
| # time units | ||
chrisjonesBSU marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| s = u.s | ||
| second = u.s | ||
| ns = u.ns | ||
| nanosecond = u.ns | ||
| ps = u.ps | ||
| picosecond = u.ps | ||
| fs = u.fs | ||
| femtosecond = u.fs | ||
|
|
||
| # temperature units | ||
| K = u.K | ||
| Kelvin = u.K | ||
| C = u.degC | ||
| Celsius = u.degC | ||
| F = u.degF | ||
| Fahrenheit = u.degF | ||
|
|
||
| # mass density units | ||
| g_cm3 = u.g / u.cm**3 | ||
| kg_m3 = u.kg / u.m**3 | ||
| amu_A3 = u.amu / u.angstrom**3 | ||
| # number density units | ||
| n_m3 = u.Unit("m**-3") | ||
| n_cm3 = u.Unit("cm**-3") | ||
| n_A3 = u.Unit("angstrom**-3") | ||
| n_nm3 = u.Unit("nm**-3") | ||
|
|
||
| # pressure units | ||
| atm = u.atm | ||
| bar = u.bar | ||
| Pa = u.Pa | ||
| kPa = u.kPa | ||
| MPa = u.MPa | ||
| GPa = u.GPa | ||
| psi = u.psi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.