Skip to content

Conversation

@Valdes-Tresanco-MS
Copy link
Contributor

Hi Jason. I found a bug in my previous PR. Although rare, negative residues numbers fail with this setup. So I replaced the conditional with a try-except clause. According to the tests I did, it should work correctly in all cases.

type=words[1], charge=charge, mass=mass)
# check for insertion code
if words[2].isnumeric():
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the problem is that a leading - leads to isnumeric() returning False. What about we change line 494 to this instead:

if words[2].isnumeric() or (words[2].startswith('-') and words[2][1:].isnumeric()):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done via a8d0e3f

@swails
Copy link
Contributor

swails commented Feb 15, 2022

Thanks!

@swails swails merged commit ac67ac2 into ParmEd:v3.4 Feb 15, 2022
@Valdes-Tresanco-MS Valdes-Tresanco-MS deleted the fix_icode_resn branch February 16, 2022 02:45
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.

2 participants