FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FIX: Fix unit example so that we can unpin numpy<2.1 by timhoffm · Pull Request #29616 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .yml  (2) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion .circleci/config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ commands:
parameters:
numpy_version:
type: string
default: "~=2.0.0"
default: ""
steps:
- run:
name: Install Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- kiwisolver>=1.3.1
- pybind11>=2.13.2
- meson-python>=0.13.1
- numpy<2.1
- numpy
- pillow>=9
- pkg-config
- pygobject
Expand Down
5 changes: 5 additions & 0 deletions galleries/examples/units/basic_units.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ def get_unit(self):


class BasicUnit:
# numpy scalars convert eager and np.float64(2) * BasicUnit('cm')
# would thus return a numpy scalar. To avoid this, we increase the
# priority of the BasicUnit.
__array_priority__ = np.float64(0).__array_priority__ + 1

def __init__(self, name, fullname=None):
self.name = name
if fullname is None:
Expand Down

Back | FazBrowse Home | New Git URL