-
Notifications
You must be signed in to change notification settings - Fork 250
environment.yml Unblocking Python 3.11 - rdkit to conda-forge channel, remove chemprop for now
#2553
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
Merged
hwpang
merged 15 commits into
ReactionMechanismGenerator:main
from
JacksonBurns:rdkit-conda-forge
Mar 13, 2024
Merged
environment.yml Unblocking Python 3.11 - rdkit to conda-forge channel, remove chemprop for now
#2553
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5532912
switch rdkit to the conda-forge channel
JacksonBurns 9346621
Update RDKit version to >=2022.09.1
xiaoruiDong ea1772e
Update the ref inchi used in translatorTest for ch2o2
xiaoruiDong 1ec9eba
Update molecule and species object inchi conversion to enable backend
xiaoruiDong 1b90390
Skip the unit test for failure inchi translation
xiaoruiDong 3706001
remove rdkit logger before making the checkModels logger
JacksonBurns 55d39b6
explicitly pull descriptastorus from conda-forge instead of rmg
JacksonBurns 72886d1
update changelog, limit descriptastorus version for scipy compatibility
JacksonBurns ffa6d8f
temporarily remove `chemprop` support completely
JacksonBurns d3359aa
remove descriptastorus since chemprop is gone
JacksonBurns 07d7a17
skip tests which require chemprop
JacksonBurns e47a23f
skip input mlestimator test
JacksonBurns a23b5f3
Update docstring of translator to reflect the default backend usage
xiaoruiDong d8d430f
remove scipy version restriction, clarify diffeqpy removal issue
JacksonBurns 7496009
Renaming InChI/SMILES backend option try-all to openbabel-first
xiaoruiDong 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
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
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
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 |
|---|---|---|
|
|
@@ -1768,9 +1768,13 @@ def _repr_png_(self): | |
| os.unlink(temp_file_name) | ||
| return png | ||
|
|
||
| def from_inchi(self, inchistr, backend='try-all', raise_atomtype_exception=True): | ||
| def from_inchi(self, inchistr, backend='openbabel-first', raise_atomtype_exception=True): | ||
| """ | ||
| Convert an InChI string `inchistr` to a molecular structure. | ||
|
|
||
| RDKit and Open Babel are the two backends used in RMG. It is possible to use a | ||
| single backend or try different backends in sequence. The available options for the ``backend`` | ||
| argument: 'openbabel-first'(default), 'rdkit-first', 'rdkit', or 'openbabel'. | ||
| """ | ||
| translator.from_inchi(self, inchistr, backend, raise_atomtype_exception=raise_atomtype_exception) | ||
| return self | ||
|
|
@@ -1782,9 +1786,13 @@ def from_augmented_inchi(self, aug_inchi, raise_atomtype_exception=True): | |
| translator.from_augmented_inchi(self, aug_inchi, raise_atomtype_exception=raise_atomtype_exception) | ||
| return self | ||
|
|
||
| def from_smiles(self, smilesstr, backend='try-all', raise_atomtype_exception=True): | ||
| def from_smiles(self, smilesstr, backend='openbabel-first', raise_atomtype_exception=True): | ||
| """ | ||
| Convert a SMILES string `smilesstr` to a molecular structure. | ||
|
|
||
| RDKit and Open Babel are the two backends used in RMG. It is possible to use a | ||
| single backend or try different backends in sequence. The available options for the ``backend`` | ||
| argument: 'openbabel-first'(default), 'rdkit-first', 'rdkit', or 'openbabel'. | ||
| """ | ||
| translator.from_smiles(self, smilesstr, backend, raise_atomtype_exception=raise_atomtype_exception) | ||
| return self | ||
|
|
@@ -1863,62 +1871,78 @@ def to_single_bonds(self, raise_atomtype_exception=True): | |
| new_mol.update_atomtypes(raise_exception=raise_atomtype_exception) | ||
| return new_mol | ||
|
|
||
| def to_inchi(self): | ||
| def to_inchi(self, backend='rdkit-first'): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It feels kind of awkward that the default arguments are duplicated both here in |
||
| """ | ||
| Convert a molecular structure to an InChI string. Uses | ||
| `RDKit <http://rdkit.org/>`_ to perform the conversion. | ||
| Perceives aromaticity. | ||
|
|
||
| or | ||
|
|
||
| Convert a molecular structure to an InChI string. Uses | ||
| `OpenBabel <http://openbabel.org/>`_ to perform the conversion. | ||
|
|
||
| It is possible to use a single backend or try different backends in sequence. | ||
| The available options for the ``backend`` argument: 'rdkit-first'(default), | ||
| 'openbabel-first', 'rdkit', or 'openbabel'. | ||
| """ | ||
| try: | ||
| return translator.to_inchi(self) | ||
| return translator.to_inchi(self, backend=backend) | ||
| except: | ||
| logging.exception(f"Error for molecule \n{self.to_adjacency_list()}") | ||
| raise | ||
|
|
||
| def to_augmented_inchi(self): | ||
| def to_augmented_inchi(self, backend='rdkit-first'): | ||
| """ | ||
| Adds an extra layer to the InChI denoting the multiplicity | ||
| of the molecule. | ||
|
|
||
| Separate layer with a forward slash character. | ||
|
|
||
| RDKit and Open Babel are the two backends used in RMG. It is possible to use a | ||
| single backend or try different backends in sequence. The available options for the ``backend`` | ||
| argument: 'rdkit-first'(default), 'openbabel-first', 'rdkit', or 'openbabel'. | ||
| """ | ||
| try: | ||
| return translator.to_inchi(self, aug_level=2) | ||
| return translator.to_inchi(self, backend=backend, aug_level=2) | ||
| except: | ||
| logging.exception(f"Error for molecule \n{self.to_adjacency_list()}") | ||
| raise | ||
|
|
||
| def to_inchi_key(self): | ||
| def to_inchi_key(self, backend='rdkit-first'): | ||
| """ | ||
| Convert a molecular structure to an InChI Key string. Uses | ||
| `OpenBabel <http://openbabel.org/>`_ to perform the conversion. | ||
| or | ||
|
|
||
| or | ||
|
|
||
| Convert a molecular structure to an InChI Key string. Uses | ||
| `RDKit <http://rdkit.org/>`_ to perform the conversion. | ||
|
|
||
| It is possible to use a single backend or try different backends in sequence. | ||
| The available options for the ``backend`` argument: 'rdkit-first'(default), | ||
| 'openbabel-first', 'rdkit', or 'openbabel'. | ||
| """ | ||
| try: | ||
| return translator.to_inchi_key(self) | ||
| return translator.to_inchi_key(self, backend=backend) | ||
| except: | ||
| logging.exception(f"Error for molecule \n{self.to_adjacency_list()}") | ||
| raise | ||
|
|
||
| def to_augmented_inchi_key(self): | ||
| def to_augmented_inchi_key(self, backend='rdkit-first'): | ||
| """ | ||
| Adds an extra layer to the InChIKey denoting the multiplicity | ||
| of the molecule. | ||
|
|
||
| Simply append the multiplicity string, do not separate by a | ||
| character like forward slash. | ||
|
|
||
| RDKit and Open Babel are the two backends used in RMG. It is possible to use a | ||
| single backend or try different backends in sequence. The available options for the ``backend`` | ||
| argument: 'rdkit-first'(default), 'openbabel-first', 'rdkit', or 'openbabel'. | ||
| """ | ||
| try: | ||
| return translator.to_inchi_key(self, aug_level=2) | ||
| return translator.to_inchi_key(self, backend=backend, aug_level=2) | ||
| except: | ||
| logging.exception(f"Error for molecule \n{self.to_adjacency_list()}") | ||
| raise | ||
|
|
||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I believe I originally added this because of descriptastorus (which was incompatible with later versions of scipy) but it might not be required. I will remove it and we can see what happens in the CI.