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>
This was referenced Mar 16, 2026
Contributor
Author
|
@JamesVarndell The remaining failing tests already fail in |
There was a problem hiding this comment.
Pull request overview
This PR standardizes linting/formatting across the project by migrating pre-commit hooks and code style tooling to Ruff, and applies the resulting formatting changes across source, tests, and documentation notebooks.
Changes:
- Replaced Black/isort-driven formatting with Ruff (
ruff-check+ruff-format) and added Ruff configuration topyproject.toml. - Updated
.pre-commit-config.yamlto run Ruff linting/fixes and Ruff formatting. - Applied formatting-only updates across Python sources, tests, and many Jupyter notebooks to match the new style.
Reviewed changes
Copilot reviewed 111 out of 113 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/test_string_utils.py | Ruff formatting updates in tests. |
| tests/test_schemas.py | Ruff formatting updates in tests. |
| tests/test_identifiers.py | Ruff formatting updates in tests. |
| tests/styles/test_style_features.py | Ruff formatting updates in tests. |
| tests/sources/test_xarray.py | Ruff formatting updates in tests. |
| tests/sources/test_numpy.py | Ruff formatting updates in tests. |
| tests/metadata/test_formatters.py | Ruff formatting updates in tests. |
| tests/interactive/test_polar.py | Ruff formatting updates in tests. |
| tests/images/test_mulitple_layers.py | Ruff formatting updates in image tests. |
| tests/images/test_anemoi_use_case.py | Ruff formatting updates in image tests. |
| tests/geo/test_natural_earth.py | Ruff formatting updates in geo tests. |
| tests/geo/test_grids.py | Ruff formatting updates in geo tests. |
| tests/geo/test_geometry.py | Ruff formatting updates in geo tests. |
| tests/geo/test_domains.py | Ruff formatting updates in geo tests. |
| tests/components/test_figures.py | Minor docstring casing/formatting updates in tests. |
| src/earthkit/plots/styles/levels.py | Ruff formatting updates in style levels. |
| src/earthkit/plots/styles/legends.py | Ruff formatting updates in legends helpers. |
| src/earthkit/plots/styles/colors/init.py | Docstring punctuation tweak. |
| src/earthkit/plots/styles/init.py | Ruff formatting updates in core Style implementation. |
| src/earthkit/plots/sources/extractors/xarray.py | Ruff formatting updates in xarray extractor. |
| src/earthkit/plots/sources/extractors/numpy.py | Ruff formatting updates in numpy extractor. |
| src/earthkit/plots/sources/extractors/earthkit.py | Ruff formatting updates in earthkit extractor. |
| src/earthkit/plots/sources/init.py | Ruff formatting updates in Source/dimension handling. |
| src/earthkit/plots/shortcuts.py | Ruff formatting updates to shortcuts helpers. |
| src/earthkit/plots/schemas.py | Ruff formatting updates in schema utilities. |
| src/earthkit/plots/resample.py | Ruff formatting updates in resampling utilities. |
| src/earthkit/plots/quickplot.py | Formatting changes + docstring line wrapping. |
| src/earthkit/plots/quickmap.py | Formatting changes + docstring punctuation. |
| src/earthkit/plots/plottypes/statistics.py | Docstring punctuation + formatting updates. |
| src/earthkit/plots/metadata/labels.py | Ruff formatting updates in label helpers. |
| src/earthkit/plots/metadata/formatters.py | Ruff formatting updates in metadata formatters. |
| src/earthkit/plots/interactive/polar.py | Ruff formatting updates in polar plotting. |
| src/earthkit/plots/interactive/inputs.py | Ruff formatting updates in interactive inputs utilities. |
| src/earthkit/plots/interactive/heat.py | Ruff formatting updates in interactive heatmap. |
| src/earthkit/plots/interactive/charts.py | Ruff formatting updates in interactive chart class. |
| src/earthkit/plots/interactive/box.py | Ruff formatting updates in interactive box plot. |
| src/earthkit/plots/identifiers.py | Ruff formatting updates in identifier helpers. |
| src/earthkit/plots/geo/regrid.py | Ruff formatting updates in regridding helpers. |
| src/earthkit/plots/geo/optimisers.py | Docstring + formatting updates. |
| src/earthkit/plots/geo/octahedral.py | Formatting + docstring section header normalization. |
| src/earthkit/plots/geo/natural_earth.py | Ruff formatting updates in Natural Earth helpers. |
| src/earthkit/plots/geo/healpix.py | Formatting + minor docstring punctuation. |
| src/earthkit/plots/geo/grids.py | Ruff formatting updates in grids helpers. |
| src/earthkit/plots/geo/gisco.py | Ruff formatting updates in GISCO helpers. |
| src/earthkit/plots/geo/geometry.py | Ruff formatting updates in geometry helpers. |
| src/earthkit/plots/geo/domains.py | Ruff formatting updates in Domain helpers. |
| src/earthkit/plots/geo/coordinate_reference_systems.py | Ruff formatting updates in CRS helpers. |
| src/earthkit/plots/geo/bounds.py | Ruff formatting updates in bounds helpers. |
| src/earthkit/plots/components/ticks.py | Formatting/docstring wrapping updates. |
| src/earthkit/plots/components/subplots.py | Formatting/docstring wrapping updates. |
| src/earthkit/plots/components/maps.py | Formatting/docstring wrapping updates. |
| src/earthkit/plots/components/layouts.py | Formatting cleanup. |
| src/earthkit/plots/components/layers.py | Formatting/docstring compacting updates. |
| src/earthkit/plots/components/figures.py | Formatting/docstring wrapping updates. |
| src/earthkit/plots/components/extractors.py | Formatting updates in plotting extractors. |
| src/earthkit/plots/cli/parsers.py | Formatting updates in YAML CLI parser. |
| src/earthkit/plots/ancillary.py | Formatting updates in ancillary loader errors. |
| pyproject.toml | Remove isort config; add Ruff configuration (line length, lint selects/ignores). |
| docs/examples/sandbox.ipynb | Notebook formatting (quotes/whitespace). |
| docs/examples/reduced_gg.ipynb | Notebook formatting (expressions/whitespace). |
| docs/examples/guide/figures-and-subplots.ipynb | Notebook formatting (imports/quotes). |
| docs/examples/guide/06-reusable-code.ipynb | Notebook whitespace formatting. |
| docs/examples/guide/04-styles.ipynb | Notebook whitespace formatting. |
| docs/examples/guide/03-components.ipynb | Notebook whitespace + expression formatting. |
| docs/examples/gallery/vector-data/vector-styles.ipynb | Notebook formatting (string concatenation). |
| docs/examples/gallery/vector-data/Untitled.ipynb | Notebook formatting/cleanup. |
| docs/examples/gallery/time-series/timeseries.ipynb | Notebook formatting (trailing commas). |
| docs/examples/gallery/time-series/simple-line.ipynb | Notebook import ordering/spacing. |
| docs/examples/gallery/time-series/global-average-temperature.ipynb | Notebook formatting (imports + long lines). |
| docs/examples/gallery/time-series/era5-precip.ipynb | Notebook formatting (trailing commas + spacing). |
| docs/examples/gallery/time-series/cmip6.ipynb | Notebook formatting (quotes + line wrapping). |
| docs/examples/gallery/tiles/tiles.ipynb | Notebook content changed (cells emptied). |
| docs/examples/gallery/point-data/usa-temperature-obs.ipynb | Notebook formatting (long call collapsed). |
| docs/examples/gallery/point-data/satellite-level2-co2.ipynb | Notebook formatting (kwargs spacing). |
| docs/examples/gallery/interactive/meteogram.ipynb | Notebook formatting (import order + quotes). |
| docs/examples/gallery/hovmoeller/hovmoeller.ipynb | Notebook formatting (import ordering + call wrapping). |
| docs/examples/gallery/gridded-data/weather-forecast-steps.ipynb | Notebook formatting (imports + long call wrapping). |
| docs/examples/gallery/gridded-data/vorticity-over-andes.ipynb | Notebook formatting (list layout + expressions). |
| docs/examples/gallery/gridded-data/unstructured-grids.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/gridded-data/true-color-satellite.ipynb | Notebook formatting (imports + dict quoting). |
| docs/examples/gallery/gridded-data/time-zones.ipynb | Notebook formatting (quotes/spacing). |
| docs/examples/gallery/gridded-data/temperature-and-pressure.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/gridded-data/numpy-arrays.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/gridded-data/model-orography.ipynb | Notebook formatting (expression spacing). |
| docs/examples/gallery/gridded-data/hatched-shading.ipynb | Notebook formatting (string repetition spacing). |
| docs/examples/gallery/gridded-data/globe.ipynb | Notebook formatting (imports + dict quoting). |
| docs/examples/gallery/gridded-data/el-nino.ipynb | Notebook formatting (call wrapping). |
| docs/examples/gallery/gridded-data/efas.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/gridded-data/categorical-data.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/grid-types/reduced-gg-point-cloud.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/grid-types/reduced-gg-interpolated.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/grid-types/reduced-gg-grid-cells.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/grid-types/octahedral-cells.ipynb | Notebook formatting (escape handling). |
| docs/examples/gallery/grid-types/healpix-point-cloud.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/grid-types/healpix-pixels.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/grid-types/healpix-interpolated.ipynb | Notebook formatting (imports/spacing). |
| docs/examples/gallery/domains/domain-union.ipynb | Notebook formatting (quotes/spacing). |
| docs/examples/gallery/domains/cartopy-crs.ipynb | Notebook formatting (import order/spacing). |
| docs/examples/gallery/animation.ipynb | Notebook formatting (imports + quotes). |
| docs/examples/examples/vectors-styles.ipynb | Notebook formatting (string concatenation). |
| docs/examples/examples/unstructured-data.ipynb | Notebook formatting (spacing + trailing commas). |
| docs/examples/examples/string-formatting-units.ipynb | Notebook whitespace + string concatenation formatting. |
| docs/examples/examples/string-formatting-time.ipynb | Notebook formatting (string concatenation). |
| docs/examples/examples/plotting-and-styling-vector-data.ipynb | Notebook import ordering formatting. |
| docs/examples/examples/plotting-and-styling-isolines.ipynb | Notebook formatting (trailing commas + call layout). |
| docs/examples/examples/isolines-basics.ipynb | Notebook comment spacing formatting. |
| docs/examples/examples/interactive-windrose-plot.ipynb | Notebook formatting (imports, quotes, long calls). |
| docs/examples/examples/interactive-line-plot.ipynb | Notebook formatting (quotes + long lines). |
| docs/examples/examples/interactive-heatmap-plot.ipynb | Notebook formatting (quotes + wrapping). |
| docs/examples/examples/interactive-bar-plot.ipynb | Notebook formatting (spacing + dict layout). |
| docs/examples/ads.ipynb | Notebook formatting (quotes + call layout). |
| docs/Untitled.ipynb | Notebook formatting (trailing commas). |
| .pre-commit-config.yaml | Replace Black/isort hooks with Ruff check/format hooks; update other hook revisions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closed
…t-plots into chore/update-linting-tools
…t-plots into chore/update-linting-tools
JamesVarndell
approved these changes
Mar 23, 2026
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:
In
earthkit-plotsin particular, it prevents now directly pushing todevelopand checks the pre-commit hooks as part of the CI.Add the mpl references for tests and remove the directory from the
.gitignore.The only remaining failing tests are:
As the
earthkit-regridpackage is deprecated AFAIK, I don't know if the 1st and 3rd test should be fixed or simply removed.Re the 2nd test. Either healpy should be added as a strict dependency, or the test should only be executed if
healpyis installed. That's a call one of the maintainers has to make.Contributor Declaration
By opening this pull request, I affirm the following: