ADicksonLab / wepy

Weighted Ensemble simulation framework in Python
https://adicksonlab.github.io/wepy/index.html
MIT License
51 stars 20 forks source link

Fixes #103: Probing for OpenMMState before getting #106

Closed salotz closed 11 months ago

salotz commented 11 months ago

This implements using probe to figure out what fields an openmm.State has before trying to fetch its data.

This is in general a cleaner way to do this (previously we just used try and handled errors), and fixes some problems that occur with using asNumpy when there is no data, see #103

The ergonomics of getting this field info is not good from OpenMM directly so there is a nice helper function built to do this that could be useful elsewhere. And indeed could probably live in a different module.

Fixes: #103

salotz commented 11 months ago

Just going to wait on doing a little more testing locally before merging.