@@ -25,8 +25,25 @@ Objects have the following properties:
2525- `.size :: Int`: size of the dataset version in bytes
2626- `.timestamp :: ZonedDateTime`: dataset version timestamp
2727
28- ```
29- julia> JuliaHub.datasets()
28+ ```jldoctest
29+ julia> dataset = JuliaHub.dataset("example-dataset")
30+ Dataset: example-dataset (Blob)
31+ owner: username
32+ description: An example dataset
33+ versions: 2
34+ size: 388 bytes
35+ tags: tag1, tag2
36+
37+ julia> dataset.versions
38+ 2-element Vector{JuliaHub.DatasetVersion}:
39+ JuliaHub.dataset(("username", "example-dataset")).versions[1]
40+ JuliaHub.dataset(("username", "example-dataset")).versions[2]
41+
42+ julia> dataset.versions[end]
43+ DatasetVersion: example-dataset @ v2
44+ owner: username
45+ timestamp: 2022-10-14T01:39:43.237-04:00
46+ size: 331 bytes
3047```
3148
3249See also: [`Dataset`](@ref), [`datasets`](@ref), [`dataset`](@ref).
@@ -46,28 +63,25 @@ struct DatasetVersion
4663 size = _get_json (json, " size" , Int; msg)
4764 timestamp = _parse_tz (_get_json (json, " date" , String; msg); msg)
4865 blobstore_path = _get_json (json, " blobstore_path" , String; msg)
49- new ((owner, name), version, size, timestamp, blobstore_path)
66+ return new ((owner, name), version, size, timestamp, blobstore_path)
5067 end
5168end
5269
5370function Base. show (io:: IO , dsv:: DatasetVersion )
5471 owner, name = dsv. _dsref
55- print (
56- io,
57- " JuliaHub.DatasetVersion(dataset = (\" " ,
58- owner,
59- " \" , \" " ,
60- name,
61- " \" ), version = $(dsv. id) )" ,
62- )
72+ dsref = string (" (\" " , owner, " \" , \" " , name, " \" )" )
73+ print (io, " JuliaHub.dataset($dsref ).versions[$(dsv. id) ]" )
74+ return nothing
6375end
76+
6477function Base. show (io:: IO , :: MIME"text/plain" , dsv:: DatasetVersion )
6578 owner, name = dsv. _dsref
6679 printstyled (io, " DatasetVersion:" ; bold= true )
6780 print (io, " " , name, " @ v" , dsv. id)
6881 print (io, " \n owner: " , owner)
6982 print (io, " \n timestamp: " , dsv. timestamp)
7083 print (io, " \n size: " , dsv. size, " bytes" )
84+ return nothing
7185end
7286
7387"""
0 commit comments