Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

- Review changes against `CODING_STANDARDS.md`.
- Check with `uvx pre-commit run --all-files` (ruff and line endings, as CI's `lint.yml` does), `uv run pyrefly check` (as `type_check.yml` does, which also caps the warning count) and `uv run pytest`.
- Native libraries: the hatch build hook `buildUtil/build.py` downloads the NuGet packages in `buildUtil/packages.config` into `packages/` and copies them to `mikecore/bin/{windows,linux}`, then, on Linux, adds `-mikecore-python` to every `.so` name, rewrites their references to each other and sets RPATH `$ORIGIN` (ADR 0002). The Windows DLLs are left as shipped, so DHI's signatures stay valid; the build fails if one is unsigned. Inspect `mikecore/bin/` after `uv sync`, not the NuGet sources.
- Native libraries: the hatch build hook `buildUtil/build.py` downloads the NuGet packages in `buildUtil/packages.config` into `packages/` and copies them to `mikecore/bin/{windows,linux}`, then, on Linux, adds `-mikecore-python` to every `.so` name, rewrites their references to each other and sets RPATH `$ORIGIN` (ADR 0002). The Windows DLLs are left as shipped. Inspect `mikecore/bin/` after `uv sync`, not the NuGet sources.
- Test data lives in the root `testdata/`, not `tests/testdata/`.
- `uv.lock` is gitignored. Push branches to `origin` (DHI/mikecore-python); PRs target `master`.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
ones, at your own risk (see README).
- A required `source` attribute in `buildUtil/packages.config` picks where the
build downloads the native NuGet packages from: `nuget.org`, or
`github-mirror` for a mirror on this repository's releases. It's
`nuget.org` for now, so the wheel is unchanged.
`github-mirror` for a mirror on this repository's releases.
- `eumItem` and `eumUnit` entries for the 2026 EUM table: the items
`eumIFreqIntegWaveActionDensity`, `eumIDirecIntegWaveActionDensity` and
`eumIFreqIntegWaveEnergyDensityRate`, and the units `eumUm2Sec2`,
`eumUft2Sec2`, `eumUm2SecRad` and `eumUft2SecRad`.

### Changed

- 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
[ADR 0002](docs/adr/0002-isolate-bundled-native-libraries.md)). Code that
loads them by name needs the new names. The Windows DLLs keep their names
and DHI's signatures.
loads them by name needs the new names. The Windows DLLs keep their names.
- **Possibly breaking:** the bundled native libraries are the 2026 GOLD
versions: DHI.DFS, DHI.PFS, DHI.EUM, DHI.DHIfl and DHI.Projections 24.1.2,
and DHI.MikeCore.Linux.ubuntu22 24.0.2 (previously all 23.0.3). They're
downloaded from the GitHub mirror on this repository's releases until
nuget.org publishes them. The bundled Windows DLLs are unsigned for now,
which policies such as WDAC or AppLocker may block.
- **Possibly breaking:** importing mikecore no longer adds its library folder
to `PATH` or `LD_LIBRARY_PATH`. Child processes, such as an engine started
with `subprocess`, no longer inherit it.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ All commands are run from the project root.

### Another library in the same process also loads MIKE Core

mikecore loads its bundled MIKE Core libraries (23.0.3) by default, even with
MIKE installed. With another library in the process that loads MIKE Core
mikecore loads its bundled MIKE Core libraries by default, even with MIKE
installed. With another library in the process that loads MIKE Core
(a MIKE engine, for example):

- **Linux:** the two keep separate libraries, unless the other library is
Expand Down
3 changes: 2 additions & 1 deletion buildUtil/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def setup():
download_nuget_package(name, version, output_dir="packages", feed=feed)
copy_native_libs_to_bin("packages", "mikecore/bin")

check_signed("mikecore/bin/windows")
# The 2026 GOLD DLLs on the mirror are unsigned; re-enable when switching back to nuget.org.
# check_signed("mikecore/bin/windows")
if platform.system().lower() == "linux":
isolate_linux_libs("mikecore/bin/linux")
check_isolated("mikecore/bin/linux")
Expand Down
14 changes: 7 additions & 7 deletions buildUtil/packages.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages source="nuget.org">
<package id="DHI.DFS" version="23.0.3" />
<package id="DHI.PFS" version="23.0.3" />
<package id="DHI.EUM" version="23.0.3" />
<package id="DHI.DHIfl" version="23.0.3" />
<package id="DHI.Projections" version="23.0.3" />
<package id="DHI.MikeCore.Linux.ubuntu22" version="23.0.3" />
<packages source="github-mirror">
<package id="DHI.DFS" version="24.1.2" />
<package id="DHI.PFS" version="24.1.2" />
<package id="DHI.EUM" version="24.1.2" />
<package id="DHI.DHIfl" version="24.1.2" />
<package id="DHI.Projections" version="24.1.2" />
<package id="DHI.MikeCore.Linux.ubuntu22" version="24.0.2" />
</packages>
7 changes: 7 additions & 0 deletions mikecore/eum.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ class eumItem(IntEnum):
eumIFluorideF = 110362
eumITotalAlkanlinity = 110363
eumIChemicalOxygenDemandCOD = 110364
eumIFreqIntegWaveActionDensity = 110365
eumIDirecIntegWaveActionDensity = 110366
eumIFreqIntegWaveEnergyDensityRate = 110367


# Predefined enums of EUM units.
Expand Down Expand Up @@ -1050,6 +1053,10 @@ class eumUnit(IntEnum):
eumUft2PerRad = 5215
eumUft2PerDegree = 5216
eumUft2Sec = 5217
eumUm2Sec2 = 5218
eumUft2Sec2 = 5219
eumUm2SecRad = 5220
eumUft2SecRad = 5221
eumUmilliGramPerL2OneHalfPerDay = 5300
eumUmilliGramPerL2OneHalfPerHour = 5301
eumUNewtonPerSqrMeter = 5400
Expand Down
Loading