From 22789289b3e043dcaea7fc980c89e39bbaeebcc2 Mon Sep 17 00:00:00 2001 From: agstephens Date: Tue, 6 Feb 2024 14:46:32 +0000 Subject: [PATCH 1/4] Updated numpy import to fix pip install --- nappy/utils/common_utils.py | 5 +++-- tests/test_outputs/1010.nc | Bin 16425 -> 18150 bytes 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nappy/utils/common_utils.py b/nappy/utils/common_utils.py index 2ba90d6..64e13cc 100644 --- a/nappy/utils/common_utils.py +++ b/nappy/utils/common_utils.py @@ -14,8 +14,6 @@ from io import StringIO import logging -import numpy as np - # Imports from local package from nappy import __version__ from nappy.utils import parse_config @@ -263,6 +261,9 @@ def get_rank_zero_array_value(arr): It returns a float (for a number) or a string (from a string or bytes string). """ + # Import numpy here so that pip install works without error + import numpy as np + if arr.dtype.type is np.str_: return str(arr) elif arr.dtype.type is np.bytes_: diff --git a/tests/test_outputs/1010.nc b/tests/test_outputs/1010.nc index 6d1992b691461526ef0a606b25273e489a46a0d2..3b2b7a959e07329ed7d8c9584c26b2a60b1dea66 100644 GIT binary patch literal 18150 zcmeHP4RBOf6~4*J-?AW3h!zBH0qdsCZgw|;H2h^ZyIB&NCXh`_7;TrA-IweuZ{J(r zdmBg@T4+IQ(OQd^T04c2Deb5ubxO6?T9MkRNHe1KZ=|)=YJXv-b=0Dc)^qMpk_`)_ zHXWyRFSGgHz4x5^&OP_sd(ZuOe5N@TpW>eFE}uA&$ncg3FUEOFKxFJ)=l*MZbF8C$ zO0%nc0ZVjE5P6bkB)ZE<8IsKU2>AejYckp4;w%*yhp=4W_&FFW6EQ+2D!QXN`LudS zNH#u5$OIr@G5l*Ty@V*AO)Fax!hGVzMVqUCh(ErKN=h zjYpuD<75#%A3!m(B;GZN7jV{xIG>9ws@OWcv9mb_51NW0?HzfP2%OtSIZtIJM#y~8nPKAff0Zao^W&er5uPvU%+W@ z>}-vLbmOo`hoOT5%=XsJC6{2KYY9PCz2;dTc?K!kU?>4-`AppkvKJo6c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1df2f47a6c006ce923eed9c72f93263abeee0b34 Mon Sep 17 00:00:00 2001 From: Ag Stephens Date: Tue, 6 Feb 2024 14:48:57 +0000 Subject: [PATCH 2/4] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4591fd..e02ca3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, 3.10, 3.11] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@main @@ -26,6 +26,7 @@ jobs: pip install flake8 black pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi + pip install -e . --no-deps # - name: Lint with flake8 # run: flake8 roocs_utils tests # if: matrix.python-version == 3.6 From 8f54870eb154462eb1a82542eedefd5c58d21c7f Mon Sep 17 00:00:00 2001 From: Ag Stephens Date: Tue, 6 Feb 2024 14:50:25 +0000 Subject: [PATCH 3/4] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e02ca3f..6c39296 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, "3.10", 3.11] steps: - uses: actions/checkout@main From 0a162c51095b0f138f45c4f1e5cd552c5cbd8cb6 Mon Sep 17 00:00:00 2001 From: agstephens Date: Tue, 6 Feb 2024 15:14:50 +0000 Subject: [PATCH 4/4] Updated requirements for py3.8...3.11 compatibility --- requirements.txt | 2 +- tests/test_outputs/1010.nc | Bin 18150 -> 18150 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1ff1a4f..8db2f90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ netCDF4 scipy numpy xarray -cf_xarray +cf_xarray<=0.8.4 cftime diff --git a/tests/test_outputs/1010.nc b/tests/test_outputs/1010.nc index 3b2b7a959e07329ed7d8c9584c26b2a60b1dea66..dbe179cf9852cb25d89e29547ac88ca904dbc47e 100644 GIT binary patch delta 32 ncmaFX%lNF9af7-rOPrdM>Sk@>HYRpcD??)|Q?t!GMD+{-ujL7u delta 32 ncmaFX%lNF9af7-ri-^Bd`etq6HYRoxD-%;IL!-?*MD+{-vAhYk