Amber-MD / pytraj

Python interface of cpptraj
https://amber-md.github.io/pytraj
170 stars 38 forks source link

Overwrite not working as expected with pt.write_traj #1441

Closed hectormartinezdev closed 6 years ago

hectormartinezdev commented 6 years ago

Issue type

Useful info

>>> pytraj.show_versions()
2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609]

('pytraj version = ', '2.0.0')
('cpptraj version = ', u'V17.00')
('cpptraj internal version = ', u'V4.3.3')
('cpptraj compiled flag = ', u' -DHASBZ2 -DHASGZ -DBINTRAJ')

Actual behaviour

Hey! I'm using pytraj to split my PDB into models, and I use this code:

import pytraj as pt

traj = pt.iterload("2m9r.pdb")
pt.write_traj("2m9r_models.pdb", traj, options="multi")

When I use this twice, the files are ovewrited, while the default option for overwrite is False.

Desired behaviour

The code shouldn't overwrite the files.

Note: the PDB is available here

hainm commented 6 years ago

thank you for your feedback. The issue is fixed in #1444

screen shot 2018-02-08 at 7 16 23 pm