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

Commit3fa730d

Browse files
authored
Merge pull request#29616 from timhoffm/fix-units
FIX: Fix unit example so that we can unpin numpy<2.1
2 parents3f91524 +2c087c1 commit3fa730d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

‎.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ commands:
9898
parameters:
9999
numpy_version:
100100
type:string
101-
default:"~=2.0.0"
101+
default:""
102102
steps:
103103
-run:
104104
name:Install Python dependencies

‎environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
-kiwisolver>=1.3.1
1919
-pybind11>=2.13.2
2020
-meson-python>=0.13.1
21-
-numpy<2.1
21+
-numpy
2222
-pillow>=9
2323
-pkg-config
2424
-pygobject

‎galleries/examples/units/basic_units.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ def get_unit(self):
193193

194194

195195
classBasicUnit:
196+
# numpy scalars convert eager and np.float64(2) * BasicUnit('cm')
197+
# would thus return a numpy scalar. To avoid this, we increase the
198+
# priority of the BasicUnit.
199+
__array_priority__=np.float64(0).__array_priority__+1
200+
196201
def__init__(self,name,fullname=None):
197202
self.name=name
198203
iffullnameisNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp