Skip to content

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

Merged
mmcky merged 1 commit into
mainfrom
conda-channel-defaults
Nov 25, 2026
Merged

mmcky merged 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. dp's own builds run in a container and never read this file, but anyone who makes the environment from it gets that channel. It 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, as the other series' build logs show ("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.

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, in the same container image. 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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
@mmcky

mmcky commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Validation: a full validation

dp builds in the container ghcr.io/quantecon/quantecon-build:latest; none of its workflows reads environment.yml to make an environment. So this change cannot alter dp's build. It was still validated as fully as dp's other changes (#75): a fresh build with no cache of main and of this pull request, each executing all 51 notebooks (cache.yml), each then rendered by ci.yml, which restored exactly that build's cache and executed nothing.

main at 5aaa712, 2026-11-22 this pull request at ef45473, 2026-11-22
fresh build 45012310197 45024496641
render 45015664442 45027256405
  • The environment: both fresh builds ran in the same image, the same digest (sha256:833e117fefbd…).
  • Build logs: no Sphinx warning on either side, and the renders' warning lines are identical.
  • Cell outputs: the warnings and errors are the same on both sides, page by page.
  • The HTML: 13 of 57 pages differ, and no lecture's prose does. The differences are output noise, the same as between any two builds: unseeded draws, timings and solver printouts. The status page differs too, with its build times.

One effect of merging. dp's execution cache is keyed on the hash of environment.yml (quantecon/actions' build-jupyter-cache and restore-jupyter-cache), so this pull request's builds used a new key. cache.yml runs on any push to main that changes environment.yml, so the merge rebuilds main's cache under the new key by itself, in about half an hour. A ci.yml or publish.yml run in that window finds no cache and executes every lecture, which is slower but works, since neither fails on a miss.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Because the change modifies Conda channel precedence and the build environment specification, a human should verify the intended dependency-source policy despite the reported fresh-build validation.

No open issues 🎉

What changed in this PR

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

Changes:

  • Replaces default with defaults in the Conda channel list.
  • Preserves the existing environment configuration and dependencies.
File Description
environment.yml Corrects the Conda channel declaration used to resolve the build environment.

Review effort: Lite (adaptive)

@mmcky

mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation addendum: the 27 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, 27 pages differ, not 13. The 14 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 57 pages differ in output noise; with figures counted it is 27. Here they are, with what differs on each, so the claim can be checked. No page's prose differs, and every one of them also differed when the same main render was compared with the render of #77, another pull request on the same base.

Page What differs between main's render and this pull request's
amss2 figure 2 of 2, from a long simulation whose Markov states mc.simulate draws without a seed
amss3 figures 1 and 4 of 5, from a long simulation whose Markov states mc.simulate draws without a seed
calvo_machine_learn the progress bars of the cell's pip install
career figure 5 of 6, from qe.random.draw, which draws without a seed
chang_credible the progress spinner of the cell's pip install
chang_ramsey the progress bars of the cell's pip install
cons_news memory addresses in printed objects, and figures 3 and 4 of 4, from unseeded LSS.simulate draws
discrete_dp %timeit timings and the printed elapsed times
ifp_discrete relative speeds
ifp_egm the NumPy/JAX speed-up, 11.97x against 10.75x
ifp_egm_transient_shocks the NumPy/JAX speed-up, 14.91x against 14.54x
ifp_opi speed-ups, and figure 2 of 2, which plots run times
jv figures 1 and 2 of 3, from unseeded draws (np.random.beta, np.random.uniform)
lagrangian_lqdp %%timeit timings
lq_inventories figures 1, 2, 4, 5, 6, 12, 15 and 16 of 16, from simulate, which calls LQ.compute_sequence without a seed
lqcontrol figures 1, 2, 8, 9 and 10 of 10, from LQ.compute_sequence, which draws its shocks without a seed
lqramsey figures 1 to 6 of 6, from paths drawn with numpy's unseeded randn
markov_jump_lq figure 2 of 52, from compute_sequence, which draws its shocks without a seed
mccall_q the Q-learning results and figures 3, 5 and 6 of 6, from unseeded draws (np.random.random); #78 seeds them
odu the two solvers' progress lines: each converged in one more iteration (33 rather than 32, and 24 rather than 23), from unseeded draws, and 14 of 15 figures, from unseeded draws (np.random.beta, np.random.uniform)
perm_income figures 1 and 2 of 3, from unseeded draws (np.random.randn)
perm_income_cons figures 1 to 6 of 6, from lss.simulate, which draws without a seed
smoothing figure 1 of 2, from a simulation whose seed is itself drawn at random (np.random.randint)
status the build times
tax_smoothing_1 figures 1 to 3 of 3, from compute_sequence, which draws its shocks without a seed
tax_smoothing_2 figures 1 to 4 of 4, from compute_sequence, which draws its shocks without a seed
tax_smoothing_3 figures 1 and 2 of 2, from compute_sequence, which draws its shocks without a seed

Packages installed inside cells. Five pages run pip install in a cell (amss, calvo_machine_learn, chang_credible, chang_ramsey, odu), which the container's build log doesn't record. On each one, "Successfully installed" lists the same packages at the same versions on both sides.

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