Skip to content

Commit e9fa730

Browse files
RomeoVclaude
andcommitted
Fix logmetric array handling in tutorial and examples
Fixes type error where arrays were passed to logmetric instead of individual Float64 values. Now properly logs each point in the price path as a separate metric with step parameters. Before: logmetric(mlf, exprun, "pricepath$(idx)", pricepath) # ❌ Array After: Loop through array and log individual values with step parameter This approach: - Maintains the original intent of logging price paths over time - Uses MLFlow's step parameter to track the temporal sequence - Creates proper time-series metrics that can be visualized in MLFlow UI - Follows logmetric API requirements (Float64 values only) Fixes #63 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b5bad10 commit e9fa730

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/src/tutorial.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ for (idx, pricepath) in enumerate(pricepaths)
9595
ylabel="Price"
9696
)
9797

98-
logmetric(mlf, exprun, "pricepath$(idx)", pricepath)
98+
# Log each point in the price path as a separate metric with step parameter
99+
for (step, value) in enumerate(pricepath)
100+
logmetric(mlf, exprun, "pricepath$(idx)", Float64(value); step=step-1)
101+
end
99102
end
100103

101104
# Save the price path plot as an image

examples/simple-with-mlflow.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ for (idx, pricepath) in enumerate(pricepaths)
4444
ylabel="Price"
4545
)
4646

47-
logmetric(mlf, exprun, "pricepath$(idx)", pricepath)
47+
# Log each point in the price path as a separate metric with step parameter
48+
for (step, value) in enumerate(pricepath)
49+
logmetric(mlf, exprun, "pricepath$(idx)", Float64(value); step=step-1)
50+
end
4851
end
4952

5053
# Save the price path plot as an image

0 commit comments

Comments
 (0)