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.
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 usingasNumpy
when there is no data, see #103The 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