Skip to content

fix: disallow QQuantity with derived units#342

Merged
tlambert03 merged 8 commits into
pyapp-kit:mainfrom
Antyos:antyos/quantity-fixes
May 7, 2026
Merged

fix: disallow QQuantity with derived units#342
tlambert03 merged 8 commits into
pyapp-kit:mainfrom
Antyos:antyos/quantity-fixes

Conversation

@Antyos
Copy link
Copy Markdown
Contributor

@Antyos Antyos commented May 7, 2026

Fixes #339.

Added:

  • Units with exponents (1/s, m^2) are supported
  • Raises a NotImplementedError when using non-simple units (m/s, N).

There is probably a world where it wouldn't be too hard to infer the prefixes if it's a single unit like N, but I'm not tackling that right now.

I have also updated the docs and added corresponding tests.

@tlambert03 tlambert03 changed the title Antyos/quantity fixes fix: disallow QQuantity with derived units May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.85%. Comparing base (3285493) to head (e0bd85b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
+ Coverage   84.81%   84.85%   +0.04%     
==========================================
  Files          49       49              
  Lines        3904     3909       +5     
==========================================
+ Hits         3311     3317       +6     
+ Misses        593      592       -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.

Comment thread docs/widgets/qquantity.md Outdated
@tlambert03 tlambert03 enabled auto-merge (squash) May 7, 2026 18:28
@tlambert03 tlambert03 merged commit a376b33 into pyapp-kit:main May 7, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

QQuantity does not work for derrived units

2 participants