From 349df138cd02f3bfceb8b0a295b7cb5919a9eb9c Mon Sep 17 00:00:00 2001 From: Toby Hodges Date: Tue, 1 Apr 2025 12:31:18 +0200 Subject: [PATCH 1/6] replace Anaconda with MiniForge --- learners/setup.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/learners/setup.md b/learners/setup.md index a12264ae0..c73f1106d 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -16,16 +16,14 @@ e.g. your Desktop or a folder you have created for using in this workshop. ## Software -1. Download and install the latest [Anaconda - distribution](https://www.anaconda.com/download/) for your - operating system. Make sure to choose the Python 3 version (as - opposed to the one with Python 2). If you wish to use an existing - installation, be sure to upgrade your scikit-image to at least 0.19. +1. Download and install the latest [MiniForge distribution of Python](https://conda-forge.org/download/) for your operating system. + Make sure to choose the Python 3 version (as opposed to the one with Python 2). + If you wish to use an existing installation, be sure to upgrade your scikit-image to at least 0.19. You can upgrade to the latest scikit-image using the shell command that follows. ::::::::::::::::::::::::::::::::::::::::: callout - ## Updating scikit-image in an existing Anaconda distribution + ## Updating scikit-image in an existing MiniForge distribution ```shell conda upgrade -y scikit-image @@ -83,7 +81,7 @@ e.g. your Desktop or a folder you have created for using in this workshop. ## Instructions for Windows - Launch the Anaconda Prompt program and type `jupyter lab`. + Launch the MiniForge Prompt program and type `jupyter lab`. (Running this command on the standard Command Prompt will return an error: `'conda' is not recognized as an internal or external command, operable program or batch file.`) From 55346f25636b3733ff3a1650f7c53bbd3351a676 Mon Sep 17 00:00:00 2001 From: Toby Hodges Date: Tue, 1 Apr 2025 14:34:41 +0200 Subject: [PATCH 2/6] set up an environment for the workshop --- episodes/files/environment.yml | 11 +++++++++++ learners/setup.md | 28 +++++++++++----------------- 2 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 episodes/files/environment.yml diff --git a/episodes/files/environment.yml b/episodes/files/environment.yml new file mode 100644 index 000000000..d292b8ab5 --- /dev/null +++ b/episodes/files/environment.yml @@ -0,0 +1,11 @@ +name: dc-image +channels: + - conda-forge +dependencies: + - python>=3.11 + - jupyterlab + - numpy + - matplotlib + - pandas + - scikit-image + - ipympl diff --git a/learners/setup.md b/learners/setup.md index c73f1106d..270b294ad 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -7,7 +7,7 @@ Before joining the workshop or following the lesson, please complete the data an ## Data -The example images used in this lesson are available on [FigShare](https://figshare.com/). +The example images and a description of the Python environment used in this lesson are available on [FigShare](https://figshare.com/). To download the data, please visit [the dataset page for this workshop][figshare-data] and click the "Download all" button. Unzip the downloaded file, and save the contents as a folder called `data` somewhere you will easily find it again, @@ -18,26 +18,20 @@ e.g. your Desktop or a folder you have created for using in this workshop. 1. Download and install the latest [MiniForge distribution of Python](https://conda-forge.org/download/) for your operating system. Make sure to choose the Python 3 version (as opposed to the one with Python 2). - If you wish to use an existing installation, be sure to upgrade your scikit-image to at least 0.19. - You can upgrade to the latest scikit-image using the shell command that follows. + If you already have a Python 3 setup that you are happy with, you can continue to use that (we recommend that you make sure your Python version is current). + The next step assumes that `conda` is available to manage your Python environment. +2. Setup an environment to work in during the lesson. + In a terminal or the MiniForge Prompt application, navigate to the location where you saved the unzipped data for the lesson and run the following command: - ::::::::::::::::::::::::::::::::::::::::: callout - - ## Updating scikit-image in an existing MiniForge distribution - - ```shell - conda upgrade -y scikit-image + ```bash + conda env create -f environment.yml ``` - :::::::::::::::::::::::::::::::::::::::::::::::::: - -2. This lesson uses Matplotlib features to display images, and some - interactive features will be valuable. To enable the interactive - tools in JupyterLab, the `ipympl` package is required. The package - can be installed with the command + If prompted, allow `conda` to install the required libraries. +3. Activate the new environment you just created: - ```shell - conda install -c conda-forge ipympl + ```bash + conda activate dc-image ``` ::::::::::::::::::::::::::::::::::::::::: callout From fb6258b3b72022c473ba0e9692d5226789d8cb22 Mon Sep 17 00:00:00 2001 From: Toby Hodges Date: Sun, 6 Apr 2025 11:08:41 +0200 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> --- episodes/files/environment.yml | 2 +- learners/setup.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/episodes/files/environment.yml b/episodes/files/environment.yml index d292b8ab5..bb1b80490 100644 --- a/episodes/files/environment.yml +++ b/episodes/files/environment.yml @@ -6,6 +6,6 @@ dependencies: - jupyterlab - numpy - matplotlib - - pandas - scikit-image - ipympl + - imageio diff --git a/learners/setup.md b/learners/setup.md index 270b294ad..eac31a895 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -21,7 +21,7 @@ e.g. your Desktop or a folder you have created for using in this workshop. If you already have a Python 3 setup that you are happy with, you can continue to use that (we recommend that you make sure your Python version is current). The next step assumes that `conda` is available to manage your Python environment. 2. Setup an environment to work in during the lesson. - In a terminal or the MiniForge Prompt application, navigate to the location where you saved the unzipped data for the lesson and run the following command: + In a terminal (Linux/Mac) or the MiniForge Prompt application (Windows), navigate to the location where you saved the unzipped data for the lesson and run the following command: ```bash conda env create -f environment.yml @@ -77,7 +77,7 @@ e.g. your Desktop or a folder you have created for using in this workshop. Launch the MiniForge Prompt program and type `jupyter lab`. (Running this command on the standard Command Prompt will return an error: - `'conda' is not recognized as an internal or external command, operable program or batch file.`) + `'jupyter' is not recognized as an internal or external command, operable program or batch file.`) ::::::::::::::::::::::::: From 9ae46f2f62b595200445925bfa562304a4d12644 Mon Sep 17 00:00:00 2001 From: Toby Hodges Date: Sun, 6 Apr 2025 11:09:27 +0200 Subject: [PATCH 4/6] Remove mention of Py3 vs Py2 Co-authored-by: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> --- learners/setup.md | 1 - 1 file changed, 1 deletion(-) diff --git a/learners/setup.md b/learners/setup.md index eac31a895..e02de4397 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -17,7 +17,6 @@ e.g. your Desktop or a folder you have created for using in this workshop. ## Software 1. Download and install the latest [MiniForge distribution of Python](https://conda-forge.org/download/) for your operating system. - Make sure to choose the Python 3 version (as opposed to the one with Python 2). If you already have a Python 3 setup that you are happy with, you can continue to use that (we recommend that you make sure your Python version is current). The next step assumes that `conda` is available to manage your Python environment. 2. Setup an environment to work in during the lesson. From 89f5b4723b43df10ab5dab1693b6b837a4a93852 Mon Sep 17 00:00:00 2001 From: Toby Hodges Date: Wed, 7 May 2025 15:23:18 +0200 Subject: [PATCH 5/6] Apply fixes from review Co-authored-by: Marianne Corvellec --- learners/setup.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/learners/setup.md b/learners/setup.md index e02de4397..19773e1de 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -10,16 +10,16 @@ Before joining the workshop or following the lesson, please complete the data an The example images and a description of the Python environment used in this lesson are available on [FigShare](https://figshare.com/). To download the data, please visit [the dataset page for this workshop][figshare-data] and click the "Download all" button. -Unzip the downloaded file, and save the contents as a folder called `data` somewhere you will easily find it again, +Unzip the downloaded file, and save the contents as a folder called `data` somewhere you will easily find it again, e.g. your Desktop or a folder you have created for using in this workshop. (The name `data` is optional but recommended, as this is the name we will use to refer to the folder throughout the lesson.) ## Software -1. Download and install the latest [MiniForge distribution of Python](https://conda-forge.org/download/) for your operating system. +1. Download and install the latest [Miniforge distribution of Python](https://conda-forge.org/download/) for your operating system. If you already have a Python 3 setup that you are happy with, you can continue to use that (we recommend that you make sure your Python version is current). The next step assumes that `conda` is available to manage your Python environment. -2. Setup an environment to work in during the lesson. +2. Set up an environment to work in during the lesson. In a terminal (Linux/Mac) or the MiniForge Prompt application (Windows), navigate to the location where you saved the unzipped data for the lesson and run the following command: ```bash @@ -74,7 +74,7 @@ e.g. your Desktop or a folder you have created for using in this workshop. ## Instructions for Windows - Launch the MiniForge Prompt program and type `jupyter lab`. + Launch the Miniforge Prompt program and type `jupyter lab`. (Running this command on the standard Command Prompt will return an error: `'jupyter' is not recognized as an internal or external command, operable program or batch file.`) From 9c8345e10faaa2ff86260d63e86f37539cd0642d Mon Sep 17 00:00:00 2001 From: Toby Hodges Date: Wed, 7 May 2025 15:26:57 +0200 Subject: [PATCH 6/6] Link to central Python install instructions --- learners/setup.md | 1 + 1 file changed, 1 insertion(+) diff --git a/learners/setup.md b/learners/setup.md index 19773e1de..43f49f299 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -17,6 +17,7 @@ e.g. your Desktop or a folder you have created for using in this workshop. ## Software 1. Download and install the latest [Miniforge distribution of Python](https://conda-forge.org/download/) for your operating system. + ([See more detailed instructions from The Carpentries](https://carpentries.github.io/workshop-template/#python-1).) If you already have a Python 3 setup that you are happy with, you can continue to use that (we recommend that you make sure your Python version is current). The next step assumes that `conda` is available to manage your Python environment. 2. Set up an environment to work in during the lesson.