Skip to content

Commit 9a4836f

Browse files
committed
Added missing documentation of the append_step setting in the configuration reference
1 parent 87dbd97 commit 9a4836f

File tree

4 files changed

+54
-18
lines changed

4 files changed

+54
-18
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Version 0.4.1 (in development)
22

3+
### Enhancements
4+
5+
* Added missing documentation of the `append_step` setting in the
6+
[configuration reference](https://bcdev.github.io/zappend/config/).
7+
38
## Version 0.4.0 (from 2024-02-08)
49

510
### Enhancements

docs/config.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
## `version`
55

66
Configuration schema version. Allows the schema to evolve while still preserving backwards compatibility.
7-
Its value must be `1`.
7+
Its value is `1`.
88
Defaults to `1`.
99

1010
## `zarr_version`
1111

1212
The Zarr version to be used.
13-
Its value must be `2`.
13+
Its value is `2`.
1414
Defaults to `2`.
1515

1616
## `fixed_dims`
@@ -25,6 +25,28 @@ Type _string_.
2525
The name of the variadic append dimension.
2626
Defaults to `"time"`.
2727

28+
## `append_step`
29+
30+
If set, enforces a step size in the append dimension between two slices or just enforces a direction.
31+
Must be one of the following:
32+
33+
* Arbitrary step size or not applicable.
34+
Its value is `null`.
35+
36+
* Monotonically increasing.
37+
Its value is `"+"`.
38+
39+
* Monotonically decreasing.
40+
Its value is `"-"`.
41+
42+
* Type _string_.
43+
A positive or negative time delta value, such as `12h`, `2D`, `-1D`.
44+
45+
* Type _number_.
46+
A positive or negative numerical delta value.
47+
48+
Defaults to `null`.
49+
2850
## `included_variables`
2951

3052
Type _array_.
@@ -59,27 +81,29 @@ Variable metadata.
5981

6082
* `chunks`:
6183
Storage chunking.
62-
Must be one of the following.
84+
Must be one of the following:
6385

6486
* Type _array_.
6587
Chunk sizes in the order of the dimensions.
6688
The items of the array are of type _integer_.
6789

6890
* Disable chunking.
69-
Its value must be `null`.
91+
Its value is `null`.
92+
7093

7194
* `fill_value`:
7295
Storage fill value.
73-
Must be one of the following.
96+
Must be one of the following:
7497

7598
* Type _number_.
7699
A number of type and unit of the given storage `dtype`.
77100

78101
* Not-a-number. Can be used only if storage `dtype` is `float32` or `float64`.
79-
Its value must be `"NaN"`.
102+
Its value is `"NaN"`.
80103

81104
* No fill value.
82-
Its value must be `null`.
105+
Its value is `null`.
106+
83107

84108
* `scale_factor`:
85109
Type _number_.
@@ -147,13 +171,13 @@ Options for the filesystem given by the protocol of the URIs of contributing dat
147171
## `slice_polling`
148172

149173
Defines how to poll for contributing datasets.
150-
Must be one of the following.
174+
Must be one of the following:
151175

152176
* No polling, fail immediately if dataset is not available.
153-
Its value must be `false`.
177+
Its value is `false`.
154178

155179
* Poll using default values.
156-
Its value must be `true`.
180+
Its value is `true`.
157181

158182
* Type _object_.
159183
Polling parameters.
@@ -169,6 +193,7 @@ Must be one of the following.
169193
Polling timeout in seconds.
170194
Defaults to `60`.
171195

196+
172197
## `persist_mem_slices`
173198

174199
Type _boolean_.
@@ -194,7 +219,7 @@ Defaults to `false`.
194219
## `profiling`
195220

196221
Profiling configuration. Allows for runtime profiling of the processing.
197-
Must be one of the following.
222+
Must be one of the following:
198223

199224
* Type _boolean_.
200225
If set, profiling is enabled and output is logged using level `"INFO"`. Otherwise, profiling is disabled.
@@ -227,7 +252,7 @@ Must be one of the following.
227252
* `restrictions`:
228253
Type _array_.
229254
Used to limit the list down to the significant entries in the profiling report. Refer to [Stats.print_stats(*restrictions)](https://docs.python.org/3/library/profile.html#pstats.Stats.print_stats).
230-
The items of the array must be one of the following.
255+
The items of the array must be one of the following:
231256

232257
* Type _integer_.
233258
Select a count of lines.
@@ -237,6 +262,8 @@ Must be one of the following.
237262

238263
* Type _string_.
239264
Pattern-match the standard name that is printed.
265+
266+
240267

241268
## `logging`
242269

@@ -246,7 +273,7 @@ The key `version` is required.
246273

247274
* `version`:
248275
Logging schema version.
249-
Its value must be `1`.
276+
Its value is `1`.
250277

251278
* `formatters`:
252279
Type _object_.

zappend/config/markdown.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def _schema_to_md(
4444
one_of = schema.get("anyOf") or schema.get("oneOf")
4545
if one_of:
4646
if sequence_name:
47-
lines.append(f"The {sequence_name} must be one of the following.")
47+
lines.append(f"The {sequence_name} must be one of the following:")
4848
else:
49-
lines.append("Must be one of the following.")
49+
lines.append("Must be one of the following:")
5050
for sub_schema in one_of:
5151
sub_lines = []
5252
_schema_to_md(sub_schema, path, sub_lines)
@@ -55,11 +55,12 @@ def _schema_to_md(
5555
lines.append(" * " + sub_lines[0])
5656
for sub_line in sub_lines[1:]:
5757
lines.append(" " + sub_line)
58+
lines.append("")
5859

5960
const = schema.get("const", undefined)
6061
if const is not undefined:
6162
value = json.dumps(const)
62-
lines.append(f"Its value must be `{value}`.")
63+
lines.append(f"Its value is `{value}`.")
6364

6465
default = schema.get("default", undefined)
6566
if default is not undefined:

zappend/config/schema.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,15 @@
487487
{"description": "Monotonically increasing.", "const": "+"},
488488
{"description": "Monotonically decreasing.", "const": "-"},
489489
{
490-
"description": "A time delta value.",
490+
"description": (
491+
"A positive or negative time delta value,"
492+
" such as `12h`, `2D`, `-1D`."
493+
),
491494
"type": "string",
492495
"not": {"const": ""},
493496
},
494497
{
495-
"description": "A numerical delta value.",
498+
"description": "A positive or negative numerical delta value.",
496499
"type": "number",
497500
"not": {"const": 0},
498501
},

0 commit comments

Comments
 (0)