diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba481194..3faac415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9ecbeeef..8bbbc317 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,21 +4,25 @@ Changelog dev --- -New features +Added * Improved the functionality of `merge_double_ended`, by adding a check that handles measurements missing in one channel while present in the other ([#171](https://github.com/dtscalibration/python-dts-calibration/pull/171)) +* Support for Python 3.11 -Bug fixes +Fixed * Single-ended measurements with `fix_alpha` failed due to a bug introduced in v2.0.0 ([#173](https://github.com/dtscalibration/python-dts-calibration/pull/173)). -Introduced limitations +Changed * Standardized parameter names. Reduced the freedom in choosing parameter names and dimension names in favor of simplifying the code. +* Requiring netcdf4 >= 1.6.4 +* Flox included in requirements to speed up resampling via xarray ([Xarray #5734](https://github.com/pydata/xarray/pull/5734)). Removed * Removed ds.resample_datastore() in favor of using xarray's resample function. See example notebook 2. +* Removed support for Python 3.8 2.0.0 (2023-05-24) ------------------ diff --git a/pyproject.toml b/pyproject.toml index 1e896d88..b16f6333 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ name = "dtscalibration" description = "A Python package to load raw DTS files, perform a calibration, and plot the result." readme = "README.rst" license = "BSD-3-Clause" -requires-python = ">=3.9, <3.11" +requires-python = ">=3.9, <3.12" authors = [ {email = "bdestombe@gmail.com"}, {name = "Bas des Tombe, Bart Schilperoort"} @@ -48,12 +48,13 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Utilities", ] dependencies = [ "numpy", "xarray", - "pyyaml", + "pyyaml>=6.0.1", "xmltodict", "scipy", "patsy", # a dependency of statsmodels @@ -61,7 +62,8 @@ dependencies = [ "dask", "toolz", "matplotlib", - "netCDF4<=1.5.8", + "netCDF4>=1.6.4", + "flox", "pandas", ] dynamic = ["version"] @@ -117,7 +119,7 @@ build = [ features = ["dev"] [[tool.hatch.envs.matrix_test.matrix]] -python = ["3.9", "3.10"] +python = ["3.9", "3.10", "3.11"] [tool.hatch.envs.matrix_test.scripts] test = ["pytest ./src/ ./tests/",] # --doctest-modules @@ -155,7 +157,8 @@ line-length = 88 exclude = ["docs", "build"] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" -target-version = "py38" +# Minimum supported Python version +target-version = "py39" [tool.ruff.per-file-ignores] "tests/**" = ["D"] diff --git a/src/dtscalibration/datastore.py b/src/dtscalibration/datastore.py index 6e1b0579..156c8bab 100644 --- a/src/dtscalibration/datastore.py +++ b/src/dtscalibration/datastore.py @@ -662,6 +662,11 @@ def get_default_encoding(self, time_chunks_from_key=None): v['dtype'] = 'int32' # v['_FillValue'] = -9999 # Int does not support NaN + if np.issubdtype(self[k].dtype, str) or np.issubdtype(self[k].dtype, object): + # Compression not supported for variable length strings + # https://github.com/Unidata/netcdf4-python/issues/1205 + v["zlib"] = False + if time_chunks_from_key is not None: # obtain optimal chunk sizes in time and x dim if self[time_chunks_from_key].dims == ('x', 'time'):