From 1cffe91ddddfca6db75a1780b2bab283222bed14 Mon Sep 17 00:00:00 2001 From: Marco Dalla Vecchia Date: Mon, 23 Mar 2026 22:19:17 +0100 Subject: [PATCH 1/3] updated root mass values based on fresh new environment --- episodes/07-thresholding.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/episodes/07-thresholding.md b/episodes/07-thresholding.md index cd9ccafc..5ebbe4e4 100644 --- a/episodes/07-thresholding.md +++ b/episodes/07-thresholding.md @@ -512,7 +512,7 @@ measure_root_mass(filename="data/trial-016.jpg", sigma=1.5) ``` ```output -0.0482436835106383` +0.04907247340425532 ``` Now we can use the function to process the series of four images shown above. @@ -525,7 +525,7 @@ and the filenames all start with the **trial-** prefix and end with the **.jpg** suffix. ```python -all_files = glob.glob("data/trial-*.jpg") +all_files = sorted(glob.glob("data/trial-*.jpg")) for filename in all_files: density = measure_root_mass(filename=filename, sigma=1.5) # output in format suitable for .csv @@ -533,10 +533,10 @@ for filename in all_files: ``` ```output -data/trial-016.jpg,0.0482436835106383 -data/trial-020.jpg,0.06346941489361702 -data/trial-216.jpg,0.14073969414893617 -data/trial-293.jpg,0.13607895611702128 +data/trial-016.jpg,0.04907247340425532 +data/trial-020.jpg,0.06381366356382978 +data/trial-216.jpg,0.14205152925531914 +data/trial-293.jpg,0.13665791223404256 ``` ::::::::::::::::::::::::::::::::::::::: challenge From b958160e5742e7945a46c54d399fb7cf2d486f43 Mon Sep 17 00:00:00 2001 From: Marco Dalla Vecchia Date: Mon, 23 Mar 2026 22:29:43 +0100 Subject: [PATCH 2/3] added callout block to highlight the importance of reproducible environments --- episodes/07-thresholding.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/episodes/07-thresholding.md b/episodes/07-thresholding.md index 5ebbe4e4..4e12e6ba 100644 --- a/episodes/07-thresholding.md +++ b/episodes/07-thresholding.md @@ -539,6 +539,14 @@ data/trial-216.jpg,0.14205152925531914 data/trial-293.jpg,0.13665791223404256 ``` +::::::::::::::::::::::::::::::::::::::::: callout + +Compare your results with the values above. Do they match exactly? You may find that certain decimal values differ slightly, even when using identical input parameters. + +This variation often stems from the specific versions of your installed packages (such as `numpy` or `scikit-image`). As these libraries evolve, updates can introduce subtle changes in numerical handling, underlying algorithms, or rounding logic. This highlights why reproducible environments, as well as reproducible code, are essential for consistent scientific computing. + +::::::::::::::::::::::::::::::::::::::::: + ::::::::::::::::::::::::::::::::::::::: challenge ## Ignoring more of the images -- brainstorming (10 min) From ad79637363bc3535bfe63b141ad3f6faa0092550 Mon Sep 17 00:00:00 2001 From: Marco Dalla Vecchia Date: Tue, 24 Mar 2026 21:16:58 +0100 Subject: [PATCH 3/3] more updated values after re-running with fresh updated environment --- episodes/07-thresholding.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/episodes/07-thresholding.md b/episodes/07-thresholding.md index 4e12e6ba..43b79e84 100644 --- a/episodes/07-thresholding.md +++ b/episodes/07-thresholding.md @@ -383,7 +383,7 @@ print("Found automatic threshold t = {}.".format(t)) ``` ```output -Found automatic threshold t = 0.4172454549881862. +Found automatic threshold t = 0.4116003928683858. ``` For this root image and a Gaussian blur with the chosen sigma of 1.0, @@ -658,7 +658,7 @@ def enhanced_root_mass(filename, sigma): return density -all_files = glob.glob("data/trial-*.jpg") +all_files = sorted(glob.glob("data/trial-*.jpg")) for filename in all_files: density = enhanced_root_mass(filename=filename, sigma=1.5) # output in format suitable for .csv @@ -669,10 +669,10 @@ The output of the improved program does illustrate that the white circles and labels were skewing our root mass ratios: ```output -data/trial-016.jpg,0.046250166223404256 -data/trial-020.jpg,0.05886968085106383 -data/trial-216.jpg,0.13712117686170214 -data/trial-293.jpg,0.13190342420212767 +data/trial-016.jpg,0.046261136968085106 +data/trial-020.jpg,0.05887167553191489 +data/trial-216.jpg,0.13712067819148935 +data/trial-293.jpg,0.1319044215425532 ``` :::::::::::::::::::::::::::::::::::::::::: spoiler