Skip to content

Commit 6bb31d9

Browse files
committed
More consistent messages.
1 parent 65b6b37 commit 6bb31d9

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

xrlint/plugins/core/rules/coords_for_dims.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def dataset(self, ctx: RuleContext, node: DatasetNode):
3131
n = len(no_coord_dims)
3232
ctx.report(
3333
f"{format_item(n, 'Data variable dimension')} without"
34-
f" coordinates: {', '.join(no_coord_dims)}",
34+
f" coordinates: {', '.join(no_coord_dims)}.",
3535
suggestions=[
3636
f"Add corresponding {format_item(n, 'coordinate variable')}"
3737
f" to dataset:"

xrlint/plugins/core/rules/flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _validate_flag_values(
7070
) -> int | None:
7171
if not has_meanings:
7272
ctx.report(
73-
f"Missing attribute {FLAG_MEANINGS!r} to explain attribute {FLAG_VALUES!r}"
73+
f"Missing attribute {FLAG_MEANINGS!r} to explain attribute {FLAG_VALUES!r}."
7474
)
7575
type_ok, flag_count = _check_values(flag_values)
7676
if not type_ok or flag_count is None:

xrlint/plugins/core/rules/no_empty_chunks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def data_array(self, ctx: RuleContext, node: DataArrayNode):
3030
and "chunks" in node.data_array.encoding
3131
and "_FillValue" in node.data_array.encoding
3232
):
33-
ctx.report("Consider writing the dataset using 'write_empty_chunks=True`.")
33+
ctx.report("Consider writing the dataset using 'write_empty_chunks=True'.")

xrlint/plugins/core/rules/time_coordinate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def data_array(self, ctx: RuleContext, node: DataArrayNode):
5757
has_tz = last_part.lower() == "utc" or last_part[0] in ("+", "-")
5858
if not has_tz:
5959
ctx.report(
60-
f"Missing timezone in 'units' attribute: {units}",
60+
f"Missing timezone in 'units' attribute: {units!r}.",
6161
suggestions=[
6262
use_units_format_msg,
6363
f"Append timezone specification, e.g., use"
@@ -68,6 +68,6 @@ def data_array(self, ctx: RuleContext, node: DataArrayNode):
6868
return
6969

7070
ctx.report(
71-
f"Invalid 'units' attribute: {units}",
71+
f"Invalid 'units' attribute: {units!r}.",
7272
suggestions=[use_units_format_msg],
7373
)

xrlint/plugins/xcube/rules/data_var_colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ def data_array(self, ctx: RuleContext, node: DataArrayNode):
2323
attrs = array.attrs
2424
color_bar_name = attrs.get("color_bar_name")
2525
if not color_bar_name:
26-
ctx.report("Missing attribute 'color_bar_name'")
26+
ctx.report("Missing attribute 'color_bar_name'.")
2727
else:
2828
color_value_min = attrs.get("color_value_min")
2929
color_value_max = attrs.get("color_value_max")
3030
if color_value_min is None or color_value_max is None:
3131
ctx.report(
32-
"Missing both or one of 'color_value_min' and 'color_value_max'"
32+
"Missing both or one of 'color_value_min' and 'color_value_max'."
3333
)
3434

3535
color_norm = attrs.get("color_norm")
3636
if color_norm and color_norm not in ("lin", "log"):
3737
ctx.report(
38-
"Invalid value of attribute 'color_norm', should be 'lin' or 'log'"
38+
"Invalid value of attribute 'color_norm', should be 'lin' or 'log'."
3939
)

xrlint/plugins/xcube/rules/grid_mapping_naming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ def dataset(self, ctx: RuleContext, node: DatasetNode):
2121
ctx.report(
2222
f"Grid mapping variables should be named"
2323
f" {GM_NAMES_TEXT},"
24-
f" but name is {var_name!r}"
24+
f" but name is {var_name!r}."
2525
)

xrlint/plugins/xcube/rules/increasing_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ def check_indexes(ctx, cond: np.ndarray, issue_name: str):
3232
index_text = format_count(indexes.size, singular="index", plural="indexes")
3333
ctx.report(
3434
f"{issue_name} 'time' coordinate label at {index_text}"
35-
f" {format_seq(indexes)}"
35+
f" {format_seq(indexes)}."
3636
)

xrlint/plugins/xcube/rules/ml_dataset_meta.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ def dataset(self, ctx: RuleContext, node: DatasetNode):
4040
return
4141

4242
if not meta.version.startswith("1."):
43-
ctx.report(f"Unsupported {ML_META_FILENAME!r} meta-info version")
43+
ctx.report(f"Unsupported {ML_META_FILENAME!r} meta-info version.")
4444

4545
if meta.num_levels <= 0:
4646
ctx.report(
4747
f"Invalid 'num_levels' in {ML_META_FILENAME!r} meta-info:"
48-
f" {meta.num_levels}"
48+
f" {meta.num_levels}."
4949
)
5050
elif meta.num_levels != level_info.num_levels:
5151
ctx.report(
5252
f"Expected {format_item(meta.num_levels, 'level')},"
53-
f" but found {level_info.num_levels}"
53+
f" but found {level_info.num_levels}."
5454
)
5555

5656
if meta.use_saved_levels is None:

xrlint/plugins/xcube/rules/ml_dataset_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ def dataset(self, ctx: RuleContext, node: DatasetNode):
3535
if not all(c == 1 for c in time_chunks):
3636
ctx.report(
3737
f"Variable {var_name!r} uses chunking for {TIME_NAME!r}"
38-
f" that differs from from one: {format_seq(time_chunks)}"
38+
f" that differs from from one: {format_seq(time_chunks)}."
3939
)

xrlint/plugins/xcube/rules/ml_dataset_xy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ def dataset(self, ctx: RuleContext, node: DatasetNode):
4545
if level_width != expected_level_width:
4646
ctx.report(
4747
f"Expected size of dimension {x_name!r} in level {level}"
48-
f" to be {expected_level_width}, but was {level_width}"
48+
f" to be {expected_level_width}, but was {level_width}."
4949
)
5050

5151
if level_height != expected_level_height:
5252
ctx.report(
5353
f"Expected size of dimension {y_name!r} in level {level}"
54-
f" to be {expected_level_height}, but was {level_height}"
54+
f" to be {expected_level_height}, but was {level_height}."
5555
)
5656

5757
# Here: check spatial coordinates...

0 commit comments

Comments
 (0)