Split skills - #646
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the repo’s marimo/Jupyter conversion guidance by introducing a focused marimo-wandb-notebooks skill (with repo-specific references) and adding scripts + source lists to support converting Colab notebooks into marimo .py files with diagnostics.
Changes:
- Added
scripts/convert-colab-to-marimo.pyto batch-convert.ipynbfiles to marimo notebooks and captureconvert/checkdiagnostics. - Added/updated conversion inputs under
scripts/colab_sources/(CSV export + path list + list-builder helper). - Replaced prior vendored/general marimo skills with a single W&B-specific marimo skill and reference docs.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/convert-colab-to-marimo.py |
New CLI tool to convert/check notebooks and write per-notebook diagnostics + batch summary. |
scripts/colab_sources/notebook_paths.txt |
Curated batch input list for conversion (notebook paths). |
scripts/colab_sources/Notebook_mentions_Exported_wandb_docs_models_list.csv |
Source export used to derive candidate notebook paths. |
scripts/colab_sources/make_list.py |
Helper script to normalize CSV “Path” values into a de-duplicated notebook path list. |
marimo/convert/convert-summary.txt |
Example/generated batch summary output from a conversion run. |
.gitignore |
Adds ignores related to marimo conversion artifacts. |
.agents/skills/README.md |
Updates skills index and points to the conversion script. |
.agents/skills/marimo-wandb-notebooks/SKILL.md |
New consolidated skill for W&B marimo notebooks + conversion workflow pointers. |
.agents/skills/marimo-wandb-notebooks/references/wandb-patterns.md |
New W&B SDK patterns for marimo tutorials (auth, runs, expected failures, etc.). |
.agents/skills/marimo-wandb-notebooks/references/tutorial-notebook-objectives.md |
New guidance for preserving tutorial narrative/teaching surface during conversion. |
.agents/skills/marimo-wandb-notebooks/references/marimo-idioms.md |
New marimo mechanics checklist (reactivity, gating, rendering, etc.). |
.agents/skills/marimo-wandb-notebooks/references/convert-cleanup.md |
New checklist for triaging converter output and fixing marimo check failures. |
.agents/skills/marimo-notebook/SKILL.md |
Removed prior vendored/general marimo skill. |
.agents/skills/marimo-notebook/references/WATCHING.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/UI.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/TOP-LEVEL-IMPORTS.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/STATE.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/SQL.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/REACTIVITY.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/PYTEST.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/EXPORTS.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/EXPENSIVE.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/DEPLOYMENT.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/CONFIGURATION.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/COLUMNS.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/references/ANYWIDGET.md |
Removed (was part of vendored/general marimo skill). |
.agents/skills/marimo-notebook/LICENSE |
Removed (license for vendored/general marimo skill). |
.agents/skills/marimo-example-notebook/SKILL.md |
Removed (replaced by the new consolidated marimo-wandb-notebooks skill). |
.agents/skills/jupyter-to-marimo/SKILL.md |
Removed prior vendored conversion skill (workflow moved into scripts + new references). |
.agents/skills/jupyter-to-marimo/references/widgets.md |
Removed (was part of vendored conversion skill). |
.agents/skills/jupyter-to-marimo/references/latex.md |
Removed (was part of vendored conversion skill). |
.agents/skills/jupyter-to-marimo/LICENSE |
Removed (license for vendored conversion skill). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if not (repo_root / MARIMO_DIR).is_dir(): | ||
| raise PrepareError( | ||
| "Run this script from the root of the wandb/examples repository " | ||
| "(the directory containing examples/marimo)." | ||
| ) |
| Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py) | ||
| to create the initial marimo notebook from a Jupyter `.ipynb`, capture | ||
| `marimo check` output, and write a temporary `.conversion/` report directory | ||
| for the polishing pass. The report directory includes a Markdown handoff, | ||
| raw convert/check output, structured JSON metadata, and an event log. |
| def create_path_list_file(args): | ||
| """Read the CSV Path column and write unique normalized paths, one per line.""" | ||
| with open(args.input_file, newline="", encoding="utf-8") as f: | ||
| paths = { | ||
| normalize_path(row["Path"]) | ||
| for row in csv.DictReader(f) | ||
| if row.get("Path") | ||
| } | ||
|
|
||
| with open(args.output_file, "w") as f: | ||
| f.write("\n".join(sorted(paths))) | ||
| f.write("\n") |
| - prepare_failed: examples/boosting-algorithms/xgboost-housing/train.py | ||
| target: marimo/convert/train/train.py | ||
| failed_stage: prepare | ||
| log: - | ||
| error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/boosting-algorithms/xgboost-housing/train.py | ||
|
|
| colabs/intro/Intro_to_Weights_&_Biases_keras.ipynb | ||
| colabs/intro/Report_API_Quickstart.ipynb | ||
| colabs/intro/run_quickstart.ipynb | ||
| colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb |
| examples/boosting-algorithms/xgboost-housing/train.py | ||
| examples/keras/keras-cnn-fashion/train.py | ||
| examples/pytorch/pytorch-cnn-fashion/fashion_data.py | ||
| examples/pytorch/pytorch-ddp/log-ddp.py | ||
| examples/tensorflow/tf-cnn-fashion/train.py | ||
| examples/tensorflow/tf-estimator-mnist/mnist.py | ||
| examples/wandb-sweeps/sweeps-xgboost/xgboost_tune.py |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (6)
scripts/convert-colab-to-marimo.py:63
validate_repo_root()checks for a top-levelmarimo/directory, but the error message says the repo root is "the directory containing examples/marimo". These don’t match (andexamples/marimoexists even whenmarimo/doesn’t). Align the check and message (e.g., validateexamples/marimo/to detect repo root, and createmarimo/output dir as needed).
.agents/skills/README.md:20- This README says the conversion script writes a temporary
.conversion/report directory with a Markdown handoff and event log, butscripts/convert-colab-to-marimo.pycurrently writesmarimo/convert/<name>/.logs/andmarimo/convert/convert-summary.txtonly. Update the README (or the script) so the documented output directory name + contents match reality.
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
scripts/colab_sources/make_list.py:24
create_path_list_file()currently includes every row’sPathvalue, which (per the checked-in CSV) includes non-notebook.pypaths. That produces anotebook_paths.txtthat will reliably fail inconvert-colab-to-marimo.py(it enforces.ipynb). Filter to.ipynbentries (and optionally honor the CSV’s "Keep?" column) before writing the path list.
def create_path_list_file(args):
"""Read the CSV Path column and write unique normalized paths, one per line."""
with open(args.input_file, newline="", encoding="utf-8") as f:
paths = {
normalize_path(row["Path"])
for row in csv.DictReader(f)
if row.get("Path")
}
scripts/colab_sources/notebook_paths.txt:37
- This path list mixes
.ipynbnotebooks with Python scripts (examples/.../*.py).scripts/convert-colab-to-marimo.pyrejects non-.ipynbinputs, so these entries will always show up asprepare_failedin batch runs. Split these into a separate list or remove them from this conversion input file.
scripts/colab_sources/notebook_paths.txt:13 colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynbdoesn’t exist in-repo (current file iscolabs/keras/Legacy_Keras_pipeline_with_Weights_and_Biases.ipynb), so batch conversion will always fail this entry. Update the path list to the correct notebook filename.
marimo/convert/convert-summary.txt:56- This looks like generated, machine-specific output (timestamped header + run results) and it includes absolute local filesystem paths (e.g.
/Users/...) in error messages. It’s not stable for version control and may leak local environment details. Consider removing this from the repo and addingmarimo/convert/convert-summary.txt(and possiblymarimo/convert/**/.logs/) to.gitignore, or sanitize output before committing.
- prepare_failed: examples/boosting-algorithms/xgboost-housing/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/boosting-algorithms/xgboost-housing/train.py
- prepare_failed: examples/keras/keras-cnn-fashion/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/keras/keras-cnn-fashion/train.py
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (6)
scripts/convert-colab-to-marimo.py:63
- The repo-root validation error message points to
examples/marimo, but the actual check is for a top-levelmarimo/directory (repo_root / MARIMO_DIR). This will confuse users when the check fails; update the message (or the check) so the referenced directory matches what the script requires.
.agents/skills/README.md:20 - This README claims
scripts/convert-colab-to-marimo.pywrites a.conversion/report directory with a Markdown handoff, event log, etc., but the script currently writes diagnostics tomarimo/convert/<name>/.logs/and a batch summary file. Please update the README to match the script output (or implement the described.conversion/output).
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
scripts/colab_sources/notebook_paths.txt:12
- This batch list references
colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb, but that file does not exist in the repository. Running--batchwill always produce aprepare_failedentry for it; either fix the path or remove it from the list.
scripts/colab_sources/notebook_paths.txt:37 - This batch list includes several
.pyscripts (not.ipynbnotebooks).convert-colab-to-marimo.pyexplicitly rejects non-.ipynbinputs, so these entries will always fail in batch mode; the path list should contain only notebooks intended for conversion (or the script/list format should be adjusted to support.py).
marimo/convert/convert-summary.txt:50 - This file appears to be generated output from a local conversion run and includes machine-specific absolute paths (e.g.
/Users/...). Committing it makes the repo non-deterministic/noisy and can leak local environment details; consider removing it from version control and adding an ignore rule formarimo/convert/**(or at leastmarimo/convert/convert-summary.txt).
- prepare_failed: examples/boosting-algorithms/xgboost-housing/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/boosting-algorithms/xgboost-housing/train.py
.agents/skills/marimo-wandb-notebooks/references/wandb-patterns.md:30
- There is an empty list item (
-with no content), which renders as a dangling bullet in the rendered markdown. Please remove it or replace it with the intended guidance.
- Prefer run-bound methods such as `wandb.Run.log()`, `wandb.Run.log_artifact()`, and
`wandb.Run.summary` unless the tutorial intentionally teaches a global
API from `wandb.apis.public`.
-
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (8)
scripts/convert-colab-to-marimo.py:63
- The repo-root validation error message references
examples/marimo, but the check is for a top-levelmarimo/directory (repo_root / MARIMO_DIR). This is likely to confuse users running the script from the correct root; update the message to match the actual expected directory (e.g. “directory containing marimo/”).
.agents/skills/README.md:20 - This README says the converter script writes a
.conversion/report directory with a Markdown handoff and event log, butscripts/convert-colab-to-marimo.pycurrently writes diagnostics undermarimo/convert/<name>/.logs/(JSON + command logs). Please either update this text to match the script’s actual outputs, or implement the described.conversion/report directory so the guidance is accurate.
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
scripts/colab_sources/notebook_paths.txt:12
- This path list entry doesn’t exist in the repo (
colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb); the current notebook appears to becolabs/keras/Legacy_Keras_pipeline_with_Weights_and_Biases.ipynb. Keeping a non-existent path here causes avoidableprepare_failedresults in batch runs.
scripts/colab_sources/notebook_paths.txt:37 - The batch path list includes several non-
.ipynbfiles (examples/**.py), but the converter enforces.ipynbinputs and will always mark these asprepare_failed. If this file is meant to drive--batch, it should contain only notebooks (ormake_list.pyshould filter to.ipynbentries).
marimo/convert/convert-summary.txt:56 - This committed conversion summary contains machine-specific absolute paths including a local username (e.g.
/Users/noahluna/...). That’s not portable and can leak personal/environment details. If this file is just a generated artifact, it should be removed from version control (and/or sanitized) and ignored going forward.
- prepare_failed: examples/boosting-algorithms/xgboost-housing/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/boosting-algorithms/xgboost-housing/train.py
- prepare_failed: examples/keras/keras-cnn-fashion/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/keras/keras-cnn-fashion/train.py
scripts/colab_sources/make_list.py:24
make_list.pycurrently writes every non-emptyPathentry from the CSV, which includes non-notebook files (e.g.examples/**.py) and leads to guaranteedprepare_failedentries when used withconvert-colab-to-marimo.py --batch. If the intent is “notebook paths”, filter to.ipynb(or add a flag to include non-notebook paths explicitly).
def create_path_list_file(args):
"""Read the CSV Path column and write unique normalized paths, one per line."""
with open(args.input_file, newline="", encoding="utf-8") as f:
paths = {
normalize_path(row["Path"])
for row in csv.DictReader(f)
if row.get("Path")
}
scripts/colab_sources/make_list.py:28
- The output file is opened without an explicit encoding (
open(args.output_file, "w")). For consistency with the CSV read (and to avoid platform-dependent defaults), write usingencoding="utf-8"as well.
with open(args.output_file, "w") as f:
f.write("\n".join(sorted(paths)))
f.write("\n")
.agents/skills/marimo-wandb-notebooks/references/wandb-patterns.md:30
- There’s an empty list item (
-with no content) here, which renders as a blank bullet and looks like an editing artifact. Please remove it or replace it with the intended guidance.
- Prefer run-bound methods such as `wandb.Run.log()`, `wandb.Run.log_artifact()`, and
`wandb.Run.summary` unless the tutorial intentionally teaches a global
API from `wandb.apis.public`.
-
## Entity
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (7)
scripts/convert-colab-to-marimo.py:63
- The repo-root validation error message references
examples/marimo, but this script validates the presence of a top-levelmarimo/directory (MARIMO_DIR = Path("marimo")). This will mislead users about where to run the script from; update the message to match the actual expected directory (e.g., "the directory containing marimo/").
.agents/skills/README.md:20 - This README claims the converter writes a temporary
.conversion/report directory with a Markdown handoff/event log, but the actual converter writes undermarimo/convert/<name>/.logs/and producesresult.jsonplusmarimo-*.log. Either update this documentation to match the script’s current outputs or adjust the script to produce the described.conversion/report directory.
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
scripts/colab_sources/make_list.py:28
create_path_list_filewrites every non-emptyPathvalue from the CSV, which allows non-notebook paths (e.g..py) into the batch list. Sinceconvert-colab-to-marimo.pyrejects non-.ipynbinputs, the generated list will systematically createprepare_failedentries. Filter to*.ipynbhere (or write separate lists for notebooks vs code examples).
def create_path_list_file(args):
"""Read the CSV Path column and write unique normalized paths, one per line."""
with open(args.input_file, newline="", encoding="utf-8") as f:
paths = {
normalize_path(row["Path"])
for row in csv.DictReader(f)
if row.get("Path")
}
with open(args.output_file, "w") as f:
f.write("\n".join(sorted(paths)))
f.write("\n")
scripts/colab_sources/notebook_paths.txt:37
- This batch list includes several
.pyfiles (not.ipynb). The converter in this PR hard-requires.ipynbinputs, so these entries will always fail in batch mode. Remove non-notebook entries or split them into a separate list consumed by a different tool.
marimo/convert/convert-summary.txt:56 - This committed
convert-summary.txtcontains machine-specific absolute paths (e.g./Users/...) and reflects a local run’s transient results. This is noisy and non-reproducible in-repo; prefer not committing generated conversion reports (add to.gitignore) or ensure the tooling always records repo-relative paths only.
- prepare_failed: examples/boosting-algorithms/xgboost-housing/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/boosting-algorithms/xgboost-housing/train.py
- prepare_failed: examples/keras/keras-cnn-fashion/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/keras/keras-cnn-fashion/train.py
scripts/colab_sources/notebook_paths.txt:12
- This path does not exist in the repo (it causes a
prepare_failedin the committed convert summary). There is acolabs/keras/Legacy_Keras_pipeline_with_Weights_and_Biases.ipynbnotebook instead; update this entry to the correct existing notebook path so batch conversion can run cleanly.
.agents/skills/marimo-wandb-notebooks/references/wandb-patterns.md:30 - There is a stray empty list item (
-with no content), which looks like an incomplete guideline and renders oddly in Markdown. Remove the empty bullet or replace it with the intended content.
- Prefer run-bound methods such as `wandb.Run.log()`, `wandb.Run.log_artifact()`, and
`wandb.Run.summary` unless the tutorial intentionally teaches a global
API from `wandb.apis.public`.
-
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (7)
scripts/convert-colab-to-marimo.py:63
validate_repo_root()checks for a top-levelmarimo/directory (repo_root / MARIMO_DIR), but the error message tells users to run from the directory containingexamples/marimo. This is confusing and may send users to the wrong location. Either change the check to validateexamples/marimo/(seems more stable in this repo) or update the error text to reference the requiredmarimo/output directory explicitly.
scripts/colab_sources/make_list.py:28create_path_list_file()writes every unique normalizedPathfrom the CSV, including non-notebook paths (e.g..py). Sinceconvert-colab-to-marimo.pyrequires.ipynb, the list generator should likely filter to.ipynbpaths (or write separate lists) to avoid guaranteed batch failures.
def create_path_list_file(args):
"""Read the CSV Path column and write unique normalized paths, one per line."""
with open(args.input_file, newline="", encoding="utf-8") as f:
paths = {
normalize_path(row["Path"])
for row in csv.DictReader(f)
if row.get("Path")
}
with open(args.output_file, "w") as f:
f.write("\n".join(sorted(paths)))
f.write("\n")
scripts/colab_sources/notebook_paths.txt:14
- The batch list includes
colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb, but that file doesn’t exist in the repo (there isLegacy_Keras_pipeline_with_Weights_and_Biases.ipynbinstead). This will always produce aprepare_failedentry; update the path to the correct notebook or remove it.
scripts/colab_sources/notebook_paths.txt:37 - The batch list includes several
.pyfiles underexamples/…(notebooks converter requires.ipynb). These entries will always fail inprepare_notebook()and can mask real conversion issues. Remove them from this list or split them into a separate non-notebook list.
marimo/convert/convert-summary.txt:56 marimo/convert/convert-summary.txtlooks like generated output from a local run and it includes an absolute local path (/Users/...) in error messages. This is environment-specific and can leak developer machine details; it should likely not be committed (add to.gitignoreor move to an example/docs location with paths redacted).
- prepare_failed: examples/boosting-algorithms/xgboost-housing/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/boosting-algorithms/xgboost-housing/train.py
- prepare_failed: examples/keras/keras-cnn-fashion/train.py
target: marimo/convert/train/train.py
failed_stage: prepare
log: -
error: input must be a .ipynb file: /Users/noahluna/Desktop/examples_group/examples/examples/keras/keras-cnn-fashion/train.py
.agents/skills/README.md:20
- The README says
scripts/convert-colab-to-marimo.pywrites a temporaryexamples/marimo/*/.conversion/report directory with a Markdown handoff and event log, but the converter script (and the marimo-wandb-notebooks skill) describe outputs undermarimo/convert/<name>/.logs/+convert-summary.txt. Please update this section to match the actual converter outputs, or implement the.conversion/report directory if that’s the intended behavior.
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
.agents/skills/marimo-wandb-notebooks/references/wandb-patterns.md:31
- There is an empty list item (
-) under “Runs And Reruns” which renders as a blank bullet. Remove it or replace it with the intended guidance.
- Prefer run-bound methods such as `wandb.Run.log()`, `wandb.Run.log_artifact()`, and
`wandb.Run.summary` unless the tutorial intentionally teaches a global
API from `wandb.apis.public`.
-
## Entity
|
|
|
||
| # drop slow mirror from list of MNIST mirrors | ||
| torchvision.datasets.MNIST.mirrors = [mirror for mirror in torchvision.datasets.MNIST.mirrors | ||
| if not mirror.startswith("http://yann.lecun.com")] |
|
|
||
| # remove slow mirror from list of MNIST mirrors | ||
| torchvision.datasets.MNIST.mirrors = [mirror for mirror in torchvision.datasets.MNIST.mirrors | ||
| if not mirror.startswith("http://yann.lecun.com")] |
| model_runner = model.RunModel(cfg, params) | ||
| processed_feature_dict = model_runner.process_features(feature_dict, random_seed=0) | ||
| prediction_result = model_runner.predict(processed_feature_dict) | ||
| mean_plddt = prediction_result['plddt'].mean() |
| x_train, x_test = (x_train / 255.0, x_test / 255.0) | ||
| x_train, y_train = (x_train[::5], y_train[::5]) | ||
| x_test, y_test = (x_test[::20], y_test[::20]) | ||
| labels = [str(digit) for digit in range(np.max(y_train) + 1)] |
| autolog(init=dict(project="diffusers_logging")) | ||
|
|
||
| # call the pipeline to generate the images | ||
| images = pipeline( |
| "optimizer": "Adam"} | ||
|
|
||
| entity = wandb_entity.value.strip() or None | ||
| model = train_and_log(train_config, entity=entity) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 83 out of 107 changed files in this pull request and generated 3 comments.
Suppressed comments (6)
scripts/colab_sources/notebook_paths.txt:37
- This path list is fed to scripts/convert-colab-to-marimo.py, which only accepts .ipynb inputs. The entries below are .py files and will consistently fail batch conversion ("input must be a .ipynb file"). Consider removing non-notebook entries from this list (or splitting into a separate list/command for scripts), so batch conversion is deterministic.
scripts/colab_sources/notebook_paths.txt:12 - This notebook path does not exist in the repository, so batch conversion will fail at the prepare stage ("input file does not exist"). Either correct the path to the actual notebook filename/location or remove it from the batch list.
marimo/convert/lcm-diffusers/lcm_diffusers.py:40 - The markdown references a local asset (./assets/diffusers-autolog-4.gif), but there is no assets/ directory alongside this notebook, so the image will be broken. Either add the asset to the repo at that path or change the link to a stable hosted URL.
marimo/convert/torchtune-and-wandb/torchtune_and_wandb.py:49 - Typo in the tutorial title: "Weigths" should be "Weights".
.agents/skills/README.md:20 - This README says convert-colab-to-marimo.py writes a temporary examples/marimo/*/.conversion/ report directory, but the script currently writes diagnostics under marimo/convert//.logs/ (and does not reference .conversion). Please align the documentation with the script output locations to avoid confusing agent workflows.
## Scripts
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
scripts/convert-colab-to-marimo.py:316
- The logged command arguments embed absolute local paths (e.g. /Users/...) into result.json and marimo-*.log outputs. Since these logs are committed, this leaks workstation-specific paths and makes diffs noisy. Prefer invoking marimo with repo-relative paths (e.g., source.relative_to(repo_root)) and logging those instead.
| # /// script | ||
| # dependencies = ["", "accelerate", "diffusers", "install-log", "transformers", "wandb"] | ||
| # /// |
| # /// script | ||
| # dependencies = ["-"] | ||
| # /// |
| @app.cell | ||
| def _(openai): | ||
| # pass your OpenAI key | ||
| openai.api_key = 'sk-foo' | ||
| return |
| with wandb.init(project="visualize-predictions", name="html") as run: | ||
| # Log HTML from file | ||
| path_to_html = "examples/data/some_html.html" | ||
| run.log({"custom_file": wandb.Html(open(path_to_html))}) |
| # Initialize a new run | ||
| with wandb.init(project="visualize-predictions", name="3d_objects") as run: | ||
| path_to_obj = "examples/data/wolf.obj" | ||
| run.log({"3d_object": wandb.Object3D(open(path_to_obj))}) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 83 out of 107 changed files in this pull request and generated 1 comment.
Suppressed comments (9)
scripts/convert-colab-to-marimo.py:63
validate_repo_root()checks for a top-levelmarimo/directory, but the error message says the repo root is the directory containingexamples/marimo. That mismatch is confusing when users run the script from the wrong directory.
scripts/colab_sources/notebook_paths.txt:12- This path does not exist in the repo (conversion summary shows
prepare_failed). There is aLegacy_Keras_pipeline_with_Weights_and_Biases.ipynbfile under the same directory, which is likely what you intended to include in the batch list.
scripts/colab_sources/notebook_paths.txt:37 - This batch list is used by
convert-colab-to-marimo.py, which rejects non-.ipynbinputs. Including these.pypaths causes deterministicprepare_failedentries inmarimo/convert/convert-summary.txtand makes batch results noisy.
marimo/convert/lcm-diffusers/lcm_diffusers.py:3 - The PEP 723 dependency list contains invalid entries (
""and"install-log") and is missingtorch, which is imported later in the notebook. As-is,uv/marimo sandbox resolution will fail before the notebook can run.
marimo/convert/torchtune-and-wandb/torchtune_and_wandb.py:3 - The PEP 723 dependency list is
"-", which is not a valid package specifier. This breaksuv/marimo sandbox resolution for the notebook.
marimo/convert/openai-api-autologger-quickstart/openai_api_autologger_quickstart.py:109 - This cell hardcodes an OpenAI API key string (
sk-foo). Even as a placeholder, committingsk-...patterns tends to trigger secret-scanning workflows and encourages copying the pattern. Prefer relying on environment-based auth (OPENAI_API_KEY) or prompting the user via a secure UI input without committing key-shaped literals. Note: the same literal also exists incolabs/openai/OpenAI_API_Autologger_Quickstart.ipynb, so addressing this properly likely needs a coordinated change across both source and converted notebooks.
scripts/convert-colab-to-marimo.py:316 - The command arguments recorded in
.logs/include absolute paths (e.g./Users/...). Sincecwd=repo_root, you can pass repo-relative paths when possible to make committed logs more portable and avoid leaking developer-specific paths.
marimo/convert/use-wandbmodelcheckpoint-in-your-keras-workflow/use_wandbmodelcheckpoint_in_your_keras_workflow.py:3 - This notebook imports
tensorflowandtensorflow_datasets, but the PEP 723 dependency list only includeswandb. In marimo sandbox/script mode, this will fail at import time unless those dependencies happen to be preinstalled. This same dependency-mismatch pattern also appears inmarimo/convert/use-wandbmetriclogger-in-your-keras-workflow/use_wandbmetriclogger_in_your_keras_workflow.py(and likely needs to be fixed systematically for converted notebooks).
marimo/convert/organizing-hyperparameter-sweeps-in-pytorch-with-w-b/organizing_hyperparameter_sweeps_in_pytorch_with_w_b.py:3 - This notebook later imports
torchandtorchvision, but the PEP 723 dependency list only includeswandb. This will break marimo sandbox/script execution unless those packages are preinstalled. (This appears to be a broader issue across several converted notebooks withdependencies = ["wandb"].)
| # /// script | ||
| # dependencies = ["client.git@molecule_tables @ git+https://github.com/wandb/client.git@molecule_tables"] | ||
| # /// |
Summary
Adds tooling (Python scripts) for converting Colab/Jupyter notebooks to marimo and consolidates marimo conversion guidance into a focused W&B-specific skill.
How this works
scripts/convert-colab-to-marimo.pyconverts individual.ipynbnotebooks or a batch list to marimo.pyfiles. It runsmarimo convertand an initialmarimo check. Records and saves diagnostics as JSON and/or.txtfiles.Outputs are written under
marimo/convert/:Converted notebooks may still need cleanup before they can run successfully on molab. An agent uses the generated output files (
.json) to identify blockers, then use the marimo notebook skill to fix reactive-graph issues (i.e. marimo idioms) and preserve tutorial intent (i.e. preserve teaching qualities of the notebook).Skill updates
Replaces the previous general marimo/Jupyter conversion guidance with one repo-specific skill:
Key changes:
SKILL.md: defines the conversion and cleanup workflow.convert-cleanup.md: covers conversion diagnostics and cleanup.marimo-idioms.md: contains marimo mechanics and reactive-notebook conventions.tutorial-notebook-objectives.md: covers tutorial narrative, purposewandb-patterns.md: contains W&B SDK conventionsscripts/convert-colab-to-marimo.pyhandles mechanical conversion and initial validation; agents rerunmarimo checkduring cleanup and final verification.Scripts added
scripts/colab_sources/make_list.py: converts the source CSV into a deduplicated notebook path list.scripts/colab_sources/notebook_paths.txt: batch input for conversion.scripts/convert-colab-to-marimo.py: converts notebooks, runs the initial check, and records diagnostics.