Skip to content

Conversation

@JohannesKarwou
Copy link
Contributor

When reading in CHARMM psf files, I experienced problems for certain psf files. I included one, generated by CHARMM-GUI, which does not work as expected (loading with load_psf works fine, but processing this file or saving it with save_psf produces errors):

step3_input.zip

I think the problem is, that _process_lonepair_section is only executed, if there is a MOLNT section, which is sometimes not the case (e.g. when using the openmm option in CHARMM-GUI, like for the example provided above)

tmp = psfsections['MOLNT'][1]
tag_molecules(self)
if len(tmp) == len(self.atoms):
    # We have a CHARMM PSF file; now do NUMLP/NUMLPH sections
    self._process_lonepair_section(psfsections["NUMLP NUMLPH"])

Is there a reason, why if len(tmp) == len(self.atoms): is used for deciding whether the _process_lonepair_section() function is executed or not?
If not, I suggest a check like this:

if len(psfsections["NUMLP NUMLPH"][1]) != 0:

Copy link
Contributor

@swails swails left a comment

Choose a reason for hiding this comment

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

Thanks!

@swails swails enabled auto-merge (squash) March 23, 2023 14:45
@swails swails merged commit c897ebb into ParmEd:master Mar 23, 2023
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