Skip to content

Commit

Permalink
Merge pull request #38 from invenia/ox/fullname
Browse files Browse the repository at this point in the history
add checkpoint_fullname
  • Loading branch information
oxinabox authored Nov 17, 2021
2 parents 72299dd + 315cf21 commit f380d77
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Checkpoints"
uuid = "b4a3413d-e481-5afc-88ff-bdfbd6a50dce"
authors = "Invenia Technical Computing Corporation"
version = "0.3.14"
version = "0.3.15"

[deps]
AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
Expand Down
2 changes: 1 addition & 1 deletion src/Checkpoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export checkpoint, with_checkpoint_tags # creating stuff
export enabled_checkpoints
# indexing stuff
export IndexEntry, index_checkpoint_files, index_files
export checkpoint_name, checkpoint_path, prefixes, tags
export checkpoint_fullname, checkpoint_name, checkpoint_path, prefixes, tags

const LOGGER = getlogger(@__MODULE__)

Expand Down
13 changes: 13 additions & 0 deletions src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ specified (as in `checkpoint("forecasts",...)`). If it was saved as
"""
prefixes(x::IndexEntry) = getfield(x, :prefixes)


"""
checkpoint_fullname(x::IndexEntry)
The full name of the checkpoint output file, including [`prefixes`](@ref), and
[`checkpoint_name`](@ref).
If the checkpoint was saved using `checkpoint(Forecasters, "forecasts", ...)` then
`checkpoint_fullname` will return `"Forecasters.forecasts"`.
If the checkpoint was saved using `checkpoint("Foo.Bar", "forecasts.jlso")` then
`checkpoint_fullname` will return `"Foo.Bar.forecasts"`.
"""
checkpoint_fullname(x::IndexEntry) = join((prefixes(x)..., checkpoint_name(x)), ".")

"""
tags(x::IndexEntry)
Expand Down
1 change: 1 addition & 0 deletions test/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@test entry.date == "2017-01-01"
@test prefixes(entry) == ("TestPkg",)
@test checkpoint_name(entry) == "bar"
@test checkpoint_fullname(entry) == "TestPkg.bar"
@test ==(
checkpoint_path(entry),
Path(joinpath(path, "date=2017-01-01", "TestPkg", "bar.jlso"))
Expand Down

2 comments on commit f380d77

@oxinabox
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/48952

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.15 -m "<description of version>" f380d77731a3706286806c06c21633aec1d76fa1
git push origin v0.3.15

Please sign in to comment.