Amber-MD / pytraj

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

WIP: remove runtime error in pytraj.topology.topology.Topology.to_parmed. #1533

Closed c56pony closed 4 years ago

c56pony commented 4 years ago

When the to_parmed method of the pytraj.topology.topology.Topology class is invoked, the I got the following error.

  File "pytraj/topology/topology.pyx", line 874, in pytraj.topology.topology.Topology.to_parmed
  File "pytraj/topology/topology.pyx", line 875, in pytraj.topology.topology.Topology.to_parmed
  File "pytraj/topology/topology.pyx", line 837, in pytraj.topology.topology.Topology.save
TypeError: save() got an unexpected keyword argument 'overwrite'

python: 3.8.1 cpptraj: V4.26.2 (GitHub) pytraj: 2.0.5.dev0 ParmEd: 3.2.0

The reason for this error is that Topology.save does not have an argument 'overwrite'. So, I added 'overwrite' to the argument of ParmFile.write as well as Topology.save.

Of course, we can also remove overwrite=True from Topology.to_parmed (line 875 of topology.pyx). Which solution would be more preferable?

hainm commented 4 years ago

Of course, we can also remove overwrite=True from Topology.to_parmed (line 875 of topology.pyx). Which solution would be more preferable?

I vote for this. Thanks.

hainm commented 4 years ago

thank you.