Skip to content

Fix rendered newline escapes in GP regression notebooks#3

Open
jwwtc wants to merge 6 commits into
masterfrom
codex/fix-invalid-json-in-jupyter-notebooks-kyswcr
Open

Fix rendered newline escapes in GP regression notebooks#3
jwwtc wants to merge 6 commits into
masterfrom
codex/fix-invalid-json-in-jupyter-notebooks-kyswcr

Conversation

@jwwtc

@jwwtc jwwtc commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The GP notebooks contained literal escaped newline sequences (\\n) in cell source strings which caused GitHub to show raw \n text instead of rendered markdown/code.
  • The goal was to make the notebooks display normally while preserving the existing model-loading examples.

Description

  • Rewrote src/gaussian_process_regression/gp_regression_a.ipynb and src/gaussian_process_regression/gp_regression_b.ipynb so the cell source arrays contain real newline characters instead of escaped \\n sequences.
  • Kept the notebook structure (cells, metadata.kernelspec, language_info, nbformat/nbformat_minor) and the model-loading code unchanged aside from newline encoding.
  • Addressed the inline diff feedback by ensuring code and markdown sources are written as normal multi-line strings that render properly on GitHub.

Testing

  • Parsed both notebooks with json.loads successfully to confirm valid JSON documents.
  • Verified the first markdown and code cell source entries contain real newline characters using repr(nb['cells'][i]['source'][j]), which showed actual \n characters rather than \\n escapes.
  • Confirmed no literal escaped-newline sequences remain by running rg '\\\\n' src/gaussian_process_regression/gp_regression_a.ipynb src/gaussian_process_regression/gp_regression_b.ipynb and observing no matches.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant