Skip to content

Commit 30946be

Browse files
committed
Clarify tags documentation and update type definition
1 parent c0d7723 commit 30946be

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/experiments.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
"""
2-
createexperiment(mlf::MLFlow; name=missing, artifact_location=missing, tags=missing)
2+
createexperiment(mlf::MLFlow; name=missing, artifact_location=missing, tags::Vector{Dict{String, String}}=missing)
33
44
Creates an MLFlow experiment.
55
66
# Arguments
77
- `mlf`: [`MLFlow`](@ref) configuration.
88
- `name`: experiment name. If not specified, MLFlow sets it.
99
- `artifact_location`: directory where artifacts of this experiment will be stored. If not specified, MLFlow uses its default configuration.
10-
- `tags`: a Dictionary of key-values which tag the experiment.
10+
- `tags`: a Vector of Dictionaries which tag the experiment.
11+
- example tags: [Dict("key" => "foo", "value" => "bar"), Dict("key" => "missy", "value" => "gala")]
1112
1213
# Returns
1314
An object of type [`MLFlowExperiment`](@ref).
1415
1516
"""
16-
function createexperiment(mlf::MLFlow; name=missing, artifact_location=missing, tags=missing)
17+
function createexperiment(mlf::MLFlow; name=missing, artifact_location=missing, tags::Vector{Dict{String, String}}=missing)
1718
endpoint = "experiments/create"
1819

1920
if ismissing(name)
@@ -89,21 +90,22 @@ function getexperiment(mlf::MLFlow, experiment_name::String)
8990
end
9091

9192
"""
92-
getorcreateexperiment(mlf::MLFlow, experiment_name::String; artifact_location=missing, tags=missing)
93+
getorcreateexperiment(mlf::MLFlow, experiment_name::String; artifact_location=missing, tags::Vector{Dict{String, String}}=missing)
9394
9495
Gets an experiment if one alrady exists, or creates a new one.
9596
9697
# Arguments
9798
- `mlf`: [`MLFlow`](@ref) configuration.
9899
- `experiment_name`: Experiment name.
99100
- `artifact_location`: directory where artifacts of this experiment will be stored. If not specified, MLFlow uses its default configuration.
100-
- `tags`: a Dictionary of key-values which tag the experiment.
101+
- `tags`: a Vector of Dictionaries which tag the experiment.
102+
- example tags: [Dict("key" => "foo", "value" => "bar"), Dict("key" => "missy", "value" => "gala")]
101103
102104
# Returns
103105
An instance of type [`MLFlowExperiment`](@ref)
104106
105107
"""
106-
function getorcreateexperiment(mlf::MLFlow, experiment_name::String; artifact_location=missing, tags=missing)
108+
function getorcreateexperiment(mlf::MLFlow, experiment_name::String; artifact_location=missing, tags::Vector{Dict{String, String}}=missing)
107109
experiment = getexperiment(mlf, experiment_name)
108110

109111
if ismissing(experiment)

src/runs.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ Creates a run associated to an experiment.
1010
# Keywords
1111
- `run_name`: run name. If not specified, MLFlow sets it.
1212
- `start_time`: if provided, must be a UNIX timestamp in milliseconds. By default, set to current time.
13-
- `tags`: if provided, must be a key-value structure such as a dictionary.
13+
- `tags`: if provided, must be a key-value structure such as for example:
14+
- [Dict("key" => "foo", "value" => "bar"), Dict("key" => "missy", "value" => "gala")]
1415
1516
# Returns
1617
- an instance of type [`MLFlowRun`](@ref)
1718
"""
18-
function createrun(mlf::MLFlow, experiment_id; run_name=missing, start_time=missing, tags=missing)
19+
function createrun(mlf::MLFlow, experiment_id; run_name=missing, start_time=missing, tags::Vector{Dict{String, String}}=missing)
1920
endpoint = "runs/create"
2021
if ismissing(start_time)
2122
start_time = Int(trunc(datetime2unix(now(UTC)) * 1000))
@@ -24,11 +25,11 @@ function createrun(mlf::MLFlow, experiment_id; run_name=missing, start_time=miss
2425
MLFlowRun(result["run"]["info"], result["run"]["data"])
2526
end
2627
"""
27-
createrun(mlf::MLFlow, experiment::MLFlowExperiment; run_name=missing, start_time=missing, tags=missing)
28+
createrun(mlf::MLFlow, experiment::MLFlowExperiment; run_name=missing, start_time=missing, tags::Vector{Dict{String, String}}=missing)
2829
2930
Dispatches to `createrun(mlf::MLFlow, experiment_id; run_name=run_name, start_time=start_time, tags=tags)`
3031
"""
31-
createrun(mlf::MLFlow, experiment::MLFlowExperiment; run_name=missing, start_time=missing, tags=missing) =
32+
createrun(mlf::MLFlow, experiment::MLFlowExperiment; run_name=missing, start_time=missing, tags::Vector{Dict{String, String}}=missing) =
3233
createrun(mlf, experiment.experiment_id; run_name=run_name, start_time=start_time, tags=tags)
3334

3435
"""

0 commit comments

Comments
 (0)