alchemistry / alchemlyb

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

Implement a more robust gmx parser #183

Closed xiki-tempula closed 2 years ago

xiki-tempula commented 2 years ago

Fix #171 Fix #126

I tried to do this as a preprocessing step but I cannot get it to fix the issues that I tested in the test files, so I implement it inside the parser.

codecov[bot] commented 2 years ago

Codecov Report

Merging #183 (b9e93a9) into master (ff491d7) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #183   +/-   ##
=======================================
  Coverage   98.16%   98.17%           
=======================================
  Files          22       22           
  Lines        1308     1313    +5     
  Branches      287      289    +2     
=======================================
+ Hits         1284     1289    +5     
  Misses          5        5           
  Partials       19       19           
Impacted Files Coverage Δ
src/alchemlyb/parsing/__init__.py 100.00% <100.00%> (ø)
src/alchemlyb/parsing/gmx.py 98.18% <100.00%> (+0.05%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ff491d7...b9e93a9. Read the comment docs.

xiki-tempula commented 2 years ago

@orbeckst Thanks for the review. I made the changes. I wonder how should I bump the version? sorry, I'm not too familiar with the versioner.

orbeckst commented 2 years ago

Just change the entry in the CHANGELOG.

The actual version change happens on release anyway.

xiki-tempula commented 2 years ago

@orbeckst Thanks for the review. I have changed the default to True. And add versionchange It seems that filtering is actually faster but this might just be random fluctuation.

dataset = alchemtest.gmx.load_benzene()
time_list = []
for i in range(100):
    start = time.time()
    alchemlyb.concat([gmx.extract_u_nk(filename, T=300, filter=True) for filename in dataset['data']['Coulomb']])
    time_list.append(time.time()-start)
print(np.mean(time_list))

gives 0.14853424549102784 Changing the filter=False gives 0.152081116437912

orbeckst commented 2 years ago

thanks @xiki-tempula !