Skip to content

Commit 8007da6

Browse files
authored
Merge pull request #58 from bcdev/forman-0.5.0
Release 0.5.0
2 parents f5513cc + bf1c6b8 commit 8007da6

File tree

13 files changed

+45
-37
lines changed

13 files changed

+45
-37
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# XRLint Change History
22

3-
## Version 0.5.0 (in development)
3+
## Version 0.5.0 (from 2025-02-13)
44

55
### Adjustments and Enhancements
66

docs/rule-ref.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ A dataset should provide information about where the data came from and what has
2020
- `no_vars`: do not check variables at all. Defaults to `False`.
2121
- `ignored_vars`: list of ignored variables (regex patterns). Defaults to `['crs', 'spatial_ref']`.
2222

23-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#description-of-file-contents)
23+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#description-of-file-contents)
2424

2525
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
2626

2727
### :material-lightbulb: `conventions`
2828

2929
Datasets should identify the applicable conventions using the `Conventions` attribute.
3030
The rule has an optional configuration parameter `match` which is a regex pattern that the value of the `Conventions` attribute must match, if any. If not provided, the rule just verifies that the attribute exists and whether it is a character string.
31-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#identification-of-conventions)
31+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#identification-of-conventions)
3232

3333
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
3434

@@ -41,20 +41,21 @@ Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning
4141
### :material-bug: `grid-mappings`
4242

4343
Grid mappings, if any, shall have valid grid mapping coordinate variables.
44+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#grid-mappings-and-projections)
4445

4546
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
4647

4748
### :material-bug: `lat-coordinate`
4849

4950
Latitude coordinate should have standard units and standard names.
50-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#latitude-coordinate)
51+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#latitude-coordinate)
5152

5253
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
5354

5455
### :material-bug: `lon-coordinate`
5556

5657
Longitude coordinate should have standard units and standard names.
57-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#longitude-coordinate)
58+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#longitude-coordinate)
5859

5960
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
6061

@@ -67,35 +68,42 @@ Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
6768
### :material-lightbulb: `no-empty-chunks`
6869

