'Fragment' object has no attribute 'is_atom_in_cycle' error#2400
Merged
'Fragment' object has no attribute 'is_atom_in_cycle' error#2400
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2400 +/- ##
==========================================
+ Coverage 48.24% 48.29% +0.04%
==========================================
Files 110 110
Lines 30626 30649 +23
Branches 7986 7995 +9
==========================================
+ Hits 14776 14802 +26
+ Misses 14306 14304 -2
+ Partials 1544 1543 -1
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Contributor
|
I agree that inherit from Molecule is easier for maintainability. We have this separate PR addressing this issue #2360 |
lily90502
approved these changes
Mar 21, 2023
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.
Related to #2395
Another issue with the
Fragmentclass was encountered. It takes time for these errors to pop (in my experience, only in an advanced stage of an RMG run after a few hundred species were added into the core).I got the following trace:
I'm not fluent in the purpose of the
Fragmentobject, and one of the questions to be asked is whether the behavior that we see (here and in the previous PR) that a call inside statmech.py ofmolecule.is_atom_in_cycle(atom)is treating aFragmentinstance instead of aMoleculeinstance is desired. PerhapsFragmentobjects are not supposed to be processed by statmech at all? If so, then we need a more fundamental fix rather than these patches.(I didn't specifically asked in the input file to use fragments)
This patch PR addresses the specific error in the above trace. We may encounter additional similar instances in the future since the
Fragmentclass by design does not implement all the methods of theMoleculeobject. Perhaps a possible solution would be to inherit fromMoleculeinstead of fromGraph? E.g.,class Fragment(Molecule)? I don't feel I have a thorough understanding of theFragmentobject though to go ahead and implement this.