From 32597a85f262e6c43a8cf72befb079c702ca0d67 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 15 Sep 2026 08:22:08 +0100 Subject: [PATCH] fix: install autofit's lazily-imported deps in the Colab setup cell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Colab bootstrap installs the stack with `--no-deps`, so any dependency Colab does not itself preinstall must be named in autonerves' `_SHARED_EXTRAS` or it never lands. Four autofit dependencies are missing from that list, and all four are imported lazily — inside a function rather than at module scope — so `import autofit` succeeds, the search runs to completion, and the notebook dies partway through: corner - `corner_cornerpy`; kills the post-fit corner plot optax - MultiStartAdam / MultiStartProdigy xxhash - graphical/EP factor hashing blackjax - BlackJAXNUTS Reported against HowToFit chapter 1 tutorial 5, which died on Colab with `ModuleNotFoundError: No module named 'corner'` after a 2000-step emcee search had already finished. This is a stopgap: the real fix is PyAutoNerves#167, which adds all four to `_SHARED_EXTRAS`. Until that is released, the setup cell installs them itself so the notebooks are self-sufficient. `--no-deps` is required — installing blackjax or optax with dependencies would let pip downgrade Colab's GPU-enabled jax. Remove once autonerves > 2026.9.15.1 is released. Co-Authored-By: Claude Opus 5 (1M context) --- notebooks/chapter_1_introduction/start_here.ipynb | 14 ++++++++++++++ .../chapter_1_introduction/tutorial_1_models.ipynb | 14 ++++++++++++++ .../tutorial_2_fitting_data.ipynb | 14 ++++++++++++++ .../tutorial_3_non_linear_search.ipynb | 14 ++++++++++++++ .../tutorial_4_why_modeling_is_hard.ipynb | 14 ++++++++++++++ .../tutorial_5_results_and_samples.ipynb | 14 ++++++++++++++ .../tutorial_6_gradients.ipynb | 14 ++++++++++++++ .../tutorial_7_the_details.ipynb | 14 ++++++++++++++ .../tutorial_optional_bayesian_formalism.ipynb | 14 ++++++++++++++ .../tutorial_1_individual_models.ipynb | 14 ++++++++++++++ .../tutorial_2_graphical_model.ipynb | 14 ++++++++++++++ .../tutorial_3_graphical_benefits.ipynb | 14 ++++++++++++++ .../tutorial_4_hierachical_models.ipynb | 14 ++++++++++++++ .../tutorial_5_expectation_propagation.ipynb | 14 ++++++++++++++ .../tutorial_optional_hierarchical_ep.ipynb | 14 ++++++++++++++ ...tutorial_optional_hierarchical_individual.ipynb | 14 ++++++++++++++ notebooks/simulators/simulators.ipynb | 14 ++++++++++++++ notebooks/simulators/simulators_sample.ipynb | 14 ++++++++++++++ 18 files changed, 252 insertions(+) diff --git a/notebooks/chapter_1_introduction/start_here.ipynb b/notebooks/chapter_1_introduction/start_here.ipynb index a4af1c9..fc2d0fb 100644 --- a/notebooks/chapter_1_introduction/start_here.ipynb +++ b/notebooks/chapter_1_introduction/start_here.ipynb @@ -101,6 +101,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_1_models.ipynb b/notebooks/chapter_1_introduction/tutorial_1_models.ipynb index 7c1a7c8..077fb30 100644 --- a/notebooks/chapter_1_introduction/tutorial_1_models.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_1_models.ipynb @@ -107,6 +107,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb b/notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb index 3b2d084..23ca719 100644 --- a/notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_2_fitting_data.ipynb @@ -91,6 +91,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_3_non_linear_search.ipynb b/notebooks/chapter_1_introduction/tutorial_3_non_linear_search.ipynb index 21bad9a..a006f1b 100644 --- a/notebooks/chapter_1_introduction/tutorial_3_non_linear_search.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_3_non_linear_search.ipynb @@ -188,6 +188,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_4_why_modeling_is_hard.ipynb b/notebooks/chapter_1_introduction/tutorial_4_why_modeling_is_hard.ipynb index e9c4d70..e9f528a 100644 --- a/notebooks/chapter_1_introduction/tutorial_4_why_modeling_is_hard.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_4_why_modeling_is_hard.ipynb @@ -80,6 +80,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb b/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb index e39cbce..4b3f639 100644 --- a/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb @@ -72,6 +72,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb b/notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb index 463ce79..35ea0bf 100644 --- a/notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_6_gradients.ipynb @@ -81,6 +81,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb b/notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb index 3a7e3e2..0fbedc2 100644 --- a/notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_7_the_details.ipynb @@ -85,6 +85,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_1_introduction/tutorial_optional_bayesian_formalism.ipynb b/notebooks/chapter_1_introduction/tutorial_optional_bayesian_formalism.ipynb index 216a7eb..01032ab 100644 --- a/notebooks/chapter_1_introduction/tutorial_optional_bayesian_formalism.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_optional_bayesian_formalism.ipynb @@ -108,6 +108,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_1_individual_models.ipynb b/notebooks/chapter_advanced/tutorial_1_individual_models.ipynb index 5bf28d6..cc7cae5 100644 --- a/notebooks/chapter_advanced/tutorial_1_individual_models.ipynb +++ b/notebooks/chapter_advanced/tutorial_1_individual_models.ipynb @@ -89,6 +89,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb b/notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb index e24ae01..09f3e0f 100644 --- a/notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb +++ b/notebooks/chapter_advanced/tutorial_2_graphical_model.ipynb @@ -73,6 +73,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_3_graphical_benefits.ipynb b/notebooks/chapter_advanced/tutorial_3_graphical_benefits.ipynb index 0df29b3..644cf83 100644 --- a/notebooks/chapter_advanced/tutorial_3_graphical_benefits.ipynb +++ b/notebooks/chapter_advanced/tutorial_3_graphical_benefits.ipynb @@ -76,6 +76,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_4_hierachical_models.ipynb b/notebooks/chapter_advanced/tutorial_4_hierachical_models.ipynb index 255bc23..2f80f36 100644 --- a/notebooks/chapter_advanced/tutorial_4_hierachical_models.ipynb +++ b/notebooks/chapter_advanced/tutorial_4_hierachical_models.ipynb @@ -73,6 +73,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_5_expectation_propagation.ipynb b/notebooks/chapter_advanced/tutorial_5_expectation_propagation.ipynb index 3081c09..f08c52d 100644 --- a/notebooks/chapter_advanced/tutorial_5_expectation_propagation.ipynb +++ b/notebooks/chapter_advanced/tutorial_5_expectation_propagation.ipynb @@ -73,6 +73,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_optional_hierarchical_ep.ipynb b/notebooks/chapter_advanced/tutorial_optional_hierarchical_ep.ipynb index d030ea3..9d6bd27 100644 --- a/notebooks/chapter_advanced/tutorial_optional_hierarchical_ep.ipynb +++ b/notebooks/chapter_advanced/tutorial_optional_hierarchical_ep.ipynb @@ -58,6 +58,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/chapter_advanced/tutorial_optional_hierarchical_individual.ipynb b/notebooks/chapter_advanced/tutorial_optional_hierarchical_individual.ipynb index 9ba8226..227e2ad 100644 --- a/notebooks/chapter_advanced/tutorial_optional_hierarchical_individual.ipynb +++ b/notebooks/chapter_advanced/tutorial_optional_hierarchical_individual.ipynb @@ -63,6 +63,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/simulators/simulators.ipynb b/notebooks/simulators/simulators.ipynb index 8fa48f3..765363c 100644 --- a/notebooks/simulators/simulators.ipynb +++ b/notebooks/simulators/simulators.ipynb @@ -64,6 +64,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")" diff --git a/notebooks/simulators/simulators_sample.ipynb b/notebooks/simulators/simulators_sample.ipynb index 7b3b14c..b141c6e 100644 --- a/notebooks/simulators/simulators_sample.ipynb +++ b/notebooks/simulators/simulators_sample.ipynb @@ -51,6 +51,20 @@ " subprocess.check_call(\n", " [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n", " )\n", + "\n", + " # Stopgap (PyAutoNerves#167): dependencies that autofit imports lazily,\n", + " # which the released autonerves bootstrap does not yet install and Colab\n", + " # does not ship. Without these the notebook dies partway through a fit.\n", + " # Remove once autonerves > 2026.9.15.1 is released.\n", + " subprocess.check_call(\n", + " [\n", + " sys.executable, \"-m\", \"pip\", \"install\", \"--no-deps\",\n", + " \"corner==2.2.2\",\n", + " \"optax>=0.2.5\",\n", + " \"xxhash<=3.4.1\",\n", + " \"blackjax>=1.6.2\",\n", + " ]\n", + " )\n", " _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n", "\n", "_setup_colab.setup(\"howtofit\")"