6970
Empty chunks should not be encoded and written. The rule currently applies to Zarr format only.
70-
[:material-information-variant:](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.to_zarr.html#xarray-dataset-to-zarr)
71+
[More...](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.to_zarr.html#xarray-dataset-to-zarr)
7172

7273
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-circle-off-outline:
7374

7475
### :material-bug: `time-coordinate`
7576

7677
Time coordinates should have valid and unambiguous time units encoding.
77-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#time-coordinate)
78+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#time-coordinate)
7879

7980
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
8081

8182
### :material-lightbulb: `var-desc`
8283

8384
Check that each data variable provides an identification and description of the content. The rule can be configured by parameter `attrs` which is a list of names of attributes that provides descriptive information. It defaults to `['standard_name', 'long_name']`.
84-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#standard-name)
85+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#standard-name)
8586

8687
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
8788

8889
### :material-lightbulb: `var-flags`
8990

9091
Validate attributes 'flag_values', 'flag_masks' and 'flag_meanings' that make variables that contain flag values self describing.
91-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#flags)
92+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#flags)
9293

9394
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
9495

96+
### :material-lightbulb: `var-missing-data`
97+
98+
Checks the recommended use of missing data, i.e., coordinate variables should not define missing data, but packed data should. Notifies about the use of valid ranges to indicate missing data, which is currently not supported by xarray.
99+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#units)
100+
101+
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
102+
95103
### :material-lightbulb: `var-units`
96104

97105
Every variable should provide a description of its units.
98-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#units)
106+
[More...](https://cfconventions.org/cf-conventions/cf-conventions.html#units)
99107

100108
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
101109

@@ -104,70 +112,70 @@ Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
104112
### :material-bug: `any-spatial-data-var`
105113

106114
A datacube should have spatial data variables.
107-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#data-model-and-format)
115+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#data-model-and-format)
108116

109117
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
110118

111119
### :material-bug: `cube-dims-order`
112120

113121
Order of dimensions in spatio-temporal datacube variables should be [time, ..., y, x].
114-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#data-model-and-format)
122+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#data-model-and-format)
115123

116124
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
117125

118126
### :material-lightbulb: `data-var-colors`
119127

120128
Spatial data variables should encode xcube color mappings in their metadata.
121-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#encoding-of-colors)
129+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#encoding-of-colors)
122130

123131
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
124132

125133
### :material-bug: `dataset-title`
126134

127135
Datasets should be given a non-empty title.
128-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#metadata)
136+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#metadata)
129137

130138
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
131139

132140
### :material-lightbulb: `grid-mapping-naming`
133141

134142
Grid mapping variables should be called 'spatial_ref' or 'crs' for compatibility with rioxarray and other packages.
135-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#spatial-reference)
143+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#spatial-reference)
136144

137145
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
138146

139147
### :material-bug: `increasing-time`
140148

141149
Time coordinate labels should be monotonically increasing.
142-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#temporal-reference)
150+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#temporal-reference)
143151

144152
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
145153

146154
### :material-bug: `lat-lon-naming`
147155

148156
Latitude and longitude coordinates and dimensions should be called 'lat' and 'lon'.
149-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#spatial-reference)
157+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#spatial-reference)
150158

151159
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
152160

153161
### :material-lightbulb: `ml-dataset-meta`
154162

155163
Multi-level datasets should provide a '.zlevels' meta-info file, and if so, it should be consistent. Without the meta-info file the multi-level dataset cannot be reliably extended by new time slices as the aggregation method used for each variable must be specified.
156-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/mldatasets.html#the-xcube-levels-format)
164+
[More...](https://xcube.readthedocs.io/en/latest/mldatasets.html#the-xcube-levels-format)
157165

158166
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
159167

160168
### :material-bug: `ml-dataset-time`
161169

162170
The `time` dimension of multi-level datasets should use a chunk size of 1. This allows for faster image tile generation for visualisation.
163-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/mldatasets.html#definition)
171+
[More...](https://xcube.readthedocs.io/en/latest/mldatasets.html#definition)
164172

165173
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
166174

167175
### :material-bug: `ml-dataset-xy`
168176

169177
Multi-level dataset levels should provide spatial resolutions decreasing by powers of two.
170-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/mldatasets.html#definition)
178+
[More...](https://xcube.readthedocs.io/en/latest/mldatasets.html#definition)
171179

172180
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
173181

@@ -180,14 +188,14 @@ Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
180188
### :material-bug: `single-grid-mapping`
181189

182190
A single grid mapping shall be used for all spatial data variables of a datacube.
183-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#spatial-reference)
191+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#spatial-reference)
184192

185193
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
186194

187195
### :material-bug: `time-naming`
188196

189197
Time coordinate and dimension should be called 'time'.
190-
[:material-information-variant:](https://xcube.readthedocs.io/en/latest/cubespec.html#temporal-reference)
198+
[More...](https://xcube.readthedocs.io/en/latest/cubespec.html#temporal-reference)
191199

192200
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
193201

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- tabulate
1111
- xarray
1212
# Dev Dependencies
13+
- isort
1314
- mkdocs
1415
- mkdocs-autorefs
1516
- mkdocs-material

mkruleref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def write_plugin_rules(stream, plugin: Plugin):
5252
)
5353
stream.write(rule_meta.description or "_No description._")
5454
if rule_meta.docs_url:
55-
stream.write("\n" + f"[:{read_more_icon}:]({rule_meta.docs_url})")
55+
stream.write(f"\n[More...]({rule_meta.docs_url})")
5656
stream.write("\n\n")
5757
# List the predefined configurations that contain the rule
5858
stream.write("Contained in: ")

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ dev = [
6868
# Development tools
6969
"build",
7070
"hatch",
71+
"isort",
7172
"pytest",
7273
"pytest-cov",
7374
"ruff",

tests/test_linter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from xrlint.config import Config, ConfigObject
1111
from xrlint.constants import CORE_PLUGIN_NAME, DATASET_ROOT_NAME
1212
from xrlint.linter import Linter, new_linter
13-
from xrlint.node import AttrNode, AttrsNode, DatasetNode, VariableNode, DataTreeNode
13+
from xrlint.node import AttrNode, AttrsNode, DatasetNode, DataTreeNode, VariableNode
1414
from xrlint.plugin import new_plugin
1515
from xrlint.processor import ProcessorOp
1616
from xrlint.result import Message, Result

xrlint/_linter/apply.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This software is distributed under the terms and conditions of the
33
# MIT license (https://mit-license.org/).
44

5-
from xrlint.node import AttrNode, AttrsNode, DataTreeNode, DatasetNode, VariableNode
5+
from xrlint.node import AttrNode, AttrsNode, DatasetNode, DataTreeNode, VariableNode
66
from xrlint.rule import RuleConfig, RuleExit, RuleOp
77

88
from ..constants import DATASET_ROOT_NAME, DATATREE_ROOT_NAME

xrlint/formatters/html.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import html
66
from collections.abc import Iterable
77

8-
from xrlint.constants import (
9-
SEVERITY_CODE_TO_COLOR,
10-
SEVERITY_CODE_TO_NAME,
11-
)
8+
from xrlint.constants import SEVERITY_CODE_TO_COLOR, SEVERITY_CODE_TO_NAME
129
from xrlint.formatter import FormatterContext, FormatterOp
1310
from xrlint.formatters import registry
1411
from xrlint.result import Message, Result, get_rules_meta_for_results

xrlint/formatters/simple.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66

77
from tabulate import tabulate
88

9-
from xrlint.constants import (
10-
SEVERITY_CODE_TO_COLOR,
11-
SEVERITY_CODE_TO_NAME,
12-
)
9+
from xrlint.constants import SEVERITY_CODE_TO_COLOR, SEVERITY_CODE_TO_NAME
1310
from xrlint.formatter import FormatterContext, FormatterOp
1411
from xrlint.formatters import registry
1512
from xrlint.result import Message, Result

xrlint/plugins/core/rules/grid_mappings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
description=(
1515
"Grid mappings, if any, shall have valid grid mapping coordinate variables."
1616
),
17+
docs_url=(
18+
"https://cfconventions.org/cf-conventions/cf-conventions.html"
19+
"#grid-mappings-and-projections"
20+
),
1721
)
1822
class GridMappings(RuleOp):
1923
def validate_dataset(self, ctx: RuleContext, node: DatasetNode):

0 commit comments

Comments
 (0)