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

BUG: gen_ff() error reproducer #394

Closed
tylerjereddy opened this issue Nov 20, 2024 · 2 comments
Closed

BUG: gen_ff() error reproducer #394

tylerjereddy opened this issue Nov 20, 2024 · 2 comments

Comments

@tylerjereddy
Copy link

tylerjereddy commented Nov 20, 2024

I've created a repo at https://github.com/tylerjereddy/polyply_pr_383_repro with a small reproducer that can be run locally to reproduce the gen_ff() function error reported at #383 (comment).

Cloning that repository into an appropriate Python environment with the gen_ff_clean branch of polyply (and supporting deps) installed and running python repro.py should reproduce the problem in a manner that provides a bit more traction for debugging:

Traceback (most recent call last):
  File "/home/treddy/rough_work/polyply_pr_383_repro/repro.py", line 20, in <module>
    main()
  File "/home/treddy/rough_work/polyply_pr_383_repro/repro.py", line 14, in main
    gen_ff(itppath=Path("assets/smiles_molecule_GMX_OPLS.top"),
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/gen_ff.py", line 90, in gen_ff
    meta_mol = MetaMolecule.from_cgsmiles_str(force_field=force_field,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/treddy/python_venvs/py_311_hemd/lib/python3.11/site-packages/polyply/src/meta_molecule.py", line 424, in from_cgsmiles_str
    atomname = meta_graph.nodes[node]['graph'].nodes[atom]['atomname']
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'atomname'

cc @fgrunewald @pckroon @ricalessandri

@tylerjereddy
Copy link
Author

The traceback may vary depending on the supporting dependency versions you happen to be using, but so far my experience is that it will always error out one way or another.

@tylerjereddy
Copy link
Author

This appears to be resolved thanks to the cross-linked CGsmiles PR and adjustments Fabian suggested at tylerjereddy/polyply_pr_383_repro#1, so closing.

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

No branches or pull requests

1 participant