Skip to content

Fix writing metadata in prz file #463

@ericpre

Description

@ericpre

Describe the bug

Following #459, there are two things that should be improved:

  • the axes metadata doesn't seem to be written correctly when saving to prz
  • add write support for prz version >=24.03

@tensionhead, @gguzzina, could you please help with these?

To Reproduce

Steps to reproduce the behavior:

import hyperspy.api as hs
import numpy as np


fname = "test.prz"

s = hs.signals.Signal2D(np.arange(20*50).reshape((20, 50)))
s.axes_manager.signal_axes.set(scale=0.5, units="nm")
s.save(fname)

s2 = hs.load(fname, allow_restricted_pickle=True)

# the scale and units are incorrect in `s2`
assert s.axes_manager.as_dictionary() == s2.axes_manager.as_dictionary()

Python environement:

  • RosettaSciIO version: 0.11.0
  • Python version: 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions