Colvars / colvars

Collective variables library for molecular simulation and analysis programs
http://colvars.github.io/
GNU Lesser General Public License v3.0
196 stars 56 forks source link

Allow NumPy-format output for plot_colvars_traj.py #648

Closed giacomofiorin closed 5 months ago

giacomofiorin commented 5 months ago

As described in the title, allows converting segments of a Colvars traj into a more efficient binary format supported by the quintessential Python numerical analysis library.

giacomofiorin commented 5 months ago

Second commit is because I encountered a syntax error using a Python interpreter from Anaconda, even though it was 3.8, i.e. a version that supports the syntax. Weird.

HanatoK commented 5 months ago

I would recommend using pandas and saving the data with to_parquet.

giacomofiorin commented 5 months ago

I would recommend using pandas and saving the data with to_parquet.

Sure, but how about in addition to NumPy rather than instead of it? Do you want to add the code to this branch? Should be pretty quick since you already added the hooks for Pandas.

HanatoK commented 5 months ago

I would recommend using pandas and saving the data with to_parquet.

Sure, but how about in addition to NumPy rather than instead of it? Do you want to add the code to this branch? Should be pretty quick since you already added the hooks for Pandas.

That sounds good. I will submit another PR after this one is merged.