From 4ad69decfc26f74ac22ce890325c58dd6ed82f6e Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Wed, 19 Jun 2024 12:19:14 +0100 Subject: [PATCH] Prepare for NumPy 2.0 --- lib/galaxy/model/custom_types.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/model/custom_types.py b/lib/galaxy/model/custom_types.py index f36b4b9a6130..762c203eade4 100644 --- a/lib/galaxy/model/custom_types.py +++ b/lib/galaxy/model/custom_types.py @@ -32,7 +32,7 @@ class SafeJsonEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, numpy.int_): return int(obj) - elif isinstance(obj, numpy.float_): + elif isinstance(obj, numpy.float64): return float(obj) elif isinstance(obj, bytes): return unicodify(obj) diff --git a/pyproject.toml b/pyproject.toml index 92f64e3672d8..214fb82bbeb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -199,7 +199,7 @@ exclude = [ # Enable: pycodestyle errors (E), Pyflakes (F), flake8-bugbear (B), # flake8-comprehensions (C4), flake8-logging-format (G), # flake8-implicit-str-concat (ISC) and pyupgrade (UP) -select = ["E", "F", "B", "C4", "G", "ISC", "UP"] +select = ["E", "F", "B", "C4", "G", "ISC", "NPY", "UP"] # Exceptions: # B008 Do not perform function calls in argument defaults (for FastAPI Depends and Body) # B9 flake8-bugbear opinionated warnings