Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates and standardizes linting/formatting across the repository by moving to ruff for formatting, linting, and import sorting, and aligning the pre-commit configuration so code quality checks don’t spuriously fail CI.
Changes:
- Switch/align pre-commit hooks to run
rufffor linting (ruff-check) and formatting (ruff-format). - Update Ruff configuration in
pyproject.toml(line length and lint rule selection/ignores). - Apply automated formatting changes across tests, library modules, and documentation notebooks.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.pre-commit-config.yaml |
Updates pre-commit to use Ruff hooks and configured arguments. |
pyproject.toml |
Centralizes Ruff configuration (line length, lint selects/ignores). |
src/earthkit/transforms/temporal/_rates.py |
Formatting-only changes to attribute/history string construction. |
src/earthkit/transforms/temporal/_aggregate.py |
Formatting-only changes to list comprehensions/array creation. |
src/earthkit/transforms/spatial/_aggregate.py |
Formatting-only changes to return call and list comprehension layout. |
src/earthkit/transforms/climatology/_aggregate.py |
Formatting-only changes to relative anomaly expression and return call. |
src/earthkit/transforms/_tools.py |
Formatting-only changes to raised error strings and list comprehension layout. |
tests/test_30_temporal_rates.py |
Formatting-only changes to calls/expressions for Ruff formatting compliance. |
tests/test_30_temporal_aggregate.py |
Formatting-only changes to an all(...) assertion. |
tests/test_30_spatial.py |
Formatting-only changes to DataArray creation and function calls. |
tests/test_20_aggregate.py |
Formatting-only changes to a helper call. |
tests/test_10_tools.py |
Formatting-only changes to DataArray/Dataset literals and calls. |
tests/legacy-api/test_legacy_30_temporal.py |
Mirrors formatting changes in legacy API tests. |
tests/legacy-api/test_legacy_10_tools.py |
Mirrors formatting changes in legacy API tests. |
docs/notebooks/temporal/05-accumulation-to-rate-examples.ipynb |
Notebook cell formatting updates consistent with Ruff formatting. |
docs/notebooks/temporal/03-seas5-daily-statistics.ipynb |
Notebook cell formatting updates. |
docs/notebooks/temporal/02-era5-daily-monthly-statistics.ipynb |
Notebook cell formatting updates. |
docs/notebooks/spatial/02-era5-reduce-data-over-geometries.ipynb |
Notebook cell formatting updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EddyCMWF
approved these changes
Mar 18, 2026
Collaborator
|
Hi Oskar, |
Contributor
Author
|
Great, thank you very much. |
mcocdawc
added a commit
to ecmwf/earthkit-plots
that referenced
this pull request
Mar 23, 2026
Updated and unified the pre-commit hooks in all earthkit packages. Some of them were failing the test suite just because of the pre-commit hooks. Fixing this it was a good opportunity to unify settings. Uses now `ruff` for formatting (former `black`), linting, and import sort (former `isort`) The following PRs do the same changes in all the earthkit packages: - ecmwf/earthkit-climate#43 - ecmwf/earthkit-data#927 - ecmwf/earthkit-geo#39 - ecmwf/earthkit-hydro#178 - ecmwf/earthkit-meteo#125 - #176 - ecmwf/earthkit-time#14 - ecmwf/earthkit-transforms#87 - ecmwf/earthkit-workflows#173 In `earthkit-plots` in particular, it prevents now directly pushing to `develop` and checks the pre-commit hooks as part of the CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updated and unified the pre-commit hooks in all earthkit packages.
Some of them were failing the test suite just because of the pre-commit hooks.
Fixing this it was a good opportunity to unify settings.
Uses now
rufffor formatting (formerblack), linting, and import sort (formerisort)The following PRs do the same changes in all the earthkit packages:
Contributor Declaration
By opening this pull request, I affirm the following: