Skip to content

fix: preserve units for np.positive (unary plus)#273

Merged
apdavison merged 1 commit into
python-quantities:masterfrom
SAY-5:fix-positive-ufunc
May 13, 2026
Merged

fix: preserve units for np.positive (unary plus)#273
apdavison merged 1 commit into
python-quantities:masterfrom
SAY-5:fix-positive-ufunc

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Applying unary + to a Quantity raised ValueError: ufunc 'positive' not supported because np.positive had no dimensionality handler; registering it with _d_copy makes it preserve units like np.negative. Closes #94.

@apdavison apdavison merged commit 4fac71b into python-quantities:master May 13, 2026
58 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.

Unary plus (__pos__) silently discards units!

2 participants