Skip to content

Commit

Permalink
Merge pull request #181 from dtscalibration/Support-python311
Browse files Browse the repository at this point in the history
Update to python 3.11
  • Loading branch information
bdestombe authored Jul 28, 2023
2 parents eaa8857 + c457f53 commit 26b6665
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------
Expand Down
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"},
{name = "Bas des Tombe, Bart Schilperoort"}
Expand All @@ -48,20 +48,22 @@ 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
"statsmodels",
"dask",
"toolz",
"matplotlib",
"netCDF4<=1.5.8",
"netCDF4>=1.6.4",
"flox",
"pandas",
]
dynamic = ["version"]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
5 changes: 5 additions & 0 deletions src/dtscalibration/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit 26b6665

Please sign in to comment.