Skip to content

Commit 12db7ed

Browse files
committed
document constructors
1 parent c5bd7a7 commit 12db7ed

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

src/types.jl

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
"""
2-
MLFlow(baseuri; apiversion)
2+
MLFlow
33
44
Base type which defines location and version for MLFlow API service.
55
66
# Fields
77
- `baseuri::String`: base MLFlow tracking URI, e.g. `http://localhost:5000`
88
- `apiversion`: used API version, e.g. `2.0`
99
10+
# Constructors
11+
12+
- `MLFlow(baseuri; apiversion=2.0)`
1013
# Examples
1114
``` julia-repl
1215
julia> mlf = MLFlow("http://localhost:5000")
1316
MLFlow("http://localhost:5000", 2.0)
1417
```
18+
1519
"""
1620
struct MLFlow
1721
baseuri::String
@@ -30,6 +34,12 @@ Represents an MLFlow experiment.
3034
- `experiment_id::Integer`: experiment identifier.
3135
- `tags::Any`: list of tags.
3236
- `artifact_location::String`: where are experiment artifacts stored.
37+
38+
# Constructors
39+
40+
- `MLFlowExperiment(name, lifecycle_stage, experiment_id, tags, artifact_location)`
41+
- `MLFlowExperiment(exp::Dict{String,Any})`
42+
3343
"""
3444
struct MLFlowExperiment
3545
name::String
@@ -60,11 +70,14 @@ Represents the status of an MLFlow Run.
6070
# Fields
6171
- `status::String`: one of RUNNING/SCHEDULED/FINISHED/FAILED/KILLED
6272
73+
# Constructors
74+
75+
- `MLFlowRunStatus(status::String)`
6376
"""
6477
struct MLFlowRunStatus
6578
status::String
6679

67-
function MLFlowRunStatus(status)
80+
function MLFlowRunStatus(status::String)
6881
acceptable_statuses = ["RUNNING", "SCHEDULED", "FINISHED", "FAILED", "KILLED"]
6982
status acceptable_statuses || error("Invalid status $status - choose one of $acceptable_statuses")
7083
new(status)
@@ -84,6 +97,11 @@ Represents run metadata.
8497
- `end_time::Union{Int64,Missing}`: when did the run end, UNIX time in milliseconds.
8598
- `artifact_uri::String`: where are artifacts from this run stored.
8699
- `lifecycle_stage::String`: one of `active` or `deleted`.
100+
101+
# Constructors
102+
103+
- `MLFlowRunInfo(run_id, experiment_id, status, start_time, end_time, artifact_uri, lifecycle_stage)`
104+
- `MLFlowRunInfo(info::Dict{String,Any})`
87105
"""
88106
struct MLFlowRunInfo
89107
run_id::String
@@ -137,6 +155,11 @@ Represents a metric.
137155
- `value::Float64`: metric value.
138156
- `step::Int64`: step.
139157
- `timestamp::Int64`: timestamp in UNIX time in milliseconds.
158+
159+
# Constructors
160+
161+
- `MLFlowRunDataMetric(d::Dict{String,Any})`
162+
140163
"""
141164
struct MLFlowRunDataMetric
142165
key::String
@@ -163,6 +186,10 @@ Represents run data.
163186
- `params::Dict{String,String}`: run parameters.
164187
- `tags`: list of run tags.
165188
189+
# Constructors
190+
191+
- `MLFlowRunData(data::Dict{String,Any})`
192+
166193
"""
167194
struct MLFlowRunData
168195
metrics::Vector{MLFlowRunDataMetric}
@@ -192,6 +219,13 @@ Represents an MLFlow run.
192219
- `info::MLFlowRunInfo`: Run metadata.
193220
- `data::MLFlowRunData`: Run data.
194221
222+
# Constructors
223+
224+
- `MLFlowRun(rundata::MLFlowRunData)`
225+
- `MLFlowRun(runinfo::MLFlowRunInfo)`
226+
- `MLFlowRun(info::Dict{String,Any})`
227+
- `MLFlowRun(info::Dict{String,Any}, data::Dict{String,Any})`
228+
195229
"""
196230
struct MLFlowRun
197231
info::Union{MLFlowRunInfo,Missing}

0 commit comments

Comments
 (0)