Closed
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #125 +/- ##
===========================================
- Coverage 99.24% 99.23% -0.01%
===========================================
Files 27 27
Lines 2384 2363 -21
Branches 44 44
===========================================
- Hits 2366 2345 -21
Misses 9 9
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Mar 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates and standardizes linting/formatting across the repository by migrating to ruff (including formatting and import sorting) and reformatting affected code, tests, and documentation accordingly.
Changes:
- Replace
black/isortpre-commit hooks withruff(check + format) and add/adjustruffconfiguration inpyproject.toml. - Apply repository-wide formatting updates to Python sources/tests and documentation examples/notebooks.
- Normalize docstrings, imports, and minor style issues to satisfy the unified linting rules.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/wind/test_wind.py | Formatting updates to comply with new lint/format rules. |
| tests/vertical/test_xr_theta.py | Formatting updates to comply with new lint/format rules. |
| tests/vertical/test_xr_monotonic.py | Import formatting consolidation and minor docstring punctuation. |
| tests/vertical/test_array_vertical.py | Formatting of parametrization and assertions. |
| tests/vertical/test_array_interpolate.py | Docstring punctuation and formatting updates. |
| tests/thermo/test_thermo.py | Docstring punctuation and parametrization formatting updates. |
| tests/stats/test_stats.py | Formatting update for assertion call. |
| tests/solar/test_solar.py | Formatting update for function signature/call. |
| tests/score/xarray/test_ensemble.py | Import consolidation and minor whitespace cleanup. |
| tests/score/xarray/test_deterministic.py | Reformatted multi-import to grouped import style. |
| tests/score/array/test_score.py | Docstring punctuation and import consolidation. |
| tests/regimes/test_patterns.py | Whitespace cleanup in test classes. |
| tests/regimes/test_index_xarray.py | Import consolidation and whitespace cleanup. |
| tests/regimes/test_index_array.py | Formatting updates for calls and whitespace cleanup. |
| src/earthkit/meteo/wind/array/init.py | Module docstring normalized. |
| src/earthkit/meteo/vertical/interpolation.py | Typing import consolidation and error message formatting. |
| src/earthkit/meteo/vertical/array/vertical.py | Typing import consolidation; docstring section header normalization; formatting. |
| src/earthkit/meteo/vertical/array/monotonic.py | Error message wrapping and formatting for readability/line length. |
| src/earthkit/meteo/vertical/array/hybrid.py | Typing import consolidation; docstring header normalization; error formatting. |
| src/earthkit/meteo/vertical/array/init.py | Module docstring normalized. |
| src/earthkit/meteo/vertical/init.py | Whitespace cleanup. |
| src/earthkit/meteo/utils/testing.py | Docstring punctuation normalized. |
| src/earthkit/meteo/thermo/array/thermo.py | Formatting of expressions and docstring punctuation. |
| src/earthkit/meteo/thermo/array/init.py | Module docstring normalized. |
| src/earthkit/meteo/thermo/init.py | Whitespace cleanup. |
| src/earthkit/meteo/stats/array/quantiles.py | Typing import consolidation; docstring punctuation; whitespace cleanup. |
| src/earthkit/meteo/stats/array/init.py | Module docstring normalized. |
| src/earthkit/meteo/solar/array/init.py | Module docstring normalized. |
| src/earthkit/meteo/score/xarray/ensemble.py | Typing import consolidation; docstring line wrapping; minor formatting. |
| src/earthkit/meteo/score/xarray/deterministic.py | Typing import consolidation; docstring wrapping; formatting. |
| src/earthkit/meteo/score/array/deterministic.py | Docstring punctuation normalized. |
| src/earthkit/meteo/regimes/patterns.py | Formatting of dict comprehensions/construction. |
| src/earthkit/meteo/regimes/array/index.py | Error message formatting. |
| src/earthkit/meteo/regimes/init.py | Import consolidation. |
| src/earthkit/meteo/extreme/array/sot.py | Docstring punctuation and exception formatting. |
| src/earthkit/meteo/extreme/array/efi.py | Docstring punctuation and whitespace cleanup. |
| src/earthkit/meteo/extreme/array/cpf.py | Docstring punctuation normalized. |
| src/earthkit/meteo/extreme/array/init.py | Module docstring normalized. |
| pyproject.toml | Add ruff config; reformat TOML; reorganize project metadata. |
| docs/release_notes/include/migrated_hybrid_pressure_at_height_levels.py | Formatting update for example call. |
| docs/examples/seven_weather_regimes.ipynb | Notebook formatting changes (imports, commas, whitespace). |
| docs/examples/return_period.ipynb | Notebook formatting changes (imports, list formatting, floats). |
| docs/examples/interpolate_pl_to_pl.ipynb | Notebook formatting changes (comments, calls). |
| docs/examples/interpolate_pl_to_hl.ipynb | Notebook formatting changes (calls, floats, whitespace). |
| docs/examples/interpolate_hybrid_to_pl.ipynb | Notebook formatting changes (calls, floats, whitespace). |
| docs/examples/interpolate_hybrid_to_hl.ipynb | Notebook formatting/pretty-print of JSON and code cells. |
| docs/examples/hybrid_levels.ipynb | Notebook formatting changes (comments, calls, whitespace). |
| .pre-commit-config.yaml | Switch pre-commit lint/format hooks to ruff and add TOML formatting hook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Author
|
Close in favour of #130 due to amount of merge conflicts |
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: