matplotlib-scalebar icon indicating copy to clipboard operation
matplotlib-scalebar copied to clipboard

Autodetect dimension from units.

Open anntzer opened this issue 6 months ago • 1 comments

This lets one write ScaleBar(1, "kpc") instead of the slightly redundant ScaleBar(1, "kpc", "astro-length").

Note that changes only occur in the constructor; "auto" is not when later calling set_dimension (directly or via the property) because that property's mutable semantics seem a bit fuzzy anyways: what happens if one sets the dimension to something incompatible with the units? I would believe ScaleBar.dimension should be a readonly property directly derived from ScaleBar.units.

Closes #70.

anntzer avatar Jul 01 '25 10:07 anntzer

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

:x: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 91.93%. Comparing base (2c57173) to head (4b501ca). :warning: Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
matplotlib_scalebar/scalebar.py 85.71% 1 Missing :warning:
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   91.46%   91.93%   +0.46%     
==========================================
  Files           3        3              
  Lines         422      459      +37     
==========================================
+ Hits          386      422      +36     
- Misses         36       37       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jul 01 '25 10:07 codecov-commenter