andy-sweet / napari-metadata

A napari plugin to view and edit metadata
BSD 3-Clause "New" or "Revised" License
10 stars 3 forks source link

Make axes type and unit widgets #8

Closed andy-sweet closed 1 year ago

andy-sweet commented 1 year ago

This replaces the label/line-edit widgets for the axis type and units metadata attributes.

Screenshot 2023-01-30 at 4 45 33 PM

It deviates a little from the design to better suit napari's layer model.

Tests provide decent coverage of the expected interaction with the napari model.

Closes #1

codecov-commenter commented 1 year ago

Codecov Report

Merging #8 (f998b9e) into main (ac6204d) will increase coverage by 34.96%. The diff coverage is 96.67%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##             main       #8       +/-   ##
===========================================
+ Coverage   50.72%   85.68%   +34.96%     
===========================================
  Files           4        9        +5     
  Lines         207      503      +296     
===========================================
+ Hits          105      431      +326     
+ Misses        102       72       -30     
Impacted Files Coverage Δ
src/napari_metadata/_sample_data.py 25.00% <33.33%> (ø)
src/napari_metadata/_axes_type_units_widget.py 96.00% <96.00%> (ø)
src/napari_metadata/_axes_name_type_widget.py 96.61% <96.61%> (ø)
src/napari_metadata/_tests/test_widget.py 99.39% <99.39%> (-0.61%) :arrow_down:
src/napari_metadata/__init__.py 71.42% <100.00%> (ø)
src/napari_metadata/_axis_type.py 100.00% <100.00%> (ø)
src/napari_metadata/_space_units.py 100.00% <100.00%> (ø)
src/napari_metadata/_time_units.py 100.00% <100.00%> (ø)
src/napari_metadata/_widget.py 70.44% <100.00%> (+19.32%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

kephale commented 1 year ago

Something funky is going on in the slider area:

Starting off normally:

image

When typing the label the slider resizes:

image
andy-sweet commented 1 year ago

Something funky is going on in the slider area:

Good catch. That's a core napari bug, which you can reproduce by setting ViewerModel.dims.axis_labels. I suspect it's due to a slider widget existing for each axis/dimension and being laid out, but also being hidden. There's nothing we can do about it here, but might be worth creating an issue on napari/napari.