ercius / openNCEM

A collection of packages and tools for electron microscopy data analysis supported by the National Center for Electron Microscopy facility of the Molecular Foundry
GNU General Public License v3.0
55 stars 27 forks source link

Improve emd warning #60

Closed ercius closed 7 months ago

ercius commented 7 months ago

This makes the version warning more flexible. Previously if the version was not exactly 0.2 then a "Warning..." was printed which can be annoying. I removed this printing line and added an exception with some extra logic described below.

This PR adds two new custom exceptions to emd. One where no Berkeley EMD data sets are found and one for version mismatch.

A warning about version mismatch is only raised if:

The exception is also used in ncempy.read() to differentiate Berkeley EMD and Velox EMD files.

A minor typo in the MRC test was also fixed.