Skip to content

Commit 14a9927

Browse files
committed
update docstring
1 parent 1e57be4 commit 14a9927

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/DataSets.jl

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,39 @@ end
8787
Check whether a dataset name is valid.
8888
8989
Valid names must start with a letter or a number, the rest of the name can also contain `-`
90-
and `_` characters. The names can also be hieracicial, with segments separated by forward
91-
slashes (`/`). Each segment must also start with either a letter or a number. For example:
90+
and `_` characters. The names can also be hierarchical, with segments separated by forward
91+
slashes (`/`) or (`.`). Each segment must also start with either a letter or a number.
92+
93+
For example, the following dataset names are valid:
9294
9395
my_data
9496
my_data_1
9597
username/data
9698
organization_name/project-name/data
9799
123user/456dataset--name
100+
username/my_table.csv
101+
dataset/v0.1.2
102+
103+
whereas names like this are invalid:
104+
105+
__mydata__
106+
username/.git
107+
my...dataset
108+
109+
!!! note "Segment separators"
110+
111+
In dataset names, both `/` and `.` are considered segment separators from a syntax
112+
perspective. While DataSets.jl does not impose any specific interpretation on the
113+
dataset name, it is recommended to use `/` to separate segments from a semantic
114+
perspective, and to interpret each forward-slash-separated segment as a path separator.
115+
Periods would conventionally be used to separate file extensions within a segment.
116+
117+
E.g. use `username/my-project-data/population.csv`, rather than
118+
`username.my-project-data.population.csv` or something like that.
98119
"""
99120
function check_dataset_name(name::AbstractString)
100121
if !occursin(DATASET_NAME_REGEX, name)
101-
error("DataSet name \"$name\" is invalid. DataSet names must start with a letter and can contain only letters, numbers, `-`, `_` or `/`.")
122+
error("DataSet name \"$name\" is invalid. DataSet names must start with a letter or a number, and can contain only letters, numbers, `-` and `_`, or `/` and `.` as segment separators.")
102123
end
103124
end
104125
# DataSet names disallow most punctuation for now, as it may be needed as

0 commit comments

Comments
 (0)