diff --git a/.github/workflows/pytest-py38-mindeps.yml b/.github/workflows/pytest-py39-mindeps.yml similarity index 67% rename from .github/workflows/pytest-py38-mindeps.yml rename to .github/workflows/pytest-py39-mindeps.yml index 98d28fdb..189521a0 100644 --- a/.github/workflows/pytest-py38-mindeps.yml +++ b/.github/workflows/pytest-py39-mindeps.yml @@ -1,4 +1,4 @@ -name: pytest-py38-mindeps +name: pytest-py39-mindeps on: push: @@ -18,19 +18,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8.14' #used at HMC + python-version: '3.9' - name: Set fixed versions in requirements.txt extracted from pyproject.toml run: | python -m pip install --upgrade pip - python -m pip install "toml-to-requirements==0.1.0" # highest version available to py38 - toml-to-req --toml-file pyproject.toml --include-optional # --optional-lists dev # commented arg is available from toml-to-requirements 0.2.0, but that version is not available for py38. + python -m pip install toml-to-requirements + toml-to-req --toml-file pyproject.toml --optional-lists dev sed -i -E 's/>=/==/' requirements.txt - # temporarily removing all non-dev optional requirements manually, can be done more cleanly with toml-to-req>=0.2.0 - sed -i '/^sphinx/d' requirements.txt - sed -i '/^nbsphinx/d' requirements.txt - sed -i '/^pydata-sphinx-theme/d' requirements.txt - sed -i '/^jupyter/d' requirements.txt - sed -i '/^notebook/d' requirements.txt - name: Print contents of requirements.txt run: | # print file contents diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f3903e5d..8546e18d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -14,8 +14,7 @@ jobs: strategy: fail-fast: false matrix: - # Python 3.8.14 is used at HMC - python-version: ["3.8.14", "3.9", "3.12", "3.13"] + python-version: ["3.9", "3.12", "3.13"] os: [ubuntu-latest] runs-on: ${{ matrix.os }} diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index a097a54a..56ea85c8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -14,7 +14,7 @@ - download Miniforge3 from [the miniforge github](https://github.com/conda-forge/miniforge?tab=readme-ov-file#download) and install it with the recommended settings. - open Miniforge Prompt and navigate to hatyan checkout folder, e.g. ``C:\DATA\hatyan`` -- ``conda create --name hatyan_hmcenv python=3.8.13 git spyder -y`` (``git`` and ``spyder``, python version should be the one at HMC) +- ``conda create --name hatyan_hmcenv python=3.11.7 git spyder -y`` (``git`` and ``spyder``, python version should be the one at HMC) - ``conda activate hatyan_hmcenv`` - ``pip install -r environment_hmc.txt`` (installs fixed python/package versions like on HMC) - ``python -m pip install -e .[dev,docs,examples]`` (pip developer mode, any updates to the local folder are immediately available in your python. It also installs all requirements via pip, square brackets are to install optional dependency groups) diff --git a/hatyan/data/leap-seconds.list b/hatyan/data/leap-seconds.list index da0efc8c..6f861c88 100644 --- a/hatyan/data/leap-seconds.list +++ b/hatyan/data/leap-seconds.list @@ -60,15 +60,15 @@ # # The following line shows the last update of this file in NTP timestamp: # -#$ 3929093563 +#$ 3945196800 # # 2) Expiration date of the file given on a semi-annual basis: last June or last December # -# File expires on 28 June 2025 +# File expires on 28 December 2025 # # Expire date in NTP timestamp: # -#@ 3960057600 +#@ 3975868800 # # # LIST OF LEAP SECONDS @@ -117,4 +117,4 @@ # please see the readme file in the 'source' directory : # https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README # -#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 +#h 848434d5 570f7ea8 d79ba227 a00fc821 f608e2d4 diff --git a/hatyan/timeseries.py b/hatyan/timeseries.py index 9f35837d..cb0b3079 100644 --- a/hatyan/timeseries.py +++ b/hatyan/timeseries.py @@ -1540,7 +1540,9 @@ def read_dia(filename, station=None, block_ids=None, allow_duplicates=False): else: # equidistant data_pd_oneblock = read_dia_equidistant(filename_one, diablocks_pd, block_id) - # add status column + # add status columnm + # first set dtype via empty column to avoid FutureWarning + data_pd_oneblock['status'] = '' block_status_list = diablocks_pd.loc[block_id,'STA'].split('!') for block_status_one in block_status_list: status_tstart = pd.to_datetime(block_status_one[4:17],format='%Y%m%d;%H%M').tz_localize("UTC+01:00") diff --git a/pyproject.toml b/pyproject.toml index 1c612ff8..bd9c01db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,32 +10,28 @@ description = "Tidal analysis and prediction tool of Rijkswaterstaat" readme = "README.md" keywords = ["hatyan", "tidal analysis", "tidal prediction"] license = { text = "LGPLv3" } -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ - #scipy<1.5.4 env creation failed in https://github.com/Deltares/hatyan/issues/71 + #scipy>=1.5.4 env creation succeeded in https://github.com/Deltares/hatyan/issues/71 "scipy>=1.5.4", - #numpy 1.21 is EOL since june 2023 - "numpy>=1.22.0", - #TODO: contour colorbar on uniform values fails with matplotlib<3.7.0, several other features with matplotlib<3.6.0 - #matplotlib<3.5.2 raises "ValueError: Multi-dimensional indexing" in hatyan.plot_timeseries() - "matplotlib>=3.5.2", - #TODO: pandas>=1.4.0 is required by xarray>=2023.3.0 - #pandas<2.0.0 supports non-nanosecond timestep and therefore larger min/max range - "pandas>=2.0.0", - #TODO: netcdf4<1.5.4 pip install fails in py39 - #netcdf4<1.5.3 from setup.cfg - "netcdf4>=1.5.3", - #pyproj<3.1.0 not pip installable in py38 + #numpy>=1.24.0 is oldest supported version in Q4 2024 + "numpy>=1.24.0", + #matplotlib>=3.7.0 contour colorbar on uniform values succeeds + "matplotlib>=3.7.0", + #pandas>=2.1.0 has persistent max attrs (test_metadata_persistence) + "pandas>=2.1.0", + #netcdf4>=1.5.6 does not call numpy.bool (avoids AttributeError) + "netcdf4>=1.5.6", + #pyproj>=3.1.0 is pip installable in py38 "pyproj>=3.1.0", - #requests<2.28.0 not tested on hmc + #requests>=2.28.0 was tested on hmc "requests>=2.28.0", - #TODO: xarray<2023.4.0 conflicts with pandas<2.0.0 for resampling, only available for py39 - #xarray>=2022.6.0 is quite old version from dfm_tools - "xarray>=2022.6.0", - #rws-ddlpy<0.5.0 supports timezones for input dates + #xarray>=2023.4.0 does not conflict with pandas<2.0.0 for resampling + "xarray>=2023.4.0", + #rws-ddlpy>=0.5.0 supports timezones for input dates "rws-ddlpy>=0.5.0", - #click<7.1 is not available on github release page - "click>7.1", + #click>=7.1 is the first version available on github release page + "click>=7.1", ] classifiers = [ "Development Status :: 5 - Production/Stable", @@ -45,7 +41,6 @@ classifiers = [ "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -90,7 +85,10 @@ console_output_style = "count" testpaths = ["tests"] python_files = "test_*.py" addopts = "-v --tb=short --durations=0" -filterwarnings = ["ignore::UserWarning"] +filterwarnings = [ + "error", + "ignore::UserWarning", + ] markers = [ "unittest: mark a test as unittest. Used for testing single methods", "systemtest: mark a test as systemtest. Used for testing at a higher level, verifying a given input returns the expected output", diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 79714bc7..588c4fdd 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -193,4 +193,4 @@ def test_metadata_persistence(): assert len(comp.iloc[:10].attrs) > 0 assert len(comp["A"].attrs) > 0 - # assert len(comp.max().attrs) > 0 # TODO: max is not persistent in python 3.8 + assert len(comp.max().attrs) > 0