pyxem / pyxem-demos

Examples and tutorials of multi-dimensional diffraction microscopy workflows using pyxem.
30 stars 38 forks source link

Examples no longer compatible with latest version #42

Closed din14970 closed 4 years ago

din14970 commented 4 years ago

Thanks for making this nice package!

Was trying to run through the example files to learn to work with this, but I've been struggling a bit. At least in example 1, I couldn't get the file to load in the normal way:

ValueError: Invalid signal_type in saved data for pyxem, please use load_hspy for this data. 

I suppose this is because you have now created your own hdf5 format for storing the data, which is no longer compatible with the hyperspy format?

Loading in with load_hspy of course returns a hyperspy dataset that doesn't have the set_experimental_parameters methods. I worked around this by explicitly creating a dataset:

dp = pxm.signals.electron_diffraction2d.ElectronDiffraction2D(dp)

The names of arguments in set_experimental_parameters have also changed... Basically without documentation and non-working demo's it's quite difficult to use. Could you revise the examples a bit to be compatible with the latest version?

dnjohnstone commented 4 years ago

Hi - the issue is that the demos on the github master should work with the version of pyxem on the github master copy i.e. we've already updated the demos for the next release version (v0.11.0).

If you're using pyxem-0.10.0? I.e. what you get from conda-forge or pip, then you should use pyxem-demos-0.10.0, which you can get from the corresponding release on github (https://github.com/pyxem/pyxem-demos/releases) or the pyxem-demos on zenodo (https://zenodo.org/record/3533670#.XqfmNWhKhPY)

Alternatively you can get the most up to date development version of the code (which will become v0.11.0) by downloading the master copy from github.

In terms of why that particular function has changed - it's actually that we've become "more compatible" with hyperspy so we only need load() instead of also having load_hspy() moving forwards.

Does that make sense?

din14970 commented 4 years ago

ah ok, so actually the demo's are ahead of the release, thanks for the clarification. Maybe you could add a small note to the readme for the confused souls like me. I'm using Pyxem 0.10.1 - the latest available on conda-forge. I'll download the older examples and wait for the new release.