Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add widget to copy transforms between layers #75

Merged
merged 4 commits into from
Oct 25, 2023
Merged

Conversation

andreasmarnold
Copy link
Contributor

result from pair programming session on Oct 24, 2023 (EST)

@jni
Copy link
Owner

jni commented Oct 24, 2023

Thanks for the contribution @andreasmarnold! 😊

Currently the tests are failing because we need napari 0.4.17 for testing but that didn't declare that pydantic should be less than 2.0. We can fix that by adding pydantic<2 to the testing requirements here and here. Could you please do that? 🙏

@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2023

Codecov Report

Merging #75 (ab9ccb1) into main (14a02c9) will increase coverage by 0.99%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
+ Coverage   85.96%   86.95%   +0.99%     
==========================================
  Files           4        5       +1     
  Lines         171      184      +13     
==========================================
+ Hits          147      160      +13     
  Misses         24       24              
Files Coverage Δ
src/affinder/__init__.py 66.66% <100.00%> (+6.66%) ⬆️
src/affinder/_tests/test_affinder.py 100.00% <100.00%> (ø)
src/affinder/copy_tf.py 100.00% <100.00%> (ø)

@jni
Copy link
Owner

jni commented Oct 24, 2023

Awesome! imho this is basically ready to merge but it would be good to have a test! Something like:

def test_copy_affine():
    layer0 = napari.layers.Image(np.random.random((5, 5)))
    layer1 = napari.layers.Image(np.random.random((5, 5)))
    layer0.affine = np.array([[0.9, 0.1, 5], [0.4, 0.2, 9], [0, 0, 1]])

    widget = copy_affine()
    widget(layer0, layer1)
    np.testing.assert_allclose(layer0.affine, layer1.affine)

@jni jni merged commit e373c44 into jni:main Oct 25, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants