alchemistry / alchemlyb

the simple alchemistry library
https://alchemlyb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
189 stars 49 forks source link

An engine agonistic parser #316

Closed xiki-tempula closed 1 year ago

xiki-tempula commented 1 year ago

I'm thinking of an engine agonistic IO that would load a dataframe directly from a file and save it to a file and read it back. I think the pyarrow implementation of the parquet is a good choice where it faithfully reproduce the complex index that we are using.

The interface that i'm thinking of would be

from alchemlyb.parsing.parquet import extract_dHdl, extract_u_nk
import pandas as pd

u_nk.to_parquet(path='u_nk.parquet', index=True)
dHdl.to_parquet(path='dHdl.parquet', index=True)

new_u_nk = extract_u_nk('u_nk.parquet', T=300)
new_dHdl = extract_dHdl('dHdl.parquet', T=300)

assert new_u_nk==u_nk
assert new_dHdl==dHdl