From de8b74406d7dfdcd00995780f9132998848a71d7 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 27 Jun 2024 11:54:25 +0100 Subject: [PATCH 1/5] Unpin numpy, pin pandera>=0.20.0 for numpy 2 compatibility --- .environment.yml => environment.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename .environment.yml => environment.yml (68%) diff --git a/.environment.yml b/environment.yml similarity index 68% rename from .environment.yml rename to environment.yml index d582a4f..c557013 100644 --- a/.environment.yml +++ b/environment.yml @@ -12,9 +12,8 @@ dependencies: - matplotlib - nbstripout - networkx - - numpy <2.0.0 + - numpy - openpyxl - - pandera - pip - pyarrow - pyogrio @@ -25,9 +24,10 @@ dependencies: - shapely - scipy - pip: - - hilbertcurve - - irv_autopkg_client - - python-igraph - - snkit - - tqdm - - -e . + - hilbertcurve + - irv_autopkg_client + - pandera>=0.20.0 + - python-igraph + - snkit + - tqdm + - -e . From 833b7b074142a101a5a6164de6fbfc89fd247aec Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 27 Jun 2024 11:54:40 +0100 Subject: [PATCH 2/5] Unpin numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aba7667..128fe18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ requires-python = ">=3.8" dependencies = [ "geopandas", "matplotlib", - "numpy<2.0.0", + "numpy", "openpyxl", "pandera", "pyarrow", From 78deaffb0203f2501b9999ef637be9dc4867424b Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 27 Jun 2024 11:55:06 +0100 Subject: [PATCH 3/5] Drop "early development" blockquote in README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 37cf114..25c463c 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ [![Build](https://github.com/nismod/snail/actions/workflows/build.yml/badge.svg)](https://github.com/nismod/snail/actions/workflows/build.yml) [![License](https://img.shields.io/pypi/l/nismod-snail.svg)](https://opensource.org/licenses/MIT) -> This code is under early development - # 🤔 What is this? This is a Python package to help with analysis of the potential impacts of From 92e4edcd6f9b8eb312eb1c6e43da96b82cc217f7 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 27 Jun 2024 11:55:24 +0100 Subject: [PATCH 4/5] Reference environment.yml (no dot prefix) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25c463c..49cdb89 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Change directory into the root of the project: To create and activate a conda environment with snail's dependencies installed: - conda env create -f .environment.yml + conda env create -f environment.yml conda activate snail-dev Run this to install the source code as a package: From cc8616d6105fbc84873b1bca94bcf247a3eddf1b Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Thu, 27 Jun 2024 11:56:23 +0100 Subject: [PATCH 5/5] Drop use of numpy constants for compatibility with 2.0.0 --- tests/test_damages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_damages.py b/tests/test_damages.py index 8a696a0..0ecb1cc 100644 --- a/tests/test_damages.py +++ b/tests/test_damages.py @@ -1,4 +1,5 @@ """Test damage assessment""" + import os import numpy @@ -115,7 +116,7 @@ def test_linear_curve_interpolation(curve): def test_linear_curve_out_of_bounds(curve): # sense-check out-of-bounds intensities = numpy.array( - [numpy.NINF, -999, numpy.NZERO, 0, 30, 999, numpy.inf, numpy.nan] + [-numpy.inf, -999, -0.0, 0, 30, 999, numpy.inf, numpy.nan] ) expected = numpy.array([0, 0, 0, 0, 1, 1, 1, numpy.nan]) actual = curve.damage_fraction(intensities)