Skip to content

Interoperability with MMSchema #1103

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

Closed
wants to merge 6 commits into from
Closed

Conversation

anabiman
Copy link

@anabiman anabiman commented Oct 4, 2021

This PR enables interoperability with MMElemental for the FrozenMolecule class.

@anabiman
Copy link
Author

anabiman commented Oct 4, 2021

PR subject to change based on how multi-conformers are handled. See relevant issue.

@codecov
Copy link

codecov bot commented Oct 6, 2021

Codecov Report

Merging #1103 (3af3df4) into master (a35a91b) will decrease coverage by 10.27%.
The diff coverage is 54.54%.

Comment on lines +3947 to +3949
if isinstance(atom1, (int, np.integer)) and isinstance(
atom2, (int, np.integer)
):
Copy link
Member

Choose a reason for hiding this comment

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

This is throwing a deprecation warning for np.integer when I try it locally. Should an upstream component be updated so that np.integer is no longer needed?

Copy link
Author

Choose a reason for hiding this comment

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

Are you sure the deprecation warning is coming from np.integer and not np.int (somewhere else)? The latter was deprecated in v1.20.0. Anyway, this can be easily moved to the mmic_openff pkg.

Copy link
Contributor

Choose a reason for hiding this comment

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

isinstance(atom1, numbers.Integral) should be enough, see: https://docs.python.org/3/library/numbers.html numpy/numpy#4547

Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

Thanks for opening this, @andrew-abimansour. I poked around the MolSSI ecosystem docs a bit, and noted some feedback here. We'll probably eventually want to get the deps installed so tests can run on the docstrings (and so we can add more pointed tests if appropriate), though I'm open to alternatives if you'd like this to be merged sooner.

Comment on lines +5377 to +5378
version : int, default=None
MMSchema version. Overrides schema_object.schema_version.
Copy link
Member

Choose a reason for hiding this comment

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

(non blocking) Will this always be an int, or might it need to support more general values, like a packaging.version object?

Copy link
Author

Choose a reason for hiding this comment

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

Should always be an int.

Create Molecule from MMElemental Molecule:

>>> import mmelemental
>>> mm_mol = mmelemental.models.Molecule(symbols=["C", "C"])
Copy link
Member

Choose a reason for hiding this comment

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

(blocking) This is an invalid OpenFF molecule because it's not a valid kekule structure (doesn't have any bonds). It may not crash now, but it will eventually, so it may be best to do a molecule like water where we can easily fill in bonds.

Copy link
Author

Choose a reason for hiding this comment

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

Docstrings updated here.

@mattwthompson
Copy link
Member

Closing as stale, but we would happily accept an updated PR with similar aims.

Until version 0.11.0 is cut, please point new PRs to the topology-biopolymer-refactor branch, and after that to the default branch again. (I will probably become main by then.)

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.

4 participants