diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9aefa25 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/google/yapf + rev: 'v0.40.2' # Use the sha / tag you want to point at + hooks: + - id: yapf + exclude: docs/conf.py diff --git a/src/affinder/_tests/test_affinder.py b/src/affinder/_tests/test_affinder.py index 3e042b0..bd7ab72 100644 --- a/src/affinder/_tests/test_affinder.py +++ b/src/affinder/_tests/test_affinder.py @@ -9,7 +9,6 @@ from scipy import ndimage as ndi from pathlib import Path - layer0_pts = np.array([[140.38371886, 322.5390704], [181.91866481, 319.65803368], [176.15659138, 259.1562627], @@ -165,7 +164,4 @@ def test_load_affine(tmp_path): widget = load_affine() widget(layer, affile) - np.testing.assert_allclose( - layer.affine, affine - ) - + np.testing.assert_allclose(layer.affine, affine) diff --git a/src/affinder/apply_tf.py b/src/affinder/apply_tf.py index 3d4f3ad..0217efe 100644 --- a/src/affinder/apply_tf.py +++ b/src/affinder/apply_tf.py @@ -91,7 +91,7 @@ def apply_affine( layertype = 'image' ref_metadata = { n: getattr(reference_layer, n) - for n in ['scale', 'translate', 'rotate', 'shear'] + for n in ['scale', 'translate', 'rotate', 'shear', 'affine'] } mov_metadata = moving_layer.as_layer_data_tuple()[1] name = {'name': moving_layer.name + '_transformed'}