Skip to content

Commit 0da4310

Browse files
committed
formatting
1 parent 88fb2cf commit 0da4310

4 files changed

Lines changed: 34 additions & 27 deletions

File tree

docs/rule-ref.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,39 @@ New rules will be added by upcoming XRLint releases.
55

66
## Core Rules
77

8+
### :material-lightbulb: `content-desc`
9+
10+
A dataset should provide information about where the data came from and what has been done to it. This information is mainly for the benefit of human readers. The rule accepts the following configuration parameters:
11+
12+
- `globals`: list of names of required global attributes. Defaults to `['title', 'history']`.
13+
- `commons`: list of names of required variable attributes that can also be defined globally. Defaults to `['institution', 'source', 'references', 'comment']`.
14+
- `no_vars`: do not check variables at all. Defaults to `False`.
15+
- `ignored_vars`: list of ignored variables (regex patterns). Defaults to `['crs', 'spatial_ref']`.
16+
17+
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#description-of-file-contents)
18+
19+
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
20+
821
### :material-lightbulb: `conventions`
922

1023
Datasets should identify the applicable conventions using the `Conventions` attribute.
11-
The rule has an optional configuration parameter `match` which is a regex pattern that the value of the `Conventions` attribute must match, if any.
24+
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.
1225
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#identification-of-conventions)
1326

14-
Contained in: `all`-:material-lightning-bolt:
27+
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
1528

1629
### :material-bug: `coords-for-dims`
1730

1831
Dimensions of data variables should have corresponding coordinates.
1932

2033
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
2134

22-
### :material-lightbulb: `dataset-description`
23-
24-
A dataset should provide information about where the data came from and what has been done to it. This information is mainly for the benefit of human readers. The rule accepts the following configuration parameters:
25-
26-
- `global_attrs`: list of global attribute names. Defaults to `['title', 'history']`.
27-
- `var_attrs`: list of variable attribute names. Defaults to `['institution', 'source', 'references', 'comment']`.
28-
- `ignored_vars`: list of ignored variables (regex patterns). Defaults to `['crs', 'spatial_ref']`.
29-
30-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#description-of-file-contents)
31-
32-
Contained in: `all`-:material-lightning-bolt:
33-
3435
### :material-lightbulb: `dataset-title-attr`
3536

3637
Datasets should be given a non-empty title.
3738

3839
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
3940

40-
### :material-lightbulb: `flags`
41-
42-
Validate attributes 'flag_values', 'flag_masks' and 'flag_meanings' that make variables that contain flag values self describing.
43-
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#flags)
44-
45-
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
46-
4741
### :material-bug: `grid-mappings`
4842

4943
Grid mappings, if any, shall have valid grid mapping coordinate variables.
@@ -84,9 +78,23 @@ Time coordinates should have valid and unambiguous time units encoding.
8478

8579
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
8680

87-
### :material-lightbulb: `var-units-attr`
81+
### :material-lightbulb: `var-desc`
82+
83+
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+
86+
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:
87+
88+
### :material-lightbulb: `var-flags`
89+
90+
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+
93+
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-lightning-bolt:
94+
95+
### :material-lightbulb: `var-units`
8896

89-
Every variable should have a valid 'units' attribute.
97+
Every variable should provide a description of its units.
9098
[:material-information-variant:](https://cfconventions.org/cf-conventions/cf-conventions.html#units)
9199

92100
Contained in: `all`-:material-lightning-bolt: `recommended`-:material-alert:

xrlint/cli/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def get_files(self, file_paths: Iterable[str]) -> Iterator[tuple[str, Config]]:
163163
164164
Returns:
165165
An iterator of pairs comprising a file or directory path
166-
and its computed configuration.
166+
and its computed configuration.
167167
"""
168168
config_list, global_filter = self.config_list.split_global_filter(
169169
default=DEFAULT_GLOBAL_FILTER

xrlint/plugins/core/rules/content_desc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from xrlint.node import DataArrayNode, DatasetNode
44
from xrlint.plugins.core.plugin import plugin
5-
from xrlint.rule import RuleContext, RuleOp, RuleExit
5+
from xrlint.rule import RuleContext, RuleExit, RuleOp
66
from xrlint.util.schema import schema
77

88
DEFAULT_GLOBAL_ATTRS = ["title", "history"]

xrlint/plugins/core/rules/conventions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import re
22

3-
43
from xrlint.node import DatasetNode
54
from xrlint.plugins.core.plugin import plugin
6-
from xrlint.rule import RuleContext, RuleOp, RuleExit
5+
from xrlint.rule import RuleContext, RuleExit, RuleOp
76
from xrlint.util.schema import schema
87

98

0 commit comments

Comments
 (0)