Skip to content

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 1, 2025

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.

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`.
@codecov-commenter
Copy link

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

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.93%. Comparing base (2c57173) to head (4b501ca).
Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
matplotlib_scalebar/scalebar.py 85.71% 1 Missing ⚠️

❗ 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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

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.

Autodetect dimension?
2 participants