Skip to content

environment.yml: the Anaconda channels are defaults - #669

Open
mmcky wants to merge 1 commit into
mainfrom
conda-channel-defaults
Open

mmcky wants to merge 1 commit into
mainfrom
conda-channel-defaults

Conversation

@mmcky

@mmcky mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

environment.yml names the conda channel default:

Before After
channels: - default channels: - defaults

default is the anaconda.org user channel of that name, not Anaconda's own channels, which conda calls defaults. That channel is empty today, so the environment resolves from defaults all the same: conda env update appends defaults to an environment file's channels unless the file lists nodefaults, and the build logs list "Channels: - default - defaults". But conda searches default first, so anything ever uploaded there would take precedence. The review of the lecture monorepo's GPU leg found it, which had copied the line (QuantEcon/lectures#87). All six lecture series have it.

Not changed here. _notebook_repo/environment.yml still names default. It is the environment publish.yml copies into the notebooks repository that Binder uses, and it is out of date in other ways too (python 3.8), so it needs its own update and a check that Binder still builds. This pull request fixes only the environment the series' own builds use; the others are a separate follow-up.

This is part of reporting fixes upstream to each series, their source of truth (QuantEcon/project-monorepo#77).

Validation

Done on 2026-11-22, a full validation: fresh builds with no cache of this pull request and of main, every lecture executed, both green; the installed packages are identical. The evidence is in the comment below.

This changes the build environment's specification, so it needs a person's review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

`channels: - default` names the anaconda.org user channel "default", not
Anaconda's own channels, which conda calls `defaults`. That channel is
empty today, so the environment resolves from `defaults` all the same (the
runner's .condarc adds it after), but conda searches `default` first, so
anything uploaded there would take precedence. Found by the review of the
lecture monorepo's GPU leg, which copied the line (QuantEcon/lectures#87).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
@github-actions

Copy link
Copy Markdown

@mmcky

mmcky commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Validation: a full validation

Two fresh builds with no cache, each executing all 26 notebooks, -W --keep-going, both green:

Build Run
main at bae31ee, this branch's base, 2026-11-22 45024407088
this pull request at 0eaf974, 2026-11-22 45018155779

The channel. Main's build configured conda with channels: - default; this pull request's with channels: - defaults.

The installed packages are identical. Each build used the same 504 conda packages, every one at the same version and build, and the same 59 pip packages. The package lists are taken from setup-miniconda's own record of the package directories it cached, and from pip's "Successfully installed" lines.

Build logs. The same warning lines on both sides, and no Sphinx warning on either.

Cell outputs. The warnings and errors in the cell outputs are the same on both sides, page by page.

The HTML. 13 of 31 pages differ, and no lecture's prose does. The differences are output noise, the same as between any two builds: timings, memory addresses and unseeded draws. The status page differs too, with its build times.

@mmcky
mmcky marked this pull request as ready for review November 22, 2026 13:24
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 13:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human review is warranted because changing the primary Conda channel alters dependency-resolution precedence across all build environments, requiring confirmation of channel-priority behavior and reproducibility beyond the reported fresh-build validation.

No open issues 🎉

What changed in this PR

Corrects the primary Conda environment to use Anaconda’s official defaults channel instead of the unrelated default user channel, preventing unintended package-source precedence during builds.

Changes:

  • Replaces default with defaults in environment.yml.
  • Leaves the separate notebook/Binder environment unchanged for follow-up work.
File Description
environment.yml Corrects the Conda channel used by the repository’s build and CI environments.

Review effort: Lite (adaptive)

@mmcky

mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation addendum: the 15 pages that differ

Corrected on 2026-11-22 at 15:46 UTC, after this was first posted. The comparison behind the evidence comment compared a figure only when the page wraps it in a link, and this series doesn't, so a page whose only difference is a figure wasn't counted. With every figure now compared by content, 15 pages differ, not 13. The 2 added pages are in the table below and differ only in figures. The conclusion doesn't change: no page's prose differs.

The evidence comment above says 13 of 31 pages differ in output noise; with figures counted it is 15. Here they are, with what differs on each, so the claim can be checked. No page's prose differs. There was no second build of the same main to compare against, so the reason given for each comes from the lecture's own code.

Page What differs between main's build and this pull request's
functions printed values and all four figures, from unseeded draws
matplotlib figures 7, 8 and 15 of 17, from random parameters drawn with Python's unseeded uniform and scipy's norm.rvs
names memory addresses in printed module dictionaries
numba estimates from unseeded draws, the kernel's temporary file number inside a typing error message that both sides show, and figures 2 and 4 of 4, from unseeded draws
numpy unseeded random arrays, and figure 6 of 6, from unseeded draws
oop_intro the object identities printed by id()
pandas the progress counters of the cell's pip install, and the "daily returns" drawn from an unseeded generator
pandas_panel a memory address in an object's repr
polars the progress bars of the cell's pip install, values drawn from an unseeded generator, and the 2021 returns computed from Yahoo Finance prices downloaded at build time, which differ in the fifth significant figure (for example 14.922529 against 14.922493)
python_advanced_features the memory addresses of generator objects, and its one figure, from unseeded draws
python_by_example a Monte Carlo estimate of π and 9 of 11 figures, from unseeded draws
python_oop memory addresses in a class's __dict__, and values simulated with Python's unseeded random
scipy unseeded random arrays and estimates, and figures 1 and 2 of 4, from unseeded draws
status the build times and the GPU report's timestamp
sympy figures 3 and 4 of 6, two plot_implicit plots: sympy jitters its sampling mesh with an unseeded np.random.rand, so the curves' edges are shaded slightly differently

Packages installed inside cells. Three pages run pip install in a cell (jax_intro, pandas, polars), which the build log doesn't record. On each one, "Successfully installed" lists the same packages at the same versions on both sides.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants