diff --git a/.github/workflows/ci_env.yml b/.github/workflows/ci_env.yml index fbd74079..46964190 100644 --- a/.github/workflows/ci_env.yml +++ b/.github/workflows/ci_env.yml @@ -12,25 +12,29 @@ jobs: runs-on: ubuntu-latest strategy: max-parallel: 5 + matrix: + python-version: [ "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2 + - name: Checkout github repo + uses: actions/checkout@v4 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: 3.8 + python-version: ${{ matrix.python-version }} + miniforge-version: latest - name: Conda info shell: bash -el {0} run: conda info - name: Install python and gcc shell: bash -el {0} run: | - conda install -c conda-forge python=3.8 conda install -c conda-forge gcc=12.1.0 - name: Install gdal and pcraster shell: bash -el {0} run: | - conda install -c conda-forge "gdal<=3.5.3" pcraster + conda install -c conda-forge gdal pcraster - name: Install dependencies shell: bash -el {0} run: | @@ -49,4 +53,4 @@ jobs: shell: bash -el {0} run: | pip install pytest pytest-cov - pytest \ No newline at end of file + pytest -m "slow or not slow" \ No newline at end of file diff --git a/LICENSE b/LICENSE index bb8eb5e6..9534759e 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ European Union Public Licence V. 1.2 -EUPL © the European Union 2007, 2016 +EUPL © the European Union 2007, 2026 This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the terms of this Licence. Any use of diff --git a/README.md b/README.md index d8bdd2cb..8f8e62e1 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ You can use conda environment to easily install dependencies. * Create a conda env named "lisflood" and install dependencies: ```bash -conda create --name lisflood python=3.8 -c conda-forge +conda create --name lisflood "python>=3.10" -c conda-forge conda activate lisflood -conda install -c conda-forge pcraster "gdal<=3.5.3" +conda install -c conda-forge pcraster gdal ``` * Install lisflood-model pypi package @@ -51,9 +51,9 @@ git clone --single-branch --branch master https://github.com/ec-jrc/lisflood-cod * **Install requirements into a python 3 conda env** ```bash -conda create --name lisflood python=3.8 -c conda-forge +conda create --name lisflood "python>=3.10" -c conda-forge conda activate lisflood -conda install -c conda-forge pcraster "gdal<=3.5.3" +conda install -c conda-forge pcraster gdal cd lisflood-code pip install -r requirements.txt ``` diff --git a/VERSION b/VERSION index 9286fc2e..461f3df7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.3.1.506 \ No newline at end of file +4.3.1.507 diff --git a/docs/3_step2_installation/index.md b/docs/3_step2_installation/index.md index 494b7a87..33ba206b 100644 --- a/docs/3_step2_installation/index.md +++ b/docs/3_step2_installation/index.md @@ -84,9 +84,9 @@ Follow this instruction for a basic test (some sample catchments are included in 2. **Install requirements into a python 3 conda env** ```bash -conda create --name lisflood python=3.8 -c conda-forge +conda create --name lisflood python=3.10 -c conda-forge conda activate lisflood -conda install -c conda-forge pcraster "gdal<=3.5.3" +conda install -c conda-forge pcraster gdal cd lisflood-code pip install -r requirements.txt ``` diff --git a/envflex.yml b/envflex.yml index d05b8caf..e48b42e6 100644 --- a/envflex.yml +++ b/envflex.yml @@ -2,7 +2,7 @@ name: lisflood channels: - conda-forge dependencies: - - python=3.8 + - python>=3.10 - pcraster - - gdal<=3.5.3 + - gdal - pip diff --git a/environment.yml b/environment.yml index aecdb625..46f8a41d 100644 --- a/environment.yml +++ b/environment.yml @@ -1,262 +1,349 @@ -name: lisflood +name: lisflood312 channels: - conda-forge dependencies: - - _libgcc_mutex=0.1=conda_forge - - _openmp_mutex=4.5=2_gnu - - alsa-lib=1.2.8=h166bdaf_0 - - attr=2.5.1=h166bdaf_1 - - blosc=1.21.5=hc2324a3_1 - - boost-cpp=1.74.0=h75c5d50_8 - - bzip2=1.0.8=h4bc722e_7 - - c-ares=1.34.4=hb9d3cd8_0 - - ca-certificates=2025.1.31=hbcca054_0 - - cairo=1.16.0=ha61ee94_1014 - - cfitsio=4.1.0=hd9d235c_0 - - curl=8.1.1=h5eee18b_0 - - dbus=1.13.6=h5008d03_3 - - expat=2.6.4=h5888daf_0 - - fftw=3.3.10=nompi_hf1063bd_110 + - _openmp_mutex=4.5=20_gnu + - alsa-lib=1.2.15.3=hb03c661_0 + - aws-c-auth=0.10.1=ha62d5e7_3 + - aws-c-cal=0.9.13=h2c9d079_1 + - aws-c-common=0.12.6=hb03c661_0 + - aws-c-compression=0.3.2=h8b1a151_0 + - aws-c-event-stream=0.7.0=h9b893ba_0 + - aws-c-http=0.10.13=h4bacb7b_0 + - aws-c-io=0.26.3=h692f434_1 + - aws-c-mqtt=0.15.2=hc1936db_2 + - aws-c-s3=0.12.2=he6ee468_1 + - aws-c-sdkutils=0.2.4=h8b1a151_4 + - aws-checksums=0.2.10=h8b1a151_0 + - aws-crt-cpp=0.38.3=h745e52d_1 + - aws-sdk-cpp=1.11.747=h41c0014_4 + - azure-core-cpp=1.16.2=h206d751_0 + - azure-identity-cpp=1.13.3=hed0cdb0_1 + - azure-storage-blobs-cpp=12.16.0=hdd73cc9_1 + - azure-storage-common-cpp=12.12.0=ha7a2c86_1 + - azure-storage-files-datalake-cpp=12.14.0=h52c5a47_1 + - blosc=1.21.6=he440d0b_1 + - bzip2=1.0.8=hda65f42_9 + - c-ares=1.34.6=hb03c661_0 + - c-blosc2=3.0.2=hc31b594_0 + - ca-certificates=2026.4.22=hbd8a1cb_0 + - cairo=1.18.4=he90730b_1 + - capnproto=1.4.0=h791c776_0 + - cfitsio=4.6.4=hab81a10_1 + - cyrus-sasl=2.1.28=hac629b4_1 + - dbus=1.16.2=h24cb091_1 + - fmt=12.1.0=hff5e90c_0 - font-ttf-dejavu-sans-mono=2.37=hab24e00_0 - font-ttf-inconsolata=3.000=h77eed37_0 - font-ttf-source-code-pro=2.038=h77eed37_0 - font-ttf-ubuntu=0.83=h77eed37_3 - - fontconfig=2.14.2=h14ed4e7_0 + - fontconfig=2.17.1=h27c8c51_0 - fonts-conda-ecosystem=1=0 - - fonts-conda-forge=1=0 - - freeglut=3.2.2=h9c3ff4c_1 - - freetype=2.12.1=h267a509_2 - - freexl=1.0.6=h166bdaf_1 - - gdal=3.5.1=py38h5b6c9fa_5 - - geos=3.11.0=h27087fc_0 - - geotiff=1.7.1=h4fc65e6_3 - - gettext=0.23.1=h5888daf_0 - - gettext-tools=0.23.1=h5888daf_0 + - fonts-conda-forge=1=hc364b38_1 + - freeglut=3.2.2=h215f996_4 + - freexl=2.0.0=h9dce30a_2 + - fribidi=1.0.16=hb03c661_0 + - gdal=3.12.4=np2py312h6223463_3 + - geos=3.14.1=h480dda7_0 - giflib=5.2.2=hd590300_0 - - glib=2.80.2=hf974151_0 - - glib-tools=2.80.2=hb6ce0ca_0 - - gst-plugins-base=1.21.3=h4243ec0_1 - - gstreamer=1.21.3=h25f0c4b_1 - - gstreamer-orc=0.4.41=h17648ed_0 - - hdf4=4.2.15=h9772cbc_5 - - hdf5=1.12.2=nompi_h2386368_101 - - icu=70.1=h27087fc_0 - - jack=1.9.22=h11f4161_0 - - jasper=2.0.33=h0ff4b12_1 - - jpeg=9e=h0b41bf4_3 - - json-c=0.16=hc379101_0 - - kealib=1.4.15=ha7026e8_1 - - krb5=1.19.4=h568e23c_0 + - glib=2.88.1=hd810c12_2 + - glib-tools=2.88.1=hee1de02_2 + - graphite2=1.3.14=hecca717_2 + - gst-plugins-base=1.26.11=h6d08254_0 + - gstreamer=1.26.11=h29cf534_0 + - harfbuzz=14.2.0=h6083320_0 + - hdf4=4.2.15=h2a13503_7 + - hdf5=2.1.0=nompi_h87a9417_105 + - icu=78.3=h33c6efd_0 + - jasper=4.2.9=h1588d4d_1 + - json-c=0.18=h6688a6e_0 + - kealib=1.6.2=h63db1d0_3 + - keyutils=1.6.3=hb9d3cd8_0 + - krb5=1.22.2=ha1258a1_0 - lame=3.100=h166bdaf_1003 - - lcms2=2.14=h6ed2654_0 - - ld_impl_linux-64=2.43=h712a8e2_4 - - lerc=4.0.0=h27087fc_0 - - libaec=1.1.3=h59595ed_0 - - libasprintf=0.23.1=h8e693c7_0 - - libasprintf-devel=0.23.1=h8e693c7_0 - - libblas=3.9.0=31_h59b9bed_openblas - - libcap=2.66=ha37c62d_0 - - libcblas=3.9.0=31_he106b2a_openblas - - libclang=15.0.7=default_h127d8a8_5 - - libclang13=15.0.7=default_h5d6823c_5 - - libcups=2.3.3=h3e49a29_2 - - libcurl=8.1.1=h91b91d3_0 - - libdap4=3.20.6=hd7c4107_2 - - libdb=6.2.32=h9c3ff4c_0 - - libdeflate=1.14=h166bdaf_0 + - lcms2=2.19.1=h0c24ade_0 + - ld_impl_linux-64=2.45.1=default_hbd61a6d_102 + - lerc=4.1.0=hdb68285_0 + - libabseil=20260107.1=cxx17_h7b12aa8_0 + - libadbc-driver-manager=1.11.0=hb700be7_0 + - libaec=1.1.5=h088129d_0 + - libarchive=3.8.7=gpl_hc2c16d8_101 + - libblas=3.11.0=7_h4a7cf45_openblas + - libbrotlicommon=1.2.0=hb03c661_1 + - libbrotlidec=1.2.0=hb03c661_1 + - libbrotlienc=1.2.0=hb03c661_1 + - libcap=2.77=hd0affe5_1 + - libcblas=3.11.0=7_h0358290_openblas + - libclang-cpp22.1=22.1.5=default_h99862b1_1 + - libclang13=22.1.5=default_h746c552_1 + - libcrc32c=1.1.2=h9c3ff4c_0 + - libcups=2.3.3=h7a8fb5f_6 + - libcurl=8.20.0=hcf29cc6_0 + - libdeflate=1.25=h17f619e_0 + - libdrm=2.4.125=hb03c661_1 - libedit=3.1.20250104=pl5321h7949ede_0 + - libegl=1.7.0=ha4b6fd6_2 - libev=4.33=hd590300_2 - - libevent=2.1.10=h9b69904_4 - - libexpat=2.6.4=h5888daf_0 - - libffi=3.4.6=h2dba641_0 - - libflac=1.4.3=h59595ed_0 - - libgcc=14.2.0=h767d61c_2 - - libgcc-ng=14.2.0=h69a702a_2 - - libgcrypt=1.11.0=ha770c72_2 - - libgcrypt-devel=1.11.0=hb9d3cd8_2 - - libgcrypt-lib=1.11.0=hb9d3cd8_2 - - libgcrypt-tools=1.11.0=hb9d3cd8_2 - - libgdal=3.5.1=hc23bfc3_5 - - libgettextpo=0.23.1=h5888daf_0 - - libgettextpo-devel=0.23.1=h5888daf_0 - - libgfortran=14.2.0=h69a702a_2 - - libgfortran-ng=14.2.0=h69a702a_2 - - libgfortran5=14.2.0=hf1ad2bd_2 - - libglib=2.80.2=hf974151_0 - - libglu=9.0.0=he1b5a44_1001 - - libgomp=14.2.0=h767d61c_2 - - libgpg-error=1.51=hbd13f7d_1 - - libiconv=1.18=h4ce23a2_1 - - libkml=1.3.0=h01aab08_1016 - - liblapack=3.9.0=31_h7ac8fdf_openblas - - libllvm15=15.0.7=hadd5161_1 - - libltdl=2.4.3a=h5888daf_0 - - liblzma=5.6.4=hb9d3cd8_0 - - liblzma-devel=5.6.4=hb9d3cd8_0 - - libnetcdf=4.8.1=nompi_h261ec11_106 - - libnghttp2=1.51.0=hdcd2b5c_0 - - libnsl=2.0.1=hd590300_0 - - libogg=1.3.5=h4ab18f5_0 - - libopenblas=0.3.29=pthreads_h94d23a6_0 - - libopus=1.3.1=h7f98852_1 - - libpng=1.6.43=h2797004_0 - - libpq=14.5=h72a31a5_3 - - librttopo=1.1.0=hf730bdb_11 - - libsndfile=1.2.2=hc60ed4a_1 - - libspatialite=5.0.1=hd36657c_19 - - libsqlite=3.46.0=hde9e2c9_0 - - libssh2=1.10.0=haa6b8db_3 - - libstdcxx=14.2.0=h8f9b012_2 - - libstdcxx-ng=14.2.0=h4852527_2 - - libsystemd0=252=h2a991cd_0 - - libtiff=4.4.0=h82bc61c_5 - - libtool=2.5.4=h5888daf_0 - - libudev1=253=h0b41bf4_0 - - libuuid=2.38.1=h0b41bf4_0 - - libvorbis=1.3.7=h9c3ff4c_0 - - libwebp-base=1.5.0=h851e524_0 - - libxcb=1.13=h7f98852_1004 + - libevent=2.1.12=hf998b51_1 + - libexpat=2.8.0=hecca717_0 + - libffi=3.5.2=h3435931_0 + - libflac=1.5.0=he200343_1 + - libfreetype=2.14.3=ha770c72_0 + - libfreetype6=2.14.3=h73754d4_0 + - libgcc=15.2.0=he0feb66_19 + - libgcc-ng=15.2.0=h69a702a_19 + - libgdal=3.12.4=hfc2019e_3 + - libgdal-adbc=3.12.4=hb2b9f0d_3 + - libgdal-core=3.12.4=h08c5dba_3 + - libgdal-fits=3.12.4=h85ebb52_3 + - libgdal-grib=3.12.4=h0b51d66_3 + - libgdal-hdf4=3.12.4=hd9d0baa_3 + - libgdal-hdf5=3.12.4=h90596a8_3 + - libgdal-jp2openjpeg=3.12.4=hb2b9f0d_3 + - libgdal-kea=3.12.4=h90596a8_3 + - libgdal-netcdf=3.12.4=h86282e7_3 + - libgdal-pdf=3.12.4=h959df99_3 + - libgdal-pg=3.12.4=haecd9b2_3 + - libgdal-postgisraster=3.12.4=haecd9b2_3 + - libgdal-tiledb=3.12.4=hb2b9f0d_3 + - libgdal-xls=3.12.4=hb2b9f0d_3 + - libgfortran=15.2.0=h69a702a_19 + - libgfortran5=15.2.0=h68bc16d_19 + - libgl=1.7.0=ha4b6fd6_2 + - libglib=2.88.1=h0d30a3d_2 + - libglu=9.0.3=h5888daf_1 + - libglvnd=1.7.0=ha4b6fd6_2 + - libglx=1.7.0=ha4b6fd6_2 + - libgomp=15.2.0=he0feb66_19 + - libgoogle-cloud=3.3.0=h25dbb67_1 + - libgoogle-cloud-storage=3.3.0=hdbdcf42_1 + - libgrpc=1.78.1=h1d1128b_0 + - libhwy=1.4.0=h10be129_0 + - libiconv=1.18=h3b78370_2 + - libjpeg-turbo=3.1.4.1=hb03c661_0 + - libjxl=0.11.2=h174a0a3_1 + - libkml=1.3.0=haa4a5bd_1023 + - liblapack=3.11.0=7_h47877c9_openblas + - libllvm22=22.1.5=hf7376ad_1 + - liblzma=5.8.3=hb03c661_0 + - libnetcdf=4.10.0=nompi_h3c9b436_104 + - libnghttp2=1.68.1=h877daf1_0 + - libnsl=2.0.1=hb9d3cd8_1 + - libntlm=1.8=hb9d3cd8_0 + - libogg=1.3.5=hd0c01bc_1 + - libopenblas=0.3.33=pthreads_h94d23a6_0 + - libopengl=1.7.0=ha4b6fd6_2 + - libopentelemetry-cpp=1.26.0=h9692893_0 + - libopentelemetry-cpp-headers=1.26.0=ha770c72_0 + - libopus=1.6.1=h280c20c_0 + - libpciaccess=0.18=hb9d3cd8_0 + - libpng=1.6.58=h421ea60_0 + - libpq=18.4=hd5a49e9_0 + - libprotobuf=6.33.5=h2b00c02_0 + - libre2-11=2025.11.05=h0dc7533_1 + - librttopo=1.1.0=h46dd2a8_20 + - libsndfile=1.2.2=hc7d488a_2 + - libspatialite=5.1.0=gpl_hab3fe16_120 + - libsqlite=3.53.1=h0c1763c_0 + - libssh2=1.11.1=hcf80075_0 + - libstdcxx=15.2.0=h934c35e_19 + - libstdcxx-ng=15.2.0=hdf11a46_19 + - libsystemd0=260.1=h6569c3e_0 + - libtiff=4.7.1=h9d88235_1 + - liburing=2.14=hb700be7_0 + - libuuid=2.42=h5347b49_0 + - libvorbis=1.3.7=h54a6638_2 + - libwebp-base=1.6.0=hd42ef1d_0 + - libxcb=1.17.0=h8a09558_0 - libxcrypt=4.4.36=hd590300_1 - - libxkbcommon=1.5.0=h79f4944_1 - - libxml2=2.10.3=hca2bb57_4 - - libzip=1.9.2=hc869a4a_1 - - libzlib=1.2.13=h4ab18f5_6 - - lz4-c=1.9.4=hcb278e6_0 + - libxkbcommon=1.13.1=hca5e8e5_0 + - libxml2=2.15.3=h49c6c72_0 + - libxml2-16=2.15.3=hca6bf5a_0 + - libxml2-devel=2.15.3=h49c6c72_0 + - libxslt=1.1.43=h711ed8c_1 + - libzip=1.11.2=h6991a6a_0 + - libzlib=1.3.2=h25fd6f3_2 + - lz4-c=1.10.0=h5888daf_1 + - lzo=2.10=h280c20c_1002 + - minizip=4.2.1=hb71707f_0 - mpg123=1.32.9=hc50e24c_0 - - mysql-common=8.0.32=h14678bc_0 - - mysql-libs=8.0.32=h54cf53e_0 - - ncurses=6.5=h2d0b736_3 - - nspr=4.36=h5888daf_0 - - nss=3.100=hca3bf56_0 - - numpy=1.24.4=py38h59b608b_0 - - openjpeg=2.5.0=h7d73246_1 - - openssl=1.1.1w=hd590300_0 - - pcraster=4.3.3=py38hae4784f_2 - - pcre=8.45=h9c3ff4c_0 - - pcre2=10.43=hcad00b1_0 - - pip=24.3.1=pyh8b19718_0 - - pixman=0.44.2=h29eaf8c_0 - - poppler=22.04.0=h8b295ee_2 + - muparser=2.3.5=h5888daf_0 + - ncurses=6.6=hdb14827_0 + - nlohmann_json=3.12.0=h54a6638_1 + - nspr=4.38=h29cc59b_0 + - nss=3.118=h445c969_0 + - openjpeg=2.5.4=h55fea9a_0 + - openldap=2.6.13=hbde042b_0 + - openssl=3.6.2=h35e630c_0 + - packaging=26.2=pyhc364b38_0 + - pango=1.56.4=hda50119_1 + - pcraster=4.4.2=py312hfa6565d_6 + - pcre2=10.47=haa7fec5_0 + - pip=26.1.1=pyh8b19718_0 + - pixman=0.46.4=h54a6638_1 + - poppler=26.02.0=hfdef1ce_3 - poppler-data=0.4.12=hd8ed1ab_0 - - postgresql=14.5=h5bbe9e2_3 - - proj=9.0.1=h93bde94_1 + - postgresql=18.4=h3dddfe3_0 + - proj=9.8.1=he0df7b0_0 + - prometheus-cpp=1.3.0=ha5d0236_0 - pthread-stubs=0.4=hb9d3cd8_1002 - - pulseaudio=16.1=h4ab2085_1 - - python=3.8.15=h257c98d_0_cpython - - python_abi=3.8=5_cp38 - - qt-main=5.15.6=h7acdfc8_2 - - readline=8.2=h8c095d6_2 - - setuptools=75.3.0=pyhd8ed1ab_0 - - snappy=1.2.1=h8bd8927_1 - - sqlite=3.46.0=h6d4b2fc_0 - - tiledb=2.11.3=h1e4a385_1 - - tk=8.6.13=noxft_h4845f30_101 - - tzcode=2025a=hb9d3cd8_0 + - pulseaudio-client=17.0=h9a6aba3_3 + - python=3.12.13=hd63d673_0_cpython + - python_abi=3.12=8_cp312 + - qt-main=5.15.15=h0c412b5_8 + - re2=2025.11.05=h5301d42_1 + - readline=8.3=h853b02a_0 + - s2n=1.7.2=hc5a330e_1 + - snappy=1.2.2=h03e3b7b_1 + - spdlog=1.17.0=hab81395_1 + - sqlite=3.53.1=hbc0de68_0 + - tiledb=2.30.1=h8789cd1_7 + - tk=8.6.13=noxft_h366c992_103 + - tzcode=2026b=h280c20c_0 - uriparser=0.9.8=hac33072_0 - - wheel=0.45.1=pyhd8ed1ab_0 - - xcb-util=0.4.0=h516909a_0 - - xcb-util-image=0.4.0=h166bdaf_0 - - xcb-util-keysyms=0.4.0=h516909a_0 - - xcb-util-renderutil=0.3.9=h166bdaf_0 - - xcb-util-wm=0.4.1=h516909a_0 - - xerces-c=3.2.4=h55805fa_1 - - xkeyboard-config=2.38=h0b41bf4_0 - - xorg-fixesproto=5.0=hb9d3cd8_1003 - - xorg-inputproto=2.3.2=hb9d3cd8_1003 - - xorg-kbproto=1.0.7=hb9d3cd8_1003 + - wheel=0.47.0=pyhd8ed1ab_0 + - xcb-util=0.4.1=h4f16b4b_2 + - xcb-util-image=0.4.0=hb711507_2 + - xcb-util-keysyms=0.4.1=hb711507_0 + - xcb-util-renderutil=0.3.10=hb711507_0 + - xcb-util-wm=0.4.2=hb711507_0 + - xerces-c=3.3.0=hd9031aa_1 + - xkeyboard-config=2.47=hb03c661_0 - xorg-libice=1.1.2=hb9d3cd8_0 - - xorg-libsm=1.2.5=he73a12e_0 - - xorg-libx11=1.8.4=h0b41bf4_0 - - xorg-libxau=1.0.12=hb9d3cd8_0 - - xorg-libxdmcp=1.1.5=hb9d3cd8_0 - - xorg-libxext=1.3.4=h0b41bf4_2 - - xorg-libxfixes=5.0.3=h7f98852_1004 - - xorg-libxi=1.7.10=h7f98852_0 - - xorg-libxrender=0.9.10=h7f98852_1003 - - xorg-renderproto=0.11.1=hb9d3cd8_1003 - - xorg-xextproto=7.3.0=hb9d3cd8_1004 - - xorg-xproto=7.0.31=hb9d3cd8_1008 - - xz=5.6.4=hbcc6ac9_0 - - xz-gpl-tools=5.6.4=hbcc6ac9_0 - - xz-tools=5.6.4=hb9d3cd8_0 - - zlib=1.2.13=h4ab18f5_6 - - zstd=1.5.6=ha6fb4c9_0 + - xorg-libsm=1.2.6=he73a12e_0 + - xorg-libx11=1.8.13=he1eb515_0 + - xorg-libxau=1.0.12=hb03c661_1 + - xorg-libxdamage=1.1.6=hb9d3cd8_0 + - xorg-libxdmcp=1.1.5=hb03c661_1 + - xorg-libxext=1.3.7=hb03c661_0 + - xorg-libxfixes=6.0.2=hb03c661_0 + - xorg-libxi=1.8.2=hb9d3cd8_0 + - xorg-libxrender=0.9.12=hb9d3cd8_0 + - xorg-libxscrnsaver=1.2.4=hb9d3cd8_0 + - xorg-libxshmfence=1.3.3=hb9d3cd8_0 + - xorg-libxtst=1.2.5=hb9d3cd8_3 + - xorg-libxxf86vm=1.1.7=hb03c661_0 + - zlib=1.3.2=h25fd6f3_2 + - zlib-ng=2.3.3=hceb46e0_1 + - zstd=1.5.7=hb78ec9c_6 - pip: - affine==2.4.0 - - attrs==25.1.0 - - backports-tarfile==1.2.0 - - certifi==2025.1.31 - - cffi==1.17.1 - - cfgrib==0.9.15.0 - - cftime==1.6.4.post1 - - charset-normalizer==3.4.1 - - click==8.1.8 - - click-plugins==1.1.1 + - array-api-compat==1.14.0 + - attrs==26.1.0 + - beautifulsoup4==4.14.3 + - branca==0.8.2 + - cdsapi==0.7.7 + - certifi==2026.4.22 + - cffi==2.0.0 + - cfgrib==0.9.15.1 + - cftime==1.6.5 + - charset-normalizer==3.4.7 + - click==8.3.3 - cligj==0.7.2 - - cloudpickle==3.1.1 - - coverage==7.6.1 - - cryptography==44.0.2 - - dask==2023.5.0 - - docutils==0.20.1 - - eccodes==2.40.0 + - climetlab==0.24.0 + - cloudpickle==3.1.2 + - coverage==7.14.0 + - dask==2026.3.0 + - deprecation==2.1.0 + - earthkit-data==0.18.6 + - earthkit-hydro==1.1.0 + - earthkit-meteo==0.5.1 + - earthkit-utils==0.1.2 + - eccodes==2.47.0 - eccodes-python==0.9.9 - - exceptiongroup==1.2.2 - - findlibs==0.1.0 - - fsspec==2025.2.0 - - geographiclib==2.0 + - eccodeslib==2.46.2.19 + - eckitlib==2.0.7.19 + - ecmwf-api-client==1.6.5 + - ecmwf-datastores-client==0.5.1 + - ecmwf-opendata==0.3.29 + - ecmwflibs==0.7.0 + - entrypoints==0.4 + - exceptiongroup==1.3.1 + - filelock==3.29.0 + - findlibs==0.1.2 + - flexcache==0.3 + - flexparser==0.4 + - fsspec==2026.4.0 + - future==1.0.0 + - geographiclib==2.1 + - geopandas==1.1.3 - geopy==2.4.1 - - id==1.5.0 - - idna==3.10 - - importlib-metadata==4.13.0 - - importlib-resources==6.4.5 - - iniconfig==2.0.0 - - jaraco-classes==3.4.0 - - jaraco-context==6.0.1 - - jaraco-functools==4.1.0 - - jeepney==0.9.0 - - keyring==25.5.0 - - lisflood-utilities==0.12.23 - - llvmlite==0.41.1 + - idna==3.15 + - imageio==2.37.3 + - importlib-metadata==9.0.0 + - iniconfig==2.3.0 + - jinja2==3.1.6 + - joblib==1.5.3 + - jsonschema==4.26.0 + - jsonschema-specifications==2025.9.1 + - lazy-loader==0.5 + - lisflood-utilities==1.0.1 + - llvmlite==0.47.0 - locket==1.0.0 - - markdown-it-py==3.0.0 - - mdurl==0.1.2 - - more-itertools==10.5.0 - - netcdf4==1.6.4 - - nh3==0.2.21 + - lru-dict==1.4.1 + - lxml==6.1.0 + - magics==1.5.8 + - markdown==3.10.2 + - markupsafe==3.0.3 + - more-itertools==11.0.2 + - multiurl==0.3.7 + - netcdf4==1.7.4 + - networkx==3.6.1 - nine==1.2.0 - - numba==0.58.1 - - numexpr==2.8.6 - - packaging==24.2 - - pandas==2.0.3 - - partd==1.4.1 - - pluggy==1.5.0 - - pycparser==2.22 - - pyg2p==3.2.8 - - pygments==2.19.1 - - pyparsing==3.1.4 - - pytest==8.3.5 - - pytest-cov==5.0.0 - - pytest-env==1.1.5 - - pytest-mock==3.14.0 + - numba==0.65.1 + - numexpr==2.14.1 + - numpngw==0.1.4 + - numpy==2.2.6 + - odclib==1.6.3.19 + - pandas==2.3.3 + - partd==1.4.2 + - pathlib2==2.3.7.post1 + - pdbufr==0.14.2 + - pillow==12.2.0 + - pint==0.25.3 + - pkginfo==1.12.1.2 + - platformdirs==4.9.6 + - pluggy==1.6.0 + - py==1.11.0 + - pycparser==3.0 + - pyflwdir==0.5.11 + - pyg2p==3.3.0 + - pygments==2.20.0 + - pyodc==1.6.0 + - pyogrio==0.12.1 + - pyparsing==3.3.2 + - pyproj==3.7.2 + - pytest==9.0.3 + - pytest-cov==7.1.0 + - pytest-cover==3.0.0 + - pytest-coverage==0.0 + - pytest-env==1.6.0 + - pytest-mock==3.15.1 - python-dateutil==2.9.0.post0 - - pytz==2025.1 - - pyyaml==6.0.2 - - rasterio==1.3.11 - - readme-renderer==43.0 - - requests==2.32.3 - - requests-toolbelt==1.0.0 - - rfc3986==2.0.0 - - rich==13.9.4 - - scipy==1.10.1 - - secretstorage==3.3.3 + - python-dotenv==1.2.2 + - pytz==2026.2 + - pyyaml==6.0.3 + - rasterio==1.5.0 + - referencing==0.37.0 + - requests==2.34.2 + - rioxarray==0.22.0 + - rpds-py==0.30.0 + - scikit-image==0.26.0 + - scipy==1.17.1 + - setuptools==81.0.0 + - shapely==2.1.2 - six==1.17.0 - - snuggs==1.4.7 - - tomli==2.2.1 - - toolz==1.0.0 - - twine==6.1.0 - - typing-extensions==4.12.2 - - tzdata==2025.1 - - ujson==5.10.0 - - urllib3==2.2.3 - - xarray==2023.1.0 - - zipp==3.20.2 \ No newline at end of file + - soupsieve==2.8.3 + - termcolor==3.3.0 + - tifffile==2026.5.2 + - toml==0.10.2 + - tomli==2.4.1 + - toolz==1.1.0 + - tqdm==4.67.3 + - typing-extensions==4.15.0 + - tzdata==2026.2 + - ujson==5.12.1 + - urllib3==2.7.0 + - xarray==2026.4.0 + - zipp==3.23.1 +prefix: /home/ubuntu/miniforge3/envs/lisflood312 diff --git a/requirements.txt b/requirements.txt index 40df48ed..36976755 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,20 +4,20 @@ cftime>=1.0.4.2 coverage>=6.0 dask>=2021.10.0 future>=0.18.0 -GDAL>=3.2.0,<= 3.5.3 -importlib-metadata<5.0.0 +GDAL>=3.12.4 +importlib-metadata>=5.0.0 iniconfig>=1.1.1 -lisflood-utilities>=0.12.19 +lisflood-utilities>=1.0.1 llvmlite>=0.37.0 lxml>=4.6.5 more-itertools>=7.2.0 -netCDF4>=1.5.3,<=1.6.4 +netCDF4>=1.7.4 nine>=1.0.0 numba>=0.54.0 -numexpr>=2.7.0,<=2.8.4 -numpy>=1.21.0 +numexpr>=2.14.1 +numpy>=1.21.0,<2.3 packaging>=19.2 -pandas>=1,<2 +pandas>=2.3.3 pathlib2>=2.3.5 pkginfo>=1.5.0.1 pluggy>=0.13.0 diff --git a/setup.py b/setup.py index f69f1e17..5e24c0ef 100755 --- a/setup.py +++ b/setup.py @@ -134,7 +134,9 @@ def _get_gdal_version(): gdal_version = _get_gdal_version() req_file = 'requirements.txt' requirements = [l for l in open(req_file).readlines() if l and not l.startswith('#')] -requirements += ['GDAL=={}'.format(gdal_version)] +# GDAL requirement is commented to avoid fixing GDAL version in pypi package +# requirements += ['GDAL=={}'.format(gdal_version)] + setup( name='lisflood-model', version=version, diff --git a/src/lisflood/global_modules/add1.py b/src/lisflood/global_modules/add1.py index 76237671..3b92e33a 100755 --- a/src/lisflood/global_modules/add1.py +++ b/src/lisflood/global_modules/add1.py @@ -243,7 +243,7 @@ def loadsetclone(name): raise LisfloodError("Maskmap: {} is not a valid mask map nor valid coordinates".format(name)) _ = MaskAttrs(uuid.uuid4()) # init maskattrs # convert numpy map to 8bit - maskarea = np.bool8(mapnp) + maskarea = np.bool(mapnp) #check ldd map by maskchkarea map maskchkarea = np.logical_not(maskarea) _ = MaskAreaInfo(maskchkarea, map_out) # MaskAreaInfo init here @@ -520,8 +520,11 @@ def loadmap_base(name, pcr=False, lddflag=False, timestampflag='exact', averagey mapnp[mapnp.mask] = -9999 map = numpy2pcr(Nominal, mapnp, -9999) elif checkint == "int8": - mapnp[mapnp < 0] = -9999 - map = numpy2pcr(Nominal, mapnp, -9999) + mapnp[mapnp < 0] = -99 + map = numpy2pcr(Nominal, mapnp, -99) + elif checkint == "uint8": + mapnp[np.isnan(mapnp)] = 255 + map = numpy2pcr(Scalar, mapnp, 255) else: mapnp[np.isnan(mapnp)] = -9999 map = numpy2pcr(Scalar, mapnp, -9999) diff --git a/src/lisflood/global_modules/netcdf.py b/src/lisflood/global_modules/netcdf.py index bb7d7cdb..5d08ed19 100644 --- a/src/lisflood/global_modules/netcdf.py +++ b/src/lisflood/global_modules/netcdf.py @@ -49,7 +49,7 @@ def mask_array(data, mask, crop, core_dims, name, valid_min, valid_max, func_x, exclude_dims=set(core_dims), output_dtypes=[data.dtype], output_core_dims=[['z']], - dask_gufunc_kwargs = dict(output_sizes={'z': n_data}), + dask_gufunc_kwargs = dict(output_sizes={'z': n_data}, allow_rechunk=True), kwargs={'mask': mask, 'crop': crop, 'name': name, 'valid_min': valid_min, 'valid_max': valid_max, 'func_x': func_x, 'func_y':func_y}) diff --git a/src/lisflood/hydrological_modules/lakes.py b/src/lisflood/hydrological_modules/lakes.py index cecd2337..72c4b768 100755 --- a/src/lisflood/hydrological_modules/lakes.py +++ b/src/lisflood/hydrological_modules/lakes.py @@ -79,10 +79,10 @@ def initial(self): if option['simulateLakes'] and not option['InitLisflood']: - self.var.IsStructureKinematic = np.where(LakeSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) + self.var.IsStructureKinematic = np.where(LakeSitesC > 0, np.bool(1), self.var.IsStructureKinematic) # Add lake locations to structures map (used to modify LddKinematic # and to calculate LddStructuresKinematic) - self.var.IsStructureChan = np.where(LakeSitesC > 0, np.bool8(1), self.var.IsStructureChan) + self.var.IsStructureChan = np.where(LakeSitesC > 0, np.bool(1), self.var.IsStructureChan) # Add lake locations to structures map (used to modify LddChan # and to calculate LddStructuresChan) diff --git a/src/lisflood/hydrological_modules/reservoir.py b/src/lisflood/hydrological_modules/reservoir.py index 26d0b72a..27d54235 100755 --- a/src/lisflood/hydrological_modules/reservoir.py +++ b/src/lisflood/hydrological_modules/reservoir.py @@ -114,10 +114,10 @@ def initial(self): # Add reservoir locations to structures map # (used to modify LddKinematic and to calculate LddStructuresKinematic) - self.var.IsStructureKinematic = np.where(self.var.ReservoirSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) + self.var.IsStructureKinematic = np.where(self.var.ReservoirSitesC > 0, np.bool(1), self.var.IsStructureKinematic) # Add reservoir locations to structures map (used to modify LddKinematic # and to calculate LddStructuresKinematic) - self.var.IsStructureChan = np.where(self.var.ReservoirSitesC > 0, np.bool8(1), self.var.IsStructureChan) + self.var.IsStructureChan = np.where(self.var.ReservoirSitesC > 0, np.bool(1), self.var.IsStructureChan) # Add reservoir locations to structures map (used to modify LddChan # and to calculate LddStructuresChan) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 5762795f..9a70b0ed 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -115,7 +115,7 @@ def initial(self): # Calculate inverse, so we can multiply in dynamic (faster than divide) self.var.IsChannelPcr = boolean(loadmap('Channels', pcr=True)) #pcr - self.var.IsChannel = np.bool8(compressArray(self.var.IsChannelPcr)) #bool + self.var.IsChannel = np.bool(compressArray(self.var.IsChannelPcr)) #bool self.var.IsChannelPcr = boolean(decompress(self.var.IsChannel)) #pcr # Identify grid cells containing a river channel @@ -123,11 +123,11 @@ def initial(self): # Identify channel pixels using kinematic or split routing # (identical to IsChannel, unless MCT wave is used, see below) - self.var.IsStructureChan = np.bool8(maskinfo.in_zero()) #bool + self.var.IsStructureChan = np.bool(maskinfo.in_zero()) #bool # Initialise map that identifies special inflow/outflow structures (reservoirs, lakes) within the # channel routing. Set to (dummy) value of zero modified in reservoirs and lakes functions (if those are used) - self.var.IsStructureKinematic = np.bool8(maskinfo.in_zero()) #bool + self.var.IsStructureKinematic = np.bool(maskinfo.in_zero()) #bool # Initialise map that identifies special inflow/outflow structures (reservoirs, lakes) within the # kinematic wave channel routing. Set to (dummy) value of zero modified in reservoirs and lakes functions # (if those are used) @@ -189,7 +189,7 @@ def initial(self): self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) # pcr # load mask of MCT river grid cells - self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) # bool + self.var.IsChannelMCT = np.bool(compressArray(self.var.IsChannelMCTPcr)) # bool # even if MCT is active, it should be deactivated if there is no MCT cell in the domain if self.var.IsChannelMCT.sum() == 0: @@ -203,11 +203,11 @@ def initial(self): self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr # Identify channel pixels where Muskingum-Cunge-Todini is used - self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) + self.var.mctmask = np.bool(pcr2numpy(self.var.IsChannelMCTPcr,0)) # Create a mask with cells using MCT self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr - self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np + self.var.IsChannelKinematic = np.bool(compressArray(self.var.IsChannelKinematicPcr)) #np # Identify channel pixels where Kinematic wave is used instead of MCT @@ -218,7 +218,7 @@ def initial(self): self.var.AtLastPoint = boolean(pit(self.var.Ldd)) #pcr # Assign True to each of the grid cells where there are outlet points # Function 'pit' assigns a unique number starting from 1 to pit cells (ldd=5) in the Ldd - self.var.AtLastPointC = np.bool8(compressArray(self.var.AtLastPoint)) #np + self.var.AtLastPointC = np.bool(compressArray(self.var.AtLastPoint)) #np lddC = compressArray(self.var.LddChan) #np inAr = decompress(np.arange(maskinfo.info.mapC[0], dtype="int32")) #pcr @@ -607,13 +607,28 @@ def initialMCT(self): # ***** INITIALISATION FOR MCT ROUTING ************ # ************************************************************ + # even if MCT is active, it should be deactivated if there is no MCT cell in the domain + if option['MCTRouting']: + self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr + self.var.IsChannelMCT = np.bool(compressArray(self.var.IsChannelMCTPcr)) #bool + if self.var.IsChannelMCT.sum()==0: + warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) + option['MCTRouting'] = False + # rebuild lists of reported files with MCTRouting = False + settings.build_reportedmaps_dicts() if option['MCTRouting'] and not option['InitLisflood']: maskinfo = MaskInfo.instance() - # self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr - # self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np - # # Identify channel pixels where Kinematic wave is used instead of MCT + self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr + # Identify channel pixels where Muskingum-Cunge-Todini is used + + self.var.mctmask = np.bool(pcr2numpy(self.var.IsChannelMCTPcr,0)) + # Create a mask with cells using MCT + + self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr + self.var.IsChannelKinematic = np.bool(compressArray(self.var.IsChannelKinematicPcr)) #np + # Identify channel pixels where Kinematic wave is used instead of MCT self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr # Ldd for MCT routing diff --git a/src/lisflood/hydrological_modules/soil.py b/src/lisflood/hydrological_modules/soil.py index e3233d74..8cd8215e 100644 --- a/src/lisflood/hydrological_modules/soil.py +++ b/src/lisflood/hydrological_modules/soil.py @@ -324,20 +324,20 @@ def splitlanduse(array1, array2=None, array3=None): self.var.Sat1 = self.var.allocateVariableAllVegetation() self.var.Sat2 = self.var.allocateVariableAllVegetation() ''' - self.var.PoreSpaceNotZero1a = splitlanduse(np.bool8((self.var.SoilDepth1a[0] != 0) & (self.var.WS1a[0] != 0)), - np.bool8((self.var.SoilDepth1a[1] != 0) & (self.var.WS1a[1] != 0)), - np.bool8((self.var.SoilDepth1a[2] != 0) & (self.var.WS1a[2] != 0))) - self.var.PoreSpaceNotZero1b = splitlanduse(np.bool8((self.var.SoilDepth1b[0] != 0) & (self.var.WS1b[0] != 0)), - np.bool8((self.var.SoilDepth1b[1] != 0) & (self.var.WS1b[1] != 0)), - np.bool8((self.var.SoilDepth1b[2] != 0) & (self.var.WS1b[2] != 0))) - self.var.PoreSpaceNotZero2 = splitlanduse(np.bool8((self.var.SoilDepth2[0] != 0) & (self.var.WS2[0] != 0)), - np.bool8((self.var.SoilDepth2[1] != 0) & (self.var.WS2[1] != 0)), - np.bool8((self.var.SoilDepth2[2] != 0) & (self.var.WS2[2] != 0))) - -# self.var.PoreSpaceNotZero1 = [np.bool8((self.var.SoilDepth1[0] != 0) & (self.var.WS1[0] != 0)), -# np.bool8((self.var.SoilDepth1[1] != 0) & (self.var.WS1[1] != 0))] -# self.var.PoreSpaceNotZero2 = [np.bool8((self.var.SoilDepth2[0] != 0) & (self.var.WS2[0] != 0)), -# np.bool8((self.var.SoilDepth2[1] != 0) & (self.var.WS2[1] != 0))] + self.var.PoreSpaceNotZero1a = splitlanduse(np.bool((self.var.SoilDepth1a[0] != 0) & (self.var.WS1a[0] != 0)), + np.bool((self.var.SoilDepth1a[1] != 0) & (self.var.WS1a[1] != 0)), + np.bool((self.var.SoilDepth1a[2] != 0) & (self.var.WS1a[2] != 0))) + self.var.PoreSpaceNotZero1b = splitlanduse(np.bool((self.var.SoilDepth1b[0] != 0) & (self.var.WS1b[0] != 0)), + np.bool((self.var.SoilDepth1b[1] != 0) & (self.var.WS1b[1] != 0)), + np.bool((self.var.SoilDepth1b[2] != 0) & (self.var.WS1b[2] != 0))) + self.var.PoreSpaceNotZero2 = splitlanduse(np.bool((self.var.SoilDepth2[0] != 0) & (self.var.WS2[0] != 0)), + np.bool((self.var.SoilDepth2[1] != 0) & (self.var.WS2[1] != 0)), + np.bool((self.var.SoilDepth2[2] != 0) & (self.var.WS2[2] != 0))) + +# self.var.PoreSpaceNotZero1 = [np.bool((self.var.SoilDepth1[0] != 0) & (self.var.WS1[0] != 0)), +# np.bool((self.var.SoilDepth1[1] != 0) & (self.var.WS1[1] != 0))] +# self.var.PoreSpaceNotZero2 = [np.bool((self.var.SoilDepth2[0] != 0) & (self.var.WS2[0] != 0)), +# np.bool((self.var.SoilDepth2[1] != 0) & (self.var.WS2[1] != 0))] # Flag that is Boolean 1 if pixel has (any) soil moisture storage space. # Needed to avoid divisions by zero in soil moisture calculations diff --git a/src/lisflood/hydrological_modules/transmission.py b/src/lisflood/hydrological_modules/transmission.py index 8e578ac4..d566f551 100755 --- a/src/lisflood/hydrological_modules/transmission.py +++ b/src/lisflood/hydrological_modules/transmission.py @@ -53,7 +53,7 @@ def initial(self): # downstream area taking into account for transmission loss self.var.UpAreaTrans = loadmap('UpAreaTrans') # upstream area - self.var.UpTrans = np.where(self.var.UpAreaTrans >= TransArea,np.bool8(1),np.bool8(0)) + self.var.UpTrans = np.where(self.var.UpAreaTrans >= TransArea,np.bool(1),np.bool(0)) # Downstream taking into accound for transmission loss # if upstream area (the total one) is bigger than a threshold us # transmission loss diff --git a/tests/test_mct_results_slow.py b/tests/test_mct_results_slow.py index d7ac20c3..03f7c397 100644 --- a/tests/test_mct_results_slow.py +++ b/tests/test_mct_results_slow.py @@ -200,6 +200,11 @@ def run_kin(self, date_start, date_end, dtsec, dtsec_chan, type): comparator.compare_files(reference, output_tss) # compare mass balance error + # set precision for the mass balance error test + atol = 0.0005 + rtol = 0.008 + comparator = TSSComparator(atol,rtol) + reference = os.path.join(out_path_ref, 'mbError.tss') output_tss = os.path.join(self.out_path_run, 'mbError.tss') comparator.compare_files(reference, output_tss) diff --git a/tests/test_results.py b/tests/test_results.py index be0fb30e..106bfd88 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -189,6 +189,6 @@ def test_waterbalance_daily(self): def test_waterbalance_6h(self): self.run_waterbalance('21600', '02/01/2016 06:00', '02/07/2016 06:00') - self.compare_reference('mbError', check='tss', step_length='21600') + self.compare_reference('mbError', check='tss', step_length='21600', atol=0.0005, rtol=0.005) self.compare_reference('mbErrorSplitRoutingM3', check='tss', step_length='21600') diff --git a/tests/test_utils.py b/tests/test_utils.py index 29a686c4..1f48b7b2 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -319,7 +319,7 @@ def teardown_method(self): shutil.rmtree(output_dir) @classmethod - def compare_reference(cls, variable='dis', check='map', step_length='86400'): + def compare_reference(cls, variable='dis', check='map', step_length='86400', atol=0.0001, rtol=0.001): """ :param variable: variable to check. Default 'dis' (Discharge) :param check: either 'map' or 'tss'. Default 'map' @@ -332,11 +332,11 @@ def compare_reference(cls, variable='dis', check='map', step_length='86400'): if check == 'map': output_map = os.path.normpath(binding[cls.reference_files[variable]['report_map']]) + '.nc' - comparator = NetCDFComparator(settings.maskpath) + comparator = NetCDFComparator(settings.maskpath, atol=atol, rtol=rtol) comparator.compare_files(reference, output_map) elif check == 'tss': output_tss = binding[cls.reference_files[variable]['report_tss']] - comparator = TSSComparator() + comparator = TSSComparator(atol=atol, rtol=rtol) comparator.compare_files(reference, output_tss) # If there are differences, test fails before reaching this line (AssertionError(s) in comparator methods) assert True