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

change posres_fc format #659

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

change posres_fc format #659

wants to merge 6 commits into from

Conversation

csbrasnett
Copy link
Collaborator

as discussed in #639

  • write global #ifndef at top of itps
  • change value of posres_fc to global
  • add some tests for the posres processor
  • add documentation page for things vermouth writes that are applied via gromacs preprocessor

- write global #ifndef at top of itps
- change value of posres_fc to global
- add some tests for the posres processor
- add documentation page for things vermouth writes that are applied via gromacs preprocessor
@csbrasnett
Copy link
Collaborator Author

csbrasnett commented Feb 14, 2025

the tests are failing because the itp reader can't handle #define statements:

Don't know how to parse pargma #define POSRES_FC 1000 at line 14.

so that needs to be implemented somewhere in the file parser if we want to solve this

edit: I think I understand why, in that the file reader thinks the #define statement tries to parse the line as a new pragma section, but it doesn't currently understand what it is... So somewhere in gmx.read_itp.ITPDirector.parse_pragma that needs to be added as something contained within the current #ifndef section?

@pckroon
Copy link
Member

pckroon commented Feb 14, 2025

I think your analysis is spot on. Maybe you can even ignore the fact that its in an ifdef/ifndef block? Implementing that in a generic way gets quite gnarly I think.

@csbrasnett
Copy link
Collaborator Author

That seems to work nicely now, and I've double checked that output files run as expected. Have had to hack the tests slightly to ensure they still work which is not ideal, but if we're going to ignore #define sections in this way I don't think we have an option to compare properly?

Also, I think the docs page was a good idea, but not sure if it's actually in the right place at the moment so happy to move it wherever. Didn't feel like it sat right alongside the other tutorials though?

Comment on lines 162 to 166
try:
p2 = list(map(float, interaction2.parameters))
except ValueError:
if interaction2.parameters[1] == 'POSRES_FC':
p2 = list(map(float, ['1', '1000', '1000', '1000']))
Copy link
Member

Choose a reason for hiding this comment

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

Why? Add a comment please

Copy link
Member

@pckroon pckroon left a comment

Choose a reason for hiding this comment

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

Very nice. Just a few small comments

Comment on lines +152 to +153
elif line.startswith("#define"):
pass
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment why pass, rather than setting the molecule meta

Copy link
Collaborator Author

@csbrasnett csbrasnett Feb 19, 2025

Choose a reason for hiding this comment

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

do you mean the current_meta?

Copy link
Member

Choose a reason for hiding this comment

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

Probably, yes

@csbrasnett
Copy link
Collaborator Author

nb on the docs test failing, looks like the problems are related to sphinx -> 8.2.0. For the napoleon_type_aliases I think we just need to add napoleon_use_param = True somewhere. The other error is WARNING: while setting up extension sphinxcontrib.apidoc: Failed to convert [[<class 'str'>]] to a frozenset which I'm less sure about how to resolve

@pckroon
Copy link
Member

pckroon commented Feb 19, 2025

Could you try to figure out the failing docs build? You can test it locally before you push it. You can find the exact sphinx invocation in the CI config file (https://github.com/marrink-lab/vermouth-martinize/blob/master/.github/workflows/run_tests.yml#L117). I don't have time available to have a look today :(

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