From 329cf41af752c8d58e92c6a1e28fc116f8eff4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 7 Sep 2022 17:03:20 -0700 Subject: [PATCH 01/91] Adding basic test configuration to tox.ini --- ignore_testing | 4 ++++ tox.ini | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 ignore_testing create mode 100644 tox.ini diff --git a/ignore_testing b/ignore_testing new file mode 100644 index 00000000..a72bcd51 --- /dev/null +++ b/ignore_testing @@ -0,0 +1,4 @@ +content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md +content/pairing.md +content/tutorial-style-guide.md +content/tutorial-nlp-from-scratch.md diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..9cffae32 --- /dev/null +++ b/tox.ini @@ -0,0 +1,38 @@ +[tox] +envlist = + py{38,39,310}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} +requires = + pip >= 19.3.1 + +[testenv] + +description = run tests + +deps = + # We use these files to specify all the dependencies, and below we override + # versions for specific testing schenarios + -rsite/requirements.txt + -rrequirements.txt + + # TODO: be clever and use the nightly wheels instead + devdeps: git+https://github.com/numpy/numpy.git#egg=numpy + + # TODO: add the oldest supported versions of all the dependencies here + # oldestdeps: numpy==1.18 + # oldestdeps: matplotlib==3.1.2 + # oldestdeps: scipy==1.4 + +commands = + pip freeze + + # Ignore testing the tutorials listed in ignore_testing file + !buildhtml: bash -c 'find content -name "*.md" | grep -vf ignore_testing | xargs jupytext --to notebook ' + + !buildhtml: pytest --nbval-lax --durations=10 content/ + buildhtml: make -C site/ SPHINXOPTS="-nWT --keep-going" html + +pip_pre = + predeps: true + !predeps: false + +skip_install = true From 21168e5122c9cf66694919c005b9fc7a6931423c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 7 Sep 2022 17:18:10 -0700 Subject: [PATCH 02/91] Converting the current GHA test matrix to use tox --- .github/workflows/notebooks.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 9489bff9..b38678fa 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -18,6 +18,7 @@ jobs: matrix: os: [Ubuntu-20.04, macOS-latest] python-version: [3.8, 3.9, "3.10"] + toxenv: test steps: - uses: actions/checkout@v2 @@ -27,18 +28,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | - python -m pip install -r site/requirements.txt -r requirements.txt - python -m pip list + run: python -m pip install --upgrade tox - name: Test with nbval - run: | - python -m pip install pytest nbval - find content/ -name "*.md" -exec jupytext --to notebook {} \; - # TODO: find better way to exclude notebooks from test - rm content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.ipynb - rm content/pairing.ipynb - rm content/tutorial-style-guide.ipynb - rm content/tutorial-nlp-from-scratch.ipynb - # Test notebook execution - pytest --nbval-lax --durations=10 content/ + run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} From 2f524faaa03f72b04186263da5ac348b52d54790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 7 Sep 2022 17:39:36 -0700 Subject: [PATCH 03/91] Reworking the gha matrix --- .github/workflows/notebooks.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index b38678fa..86eb5eca 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -17,8 +17,15 @@ jobs: max-parallel: 12 matrix: os: [Ubuntu-20.04, macOS-latest] - python-version: [3.8, 3.9, "3.10"] - toxenv: test + include: + - python-version: '3.8' + toxenv: py38-test-oldestdeps + + - python-version: '3.9' + toxenv: py39-test + + - python-version: '3.10' + toxenv: py310-test steps: - uses: actions/checkout@v2 From 87cea397c380b83063e896f82118184c9c26abcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 7 Sep 2022 17:43:51 -0700 Subject: [PATCH 04/91] Specifying test requirements --- test_requirements.txt | 2 ++ tox.ini | 1 + 2 files changed, 3 insertions(+) create mode 100644 test_requirements.txt diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 00000000..d20d5b24 --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1,2 @@ +pytest +nbval diff --git a/tox.ini b/tox.ini index 9cffae32..a4e623d0 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ description = run tests deps = # We use these files to specify all the dependencies, and below we override # versions for specific testing schenarios + -rtest_requirements.txt -rsite/requirements.txt -rrequirements.txt From 8901a9197f98eae36b62c558d89d535c407ad4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 21 Sep 2022 08:12:03 -0700 Subject: [PATCH 05/91] CI: using nightly wheels for testing --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index a4e623d0..5d75fc75 100644 --- a/tox.ini +++ b/tox.ini @@ -15,8 +15,9 @@ deps = -rsite/requirements.txt -rrequirements.txt - # TODO: be clever and use the nightly wheels instead - devdeps: git+https://github.com/numpy/numpy.git#egg=numpy + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib # TODO: add the oldest supported versions of all the dependencies here # oldestdeps: numpy==1.18 From 36b441e51c0f4cf5e65769f2d87700937ec9993e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 21 Sep 2022 08:14:14 -0700 Subject: [PATCH 06/91] MAINT: adding more generated content to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index fe8151b1..a1654131 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,6 @@ site/notebooks/* content/mooreslaw_regression* content/tutorial-x-ray-image-processing/xray_image.gif content/video +content/*ipynb +content/tutorial-nlp-from-scratch/parameters.npy +content/tutorial-nlp-from-scratch/*ipynb \ No newline at end of file From bb2b4b7039da7ed1911c6f3a0ee26b96af689f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 21 Sep 2022 12:06:15 -0700 Subject: [PATCH 07/91] CI: run dev version testing in CI --- .github/workflows/notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 86eb5eca..9c8377ec 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -25,7 +25,7 @@ jobs: toxenv: py39-test - python-version: '3.10' - toxenv: py310-test + toxenv: py310-test-devdeps steps: - uses: actions/checkout@v2 From 466e6b4409891b5b3435d0c8aaf9d13cc023afea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 16 Nov 2022 18:32:41 -0800 Subject: [PATCH 08/91] CI: moving devdeps installs to commans --- tox.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 5d75fc75..71b8a547 100644 --- a/tox.ini +++ b/tox.ini @@ -15,16 +15,16 @@ deps = -rsite/requirements.txt -rrequirements.txt - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib - # TODO: add the oldest supported versions of all the dependencies here # oldestdeps: numpy==1.18 # oldestdeps: matplotlib==3.1.2 # oldestdeps: scipy==1.4 commands = + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib + pip freeze # Ignore testing the tutorials listed in ignore_testing file From e0b0d6aa38c43fdbbd1b972965c03068c8770bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 16 Nov 2022 19:42:09 -0800 Subject: [PATCH 09/91] CI: updating actions versions (#153) --- .github/workflows/conda.yml | 5 ++--- .github/workflows/notebooks.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index c58fbc9a..55d773fe 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -21,7 +21,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true @@ -40,7 +40,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: sphinx-build-artifact path: site/_build/html/reports @@ -48,4 +48,3 @@ jobs: - name: fail on build errors if: steps.build_step.outcome != 'success' run: exit 1 - diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 9489bff9..337591db 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -20,9 +20,9 @@ jobs: python-version: [3.8, 3.9, "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 9341046cd08b30e125903cbf8e0d15ce29019611 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 17 Nov 2022 12:44:38 -0800 Subject: [PATCH 10/91] MAINT: Replace polyfit/polyval with Polynomial class. The Polynomial class is recommended over the poly* functional interface for new code. --- content/tutorial-ma.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/content/tutorial-ma.md b/content/tutorial-ma.md index f4aa9a98..28260673 100644 --- a/content/tutorial-ma.md +++ b/content/tutorial-ma.md @@ -268,10 +268,9 @@ Finally, we can use the [numpy.polyfit](https://numpy.org/devdocs/reference/gene ```{code-cell} t = np.arange(len(china_total)) -params = np.polyfit(t[~china_total.mask], valid, 3) -cubic_fit = np.polyval(params, t) +model = np.polynomial.Polynomial.fit(t[~china_total.mask], valid, 3) plt.plot(t, china_total) -plt.plot(t, cubic_fit, "--") +plt.plot(t, model(t), "--") ``` This plot is not so readable since the lines seem to be over each other, so let's summarize in a more elaborate plot. We'll plot the real data when @@ -279,10 +278,10 @@ available, and show the cubic fit for unavailable data, using this fit to comput ```{code-cell} plt.plot(t, china_total) -plt.plot(t[china_total.mask], cubic_fit[china_total.mask], "--", color="orange") -plt.plot(7, np.polyval(params, 7), "r*") +plt.plot(t[china_total.mask], model(t)[china_total.mask], "--", color="orange") +plt.plot(7, model(7), "r*") plt.xticks([0, 7, 13], dates[[0, 7, 13]]) -plt.yticks([0, np.polyval(params, 7), 10000, 17500]) +plt.yticks([0, model(7), 10000, 17500]) plt.legend(["Mainland China", "Cubic estimate", "7 days after start"]) plt.title( "COVID-19 cumulative cases from Jan 21 to Feb 3 2020 - Mainland China\n" From 49430a3df35d75d34c01d27b9c94a89e8fbd679a Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 17 Nov 2022 13:13:54 -0800 Subject: [PATCH 11/91] MAINT: Update text to match example. --- content/tutorial-ma.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/tutorial-ma.md b/content/tutorial-ma.md index 28260673..90a7fa31 100644 --- a/content/tutorial-ma.md +++ b/content/tutorial-ma.md @@ -264,11 +264,13 @@ Now, if we want to create a very simple approximation for this data, we should t dates[~china_total.mask] ``` -Finally, we can use the [numpy.polyfit](https://numpy.org/devdocs/reference/generated/numpy.polyfit.html#numpy.polyfit) and [numpy.polyval](https://numpy.org/devdocs/reference/generated/numpy.polyval.html#numpy.polyval) functions to create a cubic polynomial that fits the data as best as possible: +Finally, we can use the +[fitting functionality of the numpy.polynomial](https://numpy.org/doc/stable/reference/generated/numpy.polynomial.polynomial.Polynomial.fit.html) +package to create a cubic polynomial model that fits the data as best as possible: ```{code-cell} t = np.arange(len(china_total)) -model = np.polynomial.Polynomial.fit(t[~china_total.mask], valid, 3) +model = np.polynomial.Polynomial.fit(t[~china_total.mask], valid, deg=3) plt.plot(t, china_total) plt.plot(t, model(t), "--") ``` From 5c4223a77279be855fe10b83ec38c5c803306709 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Mon, 5 Dec 2022 22:46:37 -0800 Subject: [PATCH 12/91] BLD: temporary pin to fix lexer. --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 63b2eefa..0f958b62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,5 @@ statsmodels imageio # For supporting .md-based notebooks jupytext +# Temporary fix for lexer errors +ipython!=8.7.0 From 00ad5045069d906b792bfa3f95512732cc245c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Mon, 12 Dec 2022 19:33:32 -0800 Subject: [PATCH 13/91] MAINT: fixing compatibility of tox v4 (#161) --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 71b8a547..a3c005b6 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,8 @@ deps = # oldestdeps: matplotlib==3.1.2 # oldestdeps: scipy==1.4 +allowlist_externals = bash + commands = devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy From a692a1559cabe6e07e9a82d8f4db36404e3c2b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Mon, 12 Dec 2022 23:44:14 -0800 Subject: [PATCH 14/91] MAINT: adding python version for binder --- runtime.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 runtime.txt diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 00000000..55090899 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.10 From f1ea3e3e0b319a20e253b2d6e4243a8932b1186a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 5 Jan 2023 14:47:42 -0800 Subject: [PATCH 15/91] MAINT: executable books are not yet sphinx5 compatible, help version resolution here --- site/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/requirements.txt b/site/requirements.txt index e040deba..8514cae9 100644 --- a/site/requirements.txt +++ b/site/requirements.txt @@ -1,4 +1,4 @@ -sphinx +sphinx<5 myst-nb sphinx-book-theme sphinx-copybutton From 699525a9c9ee991e2a397712aa885270eab136bf Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 5 Jan 2023 15:39:04 -0800 Subject: [PATCH 16/91] STY: Idiomatic use of arange. 0 and 1 are the default start and step respectively, so no need to explicitly include them. --- content/save-load-arrays.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/save-load-arrays.md b/content/save-load-arrays.md index 1960d0de..434c7370 100644 --- a/content/save-load-arrays.md +++ b/content/save-load-arrays.md @@ -68,7 +68,7 @@ will assign `x` to the integers from 0 to 9 using [`np.arange`](https://numpy.org/doc/stable/reference/generated/numpy.arange.html). ```{code-cell} -x = np.arange(0, 10, 1) +x = np.arange(10) y = x ** 2 print(x) print(y) From 01aad12650d084864b87c81df782260bf4240392 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 5 Jan 2023 16:36:29 -0800 Subject: [PATCH 17/91] CI: Update circleci deploy key (#164) See: https://circleci.com/blog/january-4-2023-security-alert/ --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a8df5dab..9e5be957 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,7 +70,7 @@ jobs: - add_ssh_keys: fingerprints: - db:84:df:44:ad:77:d0:aa:2d:81:c9:73:30:9d:21:37 + 5c:54:62:37:75:7f:4d:14:f4:07:82:1c:50:0d:ee:9b - run: name: deploy to gh-pages From a6df091245c3f8e5fe6c07c90c8b7691f1d17865 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 15 Jan 2023 22:05:14 -0800 Subject: [PATCH 18/91] MAINT: move non-executable content to its own category. (#148) * MAINT: move non-executable content to its own category. * Add warnings to untested articles. --- ...inforcement-learning-with-pong-from-pixels.md | 8 ++++++++ content/tutorial-nlp-from-scratch.md | 6 ++++++ site/applications.md | 2 -- site/articles.md | 13 +++++++++++++ site/index.md | 16 ++++++++++++++++ 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 site/articles.md diff --git a/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md b/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md index 3ef3de03..69607388 100644 --- a/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md +++ b/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md @@ -14,6 +14,14 @@ kernelspec: # Deep reinforcement learning with Pong from pixels +```{caution} + +This article is not currently tested due to licensing/installation issues with +the underlying `gym` and `atari-py` dependencies. +Help improve this article by developing an example with reduced dependency +footprint! +``` + This tutorial demonstrates how to implement a deep reinforcement learning (RL) agent from scratch using a policy gradient method that learns to play the [Pong](https://gym.openai.com/envs/Pong-v0/) video game using screen pixels as inputs with NumPy. Your Pong agent will obtain experience on the go using an [artificial neural network](https://en.wikipedia.org/wiki/Artificial_neural_network) as its [policy](https://en.wikipedia.org/wiki/Reinforcement_learning). Pong is a 2D game from 1972 where two players use "rackets" to play a form of table tennis. Each player moves the racket up and down the screen and tries to hit a ball in their opponent's direction by touching it. The goal is to hit the ball such that it goes past the opponent's racket (they miss their shot). According to the rules, if a player reaches 21 points, they win. In Pong, the RL agent that learns to play against an opponent is displayed on the right. diff --git a/content/tutorial-nlp-from-scratch.md b/content/tutorial-nlp-from-scratch.md index 865fd1c9..68a31d27 100644 --- a/content/tutorial-nlp-from-scratch.md +++ b/content/tutorial-nlp-from-scratch.md @@ -15,6 +15,12 @@ jupyter: # Sentiment Analysis on notable speeches of the last decade +```{caution} + +This article is not currently tested. Help improve this tutorial by making it +fully executable! +``` + This tutorial demonstrates how to build a simple Long Short Term memory network (LSTM) from scratch in NumPy to perform sentiment analysis on a socially relevant and ethically acquired dataset. Your deep learning model (the LSTM) is a form of a Recurrent Neural Network and will learn to classify a piece of text as positive or negative from the IMDB reviews dataset. The dataset contains 50,000 movie reviews and corresponding labels. Based on the numeric representations of these reviews and their corresponding labels (supervised learning) the neural network will be trained to learn the sentiment using forward propagation and backpropagation through time since we are dealing with sequential data here. The output will be a vector containing the probabilities that the text samples are positive. diff --git a/site/applications.md b/site/applications.md index 743143b0..fa81374e 100644 --- a/site/applications.md +++ b/site/applications.md @@ -10,8 +10,6 @@ maxdepth: 1 content/mooreslaw-tutorial content/tutorial-deep-learning-on-mnist -content/tutorial-deep-reinforcement-learning-with-pong-from-pixels -content/tutorial-nlp-from-scratch content/tutorial-x-ray-image-processing content/tutorial-static_equilibrium content/tutorial-plotting-fractals diff --git a/site/articles.md b/site/articles.md new file mode 100644 index 00000000..8540ed69 --- /dev/null +++ b/site/articles.md @@ -0,0 +1,13 @@ +# Articles + +```{admonition} Help improve the tutorials! + +Want to make a valuable contribution to the tutorials? Consider working on +these articles so that they become fully executable/reproducible! +``` + +```{toctree} + +content/tutorial-deep-reinforcement-learning-with-pong-from-pixels +content/tutorial-nlp-from-scratch +``` diff --git a/site/index.md b/site/index.md index 6d6baa3a..c15d6877 100644 --- a/site/index.md +++ b/site/index.md @@ -31,6 +31,22 @@ applications contributing ``` +### Non-executable articles + +```{admonition} Help improve the tutorials! + +Want to make a valuable contribution to the tutorials? Consider contributing to +these existing articles to help make them fully executable and reproducible! +``` + +```{toctree} +--- +maxdepth: 2 +--- + +articles +``` + ## Useful links and resources The following links may be useful: From 39c8d5da8478c07895bb9c09f0d256c6f259e602 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 15 Jan 2023 22:10:26 -0800 Subject: [PATCH 19/91] Update circleci to Python 3.10 images. --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e5be957..716a2610 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: build-docs: working_directory: ~/repo docker: - - image: cimg/python:3.8 + - image: cimg/python:3.10 steps: - checkout @@ -49,7 +49,7 @@ jobs: deploy-docs: working_directory: ~/repo docker: - - image: circleci/python:3.8.5-buster + - image: cimg/python:3.10 steps: - checkout From 60295b24efe5fe016f18dae36bc51c303d25c4c6 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 15 Jan 2023 22:12:13 -0800 Subject: [PATCH 20/91] Ubuntu-20.04 -> Ubuntu-latest. --- .github/workflows/notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 8fe7c5ac..6fe30072 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -16,7 +16,7 @@ jobs: strategy: max-parallel: 12 matrix: - os: [Ubuntu-20.04, macOS-latest] + os: [Ubuntu-latest, macOS-latest] include: - python-version: '3.8' toxenv: py38-test-oldestdeps From 82c5bee230cbe2c9512465573ec7c9bf0f032ee4 Mon Sep 17 00:00:00 2001 From: Oriol Abril-Pla Date: Mon, 16 Jan 2023 07:14:27 +0100 Subject: [PATCH 21/91] Fix link in svd tutorial (#167) * Fix link in svd tutorial Co-authored-by: Ross Barnowski --- content/tutorial-svd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-svd.md b/content/tutorial-svd.md index 3a0b58cd..cafc9697 100644 --- a/content/tutorial-svd.md +++ b/content/tutorial-svd.md @@ -134,7 +134,7 @@ It is possible to use methods from linear algebra to approximate an existing set +++ -**Note**: We will use NumPy's linear algebra module, [numpy.linalg](https://numpy.org/devdocs/reference/routines.linalg.html#module-numpy.linalg), to perform the operations in this tutorial. Most of the linear algebra functions in this module can also be found in [scipy.linalg](https://docs.scipy.org/doc/scipy/reference/linalg.html#module-scipy.linalg), and users are encouraged to use the [scipy](https://docs.scipy.org/doc/scipy/reference/index.html#module-scipy) module for real-world applications. However, some functions in the [scipy.linalg](https://docs.scipy.org/doc/scipy/reference/linalg.html#module-scipy.linalg) module, such as the SVD function, only support 2D arrays. For more information on this, check the [scipy.linalg Reference](https://docs.scipy.org/doc/scipy/reference/tutorial/linalg.html). +**Note**: We will use NumPy's linear algebra module, [numpy.linalg](https://numpy.org/devdocs/reference/routines.linalg.html#module-numpy.linalg), to perform the operations in this tutorial. Most of the linear algebra functions in this module can also be found in [scipy.linalg](https://docs.scipy.org/doc/scipy/reference/linalg.html#module-scipy.linalg), and users are encouraged to use the [scipy](https://docs.scipy.org/doc/scipy/reference/index.html#module-scipy) module for real-world applications. However, some functions in the [scipy.linalg](https://docs.scipy.org/doc/scipy/reference/linalg.html#module-scipy.linalg) module, such as the SVD function, only support 2D arrays. For more information on this, check the [scipy.linalg page](https://docs.scipy.org/doc/scipy/tutorial/linalg.html). +++ From 707d7a33d21c236e9dbc67229a8ae069cf53a5ce Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 15 Jan 2023 22:28:19 -0800 Subject: [PATCH 22/91] Rm temp IPython pin. --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0f958b62..63b2eefa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,3 @@ statsmodels imageio # For supporting .md-based notebooks jupytext -# Temporary fix for lexer errors -ipython!=8.7.0 From 81ec6ef204678a7f094af50b36075bb94d2d19ab Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 15 Jan 2023 22:35:40 -0800 Subject: [PATCH 23/91] Bump copyright and license dates. --- LICENSE.txt | 2 +- site/conf.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 8ce64521..014d51c9 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2005-2020, NumPy Developers. +Copyright (c) 2005-2023, NumPy Developers. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/site/conf.py b/site/conf.py index b9ab2a01..e1fe5b63 100644 --- a/site/conf.py +++ b/site/conf.py @@ -12,9 +12,10 @@ # -- Project information ----------------------------------------------------- +from datetime import date project = 'NumPy tutorials' -copyright = '2020, the NumPy community' +copyright = f'2020-{date.today().year}, the NumPy community' author = 'the NumPy community' From 7c649030d01bdeba9a4f803308a958786f59a110 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 15 Jan 2023 23:28:46 -0800 Subject: [PATCH 24/91] Use f-strings instead of str concat for train/eval summary. --- content/tutorial-deep-learning-on-mnist.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/content/tutorial-deep-learning-on-mnist.md b/content/tutorial-deep-learning-on-mnist.md index 82aea978..63dbdbce 100644 --- a/content/tutorial-deep-learning-on-mnist.md +++ b/content/tutorial-deep-learning-on-mnist.md @@ -544,17 +544,13 @@ for j in range(epochs): # Summarize error and accuracy metrics at each epoch print( - "\n" - + "Epoch: " - + str(j) - + " Training set error:" - + str(training_loss / float(len(training_images)))[0:5] - + " Training set accuracy:" - + str(training_accurate_predictions / float(len(training_images))) - + " Test set error:" - + str(test_loss / float(len(test_images)))[0:5] - + " Test set accuracy:" - + str(test_accurate_predictions / float(len(test_images))) + ( + f"Epoch: {j}\n" + f" Training set error: {training_loss / len(training_images):.3f}\n" + f" Training set accuracy: {training_accurate_predictions / len(training_images)}\n" + f" Test set error: {test_loss / len(test_images):.3f}\n" + f" Test set accuracy: {test_accurate_predictions / len(test_images)}" + ) ) ``` From 8d6e6d734e2076b5211ecafc8b7a05f8706cd704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 16 Mar 2023 14:58:22 -0700 Subject: [PATCH 25/91] MAINT: rename workflow to reflect purpose --- .github/workflows/{notebooks.yml => ci_tests_run_notebooks.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{notebooks.yml => ci_tests_run_notebooks.yml} (100%) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml similarity index 100% rename from .github/workflows/notebooks.yml rename to .github/workflows/ci_tests_run_notebooks.yml From 81753e38b83bc8048fe10e25460d435cbad36d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 16 Mar 2023 14:50:56 -0700 Subject: [PATCH 26/91] CI: fix matrix logic to run all the jobs --- .github/workflows/ci_tests_run_notebooks.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 6fe30072..f239e472 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -9,23 +9,30 @@ on: - main schedule: - cron: '0 5 * * 1' + workflow_dispatch: jobs: - build: + tests: + name: ${{ matrix.os }} ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: - max-parallel: 12 matrix: - os: [Ubuntu-latest, macOS-latest] + # Run all supported OS for one Python version, then add a few extra scenarios + os: [ubuntu-latest, macos-latest] + python-version: ['3.9'] + toxenv: [py39-test] + name: ['with Python 3.9',] + include: - python-version: '3.8' toxenv: py38-test-oldestdeps - - - python-version: '3.9' - toxenv: py39-test + name: with Python 3.8 and oldest versioned dependencies + os: ubuntu-latest - python-version: '3.10' toxenv: py310-test-devdeps + name: with Python 3.10 with developer versioned dependencies + os: ubuntu-latest steps: - uses: actions/checkout@v3 From d8cf97d078ea5f76791587d7ebbfee6aed2dcbed Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 20 Apr 2023 10:53:19 -0700 Subject: [PATCH 27/91] CI: Add CIRCLE_TOKEN to fix artifact redirection. This will only work if CIRCLE_TOKEN is available. --- .github/workflows/circleci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index 5115024b..be39709f 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -8,5 +8,6 @@ jobs: uses: larsoner/circleci-artifacts-redirector-action@master with: repo-token: ${{ secrets.GITHUB_TOKEN }} + api-token: ${{ secrets.CIRCLE_TOKEN }} artifact-path: 0/site/_build/html/index.html circleci-jobs: build-docs From b51cb68586d0c207a9d7b5428d815b6af0bdb7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 15 Mar 2023 12:33:32 -0700 Subject: [PATCH 28/91] CI: adding windows testing to CI --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index f239e472..f557bea0 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: # Run all supported OS for one Python version, then add a few extra scenarios - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] python-version: ['3.9'] toxenv: [py39-test] name: ['with Python 3.9',] From 188a39ea2a8d2eee44d5bcfa773eb8f4a3f4b426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 15 Mar 2023 12:29:06 -0700 Subject: [PATCH 29/91] CI: adding python 3.11 testing to CI --- .github/workflows/ci_tests_run_notebooks.yml | 9 +++++++-- tox.ini | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index f557bea0..8695b72d 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -30,8 +30,13 @@ jobs: os: ubuntu-latest - python-version: '3.10' - toxenv: py310-test-devdeps - name: with Python 3.10 with developer versioned dependencies + toxenv: py310-test + name: with Python 3.10 + os: ubuntu-latest + + - python-version: '3.11' + toxenv: py311-test-devdeps + name: with Python 3.11 and developer versioned dependencies os: ubuntu-latest steps: diff --git a/tox.ini b/tox.ini index a3c005b6..d1035f67 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{38,39,310}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} + py{38,39,310,311}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} requires = pip >= 19.3.1 From f0a34c9d2d6a60a581257a88469f2502e9b5fafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 19 Apr 2023 18:31:09 -0700 Subject: [PATCH 30/91] CI: adding oldest dependencies check to matrix, and more devdeps dependencies, too --- tox.ini | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index d1035f67..769f71e7 100644 --- a/tox.ini +++ b/tox.ini @@ -15,10 +15,11 @@ deps = -rsite/requirements.txt -rrequirements.txt - # TODO: add the oldest supported versions of all the dependencies here - # oldestdeps: numpy==1.18 - # oldestdeps: matplotlib==3.1.2 - # oldestdeps: scipy==1.4 + oldestdeps: numpy==1.20 + oldestdeps: matplotlib==3.4 + oldestdeps: scipy==1.6 + oldestdeps: pandas==1.2 + oldestdeps: statsmodels==0.13 allowlist_externals = bash @@ -26,6 +27,8 @@ commands = devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas + devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple statsmodels pip freeze From 86fc4aaa3be05e425f6bbf90ab2482a5d1e115fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 20 Apr 2023 09:24:30 -0700 Subject: [PATCH 31/91] CI: dropping python 3.8 testing --- .github/workflows/ci_tests_run_notebooks.yml | 17 ++++++----------- tox.ini | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 8695b72d..5051dc9e 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -19,19 +19,14 @@ jobs: matrix: # Run all supported OS for one Python version, then add a few extra scenarios os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.9'] - toxenv: [py39-test] - name: ['with Python 3.9',] + python-version: ['3.10'] + toxenv: [py310-test] + name: ['with Python 3.10',] include: - - python-version: '3.8' - toxenv: py38-test-oldestdeps - name: with Python 3.8 and oldest versioned dependencies - os: ubuntu-latest - - - python-version: '3.10' - toxenv: py310-test - name: with Python 3.10 + - python-version: '3.9' + toxenv: py39-test-oldestdeps + name: with Python 3.9 and oldest versioned dependencies os: ubuntu-latest - python-version: '3.11' diff --git a/tox.ini b/tox.ini index 769f71e7..b14c817d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{38,39,310,311}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} + py{39,310,311}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} requires = pip >= 19.3.1 From ab2acfdb844f455b7f9542b4ad9add776e0f0a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Mon, 24 Apr 2023 18:48:35 -0700 Subject: [PATCH 32/91] CI: let the full CI run even when a job is failing --- .github/workflows/ci_tests_run_notebooks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 5051dc9e..9b55c58f 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -16,6 +16,7 @@ jobs: name: ${{ matrix.os }} ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: # Run all supported OS for one Python version, then add a few extra scenarios os: [ubuntu-latest, macos-latest, windows-latest] From 2bc7a2f4ea2f97d2efe8078e8c0b7dc79788c702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Mon, 24 Apr 2023 18:52:48 -0700 Subject: [PATCH 33/91] MAINT: temporarily limit imageIO version --- environment.yml | 5 +++-- requirements.txt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index 1a8abe27..00870fd6 100644 --- a/environment.yml +++ b/environment.yml @@ -6,9 +6,10 @@ dependencies: - numpy - scipy - matplotlib - - pandas + - pandas - statsmodels - - imageio + # Temporary version limit, see https://github.com/numpy/numpy-tutorials/issues/179 + - imageio<2.28 # For building the site - sphinx<5 - myst-nb diff --git a/requirements.txt b/requirements.txt index 63b2eefa..3eaadb83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ scipy matplotlib pandas statsmodels -imageio +# temporary version limit, see https://github.com/numpy/numpy-tutorials/issues/179 +imageio<2.28 # For supporting .md-based notebooks jupytext From 1c8b1c79dfaf41f791377302aced72529ce00f3d Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sat, 29 Apr 2023 20:27:11 -0700 Subject: [PATCH 34/91] MAINT: rm imageio pin and switch to durations kwarg. --- content/tutorial-x-ray-image-processing.md | 2 +- environment.yml | 3 +-- requirements.txt | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/content/tutorial-x-ray-image-processing.md b/content/tutorial-x-ray-image-processing.md index c8dd3a2b..9e00ea6c 100644 --- a/content/tutorial-x-ray-image-processing.md +++ b/content/tutorial-x-ray-image-processing.md @@ -187,7 +187,7 @@ notebook: ```{code-cell} ipython3 GIF_PATH = os.path.join(DIR, "xray_image.gif") -imageio.mimwrite(GIF_PATH, combined_xray_images_1, format= ".gif", fps=1) +imageio.mimwrite(GIF_PATH, combined_xray_images_1, format= ".gif", duration=1000) ``` Which gives us: diff --git a/environment.yml b/environment.yml index 00870fd6..90c83d4d 100644 --- a/environment.yml +++ b/environment.yml @@ -8,8 +8,7 @@ dependencies: - matplotlib - pandas - statsmodels - # Temporary version limit, see https://github.com/numpy/numpy-tutorials/issues/179 - - imageio<2.28 + - imageio # For building the site - sphinx<5 - myst-nb diff --git a/requirements.txt b/requirements.txt index 3eaadb83..63b2eefa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ scipy matplotlib pandas statsmodels -# temporary version limit, see https://github.com/numpy/numpy-tutorials/issues/179 -imageio<2.28 +imageio # For supporting .md-based notebooks jupytext From 3f173984eb34e654f3cdca814dbffaa4df52a047 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 30 Apr 2023 09:54:56 -0700 Subject: [PATCH 35/91] MAINT: Unpin sphinx. --- environment.yml | 2 +- site/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 90c83d4d..8421695f 100644 --- a/environment.yml +++ b/environment.yml @@ -10,7 +10,7 @@ dependencies: - statsmodels - imageio # For building the site - - sphinx<5 + - sphinx - myst-nb - sphinx-book-theme - sphinx-copybutton diff --git a/site/requirements.txt b/site/requirements.txt index 8514cae9..e040deba 100644 --- a/site/requirements.txt +++ b/site/requirements.txt @@ -1,4 +1,4 @@ -sphinx<5 +sphinx myst-nb sphinx-book-theme sphinx-copybutton From 88780ee22698504e611142d2a2df1b1a66fcd432 Mon Sep 17 00:00:00 2001 From: partev Date: Fri, 26 May 2023 15:44:40 -0400 Subject: [PATCH 36/91] DOC: fix broken link to SciPy Tutorial fix broken link to SciPy Tutorial --- content/tutorial-svd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-svd.md b/content/tutorial-svd.md index cafc9697..a1fe60a4 100644 --- a/content/tutorial-svd.md +++ b/content/tutorial-svd.md @@ -379,6 +379,6 @@ terms of the norm of the difference. For more information, see *G. H. Golub and - [Python tutorial](https://docs.python.org/dev/tutorial/index.html) - [NumPy Reference](https://numpy.org/devdocs/reference/index.html#reference) -- [SciPy Tutorial](https://docs.scipy.org/doc/scipy/reference/tutorial/index.html) +- [SciPy Tutorial](https://docs.scipy.org/doc/scipy/tutorial/index.html) - [SciPy Lecture Notes](https://scipy-lectures.org) - [A matlab, R, IDL, NumPy/SciPy dictionary](http://mathesaurus.sf.net/) From 2285ba0725eaa8e9e0964850a10931a85f9153e2 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Sun, 30 Jul 2023 19:23:49 -0700 Subject: [PATCH 37/91] Fix bug and improve computation / display of metrics for MNIST tutorial (#189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * BUG: Fix incorrect variable in computing eval metrics. * ENH: Replace list comps with vectorization. * ENH: Use dicts and condense plotting. * Update content/tutorial-deep-learning-on-mnist.md Co-authored-by: Brigitta Sipőcz --- content/tutorial-deep-learning-on-mnist.md | 46 +++++++++------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/content/tutorial-deep-learning-on-mnist.md b/content/tutorial-deep-learning-on-mnist.md index 63dbdbce..a41438c5 100644 --- a/content/tutorial-deep-learning-on-mnist.md +++ b/content/tutorial-deep-learning-on-mnist.md @@ -561,39 +561,31 @@ The training process may take many minutes, depending on a number of factors, su After executing the cell above, you can visualize the training and test set errors and accuracy for an instance of this training process. ```{code-cell} +epoch_range = np.arange(epochs) + 1 # Starting from 1 + # The training set metrics. -y_training_error = [ - store_training_loss[i] / float(len(training_images)) - for i in range(len(store_training_loss)) -] -x_training_error = range(1, len(store_training_loss) + 1) -y_training_accuracy = [ - store_training_accurate_pred[i] / float(len(training_images)) - for i in range(len(store_training_accurate_pred)) -] -x_training_accuracy = range(1, len(store_training_accurate_pred) + 1) +training_metrics = { + "accuracy": np.asarray(store_training_accurate_pred) / len(training_images), + "error": np.asarray(store_training_loss) / len(training_images), +} # The test set metrics. -y_test_error = [ - store_test_loss[i] / float(len(test_images)) for i in range(len(store_test_loss)) -] -x_test_error = range(1, len(store_test_loss) + 1) -y_test_accuracy = [ - store_training_accurate_pred[i] / float(len(training_images)) - for i in range(len(store_training_accurate_pred)) -] -x_test_accuracy = range(1, len(store_test_accurate_pred) + 1) +test_metrics = { + "accuracy": np.asarray(store_test_accurate_pred) / len(test_images), + "error": np.asarray(store_test_loss) / len(test_images), +} # Display the plots. fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(15, 5)) -axes[0].set_title("Training set error, accuracy") -axes[0].plot(x_training_accuracy, y_training_accuracy, label="Training set accuracy") -axes[0].plot(x_training_error, y_training_error, label="Training set error") -axes[0].set_xlabel("Epochs") -axes[1].set_title("Test set error, accuracy") -axes[1].plot(x_test_accuracy, y_test_accuracy, label="Test set accuracy") -axes[1].plot(x_test_error, y_test_error, label="Test set error") -axes[1].set_xlabel("Epochs") +for ax, metrics, title in zip( + axes, (training_metrics, test_metrics), ("Training set", "Test set") +): + # Plot the metrics + for metric, values in metrics.items(): + ax.plot(epoch_range, values, label=metric.capitalize()) + ax.set_title(title) + ax.set_xlabel("Epochs") + ax.legend() plt.show() ``` From 911d71aa04a938cbf38441bd802477685370189e Mon Sep 17 00:00:00 2001 From: D McMurchy <5430744+Zirescu@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:46:10 -0700 Subject: [PATCH 38/91] Update contributing.md Removes the www on the URL for Binder as their website uses HSTS and their SSL Cert is only valid for mybinder.org and not www.mybinder.org. A user will not be able to directly access their website without editing the URL. --- site/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/contributing.md b/site/contributing.md index 8985c56c..c35db184 100644 --- a/site/contributing.md +++ b/site/contributing.md @@ -29,7 +29,7 @@ used in the main NumPy documentation has two reasons: * Jupyter notebooks are a common format for communicating scientific information. - * Jupyter notebooks can be launched in [Binder](https://www.mybinder.org), so that users can interact + * Jupyter notebooks can be launched in [Binder](https://mybinder.org), so that users can interact with tutorials * rST may present a barrier for some people who might otherwise be very interested in contributing tutorial material. From 4ea40a0a13d734a58276e795c2af5839e75c22d2 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 21 Dec 2023 12:08:39 -0800 Subject: [PATCH 39/91] ENH: Use numpy.polynomial for linear fit instead of statsmodels (#182) * Initial removal of statsmodels from mooreslaw md * Update wording for polynomial.fit. * Update wording, rm std. err. * MAINT: rm statsmodels from requirements/testing. --- content/mooreslaw-tutorial.md | 77 ++++++++--------------------------- environment.yml | 1 - requirements.txt | 1 - tox.ini | 2 - 4 files changed, 18 insertions(+), 63 deletions(-) diff --git a/content/mooreslaw-tutorial.md b/content/mooreslaw-tutorial.md index 18a13dcc..b9fefc8d 100644 --- a/content/mooreslaw-tutorial.md +++ b/content/mooreslaw-tutorial.md @@ -44,19 +44,17 @@ the 53 years following his prediction. You will determine the best-fit constants * NumPy * [Matplotlib](https://matplotlib.org/) -* [statsmodels](https://www.statsmodels.org) ordinary linear regression imported with the following commands ```{code-cell} import matplotlib.pyplot as plt import numpy as np -import statsmodels.api as sm ``` **2.** Since this is an exponential growth law you need a little background in doing math with [natural logs](https://en.wikipedia.org/wiki/Natural_logarithm) and [exponentials](https://en.wikipedia.org/wiki/Exponential_function). -You'll use these NumPy, Matplotlib, and statsmodels functions: +You'll use these NumPy and Matplotlib functions: * [`np.loadtxt`](https://numpy.org/doc/stable/reference/generated/numpy.loadtxt.html): this function loads text into a NumPy array * [`np.log`](https://numpy.org/doc/stable/reference/generated/numpy.log.html): this function takes the natural log of all elements in a NumPy array @@ -64,7 +62,6 @@ You'll use these NumPy, Matplotlib, and statsmodels functions: * [`lambda`](https://docs.python.org/3/library/ast.html?highlight=lambda#ast.Lambda): this is a minimal function definition for creating a function model * [`plt.semilogy`](https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.semilogy.html): this function will plot x-y data onto a figure with a linear x-axis and $\log_{10}$ y-axis [`plt.plot`](https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.plot.html): this function will plot x-y data on linear axes -* [`sm.OLS`](https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLS.html): find fitting parameters and standard errors using the statsmodels ordinary least squares model * slicing arrays: view parts of the data loaded into the workspace, slice the arrays e.g. `x[:10]` for the first 10 values in the array, `x` * boolean array indexing: to view parts of the data that match a given condition use boolean operations to index an array * [`np.block`](https://numpy.org/doc/stable/reference/generated/numpy.block.html): to combine arrays into 2D arrays @@ -215,59 +212,31 @@ where $\mathbf{y}$ are the observations of the log of the number of transistors in a 1D array and $\mathbf{Z}=[\text{year}_i^1,~\text{year}_i^0]$ are the polynomial terms for $\text{year}_i$ in the first and second columns. By creating this set of regressors in the $\mathbf{Z}-$matrix you set -up an ordinary least squares statistical model. Some clever -NumPy array features will build $\mathbf{Z}$ +up an ordinary least squares statistical model. -1. `year[:,np.newaxis]` : takes the 1D array with shape `(179,)` and turns it into a 2D column vector with shape `(179,1)` -2. `**[1, 0]` : stacks two columns, in the first column is `year**1` and the second column is `year**0 == 1` +`Z` is a linear model with two parameters, i.e. a polynomial with degree `1`. +Therefore we can represent the model with `numpy.polynomial.Polynomial` and +use the fitting functionality to determine the model parameters: ```{code-cell} -Z = year[:, np.newaxis] ** [1, 0] +model = np.polynomial.Polynomial.fit(year, yi, deg=1) ``` -Now that you have the created a matrix of regressors, $\mathbf{Z},$ and -the observations are in vector, $\mathbf{y},$ you can use these -variables to build the an ordinary least squares model with -[`sm.OLS`](https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLS.html). +By default, `Polynomial.fit` performs the fit in the domain determined by the +independent variable (`year` in this case). +The coefficients for the unscaled and unshifted model can be recovered with the +`convert` method: -```{code-cell} -model = sm.OLS(yi, Z) -``` - -Now, you can view the fitting constants, $A$ and $B$, and their standard -errors. Run the -[`fit`](https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLS.html) and print the -[`summary`](https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.RegressionResults.summary.html) to view results as such, ```{code-cell} -results = model.fit() -print(results.summary()) +model = model.convert() +model ``` -The __OLS Regression Results__ summary gives a lot of information about -the regressors, $\mathbf{Z},$ and observations, $\mathbf{y}.$ The most -important outputs for your current analysis are - -``` -================================= - coef std err ---------------------------------- -x1 0.3416 0.006 -const -666.3264 11.890 -================================= -``` -where `x1` is slope, $A=0.3416$, `const` is the intercept, -$B=-666.364$, and `std error` gives the precision of constants -$A=0.342\pm 0.006~\dfrac{\log(\text{transistors}/\text{chip})}{\text{years}}$ and $B=-666\pm -12~\log(\text{transistors}/\text{chip}),$ where the units are in -$\log(\text{transistors}/\text{chip})$. You created an exponential growth model. -To get the constants, save them to an array `AB` with -`results.params` and assign $A$ and $B$ to `x1` and `constant`. +The individual parameters $A$ and $B$ are the coefficients of our linear model: ```{code-cell} -AB = results.params -A = AB[0] -B = AB[1] +B, A = model ``` Did manufacturers double the transistor count every two years? You have @@ -277,24 +246,14 @@ $\dfrac{\text{transistor_count}(\text{year} +2)}{\text{transistor_count}(\text{y \dfrac{e^{B}e^{A( \text{year} + 2)}}{e^{B}e^{A \text{year}}} = e^{2A}$ where increase in number of transistors is $xFactor,$ number of years is -2, and $A$ is the best fit slope on the semilog function. The error in -your -prediction, $\Delta(xFactor),$ comes from the precision of your constant -$A,$ which you calculated as the standard error $\Delta A= 0.006$. - -$\Delta (xFactor) = \frac{\partial}{\partial A}(e^{2A})\Delta A = 2Ae^{2A}\Delta A$ +2, and $A$ is the best fit slope on the semilog function. ```{code-cell} -print("Rate of semiconductors added on a chip every 2 years:") -print( - "\tx{:.2f} +/- {:.2f} semiconductors per chip".format( - np.exp((A) * 2), 2 * A * np.exp(2 * A) * 0.006 - ) -) +print(f"Rate of semiconductors added on a chip every 2 years: {np.exp(2 * A):.2f}") ``` Based upon your least-squares regression model, the number of -semiconductors per chip increased by a factor of $1.98\pm 0.01$ every two +semiconductors per chip increased by a factor of $1.98$ every two years. You have a model that predicts the number of semiconductors each year. Now compare your model to the actual manufacturing reports. Plot the linear regression results and all of the transistor counts. @@ -455,7 +414,7 @@ np.savez( transistor_count=transistor_count, transistor_count_predicted=transistor_count_predicted, transistor_Moores_law=transistor_Moores_law, - regression_csts=AB, + regression_csts=(A, B), ) ``` diff --git a/environment.yml b/environment.yml index 8421695f..137b04ca 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,6 @@ dependencies: - scipy - matplotlib - pandas - - statsmodels - imageio # For building the site - sphinx diff --git a/requirements.txt b/requirements.txt index 63b2eefa..0ec30181 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ numpy scipy matplotlib pandas -statsmodels imageio # For supporting .md-based notebooks jupytext diff --git a/tox.ini b/tox.ini index b14c817d..e6f26ac8 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,6 @@ deps = oldestdeps: matplotlib==3.4 oldestdeps: scipy==1.6 oldestdeps: pandas==1.2 - oldestdeps: statsmodels==0.13 allowlist_externals = bash @@ -28,7 +27,6 @@ commands = devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple statsmodels pip freeze From a870f27b8f5c71313801f7c0a870f51090c49e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Fri, 12 Jan 2024 23:13:35 +0100 Subject: [PATCH 40/91] MAINT: update minimum required versions and CI maintanance (#199) * CI: update minimum versions following SPEC0 as of Q4 2023 * CI: adding python 3.12 to testing * MAINT: use the scientific python extra pip index for dev wheels Keep reinstalling numpy with a separated pip command to ensure the dev version is picked up even if a downstream dependency upper limited it * MAINT: content fixes for numpy 2.0 --- .github/workflows/ci_tests_run_notebooks.yml | 13 +++++++---- content/tutorial-ma.md | 6 ++--- tox.ini | 24 ++++++++++++-------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 9b55c58f..31ddb5d8 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -31,14 +31,19 @@ jobs: os: ubuntu-latest - python-version: '3.11' - toxenv: py311-test-devdeps - name: with Python 3.11 and developer versioned dependencies + toxenv: py311-test + name: with Python 3.11 and latest released version of dependencies + os: ubuntu-latest + + - python-version: '3.12' + toxenv: py312-test-devdeps + name: with Python 3.12 and developer versioned dependencies os: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/content/tutorial-ma.md b/content/tutorial-ma.md index 90a7fa31..fcb69eb2 100644 --- a/content/tutorial-ma.md +++ b/content/tutorial-ma.md @@ -92,7 +92,7 @@ rows of this file, since they contain other data we are not interested in. Separ # Read just the dates for columns 4-18 from the first row dates = np.genfromtxt( filename, - dtype=np.unicode_, + dtype=np.str_, delimiter=",", max_rows=1, usecols=range(4, 18), @@ -102,7 +102,7 @@ dates = np.genfromtxt( # columns, skipping the first six rows locations = np.genfromtxt( filename, - dtype=np.unicode_, + dtype=np.str_, delimiter=",", skip_header=6, usecols=(0, 1), @@ -119,7 +119,7 @@ nbcases = np.genfromtxt( ) ``` -Included in the `numpy.genfromtxt` function call, we have selected the [numpy.dtype](https://numpy.org/devdocs/reference/generated/numpy.dtype.html#numpy.dtype) for each subset of the data (either an integer - `numpy.int_` - or a string of characters - `numpy.unicode_`). We have also used the `encoding` argument to select `utf-8-sig` as the encoding for the file (read more about encoding in the [official Python documentation](https://docs.python.org/3/library/codecs.html#encodings-and-unicode). You can read more about the `numpy.genfromtxt` function from the [Reference Documentation](https://numpy.org/devdocs/reference/generated/numpy.genfromtxt.html#numpy.genfromtxt) or from the [Basic IO tutorial](https://numpy.org/devdocs/user/basics.io.genfromtxt.html). +Included in the `numpy.genfromtxt` function call, we have selected the [numpy.dtype](https://numpy.org/devdocs/reference/generated/numpy.dtype.html#numpy.dtype) for each subset of the data (either an integer - `numpy.int_` - or a string of characters - `numpy.str_`). We have also used the `encoding` argument to select `utf-8-sig` as the encoding for the file (read more about encoding in the [official Python documentation](https://docs.python.org/3/library/codecs.html#encodings-and-unicode). You can read more about the `numpy.genfromtxt` function from the [Reference Documentation](https://numpy.org/devdocs/reference/generated/numpy.genfromtxt.html#numpy.genfromtxt) or from the [Basic IO tutorial](https://numpy.org/devdocs/user/basics.io.genfromtxt.html). +++ diff --git a/tox.ini b/tox.ini index e6f26ac8..4c3157e3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{39,310,311}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} + py{39,310,311,312}-test{,-oldestdeps,-devdeps,-predeps}{,-buildhtml} requires = pip >= 19.3.1 @@ -8,6 +8,9 @@ requires = description = run tests +setenv = + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + deps = # We use these files to specify all the dependencies, and below we override # versions for specific testing schenarios @@ -15,18 +18,21 @@ deps = -rsite/requirements.txt -rrequirements.txt - oldestdeps: numpy==1.20 - oldestdeps: matplotlib==3.4 - oldestdeps: scipy==1.6 - oldestdeps: pandas==1.2 + oldestdeps: numpy==1.23 + oldestdeps: matplotlib==3.6 + oldestdeps: scipy==1.8 + oldestdeps: pandas==1.4 + + devdeps: numpy>=0.0.dev0 + devdeps: scipy>=0.0.dev0 + devdeps: matplotlib>=0.0.dev0 + devdeps: pandas>=0.0.dev0 allowlist_externals = bash commands = - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple matplotlib - devdeps: pip install -U --pre --only-binary :all: -i https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas + # Force numpy reinstall to work around upper version limits in downstream dependencies (e.g. pandas) + devdeps: pip install -U --pre --no-deps --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy pip freeze From a660336f8e5b738c2700c889642470af22488f76 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 12 Jan 2024 15:11:51 -0800 Subject: [PATCH 41/91] Replace scipy.misc.face with scipy.datasets.face. --- content/tutorial-svd.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/tutorial-svd.md b/content/tutorial-svd.md index a1fe60a4..6912d7a4 100644 --- a/content/tutorial-svd.md +++ b/content/tutorial-svd.md @@ -35,12 +35,12 @@ After this tutorial, you should be able to: ## Content -In this tutorial, we will use a [matrix decomposition](https://en.wikipedia.org/wiki/Matrix_decomposition) from linear algebra, the Singular Value Decomposition, to generate a compressed approximation of an image. We'll use the `face` image from the [scipy.misc](https://docs.scipy.org/doc/scipy/reference/misc.html#module-scipy.misc) module: +In this tutorial, we will use a [matrix decomposition](https://en.wikipedia.org/wiki/Matrix_decomposition) from linear algebra, the Singular Value Decomposition, to generate a compressed approximation of an image. We'll use the `face` image from the [scipy.datasets](https://docs.scipy.org/doc/scipy/reference/datasets.html) module: ```{code-cell} -from scipy import misc +from scipy import datasets -img = misc.face() +img = datasets.face() ``` **Note**: If you prefer, you can use your own image as you work through this tutorial. In order to transform your image into a NumPy array that can be manipulated, you can use the `imread` function from the [matplotlib.pyplot](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot) submodule. Alternatively, you can use the [imageio.imread](https://imageio.readthedocs.io/en/stable/userapi.html#imageio.imread) function from the `imageio` library. Be aware that if you use your own image, you'll likely need to adapt the steps below. For more information on how images are treated when converted to NumPy arrays, see [A crash course on NumPy for images](https://scikit-image.org/docs/stable/user_guide/numpy_images.html) from the `scikit-image` documentation. @@ -91,7 +91,7 @@ img[:, :, 0] ``` From the output above, we can see that every value in `img[:, :, 0]` is an integer value between 0 and 255, representing the level of red in each corresponding image pixel (keep in mind that this might be different if you -use your own image instead of [scipy.misc.face](https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.face.html#scipy.misc.face)). +use your own image instead of [scipy.datasets.face](https://docs.scipy.org/doc/scipy/reference/generated/scipy.datasets.face.html)). As expected, this is a 768x1024 matrix: From 684a08a782883c2e277956c6c3bf28bc39af9e5e Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 12 Jan 2024 15:12:24 -0800 Subject: [PATCH 42/91] Properly write ipython magic. --- content/save-load-arrays.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/save-load-arrays.md b/content/save-load-arrays.md index 434c7370..6768d938 100644 --- a/content/save-load-arrays.md +++ b/content/save-load-arrays.md @@ -127,7 +127,7 @@ print(load_xy.files) ``` ```{code-cell} -whos +%whos ``` ## Reassign the NpzFile arrays to `x` and `y` From 1dcfbf2c35121d7328b27dd5eaacdac003f8ed12 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 12 Jan 2024 15:15:16 -0800 Subject: [PATCH 43/91] Use string literals for LaTeX strings in fractals tutorial. --- content/tutorial-plotting-fractals.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/tutorial-plotting-fractals.md b/content/tutorial-plotting-fractals.md index e97b0cbe..373cd16f 100644 --- a/content/tutorial-plotting-fractals.md +++ b/content/tutorial-plotting-fractals.md @@ -301,14 +301,14 @@ For example, setting $c = \frac{\pi}{10}$ gives us a very elegant cloud shape, w ```{code-cell} ipython3 output = julia(mesh, c=np.pi/10, num_iter=20) -kwargs = {'title': 'f(z) = z^2 + \dfrac{\pi}{10}', 'cmap': 'plasma'} +kwargs = {'title': r'f(z) = z^2 + \dfrac{\pi}{10}', 'cmap': 'plasma'} plot_fractal(output, **kwargs); ``` ```{code-cell} ipython3 output = julia(mesh, c=-0.75 + 0.4j, num_iter=20) -kwargs = {'title': 'f(z) = z^2 - \dfrac{3}{4} + 0.4i', 'cmap': 'Greens_r'} +kwargs = {'title': r'f(z) = z^2 - \dfrac{3}{4} + 0.4i', 'cmap': 'Greens_r'} plot_fractal(output, **kwargs); ``` @@ -419,7 +419,7 @@ p.deriv() ```{code-cell} ipython3 output = newton_fractal(mesh, p, p.deriv(), num_iter=15, r=2) -kwargs = {'title': 'f(z) = z - \dfrac{(z^8 + 15z^4 - 16)}{(8z^7 + 60z^3)}', 'cmap': 'copper'} +kwargs = {'title': r'f(z) = z - \dfrac{(z^8 + 15z^4 - 16)}{(8z^7 + 60z^3)}', 'cmap': 'copper'} plot_fractal(output, **kwargs) ``` @@ -443,7 +443,7 @@ def d_tan(z): ```{code-cell} ipython3 output = newton_fractal(mesh, f_tan, d_tan, num_iter=15, r=50) -kwargs = {'title': 'f(z) = z - \dfrac{sin(z)cos(z)}{2}', 'cmap': 'binary'} +kwargs = {'title': r'f(z) = z - \dfrac{sin(z)cos(z)}{2}', 'cmap': 'binary'} plot_fractal(output, **kwargs); ``` From 5996bd6185b06ec0ebd18b49f64b6257d61de2bb Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 12 Jan 2024 16:41:50 -0800 Subject: [PATCH 44/91] Add optional pooch dep for scipy.datasets. --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 0ec30181..dd03cc89 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ # For the tutorials numpy scipy +pooch # for scipy.datasets matplotlib pandas imageio From 8fed7137cba7233a1c702dbf769e72f24e53ef08 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 12 Jan 2024 16:50:08 -0800 Subject: [PATCH 45/91] Handle SyntaxWarnings from invalid escape sequences. --- content/tutorial-plotting-fractals.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/content/tutorial-plotting-fractals.md b/content/tutorial-plotting-fractals.md index 373cd16f..a1921cea 100644 --- a/content/tutorial-plotting-fractals.md +++ b/content/tutorial-plotting-fractals.md @@ -334,7 +334,7 @@ def mandelbrot(mesh, num_iter=10, radius=2): ```{code-cell} ipython3 output = mandelbrot(mesh, num_iter=50) -kwargs = {'title': 'Mandelbrot \ set', 'cmap': 'hot'} +kwargs = {'title': 'Mandelbrot \\ set', 'cmap': 'hot'} plot_fractal(output, **kwargs); ``` @@ -370,8 +370,6 @@ for deg, ax in enumerate(axes.ravel()): diverge_len = general_julia(mesh, f=power, num_iter=15) ax.imshow(diverge_len, extent=[-2, 2, -2, 2], cmap='binary') ax.set_title(f'$f(z) = z^{degree} -1$') - -fig.tight_layout(); ``` Needless to say, there is a large amount of exploring that can be done by fiddling with the inputted function, value of $c$, number of iterations, radius and even the density of the mesh and choice of colours. @@ -475,7 +473,7 @@ We will denote this one 'Wacky fractal', as its equation would not be fun to try ```{code-cell} ipython3 output = newton_fractal(small_mesh, sin_sum, d_sin_sum, num_iter=10, r=1) -kwargs = {'title': 'Wacky \ fractal', 'figsize': (6, 6), 'extent': [-1, 1, -1, 1], 'cmap': 'terrain'} +kwargs = {'title': 'Wacky \\ fractal', 'figsize': (6, 6), 'extent': [-1, 1, -1, 1], 'cmap': 'terrain'} plot_fractal(output, **kwargs) ``` @@ -550,7 +548,7 @@ def accident(z): ```{code-cell} ipython3 output = general_julia(mesh, f=accident, num_iter=15, c=0, radius=np.pi) -kwargs = {'title': 'Accidental \ fractal', 'cmap': 'Blues'} +kwargs = {'title': 'Accidental \\ fractal', 'cmap': 'Blues'} plot_fractal(output, **kwargs); ``` From 8382ba04130f14aafe140dde0dbf655a5054b0c9 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 12 Jan 2024 20:54:36 -0800 Subject: [PATCH 46/91] Add pooch to conda deps too. --- content/x_y-squared.npz | Bin 670 -> 670 bytes environment.yml | 1 + 2 files changed, 1 insertion(+) diff --git a/content/x_y-squared.npz b/content/x_y-squared.npz index 6c32f1968769df4a983cb5b1006af0279ba4f009..e32d05c4b91f4b6b67416452fcdb58203176b834 100644 GIT binary patch delta 89 zcmbQoI*(N Date: Wed, 20 Dec 2023 16:53:10 -0800 Subject: [PATCH 47/91] CI: enabling cron and workflow dispatch for site building --- .github/workflows/conda.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 55d773fe..79d953c2 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -1,4 +1,4 @@ -name: Build site +name: Build site with conda on: push: @@ -7,6 +7,9 @@ on: pull_request: branches: - main + schedule: + - cron: '0 5 * * 1' + workflow_dispatch: jobs: test: @@ -21,7 +24,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true @@ -30,7 +33,7 @@ jobs: miniforge-variant: Mambaforge miniforge-version: latest use-mamba: true - python-version: "3.10" + python-version: "3.11" auto-activate-base: false - name: inspect and build id: build_step From 8f6c272ce7ef1e98d9a91da069091e98a0f9f904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 20 Dec 2023 20:11:15 -0800 Subject: [PATCH 48/91] CI: trying newer miniconda --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 79d953c2..e3eb60a6 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true activate-environment: numpy-tutorials From 0164e427176a41682fbe144114cbd628dcf7e70d Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 19 Jan 2024 08:34:18 -0800 Subject: [PATCH 49/91] Try/except imports to deal with scipy datasets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Brigitta Sipőcz --- content/tutorial-svd.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/tutorial-svd.md b/content/tutorial-svd.md index 6912d7a4..3798636a 100644 --- a/content/tutorial-svd.md +++ b/content/tutorial-svd.md @@ -38,9 +38,13 @@ After this tutorial, you should be able to: In this tutorial, we will use a [matrix decomposition](https://en.wikipedia.org/wiki/Matrix_decomposition) from linear algebra, the Singular Value Decomposition, to generate a compressed approximation of an image. We'll use the `face` image from the [scipy.datasets](https://docs.scipy.org/doc/scipy/reference/datasets.html) module: ```{code-cell} -from scipy import datasets +# TODO: Rm try-except with scipy 1.10 is the minimum supported version +try: + from scipy.datasets import face +except ImportError: # Data was in scipy.misc prior to scipy v1.10 + from scipy.misc import face -img = datasets.face() +img = face() ``` **Note**: If you prefer, you can use your own image as you work through this tutorial. In order to transform your image into a NumPy array that can be manipulated, you can use the `imread` function from the [matplotlib.pyplot](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot) submodule. Alternatively, you can use the [imageio.imread](https://imageio.readthedocs.io/en/stable/userapi.html#imageio.imread) function from the `imageio` library. Be aware that if you use your own image, you'll likely need to adapt the steps below. For more information on how images are treated when converted to NumPy arrays, see [A crash course on NumPy for images](https://scikit-image.org/docs/stable/user_guide/numpy_images.html) from the `scikit-image` documentation. From db5a326f43e7734262603bbd9277fbf651853b8c Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 19 Jan 2024 20:26:13 -0800 Subject: [PATCH 50/91] Revert changes to npz data file. --- content/x_y-squared.npz | Bin 670 -> 670 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/content/x_y-squared.npz b/content/x_y-squared.npz index e32d05c4b91f4b6b67416452fcdb58203176b834..6c32f1968769df4a983cb5b1006af0279ba4f009 100644 GIT binary patch delta 68 zcmbQoI**k#z?+#xWU@Sy_(Yj6(jp8Hpva(;*pP4m$N^z41`&qJiSlbF-(YlM7GVad KHU-n+Ozr^S*bV0Z delta 89 zcmbQoI*(N Date: Mon, 22 Jan 2024 11:56:56 -0800 Subject: [PATCH 51/91] CI: more descriptive job name [skip ci] --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index e3eb60a6..d94eaafb 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -1,4 +1,4 @@ -name: Build site with conda +name: Test building site with conda environment on: push: From d6d698bbfd2e2ff388460d627a18f10599293519 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Mon, 4 Mar 2024 11:52:34 -0800 Subject: [PATCH 52/91] Rm generated npz/csv files from tracking --- content/x_y-squared.csv | 11 ----------- content/x_y-squared.npz | Bin 670 -> 0 bytes 2 files changed, 11 deletions(-) delete mode 100644 content/x_y-squared.csv delete mode 100644 content/x_y-squared.npz diff --git a/content/x_y-squared.csv b/content/x_y-squared.csv deleted file mode 100644 index e74126ff..00000000 --- a/content/x_y-squared.csv +++ /dev/null @@ -1,11 +0,0 @@ -# x, y -0.000000000000000000e+00,0.000000000000000000e+00 -1.000000000000000000e+00,1.000000000000000000e+00 -2.000000000000000000e+00,4.000000000000000000e+00 -3.000000000000000000e+00,9.000000000000000000e+00 -4.000000000000000000e+00,1.600000000000000000e+01 -5.000000000000000000e+00,2.500000000000000000e+01 -6.000000000000000000e+00,3.600000000000000000e+01 -7.000000000000000000e+00,4.900000000000000000e+01 -8.000000000000000000e+00,6.400000000000000000e+01 -9.000000000000000000e+00,8.100000000000000000e+01 diff --git a/content/x_y-squared.npz b/content/x_y-squared.npz deleted file mode 100644 index 6c32f1968769df4a983cb5b1006af0279ba4f009..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 670 zcmWIWW@Zs#fB;1X8xBpr3qTGCb1{f8RKzD%WESh?6;v`Z2!KUFDnYU!FxfBEHz1Oc zp^TwgJteg`xk%kgLER?PLS08eJuSbeq$n{jKEEg>6(sJKm{Xhz6fe$5EJy|NH4F`O zG<6he703r%5LYlTFhUtjP?{M^vp{K9D9r|?*`YKCl;(ue0VrXilh}}e92S*BDlA}r zhxtta>PJZ^tpcSDp|k^(4usMH-i%Bl%(zkpR1uJB00%xIouKPO4Mk*qJV2d@Fb(i# R1xF7P0~135P?-ccG64-KTr>ax From 4d06bdcf31500301e09fe25bfa550ba5cc49a721 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Mon, 4 Mar 2024 11:58:28 -0800 Subject: [PATCH 53/91] Add generated files to gitignore. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a1654131..bee3f8ec 100644 --- a/.gitignore +++ b/.gitignore @@ -99,4 +99,5 @@ content/tutorial-x-ray-image-processing/xray_image.gif content/video content/*ipynb content/tutorial-nlp-from-scratch/parameters.npy -content/tutorial-nlp-from-scratch/*ipynb \ No newline at end of file +content/tutorial-nlp-from-scratch/*ipynb +content/x_y-squared* From c3c581a4a5bf5e276902caa4a8837f57e54b892b Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Mon, 4 Mar 2024 12:01:51 -0800 Subject: [PATCH 54/91] Replace hard-coded file output with \!head --- content/save-load-arrays.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/content/save-load-arrays.md b/content/save-load-arrays.md index 6768d938..2620bfaf 100644 --- a/content/save-load-arrays.md +++ b/content/save-load-arrays.md @@ -187,18 +187,8 @@ np.savetxt("x_y-squared.csv", X=array_out, header="x, y", delimiter=",") Open the file, `x_y-squared.csv`, and you'll see the following: -``` -# x, y -0.000000000000000000e+00,0.000000000000000000e+00 -1.000000000000000000e+00,1.000000000000000000e+00 -2.000000000000000000e+00,4.000000000000000000e+00 -3.000000000000000000e+00,9.000000000000000000e+00 -4.000000000000000000e+00,1.600000000000000000e+01 -5.000000000000000000e+00,2.500000000000000000e+01 -6.000000000000000000e+00,3.600000000000000000e+01 -7.000000000000000000e+00,4.900000000000000000e+01 -8.000000000000000000e+00,6.400000000000000000e+01 -9.000000000000000000e+00,8.100000000000000000e+01 +```{code-cell} +!head x_y-squared.csv ``` ## Our arrays as a csv file From 2ab567faabadadcceaea3e01ae6fb084d822517b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 23 May 2024 11:07:59 -0700 Subject: [PATCH 55/91] CI: adding predeps job (#207) --- .github/workflows/ci_tests_run_notebooks.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 31ddb5d8..bb561926 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -35,6 +35,11 @@ jobs: name: with Python 3.11 and latest released version of dependencies os: ubuntu-latest + - python-version: '3.12' + toxenv: py312-test-predeps + name: with Python 3.12 and latest or pre-release version of dependencies + os: ubuntu-latest + - python-version: '3.12' toxenv: py312-test-devdeps name: with Python 3.12 and developer versioned dependencies From 1280f4b6aecc740cf88dfef998f3c6af291d3ca9 Mon Sep 17 00:00:00 2001 From: partev Date: Sun, 2 Jun 2024 11:45:28 -0400 Subject: [PATCH 56/91] DOC: Update tutorial-svd.md fix a typo fix a typo in a link to Wikipedia article --- content/tutorial-svd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-svd.md b/content/tutorial-svd.md index 3798636a..614a7dc5 100644 --- a/content/tutorial-svd.md +++ b/content/tutorial-svd.md @@ -154,7 +154,7 @@ $$U \Sigma V^T = A$$ where $U$ and $V^T$ are square and $\Sigma$ is the same size as $A$. $\Sigma$ is a diagonal matrix and contains the [singular values](https://en.wikipedia.org/wiki/Singular_value) of $A$, organized from largest to smallest. These values are always non-negative and can be used as an indicator of the "importance" of some features represented by the matrix $A$. -Let's see how this works in practice with just one matrix first. Note that according to [colorimetry](https://en.wikipedia.org/wiki/Grayscale#Colorimetric_(perceptual_luminance-reserving)_conversion_to_grayscale), +Let's see how this works in practice with just one matrix first. Note that according to [colorimetry](https://en.wikipedia.org/wiki/Grayscale#Colorimetric_(perceptual_luminance-preserving)_conversion_to_grayscale), it is possible to obtain a fairly reasonable grayscale version of our color image if we apply the formula $$Y = 0.2126 R + 0.7152 G + 0.0722 B$$ From 259cf94d1c20ccf79e025debe21ae9ca97383814 Mon Sep 17 00:00:00 2001 From: partev Date: Sun, 2 Jun 2024 12:43:32 -0400 Subject: [PATCH 57/91] Update tutorial-nlp-from-scratch.md remove reference to MXNet which has been deprecated. https://lists.apache.org/thread/vzcy47wrbf89nljokghjqgzn0loq7knc --- content/tutorial-nlp-from-scratch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-nlp-from-scratch.md b/content/tutorial-nlp-from-scratch.md index 68a31d27..e51d6b1d 100644 --- a/content/tutorial-nlp-from-scratch.md +++ b/content/tutorial-nlp-from-scratch.md @@ -1051,7 +1051,7 @@ To further enhance and optimize your neural network model, you can consider one Nowadays, LSTMs have been replaced by the [Transformer](https://jalammar.github.io/illustrated-transformer/)( which uses [Attention](https://jalammar.github.io/visualizing-neural-machine-translation-mechanics-of-seq2seq-models-with-attention/) to tackle all the problems that plague an LSTM such as as lack of [transfer learning](https://en.wikipedia.org/wiki/Transfer_learning), lack of [parallel training](https://web.stanford.edu/~rezab/classes/cme323/S16/projects_reports/hedge_usmani.pdf) and a long gradient chain for lengthy sequences -Building a neural network from scratch with NumPy is a great way to learn more about NumPy and about deep learning. However, for real-world applications you should use specialized frameworks — such as PyTorch, JAX, TensorFlow or MXNet — that provide NumPy-like APIs, have built-in automatic differentiation and GPU support, and are designed for high-performance numerical computing and machine learning. +Building a neural network from scratch with NumPy is a great way to learn more about NumPy and about deep learning. However, for real-world applications you should use specialized frameworks — such as PyTorch, JAX or TensorFlow — that provide NumPy-like APIs, have built-in automatic differentiation and GPU support, and are designed for high-performance numerical computing and machine learning. Finally, to know more about how ethics come into play when developing a machine learning model, you can refer to the following resources : - Data ethics resources by the Turing Institute. https://www.turing.ac.uk/research/data-ethics From af927e31e9c87a41dcc8c7dea963839e87ae3c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Tue, 4 Jun 2024 09:55:37 -0700 Subject: [PATCH 58/91] Using hashes for all actions (#210) --- .github/workflows/ci_tests_run_notebooks.yml | 4 ++-- .github/workflows/circleci.yml | 2 +- .github/workflows/conda.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index bb561926..ba47d458 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -46,9 +46,9 @@ jobs: os: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index be39709f..ee793c73 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -5,7 +5,7 @@ jobs: name: Run CircleCI artifacts redirector steps: - name: GitHub Action step - uses: larsoner/circleci-artifacts-redirector-action@master + uses: larsoner/circleci-artifacts-redirector-action@4e13a10d89177f4bfc8007a7064bdbeda848d8d1 # v1.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} api-token: ${{ secrets.CIRCLE_TOKEN }} diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index d94eaafb..03a0b4a0 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -24,8 +24,8 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v3 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: auto-update-conda: true activate-environment: numpy-tutorials @@ -43,7 +43,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: sphinx-build-artifact path: site/_build/html/reports From 5ae3d377898e078ad341f73c986b05bee8492639 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Wed, 5 Jun 2024 10:45:24 +0200 Subject: [PATCH 59/91] =?UTF-8?q?Remove=20likely=20copy-paste=20of=20pilcr?= =?UTF-8?q?ow=20("=C2=B6")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/tutorial-nlp-from-scratch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-nlp-from-scratch.md b/content/tutorial-nlp-from-scratch.md index e51d6b1d..2eb581da 100644 --- a/content/tutorial-nlp-from-scratch.md +++ b/content/tutorial-nlp-from-scratch.md @@ -441,7 +441,7 @@ emb_path = textproc.unzipper(glove, 'glove.6B.300d.txt') emb_matrix = textproc.loadGloveModel(emb_path) ``` -## 3. Build the Deep Learning Model¶ +## 3. Build the Deep Learning Model It is time to start implementing our LSTM! You will have to first familiarize yourself with some high-level concepts of the basic building blocks of a deep learning model. You can refer to the [Deep learning on MNIST from scratch tutorial](https://numpy.org/numpy-tutorials/content/tutorial-deep-learning-on-mnist.html) for the same. You will then learn how a Recurrent Neural Network differs from a plain Neural Network and what makes it so suitable for processing sequential data. Afterwards, you will construct the building blocks of a simple deep learning model in Python and NumPy and train it to learn to classify the sentiment of a piece of text as positive or negative with a certain level of accuracy From be5acf1f9fda9f893cc9e30ae95c9f50d86353d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Fri, 14 Jun 2024 02:15:48 -0700 Subject: [PATCH 60/91] Adding dependabot for GHA version updates (#211) --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..4ebfc460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: ".github/workflows" + schedule: + interval: "weekly" + groups: + actions: + patterns: + - "*" + labels: + - "infrastructure" From b19d28f8d6fb61564f28623a982d3f7cee5f220e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:16:52 +0000 Subject: [PATCH 61/91] Bump actions/checkout in /.github/workflows in the actions group Bumps the actions group in /.github/workflows with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.1.6 to 4.1.7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/a5ac7e51b41094c92402da3b24376905380afc29...692973e3d937129bcbf40652eb9f2f61becf3332) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index ba47d458..9f0c991a 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -46,7 +46,7 @@ jobs: os: ubuntu-latest steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0 with: diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 03a0b4a0..c4860014 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -24,7 +24,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: auto-update-conda: true From 694d57c6b24c09d372dbaa4872cb031c9a6c90f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Mon, 17 Jun 2024 17:45:26 -0700 Subject: [PATCH 62/91] CI: update action that got moved org --- .github/workflows/circleci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index ee793c73..88ac6e4f 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -5,7 +5,7 @@ jobs: name: Run CircleCI artifacts redirector steps: - name: GitHub Action step - uses: larsoner/circleci-artifacts-redirector-action@4e13a10d89177f4bfc8007a7064bdbeda848d8d1 # v1.0.0 + uses: scientific-python/circleci-artifacts-redirector-action@4e13a10d89177f4bfc8007a7064bdbeda848d8d1 # v1.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} api-token: ${{ secrets.CIRCLE_TOKEN }} From 49b33035aa7a7fe1430f145e6ee65a77624b8cb7 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Tue, 18 Jun 2024 10:00:38 -0700 Subject: [PATCH 63/91] Add Jupytext requirement for binder. (#217) I think binder looks at env.yaml not at requirements.txt maybe that's the reason that binder don't have jupytext installed --- environment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/environment.yml b/environment.yml index 509d1bc7..15dd1085 100644 --- a/environment.yml +++ b/environment.yml @@ -14,3 +14,5 @@ dependencies: - myst-nb - sphinx-book-theme - sphinx-copybutton + # to load the md files in binder + - jupytext From ce12babf8b4f00e6ca030c17f0d729563daee14f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 12:34:42 +0000 Subject: [PATCH 64/91] Bump actions/upload-artifact in /.github/workflows in the actions group Bumps the actions group in /.github/workflows with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/upload-artifact` from 4.3.3 to 4.3.4 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/65462800fd760344b1a7b4382951275a0abb4808...0b2256b8c012f0828dc542b3febcab082c67f72b) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index c4860014..24702096 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -43,7 +43,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: sphinx-build-artifact path: site/_build/html/reports From e1510d893552bdd4548a7eae118ff05dcd638857 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:29:33 +0000 Subject: [PATCH 65/91] Bump the actions group across 1 directory with 2 updates Bumps the actions group with 2 updates in the /.github/workflows directory: [actions/setup-python](https://github.com/actions/setup-python) and [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/setup-python` from 5.1.0 to 5.1.1 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/82c7e631bb3cdc910f68e0081d67478d79c6982d...39cd14951b08e74b54015e9e001cdefcf80e669f) Updates `actions/upload-artifact` from 4.3.4 to 4.3.5 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/0b2256b8c012f0828dc542b3febcab082c67f72b...89ef406dd8d7e03cfd12d9e0a4a378f454709029) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 9f0c991a..18858f65 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1.0 + uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 24702096..787b626e 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -43,7 +43,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + - uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 with: name: sphinx-build-artifact path: site/_build/html/reports From 974b89e190c8a62f38ddeaac1d35135929959903 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Mon, 5 Aug 2024 12:32:41 -0700 Subject: [PATCH 66/91] Fix typo in Moore's law tutorial. --- content/mooreslaw-tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/mooreslaw-tutorial.md b/content/mooreslaw-tutorial.md index b9fefc8d..8e66104e 100644 --- a/content/mooreslaw-tutorial.md +++ b/content/mooreslaw-tutorial.md @@ -183,7 +183,7 @@ print("trans. cnt:\t", transistor_count[:10]) You are creating a function that predicts the transistor count given a year. You have an _independent variable_, `year`, and a _dependent -variable_, `transistor_count`. Transform the independent variable to +variable_, `transistor_count`. Transform the dependent variable to log-scale, $y_i = \log($ `transistor_count[i]` $),$ From a379973e6fb1b67a0276f889ff2492142dc6db2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:42:19 +0000 Subject: [PATCH 67/91] Bump the actions group across 1 directory with 2 updates Bumps the actions group with 2 updates in the /.github/workflows directory: [actions/setup-python](https://github.com/actions/setup-python) and [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/setup-python` from 5.1.1 to 5.2.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/39cd14951b08e74b54015e9e001cdefcf80e669f...f677139bbe7f9c59b41e40162b753c062f5d49a3) Updates `actions/upload-artifact` from 4.3.5 to 4.4.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/89ef406dd8d7e03cfd12d9e0a4a378f454709029...50769540e7f4bd5e21e526ee35c689e35e0d6874) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 18858f65..d7b6fbd8 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f #v5.1.1 + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 787b626e..d2f6cd86 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -43,7 +43,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 + - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: sphinx-build-artifact path: site/_build/html/reports From a8f7b4c49d0284b1e0ba8df7013d7ef161f455df Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Thu, 19 Sep 2024 22:05:51 -0400 Subject: [PATCH 68/91] update broken link --- content/tutorial-svd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-svd.md b/content/tutorial-svd.md index 614a7dc5..aded8df0 100644 --- a/content/tutorial-svd.md +++ b/content/tutorial-svd.md @@ -47,7 +47,7 @@ except ImportError: # Data was in scipy.misc prior to scipy v1.10 img = face() ``` -**Note**: If you prefer, you can use your own image as you work through this tutorial. In order to transform your image into a NumPy array that can be manipulated, you can use the `imread` function from the [matplotlib.pyplot](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot) submodule. Alternatively, you can use the [imageio.imread](https://imageio.readthedocs.io/en/stable/userapi.html#imageio.imread) function from the `imageio` library. Be aware that if you use your own image, you'll likely need to adapt the steps below. For more information on how images are treated when converted to NumPy arrays, see [A crash course on NumPy for images](https://scikit-image.org/docs/stable/user_guide/numpy_images.html) from the `scikit-image` documentation. +**Note**: If you prefer, you can use your own image as you work through this tutorial. In order to transform your image into a NumPy array that can be manipulated, you can use the `imread` function from the [matplotlib.pyplot](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot) submodule. Alternatively, you can use the [imageio.imread](https://imageio.readthedocs.io/en/stable/_autosummary/imageio.v3.imread.html) function from the `imageio` library. Be aware that if you use your own image, you'll likely need to adapt the steps below. For more information on how images are treated when converted to NumPy arrays, see [A crash course on NumPy for images](https://scikit-image.org/docs/stable/user_guide/numpy_images.html) from the `scikit-image` documentation. +++ From 01b934cf47ac5499bfaf6c872419921891f7055e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:40:26 +0000 Subject: [PATCH 69/91] Bump actions/checkout in /.github/workflows in the actions group Bumps the actions group in /.github/workflows with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.1.7 to 4.2.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/692973e3d937129bcbf40652eb9f2f61becf3332...d632683dd7b4114ad314bca15554477dd762a938) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index d7b6fbd8..e69d8069 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -46,7 +46,7 @@ jobs: os: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 with: diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index d2f6cd86..4be1c835 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -24,7 +24,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: auto-update-conda: true From f6a2721f6324ecb13771640f4905b068e6cf390a Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Tue, 1 Oct 2024 13:26:50 -0700 Subject: [PATCH 70/91] Turn off edit-this-page button. --- site/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/conf.py b/site/conf.py index e1fe5b63..4aea25ca 100644 --- a/site/conf.py +++ b/site/conf.py @@ -65,7 +65,7 @@ "repository_branch": "main", "use_repository_button": True, "use_issues_button": True, - "use_edit_page_button": True, + "use_edit_page_button": False, "path_to_docs": "site/", "launch_buttons": { "binderhub_url": "https://mybinder.org", From 0dce8f3dc15623504b5d0be0015a29471dd4a594 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 1 Oct 2024 22:30:25 -0400 Subject: [PATCH 71/91] fix broken link --- content/mooreslaw-tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/mooreslaw-tutorial.md b/content/mooreslaw-tutorial.md index 8e66104e..93722261 100644 --- a/content/mooreslaw-tutorial.md +++ b/content/mooreslaw-tutorial.md @@ -22,7 +22,7 @@ In 1965, engineer Gordon Moore [predicted](https://en.wikipedia.org/wiki/Moore%27s_law) that transistors on a chip would double every two years in the coming decade [[1](https://en.wikipedia.org/wiki/Moore%27s_law), -[2](https://newsroom.intel.com/wp-content/uploads/sites/11/2018/05/moores-law-electronics.pdf)]. +[2](https://www.intel.com/content/www/us/en/newsroom/resources/moores-law.html)]. You'll compare Moore's prediction against actual transistor counts in the 53 years following his prediction. You will determine the best-fit constants to describe the exponential growth of transistors on semiconductors compared to Moore's Law. From 3d073169119f391f65e727256ffad834c3ba0c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Wed, 2 Oct 2024 16:23:07 -0300 Subject: [PATCH 72/91] Fix conda job in CI --- .github/workflows/conda.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 4be1c835..b285d395 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -30,7 +30,6 @@ jobs: auto-update-conda: true activate-environment: numpy-tutorials environment-file: environment.yml - miniforge-variant: Mambaforge miniforge-version: latest use-mamba: true python-version: "3.11" From 350dc6c1e02d1e6226316bf505d95178b3948a4c Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Mon, 7 Oct 2024 19:13:58 -0400 Subject: [PATCH 73/91] remove broken reference --- content/mooreslaw-tutorial.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/content/mooreslaw-tutorial.md b/content/mooreslaw-tutorial.md index 93722261..42c0de15 100644 --- a/content/mooreslaw-tutorial.md +++ b/content/mooreslaw-tutorial.md @@ -21,8 +21,7 @@ _The number of transistors reported per a given chip plotted on a log scale in t In 1965, engineer Gordon Moore [predicted](https://en.wikipedia.org/wiki/Moore%27s_law) that transistors on a chip would double every two years in the coming decade -[[1](https://en.wikipedia.org/wiki/Moore%27s_law), -[2](https://www.intel.com/content/www/us/en/newsroom/resources/moores-law.html)]. +[[1](https://en.wikipedia.org/wiki/Moore%27s_law)]. You'll compare Moore's prediction against actual transistor counts in the 53 years following his prediction. You will determine the best-fit constants to describe the exponential growth of transistors on semiconductors compared to Moore's Law. @@ -130,7 +129,7 @@ print("This is x{:.2f} more transistors than 1971".format(ML_1973 / ML_1971)) Now, make a prediction based upon the historical data for semiconductors per chip. The [Transistor Count -\[4\]](https://en.wikipedia.org/wiki/Transistor_count#Microprocessors) +\[3\]](https://en.wikipedia.org/wiki/Transistor_count#Microprocessors) each year is in the `transistor_data.csv` file. Before loading a \*.csv file into a NumPy array, its a good idea to inspect the structure of the file first. Then, locate the columns of interest and save them to a @@ -520,7 +519,7 @@ double every two years from 1965 through 1975, but the average growth has maintained a consistent increase of $\times 1.98 \pm 0.01$ every two years from 1971 through 2019. In 2015, Moore revised his prediction to say Moore's law should hold until 2025. -[[3](https://spectrum.ieee.org/computing/hardware/gordon-moore-the-man-whose-name-means-progress)]. +[[2](https://spectrum.ieee.org/computing/hardware/gordon-moore-the-man-whose-name-means-progress)]. You can share these results as a zipped NumPy array file, `mooreslaw_regression.npz`, or as another csv, `mooreslaw_regression.csv`. The amazing progress in semiconductor @@ -533,6 +532,5 @@ has been over the last half-century. ## References 1. ["Moore's Law." Wikipedia article. Accessed Oct. 1, 2020.](https://en.wikipedia.org/wiki/Moore%27s_law) -2. [Moore, Gordon E. (1965-04-19). "Cramming more components onto integrated circuits". intel.com. Electronics Magazine. Retrieved April 1, 2020.](https://newsroom.intel.com/wp-content/uploads/sites/11/2018/05/moores-law-electronics.pdf) -3. [Courtland, Rachel. "Gordon Moore: The Man Whose Name Means Progress." IEEE Spectrum. 30 Mar. 2015.](https://spectrum.ieee.org/computing/hardware/gordon-moore-the-man-whose-name-means-progress). -4. ["Transistor Count." Wikipedia article. Accessed Oct. 1, 2020.](https://en.wikipedia.org/wiki/Transistor_count#Microprocessors) +2. [Courtland, Rachel. "Gordon Moore: The Man Whose Name Means Progress." IEEE Spectrum. 30 Mar. 2015.](https://spectrum.ieee.org/computing/hardware/gordon-moore-the-man-whose-name-means-progress). +3. ["Transistor Count." Wikipedia article. Accessed Oct. 1, 2020.](https://en.wikipedia.org/wiki/Transistor_count#Microprocessors) From 147ded20e8fdf6be89988a0f9ee0b0a4cde0ea57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:18:02 +0000 Subject: [PATCH 74/91] Bump the actions group in /.github/workflows with 2 updates Bumps the actions group in /.github/workflows with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/checkout` from 4.2.0 to 4.2.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/d632683dd7b4114ad314bca15554477dd762a938...eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871) Updates `actions/upload-artifact` from 4.4.0 to 4.4.3 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/50769540e7f4bd5e21e526ee35c689e35e0d6874...b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index e69d8069..71f23f81 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -46,7 +46,7 @@ jobs: os: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 with: diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index b285d395..a390cf22 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -24,7 +24,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: auto-update-conda: true @@ -42,7 +42,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sphinx-build-artifact path: site/_build/html/reports From d770172911756291bdf87f3dbb38c70839f5dff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Mon, 14 Oct 2024 09:03:34 -0700 Subject: [PATCH 75/91] MAINT: doing only montly dependabot --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4ebfc460..8db2976b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: "github-actions" directory: ".github/workflows" schedule: - interval: "weekly" + interval: "monthly" groups: actions: patterns: From d25c606607073db5b43855bff18716c2a3b4f6e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:53:51 +0000 Subject: [PATCH 76/91] Bump the actions group in /.github/workflows with 2 updates Bumps the actions group in /.github/workflows with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/checkout` from 4.2.1 to 4.2.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871...11bd71901bbe5b1630ceea73d27597364c9af683) Updates `actions/setup-python` from 5.2.0 to 5.3.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/f677139bbe7f9c59b41e40162b753c062f5d49a3...0b93645e9fea7318ecaed2b359559ac225c90a2b) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 4 ++-- .github/workflows/conda.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 71f23f81..a9c8bcee 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -46,9 +46,9 @@ jobs: os: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b #v5.3.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index a390cf22..4867c4fc 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -24,7 +24,7 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: auto-update-conda: true From fa7a0e6bfe398e51958c4b71bf97279896099c1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 12:24:12 +0000 Subject: [PATCH 77/91] Bump conda-incubator/setup-miniconda Bumps the actions group in /.github/workflows with 1 update: [conda-incubator/setup-miniconda](https://github.com/conda-incubator/setup-miniconda). Updates `conda-incubator/setup-miniconda` from 3.0.4 to 3.1.0 - [Release notes](https://github.com/conda-incubator/setup-miniconda/releases) - [Changelog](https://github.com/conda-incubator/setup-miniconda/blob/main/CHANGELOG.md) - [Commits](https://github.com/conda-incubator/setup-miniconda/compare/a4260408e20b96e80095f42ff7f1a15b27dd94ca...d2e6a045a86077fb6cad6f5adf368e9076ddaa8d) --- updated-dependencies: - dependency-name: conda-incubator/setup-miniconda dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 4867c4fc..8ed5abb7 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: auto-update-conda: true activate-environment: numpy-tutorials From 510f847e073f1b408480a148a63966aaded74065 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 12:54:55 +0000 Subject: [PATCH 78/91] Bump actions/upload-artifact in /.github/workflows in the actions group Bumps the actions group in /.github/workflows with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/upload-artifact` from 4.4.3 to 4.5.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882...6f51ac03b9356f520e9adb1b1b7802705f340c2b) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 8ed5abb7..a6ecde9e 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -42,7 +42,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: sphinx-build-artifact path: site/_build/html/reports From 552fcd08a574ede9fa1ce1e131d71edf73ebd523 Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Tue, 7 Jan 2025 14:23:23 -0800 Subject: [PATCH 79/91] Make some https URLs clickable (#241) --- content/tutorial-nlp-from-scratch.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/tutorial-nlp-from-scratch.md b/content/tutorial-nlp-from-scratch.md index 2eb581da..ae2eeb14 100644 --- a/content/tutorial-nlp-from-scratch.md +++ b/content/tutorial-nlp-from-scratch.md @@ -107,8 +107,8 @@ We made sure to include different demographics in our data and included a range 1. **Text Denoising** : Before converting your text into vectors, it is important to clean it and remove all unhelpful parts a.k.a the noise from your data by converting all characters to lowercase, removing html tags, brackets and stop words (words that don't add much meaning to a sentence). Without this step the dataset is often a cluster of words that the computer doesn't understand. -2. **Converting words to vectors** : A word embedding is a learned representation for text where words that have the same meaning have a similar representation. Individual words are represented as real-valued vectors in a predefined vector space. GloVe is an unsupervised algorithm developed by Stanford for generating word embeddings by generating global word-word co-occurence matrix from a corpus. You can download the zipped files containing the embeddings from https://nlp.stanford.edu/projects/glove/. Here you can choose any of the four options for different sizes or training datasets. We have chosen the least memory consuming embedding file. - >The GloVe word embeddings include sets that were trained on billions of tokens, some up to 840 billion tokens. These algorithms exhibit stereotypical biases, such as gender bias which can be traced back to the original training data. For example certain occupations seem to be more biased towards a particular gender, reinforcing problematic stereotypes. The nearest solution to this problem are some de-biasing algorithms as the one presented in https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1184/reports/6835575.pdf which one can use on embeddings of their choice to mitigate bias, if present. +2. **Converting words to vectors** : A word embedding is a learned representation for text where words that have the same meaning have a similar representation. Individual words are represented as real-valued vectors in a predefined vector space. GloVe is an unsupervised algorithm developed by Stanford for generating word embeddings by generating global word-word co-occurence matrix from a corpus. You can download the zipped files containing the embeddings from [the GloVe official website](https://nlp.stanford.edu/projects/glove/). Here you can choose any of the four options for different sizes or training datasets. We have chosen the least memory consuming embedding file. + >The GloVe word embeddings include sets that were trained on billions of tokens, some up to 840 billion tokens. These algorithms exhibit stereotypical biases, such as gender bias which can be traced back to the original training data. For example certain occupations seem to be more biased towards a particular gender, reinforcing problematic stereotypes. The nearest solution to this problem are some de-biasing algorithms as the one presented in [this research article](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1184/reports/6835575.pdf), which one can use on embeddings of their choice to mitigate bias, if present. You'll start with importing the necessary packages to build our Deep Learning network. @@ -1049,11 +1049,11 @@ To further enhance and optimize your neural network model, you can consider one - Initialize weights using [Xavier Initialization](https://d2l.ai/chapter_multilayer-perceptrons/numerical-stability-and-init.html#xavier-initialization) to prevent vanishing/exploding gradients instead of initializing them randomly. - Replace LSTM with a [Bidirectional LSTM](https://en.wikipedia.org/wiki/Bidirectional_recurrent_neural_networks) to use both left and right context for predicting sentiment. -Nowadays, LSTMs have been replaced by the [Transformer](https://jalammar.github.io/illustrated-transformer/)( which uses [Attention](https://jalammar.github.io/visualizing-neural-machine-translation-mechanics-of-seq2seq-models-with-attention/) to tackle all the problems that plague an LSTM such as as lack of [transfer learning](https://en.wikipedia.org/wiki/Transfer_learning), lack of [parallel training](https://web.stanford.edu/~rezab/classes/cme323/S16/projects_reports/hedge_usmani.pdf) and a long gradient chain for lengthy sequences +Nowadays, LSTMs have been replaced by the [Transformer](https://jalammar.github.io/illustrated-transformer/) which uses [Attention](https://jalammar.github.io/visualizing-neural-machine-translation-mechanics-of-seq2seq-models-with-attention/) to tackle all the problems that plague an LSTM such as lack of [transfer learning](https://en.wikipedia.org/wiki/Transfer_learning), lack of [parallel training](https://web.stanford.edu/~rezab/classes/cme323/S16/projects_reports/hedge_usmani.pdf), and a long gradient chain for lengthy sequences. Building a neural network from scratch with NumPy is a great way to learn more about NumPy and about deep learning. However, for real-world applications you should use specialized frameworks — such as PyTorch, JAX or TensorFlow — that provide NumPy-like APIs, have built-in automatic differentiation and GPU support, and are designed for high-performance numerical computing and machine learning. Finally, to know more about how ethics come into play when developing a machine learning model, you can refer to the following resources : -- Data ethics resources by the Turing Institute. https://www.turing.ac.uk/research/data-ethics +- [Data ethics resources](https://www.turing.ac.uk/research/data-ethics) by the Turing Institute - Considering how artificial intelligence shifts power, an [article](https://www.nature.com/articles/d41586-020-02003-2) and [talk](https://slideslive.com/38923453/the-values-of-machine-learning) by Pratyusha Kalluri - More ethics resources on [this blog post](https://www.fast.ai/2018/09/24/ai-ethics-resources/) by Rachel Thomas and the [Radical AI podcast](https://www.radicalai.org/) From 54a5cfa8fef50b9f989611274bf9304bd8456098 Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Mon, 20 Jan 2025 09:46:12 -0800 Subject: [PATCH 80/91] DOC: Update Vector Mechanics book link --- content/tutorial-static_equilibrium.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/tutorial-static_equilibrium.md b/content/tutorial-static_equilibrium.md index 0e8b82f7..f649e56e 100644 --- a/content/tutorial-static_equilibrium.md +++ b/content/tutorial-static_equilibrium.md @@ -263,7 +263,7 @@ print("Reaction moment =", M) ``` ### Another Example -Let's look at a slightly more complicated model. In this example you will be observing a beam with two cables and an applied force. This time you need to find both the tension in the cords and the reaction forces of the beam. *(Source: [Vector Mechanics for Engineers: Statics](https://www.mheducation.com/highered/product/vector-mechanics-engineers-statics-beer-johnston/M9780077687304.html), Problem 4.106)* +Let's look at a slightly more complicated model. In this example you will be observing a beam with two cables and an applied force. This time you need to find both the tension in the cords and the reaction forces of the beam. *(Source: [Vector Mechanics for Engineers: Statics and Dynamics](https://www.mheducation.com/highered/product/Vector-Mechanics-for-Engineers-Statics-and-Dynamics-Beer.html), Problem 4.106)* ![image.png](_static/problem4.png) @@ -387,5 +387,5 @@ This same process can be applied to kinetic problems or in any number of dimensi ### References -1. [Vector Mechanics for Engineers: Statics (Beer & Johnston & Mazurek)](https://www.mheducation.com/highered/product/vector-mechanics-engineers-statics-beer-johnston/M9780077687304.html) +1. [Vector Mechanics for Engineers: Statics and Dynamics (Beer & Johnston & Mazurek & et al.)](https://www.mheducation.com/highered/product/Vector-Mechanics-for-Engineers-Statics-and-Dynamics-Beer.html) 2. [NumPy Reference](https://numpy.org/doc/stable/reference/) From 43949b51163d946ff32234d4acfa04392a37857e Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Sun, 26 Jan 2025 18:59:01 -0800 Subject: [PATCH 81/91] DOC: Update the link to linear algebra tutorial (#243) --- content/tutorial-deep-learning-on-mnist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-deep-learning-on-mnist.md b/content/tutorial-deep-learning-on-mnist.md index a41438c5..fc874f02 100644 --- a/content/tutorial-deep-learning-on-mnist.md +++ b/content/tutorial-deep-learning-on-mnist.md @@ -33,7 +33,7 @@ This tutorial was adapted from the work by [Andrew Trask](https://github.com/iam The reader should have some knowledge of Python, NumPy array manipulation, and linear algebra. In addition, you should be familiar with main concepts of [deep learning](https://en.wikipedia.org/wiki/Deep_learning). -To refresh the memory, you can take the [Python](https://docs.python.org/dev/tutorial/index.html) and [Linear algebra on n-dimensional arrays](https://numpy.org/doc/stable/user/tutorial-svd.html) tutorials. +To refresh the memory, you can take the [Python](https://docs.python.org/dev/tutorial/index.html) and [Linear algebra on n-dimensional arrays](https://numpy.org/numpy-tutorials/content/tutorial-svd.html) tutorials. You are advised to read the [Deep learning](http://www.cs.toronto.edu/~hinton/absps/NatureDeepReview.pdf) paper published in 2015 by Yann LeCun, Yoshua Bengio, and Geoffrey Hinton, who are regarded as some of the pioneers of the field. You should also consider reading Andrew Trask's [Grokking Deep Learning](https://www.manning.com/books/grokking-deep-learning), which teaches deep learning with NumPy. From 4fbfeac3aea25a10290141467dd543b5a80aa065 Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Mon, 27 Jan 2025 16:41:19 -0800 Subject: [PATCH 82/91] DOC: Update link to Central Pollution Control Board of India --- content/tutorial-air-quality-analysis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-air-quality-analysis.md b/content/tutorial-air-quality-analysis.md index 14e46acf..fda0dbf3 100644 --- a/content/tutorial-air-quality-analysis.md +++ b/content/tutorial-air-quality-analysis.md @@ -97,7 +97,7 @@ With this, we have successfully imported the data and checked that it is complet ## Calculating the Air Quality Index -We will calculate the AQI using [the method](https://app.cpcbccr.com/ccr_docs/FINAL-REPORT_AQI_.pdf) adopted by the [Central Pollution Control Board](https://www.cpcb.nic.in/national-air-quality-index) of India. To summarize the steps: +We will calculate the AQI using [the method](https://app.cpcbccr.com/ccr_docs/FINAL-REPORT_AQI_.pdf) adopted by the [Central Pollution Control Board](https://www.cpcb.nic.in/national-air-quality-index/) of India. To summarize the steps: - Collect 24-hourly average concentration values for the standard pollutants; 8-hourly in case of CO and O3. From 2d2a30fc60da12ced652a5845b338a92793f6ddc Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Tue, 28 Jan 2025 22:04:31 -0800 Subject: [PATCH 83/91] DOC: Update another link to linear algebra tutorial (#245) --- content/tutorial-nlp-from-scratch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-nlp-from-scratch.md b/content/tutorial-nlp-from-scratch.md index ae2eeb14..a4771883 100644 --- a/content/tutorial-nlp-from-scratch.md +++ b/content/tutorial-nlp-from-scratch.md @@ -31,7 +31,7 @@ Today, Deep Learning is getting adopted in everyday life and now it is more impo ## Prerequisites -You are expected to be familiar with the Python programming language and array manipulation with NumPy. In addition, some understanding of Linear Algebra and Calculus is recommended. You should also be familiar with how Neural Networks work. For reference, you can visit the [Python](https://docs.python.org/dev/tutorial/index.html), [Linear algebra on n-dimensional arrays](https://numpy.org/doc/stable/user/tutorial-svd.html) and [Calculus](https://d2l.ai/chapter_appendix-mathematics-for-deep-learning/multivariable-calculus.html) tutorials. +You are expected to be familiar with the Python programming language and array manipulation with NumPy. In addition, some understanding of Linear Algebra and Calculus is recommended. You should also be familiar with how Neural Networks work. For reference, you can visit the [Python](https://docs.python.org/dev/tutorial/index.html), [Linear algebra on n-dimensional arrays](https://numpy.org/numpy-tutorials/content/tutorial-svd.html) and [Calculus](https://d2l.ai/chapter_appendix-mathematics-for-deep-learning/multivariable-calculus.html) tutorials. To get a refresher on Deep Learning basics, You should consider reading [the d2l.ai book](https://d2l.ai/chapter_recurrent-neural-networks/index.html), which is an interactive deep learning book with multi-framework code, math, and discussions. You can also go through the [Deep learning on MNIST from scratch tutorial](https://numpy.org/numpy-tutorials/content/tutorial-deep-learning-on-mnist.html) to understand how a basic neural network is implemented from scratch. From c5cd85f160d1549dbb66fc1be427d00f582e3b6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 12:49:08 +0000 Subject: [PATCH 84/91] Bump the actions group in /.github/workflows with 3 updates Bumps the actions group in /.github/workflows with 3 updates: [actions/setup-python](https://github.com/actions/setup-python), [conda-incubator/setup-miniconda](https://github.com/conda-incubator/setup-miniconda) and [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/setup-python` from 5.3.0 to 5.4.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/0b93645e9fea7318ecaed2b359559ac225c90a2b...42375524e23c412d93fb67b49958b491fce71c38) Updates `conda-incubator/setup-miniconda` from 3.1.0 to 3.1.1 - [Release notes](https://github.com/conda-incubator/setup-miniconda/releases) - [Changelog](https://github.com/conda-incubator/setup-miniconda/blob/main/CHANGELOG.md) - [Commits](https://github.com/conda-incubator/setup-miniconda/compare/d2e6a045a86077fb6cad6f5adf368e9076ddaa8d...505e6394dae86d6a5c7fbb6e3fb8938e3e863830) Updates `actions/upload-artifact` from 4.5.0 to 4.6.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/6f51ac03b9356f520e9adb1b1b7802705f340c2b...65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: conda-incubator/setup-miniconda dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index a9c8bcee..243a59d0 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b #v5.3.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 #v5.4.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index a6ecde9e..cf78ba1e 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 + - uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 with: auto-update-conda: true activate-environment: numpy-tutorials @@ -42,7 +42,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: sphinx-build-artifact path: site/_build/html/reports From 54bef6fe73ec03af907e27a498599bc746070e00 Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Sun, 2 Feb 2025 19:06:11 -0800 Subject: [PATCH 85/91] DOC: Update two links in deep reinforcement learning tutorial (#247) --- ...orial-deep-reinforcement-learning-with-pong-from-pixels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md b/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md index 69607388..1598e572 100644 --- a/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md +++ b/content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.md @@ -22,7 +22,7 @@ Help improve this article by developing an example with reduced dependency footprint! ``` -This tutorial demonstrates how to implement a deep reinforcement learning (RL) agent from scratch using a policy gradient method that learns to play the [Pong](https://gym.openai.com/envs/Pong-v0/) video game using screen pixels as inputs with NumPy. Your Pong agent will obtain experience on the go using an [artificial neural network](https://en.wikipedia.org/wiki/Artificial_neural_network) as its [policy](https://en.wikipedia.org/wiki/Reinforcement_learning). +This tutorial demonstrates how to implement a deep reinforcement learning (RL) agent from scratch using a policy gradient method that learns to play the [Pong](https://en.wikipedia.org/wiki/Pong) video game using screen pixels as inputs with NumPy. Your Pong agent will obtain experience on the go using an [artificial neural network](https://en.wikipedia.org/wiki/Artificial_neural_network) as its [policy](https://en.wikipedia.org/wiki/Reinforcement_learning). Pong is a 2D game from 1972 where two players use "rackets" to play a form of table tennis. Each player moves the racket up and down the screen and tries to hit a ball in their opponent's direction by touching it. The goal is to hit the ball such that it goes past the opponent's racket (they miss their shot). According to the rules, if a player reaches 21 points, they win. In Pong, the RL agent that learns to play against an opponent is displayed on the right. @@ -32,7 +32,7 @@ This example is based on the [code](https://gist.github.com/karpathy/a4166c7fe25 ## Prerequisites -- **OpenAI Gym**: To help with the game environment, you will use [Gym](https://gym.openai.com) — an open-source Python interface [developed by OpenAI](https://arxiv.org/abs/1606.01540) that helps perform RL tasks while supporting many simulation environments. +- **OpenAI Gym**: To help with the game environment, you will use [Gym](https://github.com/openai/gym) — an open-source Python interface [developed by OpenAI](https://arxiv.org/abs/1606.01540) that helps perform RL tasks while supporting many simulation environments. - **Python and NumPy**: The reader should have some knowledge of Python, NumPy array manipulation, and linear algebra. - **Deep learning and deep RL**: You should be familiar with main concepts of [deep learning](https://en.wikipedia.org/wiki/Deep_learning), which are explained in the [Deep learning](http://www.cs.toronto.edu/~hinton/absps/NatureDeepReview.pdf) paper published in 2015 by Yann LeCun, Yoshua Bengio, and Geoffrey Hinton, who are regarded as some of the pioneers of the field. The tutorial will try to guide you through the main concepts of deep RL and you will find various literature with links to original sources for your convenience. - **Jupyter notebook environments**: Because RL experiments can require high computing power, you can run the tutorial on the cloud for free using [Binder](https://mybinder.org) or [Google Colaboratory](https://colab.research.google.com/notebooks/intro.ipynb) (which offers free limited GPU and TPU acceleration). From 3eadd491e3236fa6e87376b7a0410ca1ac92c422 Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Mon, 10 Feb 2025 18:33:15 -0800 Subject: [PATCH 86/91] DOC: Update the MNIST data link (#249) --- content/tutorial-deep-learning-on-mnist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tutorial-deep-learning-on-mnist.md b/content/tutorial-deep-learning-on-mnist.md index fc874f02..89647016 100644 --- a/content/tutorial-deep-learning-on-mnist.md +++ b/content/tutorial-deep-learning-on-mnist.md @@ -62,7 +62,7 @@ This tutorial can be run locally in an isolated environment, such as [Virtualenv ## 1. Load the MNIST dataset -In this section, you will download the zipped MNIST dataset files originally stored in [Yann LeCun's website](http://yann.lecun.com/exdb/mnist/). Then, you will transform them into 4 files of NumPy array type using built-in Python modules. Finally, you will split the arrays into training and test sets. +In this section, you will download the zipped MNIST dataset files originally developed by Yann LeCun's research team. (More details of the MNIST dataset are available on [Kaggle](https://www.kaggle.com/datasets/hojjatk/mnist-dataset).) Then, you will transform them into 4 files of NumPy array type using built-in Python modules. Finally, you will split the arrays into training and test sets. **1.** Define a variable to store the training/test image/label names of the MNIST dataset in a list: From 4cce9690d3cbf1dd898cebe5ee326cd4504ebee4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 12:28:49 +0000 Subject: [PATCH 87/91] Bump actions/upload-artifact in /.github/workflows in the actions group Bumps the actions group in /.github/workflows with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/upload-artifact` from 4.6.0 to 4.6.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08...4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index cf78ba1e..b9524df9 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -42,7 +42,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 with: name: sphinx-build-artifact path: site/_build/html/reports From 30e9ae688d672b551e5ecf4669cbeab15294e7a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:12:12 +0000 Subject: [PATCH 88/91] Bump the actions group in /.github/workflows with 2 updates Bumps the actions group in /.github/workflows with 2 updates: [actions/setup-python](https://github.com/actions/setup-python) and [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `actions/setup-python` from 5.4.0 to 5.5.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/42375524e23c412d93fb67b49958b491fce71c38...8d9ed9ac5c53483de85588cdf95a591a75ab9f55) Updates `actions/upload-artifact` from 4.6.1 to 4.6.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1...ea165f8d65b6e75b540449e92b4886f43607fa02) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- .github/workflows/conda.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index 243a59d0..baafd383 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 #v5.4.0 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 #v5.5.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index b9524df9..f4dce2f5 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -42,7 +42,7 @@ jobs: conda list make -C site/ SPHINXOPTS="-nWT --keep-going" html - - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: sphinx-build-artifact path: site/_build/html/reports From 4987e37f58cc944cf91fd2e1026ab781b7a76a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Tue, 8 Apr 2025 18:27:04 -0700 Subject: [PATCH 89/91] MAINT: fix link causing warning in html build --- site/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/contributing.md b/site/contributing.md index c35db184..e95774a5 100644 --- a/site/contributing.md +++ b/site/contributing.md @@ -42,7 +42,7 @@ You may notice our content is in markdown format (`.md` files). We review and host notebooks in the [MyST-NB](https://myst-nb.readthedocs.io/) format. We accept both Jupyter notebooks (`.ipynb`) and MyST-NB notebooks (`.md`). If you want to sync your `.ipynb` to your `.md` file follow the [pairing -tutorial](content/pairing.md). +tutorial](content/pairing). ```{toctree} :hidden: From 64b5f638943cd770db83dc6d03237c3db29441e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Tue, 8 Apr 2025 18:27:27 -0700 Subject: [PATCH 90/91] CI: adding make to tox allowlist --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4c3157e3..ff48327d 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ deps = devdeps: matplotlib>=0.0.dev0 devdeps: pandas>=0.0.dev0 -allowlist_externals = bash +allowlist_externals = bash, make commands = # Force numpy reinstall to work around upper version limits in downstream dependencies (e.g. pandas) From a553bed3464bee1b72b0d478fca0aa4629f715d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 12:37:51 +0000 Subject: [PATCH 91/91] Bump actions/setup-python in /.github/workflows in the actions group Bumps the actions group in /.github/workflows with 1 update: [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/setup-python` from 5.5.0 to 5.6.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/8d9ed9ac5c53483de85588cdf95a591a75ab9f55...a26af69be951a213d495a4c3e4e4022e16d87065) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 5.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_tests_run_notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests_run_notebooks.yml b/.github/workflows/ci_tests_run_notebooks.yml index baafd383..7b54b916 100644 --- a/.github/workflows/ci_tests_run_notebooks.yml +++ b/.github/workflows/ci_tests_run_notebooks.yml @@ -48,7 +48,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 #v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0 with: python-version: ${{ matrix.python-version }}