From 50382957e792418083d305bc7698496b904ec521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Wed, 8 Feb 2023 18:31:31 +0100 Subject: [PATCH 1/2] BUG: fix a bug where float32 coordinates were incorrectly invalidated against double precision limits 0;95;0c# Please enter the commit message for your changes. Lines starting --- gpgi/types.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gpgi/types.py b/gpgi/types.py index f718d66..1aebd05 100644 --- a/gpgi/types.py +++ b/gpgi/types.py @@ -175,13 +175,14 @@ def _validate_coordinates(self) -> None: coord = self.coordinates[axis] if len(coord) == 0: continue + dtype = self._get_safe_datatype().type xmin, xmax = _AXES_LIMITS[axis] - if (cmin := np.min(coord)) < xmin: + if (cmin := np.min(coord)) < dtype(xmin): raise ValueError( f"Invalid coordinate data for axis {axis!r} {cmin} " f"(minimal allowed value is {xmin})" ) - if (cmax := np.max(coord)) > xmax: + if (cmax := np.max(coord)) > dtype(xmax): raise ValueError( f"Invalid coordinate data for axis {axis!r} {cmax} " f"(maximal allowed value is {xmax})" From 20513c058c9a29c0824e20330b3c9e731a5db5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Wed, 8 Feb 2023 18:33:09 +0100 Subject: [PATCH 2/2] REL: bump version to 0.10.1 --- gpgi/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gpgi/__init__.py b/gpgi/__init__.py index 0990f57..5d60ce5 100644 --- a/gpgi/__init__.py +++ b/gpgi/__init__.py @@ -2,4 +2,4 @@ from .api import load -__version__ = "0.11.dev0" +__version__ = "0.10.1" diff --git a/pyproject.toml b/pyproject.toml index 71eabf4..105e0ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [project] name = "gpgi" -version = "0.11.dev0" +version = "0.10.1" description = "A Generic Particle+Grid Interface" authors = [ { name = "C.M.T. Robert" },