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

Added a species constraint for the max number of rings fused together #2606

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alongd
Copy link
Member

@alongd alongd commented Feb 7, 2024

Motivation or Problem

Sometimes users know they are not interested in ring growth in their model, yet RMG spends significant time on suggesting species with complex fused rings. Using the maximum heavy atoms constraints isn't always helpful since other species with the same Mw could be relevant for the model.

Description of Changes

Added a maximumFusedRings key to the constraints dict.
A new method was implemented in Molecule along with a test.

Testing

A unit test was added.
FWIW, the feature was also tested locally by generating a model that previously gave many fused ring structures and verifying that they are absent now.

Reviewer Tips

Note that a previously non-implemented constraint was removed from the docs
I saw that this branch fails online due to a Julia installation, I think. Looks unrelated to this feature.

@JacksonBurns

This comment was marked as resolved.

@JacksonBurns
Copy link
Contributor

@alongd with the merging of #2608 and #2609 this PR should be good to review after a rebase.

A pre-emptive review comment, though. There are a few mentions of the maximumIsotopicAtoms constraint elsewhere in the documentation and examples. See: http://reactionmechanismgenerator.github.io/RMG-Py/search.html?q=maximumIsotopicAtoms+

Could you also remove these? And if there is an associated unit test for maximumIsotopicAtoms could you also remove that?

@JacksonBurns
Copy link
Contributor

@alongd the new unit test is failing, see: https://github.com/ReactionMechanismGenerator/RMG-Py/actions/runs/8028132940/job/21932958791?pr=2606#step:11:1990

It seems like you expect benzene to count as 1 ring in a fused ring system:

        mol = Molecule(smiles="c1ccccc1")
        assert mol.get_ring_count_in_largest_fused_ring_system() == 1

Should this be so?

Copy link
Contributor

@JacksonBurns JacksonBurns left a comment

Choose a reason for hiding this comment

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

@alongd
Copy link
Member Author

alongd commented May 2, 2024

Sorry for not getting back to this PR, I'm having trouble with Julia and can't run the test locally. I'm getting:

Launching pytest with arguments moleculeTest.py::TestMolecule::test_get_ring_count_in_largest_fused_ring_system --no-header --no-summary -q in /home/alon/Code/RMG-Py/test/rmgpy/molecule

DEBUG (1764452) 
DEBUG (1764452) Debug-level logging is enabled for PyJulia.
DEBUG (1764452) PyJulia version: 0.6.1
DEBUG (1764452) pyprogramname = None
DEBUG (1764452) sys.executable = /home/alon/mambaforge/envs/rmg_env/bin/python
DEBUG (1764452) bindir = /home/alon/mambaforge/envs/rmg_env/share/julia/site/julia-1.8.5/bin
DEBUG (1764452) libjulia_path = /home/alon/mambaforge/envs/rmg_env/share/julia/site/julia-1.8.5/bin/../lib/libjulia.so.1

PyCall is not installed or built.  Run the following code in Python REPL:

    >>> import julia
    >>> julia.install()

See:
    https://pyjulia.readthedocs.io/en/latest/installation.html
            
Exit: PyCall not built
!!!!!!!!!!!!!!!!!!! _pytest.outcomes.Exit: PyCall not built !!!!!!!!!!!!!!!!!!!!

Process finished with exit code 1

Empty suite

I tried reinstalling Julia and rebuilding as suggested, but still get the same thing

@JacksonBurns
Copy link
Contributor

Hmm that's vexing - could you try installing a more recent version of Julia?

Copy link

github-actions bot commented Aug 2, 2024

This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Aug 2, 2024
@github-actions github-actions bot removed the stale stale issue/PR as determined by actions bot label Aug 5, 2024
Copy link

github-actions bot commented Nov 4, 2024

This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stale issue/PR as determined by actions bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants