OpenBioSim / biosimspace

An interoperable Python framework for biomolecular simulation.
https://biosimspace.openbiosim.org
GNU General Public License v3.0
75 stars 11 forks source link

[BUG] prepareFEP.py calls `BSS.IO.saveMolecules` with an missing `match_water` parameter #291

Closed nigel-palmer-cresset closed 5 months ago

nigel-palmer-cresset commented 5 months ago

prepareFEP.py has the following code

BSS.IO.saveMolecules(
    "merged_at_lam0.pdb",
    merged,
    "PDB",
    {"coordinates": "coordinates0", "bond": "bond0", "element": "element0"},
)

This fails due to biosimspace/python/BioSimSpace/IO/_io.py::saveMolecules requiring an match_water parameter.

Changing it to the following fixes the problem.

BSS.IO.saveMolecules(
    "merged_at_lam0.pdb",
    merged,
    "PDB",
    property_map={"coordinates": "coordinates0", "bond": "bond0", "element": "element0"},
)

Thanks

lohedges commented 5 months ago

Thanks for reporting. This is actually because prepareFEP is passing keyword arguments, e.g. the property_map as positional arguments. There is no need to pass match_water.

I'll update the script tomorrow.

lohedges commented 5 months ago

Sorry, couldn't see your code snippet on my phone. That's the correct solution, i.e. passing the property map as a kwarg.