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/2] 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/2] 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)