pyxem icon indicating copy to clipboard operation
pyxem copied to clipboard

Current build failure due to .apply_affine_transform()

Open pc494 opened this issue 3 years ago • 3 comments

The failure (from the CI) occurs at:

   def test_apply_affine_transforms_paths(self, diffraction_pattern):
        D = np.array([[1.0, 0.9, 0.0], [1.1, 1.0, 0.0], [0.0, 0.0, 1.0]])
        s = Signal2D(np.asarray([[D, D], [D, D]]))
        static = diffraction_pattern.apply_affine_transformation(D, inplace=False)
        dynamic = diffraction_pattern.apply_affine_transformation(s, inplace=False)

and is probably due to a change in skimage versioning.

Specifically, skimage throws an error when in the case that generates s, as of #873 this is skipped.

pc494 avatar Aug 15 '22 16:08 pc494

~When I get to this I'll try and pick up #840, #841 and #856 as well.~

UPD: Dealt with in #873, this issue is now specifically about the .apply_affine_transform failure

pc494 avatar Aug 15 '22 16:08 pc494

~and I think I'll make a release so that #868 can come into main as soon as possible~

UPD: Not making a patch release, changes are too small.

pc494 avatar Aug 16 '22 10:08 pc494

I looked into this as well, it seems the error only occurs when the transform is iterated alongside the signal in the map function. Not sure exactly what causes this but this might be an upstream hyperspy problem as well.

CSSFrancis avatar Aug 16 '22 13:08 CSSFrancis

Realized I never fixed this one. The problem is related to the np.squeeze function in map_iterate. This calls np.asarray which tries to convert a function to an array. From there it gets very confused. For now we can by pass this just by manually setting the output dtype and signal size. This is also a little bit of a speedup too.

CSSFrancis avatar Nov 08 '22 15:11 CSSFrancis