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

Reformat loaders for different smiles paths #1211

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

CalCraven
Copy link
Contributor

@CalCraven CalCraven commented Dec 4, 2024

PR Summary:

Updating the loading paths to deal with issues loading long strings as smiles. Initial loading uses the Path package to check if the path exists, before checking to see if rdkit can load a valid smiles file. However, Path throws an error if the Path is too long:

"name": "OSError",
"message": "[Errno 63] File name too long: 'CC1C(=O)NC(C(=O)NC(CSC(C2=C(C3=CC4=C(C(SCC(C(=O)N1)NC(=O)C(CCCCN)NC(=O)C(CCC(=O)N)NC(=O)C(C(C)C)N)C)C(=C([N-]4)C=C5C(=C(C(=N5)C=C6C(=C(C(=CC2=N3)[N-]6)C)CCC(=O)[O-])CCC(=O)[O-])C)C)C)C)C(=O)NC(CC7=CNC=N7)C(=O)NC(C(C)O)C(=O)NC(C(C)C)C(=O)NC(CCC(=O)[O-])C(=O)[O-])CCC(=O)N.[Na+].[Na+].[Na+].[Na+].[Fe+2]'",

This PR better handles this type of smiles, and also splits the handling of the rdkit and pybel backends for smiles loading, both from files and from strings. Discussion with @mattwthompson helped delineate the more specific loaders for these different methods.

PR Checklist


  • Includes appropriate unit test(s)
  • Appropriate docstring(s) are added/updated
  • Code is (approximately) PEP8 compliant
  • Issue(s) raised/addressed?
  • Handle lists of smiles
  • Handle many smiles in a .txt file
  • Handle many smiles in a .smi file

mbuild/conversion.py Fixed Show fixed Hide fixed
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.89%. Comparing base (a4c41c5) to head (d7ea5e2).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
mbuild/conversion.py 95.12% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1211      +/-   ##
==========================================
+ Coverage   85.73%   85.89%   +0.15%     
==========================================
  Files          53       53              
  Lines        4802     4799       -3     
==========================================
+ Hits         4117     4122       +5     
+ Misses        685      677       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mbuild/conversion.py Outdated Show resolved Hide resolved
mbuild/conversion.py Outdated Show resolved Hide resolved
Copy link
Contributor

@chrisjonesBSU chrisjonesBSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left a couple comments that should be quick changes. Thanks!

mbuild/conversion.py Dismissed Show dismissed Hide dismissed
mbuild/tests/test_compound.py Fixed Show fixed Hide fixed
@CalCraven CalCraven merged commit 052ccdf into mosdef-hub:main Dec 13, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants