Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TST: Update Quantity test class#23523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jklymak merged 2 commits intomatplotlib:mainfromgreglucas:quantity-ufunc
Jul 31, 2022
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletionslib/matplotlib/tests/test_image.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1163,7 +1163,7 @@ def __getitem__(self, item):
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
func = getattr(ufunc, method)
if "out" in kwargs:
raise NotImplementedError
return NotImplemented
if len(inputs) == 1:
i0 = inputs[0]
unit = getattr(i0, "units", "dimensionless")
Expand All@@ -1183,11 +1183,16 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
unit = f"{u0}*{u1}"
elif ufunc == np.divide:
unit = f"{u0}/({u1})"
elif ufunc in (np.greater, np.greater_equal,
np.equal, np.not_equal,
np.less, np.less_equal):
# Comparisons produce unitless booleans for output
unit = None
else:
raise NotImplementedError
return NotImplemented
out_arr = func(i0.view(np.ndarray), i1.view(np.ndarray), **kwargs)
else:
raise NotImplementedError
return NotImplemented
if unit is None:
out_arr = np.array(out_arr)
else:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp