marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
86 stars 38 forks source link

Fix write_pdb to always define open #434

Closed pckroon closed 2 years ago

pckroon commented 2 years ago

Since open is defined as a local variable (if defer_writing) it won't be looked up in the global namespace (if not defer_writing).

Fixes #433

fgrunewald commented 2 years ago

@pckroon the gro file writer has the same issue

pckroon commented 2 years ago

I agree with leaving out the test for now. I'll open a new issue with the proposed API change where all writers should accept a file handle rather than a path. That should come with tests though. Do we want the same for readers? I guess so, right?