From e9fa7307e014fc4d33e695b2251873eb52a01852 Mon Sep 17 00:00:00 2001 From: Romeo Valentin Date: Tue, 2 Sep 2025 16:56:10 +0200 Subject: [PATCH] Fix logmetric array handling in tutorial and examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docs/src/tutorial.md | 5 ++++- examples/simple-with-mlflow.jl | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index d7565c3..f1aa50c 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -95,7 +95,10 @@ for (idx, pricepath) in enumerate(pricepaths) ylabel="Price" ) - logmetric(mlf, exprun, "pricepath$(idx)", pricepath) + # Log each point in the price path as a separate metric with step parameter + for (step, value) in enumerate(pricepath) + logmetric(mlf, exprun, "pricepath$(idx)", Float64(value); step=step-1) + end end # Save the price path plot as an image diff --git a/examples/simple-with-mlflow.jl b/examples/simple-with-mlflow.jl index 13990f0..6999480 100644 --- a/examples/simple-with-mlflow.jl +++ b/examples/simple-with-mlflow.jl @@ -44,7 +44,10 @@ for (idx, pricepath) in enumerate(pricepaths) ylabel="Price" ) - logmetric(mlf, exprun, "pricepath$(idx)", pricepath) + # Log each point in the price path as a separate metric with step parameter + for (step, value) in enumerate(pricepath) + logmetric(mlf, exprun, "pricepath$(idx)", Float64(value); step=step-1) + end end # Save the price path plot as an image