From 2be7bfeb350ddfe2e3aece2bd27ec890b45fbe94 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 12 Nov 2026 10:01:00 +0100 Subject: [PATCH 1/3] Prepare 0.3.0rc1 and check release tags against pyproject.toml Set the version to 0.3.0rc1. pyproject.toml stays the only place the version is set; the build workflow now refuses to publish a release whose tag is not v. Point the Unreleased changelog link at v0.2.2, as pre-releases get no changelog section. Add ryan-kipawa and ecomodeller as code owners. Co-Authored-By: Claude Opus 5.5 --- .github/CODEOWNERS | 2 +- .github/workflows/build_package.yml | 13 +++++++++++++ CHANGELOG.md | 2 +- pyproject.toml | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 342875c..9311aff 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @JesperGr +* @JesperGr @ryan-kipawa @ecomodeller diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index 1c1546a..9d74b90 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -20,6 +20,19 @@ jobs: steps: - uses: actions/checkout@v4 + # pyproject.toml is the one place the version is set. A release tag must + # be that version with a leading v, e.g. v0.3.0rc1, or nothing is published. + - name: Check release tag matches pyproject.toml version + if: ${{ github.event_name == 'release' }} + env: + TAG: ${{ github.event.release.tag_name }} + run: | + VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") + if [ "$TAG" != "v$VERSION" ]; then + echo "::error::Release tag $TAG does not match pyproject.toml version $VERSION (expected v$VERSION)" + exit 1 + fi + - name: Install uv uses: astral-sh/setup-uv@v6 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index dc31765..f7cdd39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,4 +155,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reading an item's value type raises the DFS error when the native library reports one, instead of returning `DataValueType.Instantaneous`. -[Unreleased]: https://github.com/DHI/mikecore-python/compare/v0.3.a1...HEAD +[Unreleased]: https://github.com/DHI/mikecore-python/compare/v0.2.2...HEAD diff --git a/pyproject.toml b/pyproject.toml index 2482965..847d767 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ packages = ["mikecore", "miketools"] [project] name = "mikecore" -version = "0.3.0a1" +version = "0.3.0rc1" description = "MIKE Core contains core libraries, like DFS (Data File System), EUM and more." readme = "README.md" license = { file = "LICENSE" } From ad33a6364a75892d211819fce5e1d5c7e6ff1603 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 12 Nov 2026 10:07:56 +0100 Subject: [PATCH 2/3] Backfill the changelog for releases 0.1.0 to 0.2.2 Add a section for each final release on PyPI. Pre-releases get no section. Untagged releases are matched to the commit whose source equals the PyPI wheel, and their links compare those commits. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7cdd39..dce690c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,4 +155,126 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reading an item's value type raises the DFS error when the native library reports one, instead of returning `DataValueType.Instantaneous`. +## [0.2.2] - 2024-08-21 + +### Fixed + +- The package declares a valid required Python version, `>=3.5`. Earlier + releases declared `>=3.5<`, which is not a valid version specifier + ([#29](https://github.com/DHI/mikecore-python/issues/29)). + +## [0.2.1] - 2022-06-02 + +### Changed + +- Opening a dfsu file is faster, because its element table is built with + less work per element + ([#20](https://github.com/DHI/mikecore-python/issues/20)). +- On Linux, importing mikecore appends its library folder to an existing + `LD_LIBRARY_PATH` instead of replacing it. + +## [0.2.0] - 2022-01-28 + +### Added + +- `eumItem` and `eumUnit` entries from the MIKE 2022 EUM table: the items + `eumIThermalConductivity`, `eumIDirectionalVariance` and + `eumISpecificDissipationRate`, and the units `eumUradiansquared`, + `eumUWattPerMeterPerDegreeCelsius` and `eumUWattPerFeetPerDegreeFahrenheit` + ([#19](https://github.com/DHI/mikecore-python/issues/19)). + +### Changed + +- The bundled native libraries are the MIKE Core Release 2022 versions + (20.0) on Windows and Linux, previously Release 2021 (19.x) + ([#19](https://github.com/DHI/mikecore-python/issues/19)). +- `DfsFile.ReadDfs0DataDouble` and `WriteDfs0DataDouble` use the native DFS + library on Linux as well as Windows. `ReadDfs0DataDouble` adds the time + axis start time offset to the times of an equidistant time axis + ([#19](https://github.com/DHI/mikecore-python/issues/19)). + +### Removed + +- The separate `MIKECoreCUtil.dll` is no longer bundled on Windows. The DFS + library itself now provides the bulk dfs0 read and write + ([#19](https://github.com/DHI/mikecore-python/issues/19)). + +## [0.1.4] - 2021-12-01 + +### Added + +- `DfsuFile` reads dfsu spectral files: point spectra (`DfsuSpectral0D`), + line spectra (`DfsuSpectral1D`) and area spectra (`DfsuSpectral2D`), with + their `Frequencies` and `Directions`, `NumberOfFrequencies`, + `NumberOfDirections` and `IsSpectral`. A 1D dfsu file without layers is + `Dfsu1D` + ([#17](https://github.com/DHI/mikecore-python/issues/17)). + +### Changed + +- The numeric values of `DfsuFileType` members changed to make room for + `Dfsu1D` (1) and the spectral types. Code that compares the type with + its member names is unaffected + ([#17](https://github.com/DHI/mikecore-python/issues/17)). + +## [0.1.3] - 2021-11-08 + +### Fixed + +- Reading and writing the encoding key of a compressed dfs file, which most + dfs3 files are, works + ([#14](https://github.com/DHI/mikecore-python/issues/14)). +- `MeshFile` reads a mesh with both triangles and quadrilaterals correctly. + Triangles were read as quadrilaterals referring to a non-existent node 0 + ([#16](https://github.com/DHI/mikecore-python/issues/16)). + +## [0.1.2] - 2021-08-25 + +### Added + +- `DfsFile.ReadDfs0DataDouble` and `DfsFile.WriteDfs0DataDouble` read and + write all times and item values of a dfs0 file as one array, with the + times in the first column. `ReadDfs0DataDouble` can read selected items + only. `WriteDfs0DataDouble` returns 0 on success + ([#9](https://github.com/DHI/mikecore-python/issues/9), + [#12](https://github.com/DHI/mikecore-python/issues/12)). +- `DfsTemporalAxis.ToSeconds` and `ToRelativeTime` convert between the time + axis unit and seconds. + +### Changed + +- Setting a temporal axis property, such as `StartDateTime` or `TimeStep`, on + a file opened for editing updates the file header + ([#10](https://github.com/DHI/mikecore-python/issues/10)). +- In a file opened for editing, a custom block's `Values` changed in place + are written to the file. +- One wheel holds the native libraries for both Windows and Linux. + +### Removed + +- `Dfs0Util`. Use `DfsFile.ReadDfs0DataDouble` instead. + +### Fixed + +- `TimeStepInSeconds` works for time units other than seconds instead of + raising. + +## [0.1.0] - 2021-05-26 + +### Added + +- Initial release: Python access to the MIKE Core libraries, with an API + close to the MIKE Core .NET API. It reads and writes dfs0, dfs1, dfs2, + dfs3 and dfsu files (`DfsFile`, `DfsBuilder`, `DfsuFile`, `DfsuBuilder`), + reads and writes mesh files (`MeshFile`, `MeshBuilder`), and gives access + to EUM (`eum`) and map projections (`Projections`). It bundles the MIKE + Core Release 2021 native libraries for 64-bit Python on Windows and Linux. + [Unreleased]: https://github.com/DHI/mikecore-python/compare/v0.2.2...HEAD +[0.2.2]: https://github.com/DHI/mikecore-python/compare/bbac3753d40a42c9840edea6ddcadd8512aeb883...v0.2.2 +[0.2.1]: https://github.com/DHI/mikecore-python/compare/04c36b1ee3dc6c81905d75ff8c39d7b8a8411bd7...bbac3753d40a42c9840edea6ddcadd8512aeb883 +[0.2.0]: https://github.com/DHI/mikecore-python/compare/a5e1b129315950c63b1efd91465f5e71ea97e091...04c36b1ee3dc6c81905d75ff8c39d7b8a8411bd7 +[0.1.4]: https://github.com/DHI/mikecore-python/compare/fff099e2190dacb1a2906ad82c2094afa521b4f5...a5e1b129315950c63b1efd91465f5e71ea97e091 +[0.1.3]: https://github.com/DHI/mikecore-python/compare/fc74acd85fa186f51816c0ce42d258487161e346...fff099e2190dacb1a2906ad82c2094afa521b4f5 +[0.1.2]: https://github.com/DHI/mikecore-python/compare/v0.1.0...fc74acd85fa186f51816c0ce42d258487161e346 +[0.1.0]: https://github.com/DHI/mikecore-python/releases/tag/v0.1.0 From cd85019bdc2a67725cb3781f7ef7b8847b9d315b Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 12 Nov 2026 10:09:35 +0100 Subject: [PATCH 3/3] Test and declare Python 3.15 as the newest supported version Run the test and MIKE IO workflows on 3.15 instead of 3.14, add the 3.15 classifier, add 3.15 to the ADR 0001 end-of-life table, and note the supported range (3.11 to 3.15) in the changelog. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/full_test.yml | 2 +- .github/workflows/test_mikeio.yml | 2 +- CHANGELOG.md | 3 +++ docs/adr/0001-python-version-support.md | 1 + pyproject.toml | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/full_test.yml b/.github/workflows/full_test.yml index 7b0d86b..e9df455 100644 --- a/.github/workflows/full_test.yml +++ b/.github/workflows/full_test.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: ["3.11", "3.14"] + python-version: ["3.11", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test_mikeio.yml b/.github/workflows/test_mikeio.yml index e9718ee..d58cd4c 100644 --- a/.github/workflows/test_mikeio.yml +++ b/.github/workflows/test_mikeio.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: ["3.12", "3.14"] + python-version: ["3.12", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index dce690c..1acf78c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- mikecore supports Python 3.11 to 3.15. Python 3.10 and older, which have + reached end of life, are no longer supported (see + [ADR 0001](docs/adr/0001-python-version-support.md)). - The bundled Linux libraries are renamed with a `-mikecore-python` tag, for example `libeum-mikecore-python.so`, so they don't collide with a MIKE installation's (see diff --git a/docs/adr/0001-python-version-support.md b/docs/adr/0001-python-version-support.md index 5fe5964..9fc006d 100644 --- a/docs/adr/0001-python-version-support.md +++ b/docs/adr/0001-python-version-support.md @@ -26,6 +26,7 @@ As of this decision: | 3.12 | 2028-10 | | 3.13 | 2029-10 | | 3.14 | 2030-10 | +| 3.15 | 2031-10 | numpy, our only runtime dependency, already supports only recent Python versions (see [SPEC 0](https://scientific-python.org/specs/spec-0000/)). So users diff --git a/pyproject.toml b/pyproject.toml index 847d767..bb1017b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] [project.urls]