Skip to content

Conversation

@dwhswenson
Copy link
Member

This adds a constructor to SimStore-based CVs to create the appropriate SimStore CV from a netcdfplus CV. This is a necessary step toward writing a script that converts netcdfplus files to SimStore files. That will be useful now for users who want to experiment with SimStore, and will be necessary in a pre-2.0 release so that users can upgrade.

Still need to do some custom work on the func_config for MDTraj
@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #1005 (2801508) into master (8292193) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1005   +/-   ##
=======================================
  Coverage   81.17%   81.17%           
=======================================
  Files         139      139           
  Lines       15143    15143           
=======================================
  Hits        12292    12292           
  Misses       2851     2851           

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 8292193...2801508. Read the comment docs.

@dwhswenson
Copy link
Member Author

@sroet, @hejung, @gyorgy-hantal (and anyone else who has some old CVs from netcdfplus and is comfortable trying an experimental branch): Could you try this branch out and see if the from_netcdfplus_cv methods are working correctly? They work on the things I have tested, but those are based on the way that I create CVs; just checking to see if there are use cases I'm missing.

The following script is a rough template of I hope you can try, especially for any CV that might have an unusual setup:

import openpathsampling as paths
from openpathsampling.experimental.storage.collective_variables import MDTrajFunctionCV

storage = paths.Storage("old_file.nc", mode='r')
old = storage.cvs['phi']  # was originally defined as a paths.MDTrajFunctionCV

# create the new CV using the classmethod `from_netcdfplus_cv`
new = MDTrajFunctionCV.from_netcdfplus_cv(old)

snap = storage.snapshots[-1]  # take an arbitrary snapshot from storage
assert old(snap) == new(snap)

So far, the CV types in the following table have been implemented in the new storage. (Only FunctionCV changed its name, because SimStore naming changed a little to avoid some domain-specific things in netcdfplus.) If you have a different CV type, let me know and I can prioritize setting up those, as well -- I assume these are the most-used CV types.

openpathsampling. openpathsampling.experimental.storage.collective_variables.
FunctionCV CollectiveVariable
CoordinateFunctionCV CoordinateFunctionCV
MDTrajFunctionCV MDTrajFunctionCV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant