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

Addition of the MOFs core M6L8L12 #529

Closed
wants to merge 13 commits into from

Conversation

iribirii
Copy link

@iribirii iribirii commented May 7, 2024

Requested Reviewers: @lukasturcani
Note for Reviewers: If you accept the review request add a 👍 to this post

@andrewtarzia
Copy link
Collaborator

Hey @iribirii , can you give some context for this topology graph? A paper with this structure, for example?

@iribirii
Copy link
Author

Sure @andrewtarzia !
This topology is a very common structure found in different MOFs, used as cores for the bigger structure instead of a single metal core.

Figure 2 in this paper show the structure of the core clearly
https://pubs.acs.org/doi/10.1021/acscentsci.7b00500

@andrewtarzia
Copy link
Collaborator

Ahh, it's the metal node of a mof, I see now. Although, I can definitely see how it can be a cage too! I think this makes sense.

@iribirii
Copy link
Author

Yeah I wasn't sure where to put it and, since I used the M6L12 cage as a template, it felt adequate to leave it under the same category. But maybe it could be a sub-family within the MOF and OF families. Up to you 😄

@andrewtarzia
Copy link
Collaborator

I think this makes sense!

Ultimately, there is no real chemistry limiting it's use elsewhere!

Copy link
Owner

@lukasturcani lukasturcani left a comment

Choose a reason for hiding this comment

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

Apologies for the delay -- this looks really good! Just one thing, could you add a test structure into https://github.com/lukasturcani/stk/tree/master/tests/molecular/molecules/molecule/fixtures/cage/metal_topologies like the other topologies, you will also need to update the fixutre in this file so that your test runs https://github.com/lukasturcani/stk/blob/master/tests/molecular/molecules/molecule/fixtures/cage/cage.py

Once that's done the test will generate a .npy file which you will also need to commit. This ensures that stk does not randomly change the geometry of structures it builds.

M6L8L12 Cuboctahedron
==========

"""
Copy link
Owner

Choose a reason for hiding this comment

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

no need to add docstrings to internal modules

Copy link
Author

Choose a reason for hiding this comment

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

I added the tests to both files above, however when I run the tests locally I get an 'CallSpec2' object has no attribute 'funcargs' message... I guess it might be a problem of the pytest version I have installed?
I am not sure, it is the first time I have to run a real test 🤣

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh yes, this issue should be solved in the latest version of stk by limiting the pytest version to < 8 (see the pyproject.toml file). You may need to reinstall your development version with just dev to get the tests working.

@lukasturcani
Copy link
Owner

@iribirii -- don't worry about the failing mypy test, thats a known rdkit issue (rdkit/rdkit#7401)

src/stk/cage.py Outdated Show resolved Hide resolved
bb1:range(6,18),
bb2:range(18,26)
},
optimizer=stk.Nulloptimizer(),
Copy link
Owner

Choose a reason for hiding this comment

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

typo: stk.NullOptimizer()

@@ -41,6 +41,7 @@
lazy_fixture("metal_cage_m4l8"),
lazy_fixture("metal_cage_m6l2l3_prism"),
lazy_fixture("metal_cage_m6l12_cube"),
lazy_fixture("metal_cage_m6l812_cuboctahedron"),
Copy link
Owner

Choose a reason for hiding this comment

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

typo: missing l between 8 and 12

@lukasturcani
Copy link
Owner

To fix the remaining tests:

@lukasturcani
Copy link
Owner

Ah and anothert thing -- can you add the structure to https://github.com/lukasturcani/stk/blob/master/docs/source/cage.rst -- so that it appears in the docs? 🙏

@lukasturcani
Copy link
Owner

And you need to add an import to this file too https://github.com/lukasturcani/stk/blob/master/tests/molecular/molecules/molecule/fixtures/cage/metal_topologies/__init__.py -- so taht the tests are able to find the fixture

@lukasturcani
Copy link
Owner

lukasturcani commented May 14, 2024

and the delete the docstring for the internal module here https://github.com/lukasturcani/stk/pull/529/files#r1598731170

    - Structure addition to cage.rst (hope it is done properly)
    - Add import to __init__.py metal_topologies fixtures
    - Deleted docstring from internal module
@lukasturcani
Copy link
Owner

lukasturcani commented May 14, 2024

it looks like your test case is broken -- you dont have to re-use get_pd_atom() etc. functions. it looks like they produce the buildings blocks with the wrong number of functional groups --you may have to make your own building blocks for the test case

import moldoc.molecule as molecule
import stk

m1 = stk.BuildingBlock('[Ti](Br)(Br)(Br)(Br)(Br)(Br)(Br)(Br)', functional_groups=[stk.BromoFactory()])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change all line lengths to be less than 72, even if in doc string?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, 79

@lukasturcani
Copy link
Owner

@iribirii fwiw -- the test case is just an example molecule constructed with your new topology graph, and the smiles is the structure you expect to make. this ensures that the topology graph is making what you expect it to make and that stk keeps making the same things acros updates -- lemme know if anything is unclear!

@lukasturcani
Copy link
Owner

Hi @iribirii -- are you still interested in finishing work on the PR?

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.

3 participants