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
10 changes: 6 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
### Adjustments and Enhancements

- Added a new core rule `access-latency` that can be used to check the
time it takes to open datasets.
time it takes to open a dataset.

- Added HTML styling for both CLI output (`--format html`) and rendering
of `Result` objects in Jupyter notebooks.

- Rule `no-empty-chunks` has taken off the `"recommended"` settings
- Rule `no-empty-chunks` has been taken off the `"recommended"` settings
as there is no easy/efficient way to tell whether a dataset has
been written using `write_emtpy_chunks` option or not.
The rule message itself has been fixed. (#45)
Expand All @@ -19,8 +19,9 @@
to be consistent with messages of other rules.

- Core rule `dataset-title-attr` has been moved into `xcube` plugin
and renamed to `xcube/dataset-title` because the core rule `var-descr`
covers checking for dataset titles.
and renamed to `xcube/dataset-title` because the core rule
`content-desc` covers checking for dataset titles and other descriptive
attributes.

### Incompatible API changes

Expand Down Expand Up @@ -49,6 +50,7 @@
- XRLint now works with zarr >=2,<3 and zarr >=3.0.2
- Added more tests so we finally reached 100% coverage.
- New `PluginMeta.docs_url` property.
- Inserted copyright header into all source files.

## Version 0.4.1 (from 2025-01-31)

Expand Down
4 changes: 4 additions & 0 deletions examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions examples/check_s3_bucket.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xrlint.all as xrl

URL = "s3://xcube-test/"
Expand Down
4 changes: 4 additions & 0 deletions examples/plugin_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
using the `Plugin` class and its `define_rule()` decorator method.
"""

# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from xrlint.node import DatasetNode
from xrlint.plugin import new_plugin
from xrlint.rule import RuleContext, RuleOp
Expand Down
4 changes: 4 additions & 0 deletions examples/rule_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
This example demonstrates how to develop new rules.
"""

# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.node import DatasetNode
Expand Down
4 changes: 4 additions & 0 deletions examples/virtual_plugin_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
can be defined inside a configuration item.
"""

# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from xrlint.node import DatasetNode
from xrlint.rule import RuleContext, RuleOp, define_rule

Expand Down
4 changes: 4 additions & 0 deletions mkruleref.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from xrlint.plugin import Plugin
from xrlint.rule import RuleConfig

Expand Down
4 changes: 4 additions & 0 deletions notebooks/mkdataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/_linter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/_linter/test_rulectx.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from unittest import TestCase

import xarray as xr
Expand Down
4 changes: 4 additions & 0 deletions tests/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

5 changes: 5 additions & 0 deletions tests/cli/configs/recommended.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).


def export_config():
import xrlint.plugins.core
import xrlint.plugins.xcube
Expand Down
4 changes: 4 additions & 0 deletions tests/cli/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import os
from contextlib import contextmanager

Expand Down
4 changes: 4 additions & 0 deletions tests/cli/test_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import unittest
from pathlib import Path
from typing import Any
Expand Down
4 changes: 4 additions & 0 deletions tests/cli/test_main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import os
import shutil
import tempfile
Expand Down
4 changes: 4 additions & 0 deletions tests/formatters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/formatters/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from xrlint.config import ConfigObject
from xrlint.formatter import FormatterContext
from xrlint.plugin import new_plugin
Expand Down
4 changes: 4 additions & 0 deletions tests/formatters/test_html.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from unittest import TestCase

from xrlint.formatters.html import Html, HtmlText
Expand Down
4 changes: 4 additions & 0 deletions tests/formatters/test_json.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from unittest import TestCase

from xrlint.formatters.json import Json
Expand Down
4 changes: 4 additions & 0 deletions tests/formatters/test_simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from unittest import TestCase

from tests.formatters.helpers import get_context
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/plugins/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/plugins/core/rules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_access_latency.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from unittest import TestCase

import pytest
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_content_desc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.content_desc import ContentDesc
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_conventions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.conventions import Conventions
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_coords_for_dims.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.coords_for_dims import CoordsForDims
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_grid_mappings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_lat_lon_coordinate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_no_empty_attrs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.no_empty_attrs import NoEmptyAttrs
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_no_empty_chunks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.no_empty_chunks import NoEmptyChunks
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_time_coordinate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_var_desc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.var_desc import VarDesc
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_var_flags.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/rules/test_var_units.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from xrlint.plugins.core.rules.var_units import VarUnits
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/core/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from unittest import TestCase

from xrlint.plugins.core import export_plugin
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/plugins/xcube/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import math

import numpy as np
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/processors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/plugins/xcube/processors/test_mldataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import json
from typing import Any
from unittest import TestCase
Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_any_spatial_data_var.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

from xrlint.plugins.xcube.rules.any_spatial_data_var import AnySpatialDataVar
from xrlint.testing import RuleTest, RuleTester

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_cube_dims_order.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_data_var_colors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_grid_mapping_naming.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_increasing_time.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_lat_lon_naming.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import numpy as np
import xarray as xr

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/xcube/rules/test_ml_dataset_meta.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 Brockmann Consult GmbH.
# This software is distributed under the terms and conditions of the
# MIT license (https://mit-license.org/).

import xarray as xr

from tests.plugins.xcube.helpers import make_cube_levels
Expand Down
Loading