-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from cta-observatory/numpy2_compat
Add compatibility with numpy 2.0 and replace deprecated logging.warn()
- Loading branch information
Showing
11 changed files
with
110 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Make pyirf compatible with numpy 2.0. | ||
|
||
Replace deprecated ``logging.warn`` with ``logging.warning``. |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import numpy as np | ||
from packaging.version import Version | ||
|
||
|
||
# in numpy 1.x, copy=False allows copying if it cannot be avoided | ||
# in numpy 2.0, copy=False raises an error when the copy cannot be avoided | ||
# copy=None is a new option in numpy 2.0 for the previous behavior of copy=False | ||
COPY_IF_NEEDED = None | ||
if Version(np.__version__) < Version("2.0.0.dev"): | ||
COPY_IF_NEEDED = False |
This file contains 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
This file contains 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
Oops, something went wrong.