Add back-mapping and coarse-graining modules using integraiton with CGSmiles - #1352
Open
chrisjonesBSU wants to merge 24 commits into
Open
Add back-mapping and coarse-graining modules using integraiton with CGSmiles#1352chrisjonesBSU wants to merge 24 commits into
chrisjonesBSU wants to merge 24 commits into
Conversation
updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.21 → v0.15.22](astral-sh/ruff-pre-commit@v0.15.21...v0.15.22)
…te-config [pre-commit.ci] pre-commit autoupdate
np.object was removed in NumPy 1.24, but the project requires numpy>=2.0 (environment.yml). Calling PeriodicKDTree.query_ball_point() with an array of multiple points therefore raises AttributeError. Use the builtin object dtype, which is NumPy's documented replacement.
Popen was called with shell=True and an f-string interpolating a temp-file
path (f"{PACKMOL} < {packmol_inp.name}"). This is a shell-injection
anti-pattern and breaks whenever the temp path contains spaces or shell
metacharacters (e.g. a TMPDIR with spaces).
Pass the executable as an argument list and feed the input file directly as
stdin instead of relying on a shell redirection. Behavior is unchanged (the
shell was only used for the '<' redirection), and PACKMOL is a resolved path
from shutil.which().
…-removed-numpy Fix np.object AttributeError in PeriodicKDTree.query_ball_point
* Update readthedocs build os to supported version * update python to mambaforge-latest * docs build os to 24.04
…hell-injection Avoid shell=True when invoking PACKMOL
Re-add FattyAcid recipe for main branch
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1352 +/- ##
===========================================
- Coverage 82.37% 80.02% -2.35%
===========================================
Files 64 69 +5
Lines 6977 7483 +506
===========================================
+ Hits 5747 5988 +241
- Misses 1230 1495 +265 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
This revamps the old coarse-graining module, and adds a back mapping capabilities as well. The workflow utilizies CGSmiles to provide a useable API/interface to mapping between different resolutions. It also provides an interface to mapping directly with mBuild compounds (rather than CGSmiles strings). I also pulled in the latest upstream/main changes here. The primary motivation for adding this was to have a more streamlined and robust API for backmapping paths to atomistic compounds. Before, most workflows involved using
Polymer.build_from_path()which worked great for linear chains. These new modules still work for linear chains, but also for branched chains, as well as non-polymer systems.Here are some examples:
Back-mapping a linear path to an atomistic polymer
Back-mapping with multiple monomer types
Fine-graining a box of water and ethanol system
Using mBuild compound templating instead of CGSMILES strings
PR Checklist