Skip to content

Store dataset properties in netCDF-safe attrs with backward-compatible reads, add CI test workflow, and include optional IFS dependencies#21

Merged
observingClouds merged 15 commits into
mainfrom
copilot/fix-properties-dataset-attribute
May 22, 2026
Merged

Store dataset properties in netCDF-safe attrs with backward-compatible reads, add CI test workflow, and include optional IFS dependencies#21
observingClouds merged 15 commits into
mainfrom
copilot/fix-properties-dataset-attribute

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

This PR fixes #17 by storing the dataset properties as individual metadata attributes.

In addition, this PR adds a CI test to ensure the changes are intact. As mxalign now also depends on cfgrib and the eccodes library to load ifs forecasts those dependencies have been added as well.

Copilot AI and others added 2 commits May 21, 2026 08:23
Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/2645ad1c-3573-48c9-88f0-5150eb23b01f

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/2645ad1c-3573-48c9-88f0-5150eb23b01f

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix properties dataset attribute writing to netCDF Store dataset properties in netCDF-safe attrs with backward-compatible reads May 21, 2026
Copilot AI requested a review from observingClouds May 21, 2026 08:26
Comment thread src/mxalign/properties/utils.py Outdated
Comment on lines +6 to +8
SPACE_ATTR = "properties_space"
TIME_ATTR = "properties_time"
UNCERTAINTY_ATTR = "properties_uncertainty"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us use "." as a separator instead of "_".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 605b283. I switched the new properties attribute keys to use . separators (properties.space, properties.time, properties.uncertainty) and updated tests accordingly. I also kept read compatibility for previously introduced underscore flat keys.

Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/77c180d8-40ee-44d4-b245-85a382fff6a4

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Comment thread src/mxalign/properties/utils.py Outdated
Comment on lines +9 to +11
LEGACY_SPACE_ATTR = "properties_space"
LEGACY_TIME_ATTR = "properties_time"
LEGACY_UNCERTAINTY_ATTR = "properties_uncertainty"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add legacy support for these properties. They were introduced in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9ece8b5. I removed the underscore flat-key fallback and constants, and deleted the underscore compatibility test so only dotted attrs plus pre-existing properties dict/JSON legacy reads remain. No UI changes in this PR.

Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/7ea2a6c3-a3f2-4be2-8210-cabc0af65ae2

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@observingClouds observingClouds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loogs good, just some linting issues to fix. Please run the linters and fix accordingly.

Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/3e3fab28-7e29-4f5e-b20d-c0ca122da9bd

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

Loogs good, just some linting issues to fix. Please run the linters and fix accordingly.

Fixed in 3bdf9bf. I ran the repo linters via pre-commit run --all-files, applied the ruff-format change, and re-ran linters successfully. No UI changes in this PR, so there is no UI screenshot to share.

Copy link
Copy Markdown
Contributor

@observingClouds observingClouds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a CI action that actually runs the test

Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/470afd36-0845-4b9b-864f-6e1a0e536c32

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

add a CI action that actually runs the test

Implemented in f596fe1. I added a new GitHub Actions workflow (.github/workflows/tests.yaml) that runs python -m unittest discover -s tests -v on pull requests, pushes to main/develop, and manual dispatch. Also added permissions: contents: read for workflow security. No UI changes in this PR, so no UI screenshot applies.

Comment thread pyproject.toml
@observingClouds
Copy link
Copy Markdown
Contributor

@copilot address requested changes

Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/e06d9499-d27d-47d7-b76f-4cb0470fc5d9

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

@copilot address requested changes

Addressed in 7216c8e by adding eccodeslib to the ifs optional dependencies and updating uv.lock accordingly. No UI changes in this PR, so no UI screenshot applies.

@observingClouds
Copy link
Copy Markdown
Contributor

@copilot add a changelog entry describing the changes made in this PR 21.

Agent-Logs-Url: https://github.com/mlwp-tools/mxalign/sessions/ce510f28-d96f-401e-a6d7-602ccc1e9ede

Co-authored-by: observingClouds <43613877+observingClouds@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

@copilot add a changelog entry describing the changes made in this PR 21.

Added in commit 90d14ba. I updated CHANGELOG.md with a new [Unreleased] entry describing the PR 21 changes (netCDF-safe properties attrs, CI test workflow with uv/lockfile/all extras, and the new ifs optional dependencies including eccodeslib). No UI changes were made, so there is no screenshot to provide.

Comment thread CHANGELOG.md Outdated
@observingClouds observingClouds marked this pull request as ready for review May 21, 2026 10:56
@observingClouds observingClouds requested a review from mpvginde May 21, 2026 10:56
@mpvginde
Copy link
Copy Markdown
Contributor

mpvginde commented May 21, 2026

Any reason not to use pytest for CI testing?

@observingClouds
Copy link
Copy Markdown
Contributor

@mpvginde no particular reason. I changed it to pytest now.

@mpvginde
Copy link
Copy Markdown
Contributor

I also don't have a favourite, but that way we are consistent with mlwp-data-loader.
Looks good now, feel free to merge.

@observingClouds observingClouds force-pushed the copilot/fix-properties-dataset-attribute branch from 33c27a4 to fdc412c Compare May 22, 2026 09:17
@observingClouds observingClouds merged commit 03b07b5 into main May 22, 2026
2 checks passed
@observingClouds observingClouds deleted the copilot/fix-properties-dataset-attribute branch May 22, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

properties dataset attribute cannot be written to netCDF

3 participants