Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
## [v1.1.0](https://github.com/eodcgmbh/eodc-cf/releases/tag/v1.0.0) - 2026-09-29

<small>[Compare with 1.0.0](https://github.com/eodcgmbh/eodc-cf/compare/1.0.0...v1.1.0)</small>

### Summary

- relaxed long name allowing '.' and '-'

## [v1.0.0](https://github.com/eodcgmbh/eodc-cf/releases/tag/v1.0.0) - 2026-08-07

<small>[Compare with 0.2.1](https://github.com/eodcgmbh/eodc-cf/compare/0.2.1...v1.0.0)</small>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = [ "uv-build>=0.11.2,<0.12" ]

[project]
name = "cf-cm-tree"
version = "1.0.0"
version = "1.1.0"
description = "Generic and light-weight package to assist CF-compliant dataset creation"
readme = "README.md"
authors = [ { name = "eodc", email = "claudio.schein-navacchi@eodc.eu" } ]
Expand Down
4 changes: 2 additions & 2 deletions src/cf_cm_tree/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def validate_long_name(arg: str | None) -> str:
"""Validate a CF long name.

Returns arg unchanged if it is None or holds only letters, digits,
whitespace, and `(),`; raises ValueError otherwise.
whitespace, and `(),.-`; raises ValueError otherwise.
"""
pattern = re.compile(r"^[a-zA-Z_0-9][a-zA-Z_0-9\s(),]+$")
pattern = re.compile(r"^[a-zA-Z_0-9][a-zA-Z_0-9\s(),.\-]+$")

if arg and not pattern.match(arg):
err_msg = f"Long name '{arg}' does not comply with the CF naming convention."
Expand Down
16 changes: 14 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,21 @@ def test_cf_base():

with pytest.raises(
ValidationError,
match=r"Long name 'bad-name' does not comply with the CF naming convention.",
match=r"Long name 'bad/name' does not comply with the CF naming convention.",
):
cf_base = CFBase(name="var", standard_name="var_name", long_name="bad-name")
cf_base = CFBase(name="var", standard_name="var_name", long_name="bad/name")

cf_base = CFBase(name="var", standard_name="var_name", long_name="Temp. at 2 m")
assert cf_base.long_name == "Temp. at 2 m"

cf_base = CFBase(name="var", standard_name="var_name", long_name="near-surface air")
assert cf_base.long_name == "near-surface air"

with pytest.raises(
ValidationError,
match=r"Long name '.hidden' does not comply with the CF naming convention.",
):
cf_base = CFBase(name="var", standard_name="var_name", long_name=".hidden")


def test_cf_coordinate():
Expand Down
Loading