|
8 | 8 |
|
9 | 9 | XRLint is a [linter](https://en.wikipedia.org/wiki/Lint_(software)) |
10 | 10 | tool and library for [xarray]() datasets. |
11 | | - |
12 | 11 | Its design is heavily inspired by [ESLint](https://eslint.org/). |
13 | 12 |
|
| 13 | +**IMPORTANT NOTE**: This project just started and is under development, |
| 14 | +there is no stable release yet. |
| 15 | + |
| 16 | +## Features |
| 17 | + |
| 18 | +- Flexible validation for `xarray.Dataset` objects by configurable _rules_. |
| 19 | +- Available from _CLI_ and _Python API_. |
| 20 | +- _Custom plugins_ providing _custom rule_ sets allow addressing |
| 21 | + different dataset conventions. |
| 22 | +- _Project-specific configurations_ including configuration of individual |
| 23 | + rules and file-specific settings. |
| 24 | + |
14 | 25 | ## Inbuilt Rules |
15 | 26 |
|
| 27 | +The following rule plugins are currently built into the code base: |
| 28 | + |
16 | 29 | - `core`: Implementing the rules for |
17 | 30 | [tiny data](https://tutorial.xarray.dev/intermediate/data_cleaning/05.1_intro.html) |
18 | 31 | and the |
19 | | - [CF-Conventions](https://cfconventions.org/cf-conventions/cf-conventions.html) |
| 32 | + [CF-Conventions](https://cfconventions.org/cf-conventions/cf-conventions.html). |
20 | 33 |
|
21 | 34 | - `xcube`: Implementing the rules for |
22 | | - [xcube datasets](https://xcube.readthedocs.io/en/latest/cubespec.html) |
23 | | - |
24 | | -## To-Dos |
25 | | - |
26 | | -### Required |
27 | | - |
28 | | -- populate `core` plugin by more rules |
29 | | -- populate `xcube` plugin by more rules |
30 | | -- add `docs` |
31 | | - - configure api docs, use mkdocstrings ref syntax in docstrings |
32 | | - - generate markdown rule reference for the docs |
33 | | -- CI for package publishing |
34 | | - |
35 | | -### Desired |
36 | | - |
37 | | -- add some more tests so we reach 99% coverage |
38 | | -- introduce `dataset_options` config: |
39 | | - - `opener: OpenerOp` |
40 | | - - `opener_options: dict[str, Any]` |
41 | | -- implement `autofix` feature |
42 | | - |
43 | | -### Nice to have |
44 | | - |
45 | | -- use `RuleMeta.type`, it is currently unused |
46 | | -- use `RuleTest.expected`, it is currently unused |
47 | | -- use `processor: ProcessorOp` config, it is currently unused |
48 | | -- add missing community standards, |
49 | | - see https://github.com/bcdev/xrlint/community |
50 | | - |
51 | | -## Ideas |
52 | | - |
53 | | -### Other plugins |
54 | | - |
55 | | -- `sgrid`: https://sgrid.github.io/sgrid/ |
56 | | -- `ugrid`: https://ugrid-conventions.github.io/ugrid-conventions/ |
57 | | - |
58 | | -## Generalize data linting |
59 | | - |
60 | | -Do not limit verification to `xr.Dataset`. |
61 | | -However, this requires new rule sets. |
62 | | - |
63 | | -To allow for other data models, we need to allow |
64 | | -for a specific verifier type for a given data type. |
65 | | - |
66 | | -The verifier verifies specific node types |
67 | | -that are characteristic for a data type. |
68 | | - |
69 | | -To do so a traverser must traverse the elements of the data |
70 | | -and pass each node to the verifier. |
71 | | - |
72 | | -Note, this is the [_Visitor Pattern_](https://en.wikipedia.org/wiki/Visitor_pattern), |
73 | | -where the verifier is the _Visitor_ and a node refers to _Element_. |
74 | | - |
75 | | -To support the CLI mode, we need different data opener |
76 | | -types that can read the data from a file path. |
| 35 | + [xcube datasets](https://xcube.readthedocs.io/en/latest/cubespec.html). |
| 36 | + Note this plugins will be moved into a separate GitHub repo later |
| 37 | + once XRLint is mature enough. |
77 | 38 |
|
78 | | -1. open data, if given data is a file path: |
79 | | - - find opener for file path |
80 | | - - open data |
81 | | -2. verify data |
82 | | - - find root element type and visitor type for data |
83 | | - - call the root element `accept(verifier)` that verifies the |
84 | | - root element `verify.root()` and starts traversal of |
85 | | - child elements. |
0 commit comments