Skip to content

Fix uncomment_jupyter_magic to match all auto* setup_notebook import forms - #231

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/howtolens-tutorial-restructure-f19y9d
Aug 6, 2026
Merged

Fix uncomment_jupyter_magic to match all auto* setup_notebook import forms#231
Jammy2211 merged 1 commit into
mainfrom
claude/howtolens-tutorial-restructure-f19y9d

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

uncomment_jupyter_magic only matched # from autonerves import setup_notebook; setup_notebook(), but every workspace and HowTo script writes the line with the library's own re-export (e.g. # from autolens import setup_notebook; setup_notebook()). The regex mismatch meant generated notebooks never activated their working-directory setup, so notebook execution from a notebook-dir cwd broke — surfaced by HowToLens markdown renders of dataset-loading tutorials failing to resolve their auto-simulate paths.

Changes

  • autohands/build_util.py: the substitution now matches any auto\w+ package and preserves the original import (# from autolens import ...from autolens import ...).

Validation

🤖 Generated with Claude Code

https://claude.ai/code/session_01BxKfSZisjnEn91LRGkN4SU


Generated by Claude Code

uncomment_jupyter_magic only matched the autonerves import form, but
every workspace and HowTo script writes the line as e.g.
'# from autolens import setup_notebook; setup_notebook()' (each library
re-exports it). The regex mismatch meant generated notebooks never
activated their working-directory setup, which broke notebook execution
from a notebook-dir cwd — surfaced by HowToLens markdown renders of
dataset-loading tutorials failing to resolve their auto-simulate paths.
The substitution now matches any auto* package and preserves it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BxKfSZisjnEn91LRGkN4SU
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