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

[Python 3.9] Clar SciPy Re-implementation, pythoncall Debugging, Optional RMS #2694

Draft
wants to merge 153 commits into
base: feat/py39
Choose a base branch
from

Conversation

JacksonBurns
Copy link
Contributor

This PR replaces #2623 as discussed in this comment: #2687 (comment)

ChrisBNEU and others added 27 commits May 17, 2024 15:36
added per sevy's review

Co-authored-by: Sevy Harris <[email protected]>
also update the final run example - the point of specifying the `PYTHONPATH` was so that users _don't_ have to give the full path to `rmg.py` - the `python` executable can search it out
- clearer error messages

Co-authored-by: Hao-Wei Pang <[email protected]>
1. Replace lpsolve APIs with the scipy milp APIs. The new implementation potentially have a slightly better performance (due to vectorization, less data transfer, comparable solver performance, etc.) and improved readability.
2. Decouple the MILP solving step (as _solve_clar_milp ) from the MILP formulation step. The motivation is to avoid unnecessary computation. The original approach includes molecule analysis (specifically `get_aromatic_rings`) into the recursive calls. However, this is not necessary, as molecules are just copied and not modified at all. Therefore analyzing once is enough.
rwest and others added 5 commits November 8, 2024 14:07
If two surface sites overlap, or if a site-adatom bond is too long,
then give up on the fancy algorithm, and just let RDkit place 
the X atoms wherever, without them being bonded.
Previous commit put the import at the top of the file.
Adsorbates with more than one surface site were drawn weirdly,
with the second or third surface site often floating up in the air.
With this change, it temporarily forms a bond between the surface sites,
so the layout algorithm sees them as part of a ring, then it rotates
the molecule so they are at the bottom, and then it removes the bond
once the coordinates are determined.

There are some special cases and exceptions for things with many
surface sites. Overall, though, this should make the adsorbates look
much better.
@JacksonBurns
Copy link
Contributor Author

TODO: add a pytest mark on all of the tests which require julia and then add a new makefile target or automatic detection in the testing aparatus to allow said tests to fail when julia is not installed

@JacksonBurns JacksonBurns changed the title [Python 3.9] Reimplement Clar Optimization with Scipy MILP [Python 3.9] Clar SciPy Re-implementation, pythoncall Debugging, Optional RMS Nov 20, 2024
@JacksonBurns
Copy link
Contributor Author

Confirmed that I can now run RMG in plain Python mode with Python 3.9, following the installation instructions as of cce1f4b

@JacksonBurns
Copy link
Contributor Author

The latest versions of quantities (0.16.0 and 0.16.1) has a bug that prevents reading 'angstrom', tracking this issue and then limiting the version for this PR:

@JacksonBurns
Copy link
Contributor Author

Docs build might not need to build Julia stuff anymore

@JacksonBurns
Copy link
Contributor Author

pydest-xdist works in pure python mode, so you can run the tests in parallel! 🎉

@JacksonBurns
Copy link
Contributor Author

Need to update graphviz version to the latest

@JacksonBurns
Copy link
Contributor Author

After optimization to get the Clar number, brute force enumerate all structures with that Clar number.

@JacksonBurns
Copy link
Contributor Author

Also, we should not optimize past the most optimal clar structure.

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.