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

Error message for undefined atom/bead types #299

Open
ricalessandri opened this issue Feb 3, 2023 · 1 comment
Open

Error message for undefined atom/bead types #299

ricalessandri opened this issue Feb 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ricalessandri
Copy link
Collaborator

Not a bug but possible enhancement.

This is the error one gets if the [ atoms ] contains a atom/bead type S4 that is not defined in the [atomtypes] section:

Traceback (most recent call last):
  File "/Users/alessandri/miniconda3/envs/polyply/bin/polyply", line 258, in <module>
    main()
  File "/Users/alessandri/miniconda3/envs/polyply/bin/polyply", line 254, in main
    subprogram(**args_dict)
  File "/Users/alessandri/miniconda3/envs/polyply/lib/python3.10/site-packages/polyply/src/gen_coords.py", line 246, in gen_coords
    GenerateTemplates(topology=topology, max_opt=10).run_system(topology)
  File "/Users/alessandri/miniconda3/envs/polyply/lib/python3.10/site-packages/polyply/src/processor.py", line 31, in run_system
    mols.append(self.run_molecule(molecule))
  File "/Users/alessandri/miniconda3/envs/polyply/lib/python3.10/site-packages/polyply/src/generate_templates.py", line 366, in run_molecule
    self.gen_templates(meta_molecule)
  File "/Users/alessandri/miniconda3/envs/polyply/lib/python3.10/site-packages/polyply/src/generate_templates.py", line 353, in gen_templates
    self.volumes[resname] = compute_volume(block,
  File "/Users/alessandri/miniconda3/envs/polyply/lib/python3.10/site-packages/polyply/src/generate_templates.py", line 180, in compute_volume
    rad = float(nonbond_params[frozenset([atom_key, atom_key])]["nb1"])
KeyError: frozenset({'S4'})

This error message for this could be improved. Opening this issue to hear your opinion and in case I can try to add an error message.

(P.S. Sorry I need to catch up with a couple of PRs but I'm planning to schedule some closing-open-PRs hackathon soon :))

@ricalessandri ricalessandri added the enhancement New feature or request label Feb 3, 2023
@fgrunewald
Copy link
Member

@ricalessandri for sure this can become an error message. The only question is from where to raise it. There are several functions that require the beads types to be present. Anyways, let's start with this one and then I'll think about of other places would benefit from the same error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants