Skip to content

Commit 5ea9725

Browse files
authored
Relax rules for layer names (#1034)
* Add $ and @ as allowed layer chars. * Update Changelog.md
1 parent d10b7eb commit 5ea9725

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1717
### Added
1818

1919
### Changed
20+
- The characters `@` and `$` are allowed within layer names now. [#1034](https://github.com/scalableminds/webknossos-libs/pull/1034)
2021

2122
### Fixed
2223

webknossos/webknossos/dataset/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@
109109
# A layer name is allowed to contain letters, numbers, underscores, hyphens and dots.
110110
# As the begin and the end are anchored, all of the name must match the regex.
111111
# The first regex group ensures that the name does not start with a dot.
112-
_ALLOWED_LAYER_NAME_REGEX = re.compile(r"^[A-Za-z0-9_\-]+[A-Za-z0-9_\-\.]*$")
112+
_ALLOWED_LAYER_NAME_REGEX = re.compile(r"^[A-Za-z0-9_$@\-]+[A-Za-z0-9_$@\-\.]*$")
113113
# This regex matches any character that is not allowed in a layer name.
114-
_UNALLOWED_LAYER_NAME_CHARS = re.compile(r"[^A-Za-z0-9_\-\.]")
114+
_UNALLOWED_LAYER_NAME_CHARS = re.compile(r"[^A-Za-z0-9_$@\-\.]")
115115

116116

117117
def _find_array_info(layer_path: Path) -> Optional[ArrayInfo]:

0 commit comments

Comments
 (0)