Skip to content

Release v0.3.1: docs-only tutorial enhancement - #14

Merged
mmogib merged 2 commits into
mainfrom
v0.3.1-dev
May 24, 2026
Merged

mmogib merged 2 commits into
mainfrom
v0.3.1-dev

Conversation

@mmogib

@mmogib mmogib commented May 24, 2026

Copy link
Copy Markdown
Owner

Release v0.3.1 — docs-only tutorial enhancement

Summary

Adds a new Tutorial page (docs/src/tutorial.md) to the manual,
slotted between Quickstart and Algorithm. Live-evaluated via Documenter
@example blocks so the rendered HTML shows real numbers, an inline
convergence plot, and a results DataFrame.

No source-code changes; no API additions or removals; 242/242 tests
pass unchanged.
Drop-in upgrade from v0.3.0.

What's new

The tutorial walks an end-to-end usage flow with emphasis on the
callback architecture (which v0.3.0 introduced but didn't have a
focused page for):

  • § 1 Setup — minimum-viable solve(NonlinearProblem(F, x0), DFProjection())
  • § 2 Choosing components — overrides for linesearch, inertial, etc.
  • § 3 Built-in observer callbacks — LoggingCallback (per-iter
    table) + HistoryCallback (collect data, plot inline convergence
    curve via Plots.jl)
  • § 4 Stopping criteria as callbacks — AnyOf(AbsResidualTol, MaxIters, MaxTime) composition; documents the
    AbstractStoppingCriterion <: AbstractCallback design
  • § 5 Writing a custom callback — IterateSnapshotCallback from
    scratch, showing the on_event!(cb, cache, event::Symbol) contract
    end-to-end (subtyping, event handling, mutating-cache.x discipline)
  • § 6 Comparative sweep — small 3-problem × 3-line-search loop,
    results aggregated into a DataFrame rendered inline

Companion changes

  • docs/Project.toml: added Plots, DataFrames, LinearAlgebra
    — needed by the new @example blocks (rendered convergence plot in
    § 3, results table in § 6).
  • docs/make.jl: added "Tutorial" => "tutorial.md" to the pages
    list between Quickstart and Algorithm.

Test plan

  • Local doc build (julia --project=docs docs/make.jl) — all
    @example tut blocks evaluate cleanly; convergence plot renders
    via GR; DataFrame renders inline.
  • Library test suite unchanged: 242/242 pass.
  • CI: GitHub Actions (CI.yml) — same matrix as v0.3.0; should be
    identical.

Notes for AutoMerge

  • PATCH bump (0.3.0 → 0.3.1) — not a BREAKING release per Julia semver.
    release.sh correctly classified this and did not require
    --breaking/--notes-file.
  • No new direct deps in the library's Project.toml. Docs-only deps
    (Plots, DataFrames, LinearAlgebra) are confined to docs/Project.toml
    and do not affect AutoMerge's compatibility checks.

mmogib and others added 2 commits May 24, 2026 11:34
New `docs/src/tutorial.md` page (~285 lines, slotted between Quickstart
and Algorithm in the nav) walks a user end-to-end through solving a
monotone equation with DFProjection, then drills into the callback
architecture. Live-evaluated via Documenter `@example` blocks so the
rendered HTML shows real numbers and an inline convergence plot.

Sections:
  § 1  Setup — define a tiny inline F, build a NonlinearProblem,
       solve with DFProjection(), inspect retcode/iters/fevals/residual.
  § 2  Choosing components — swap the line search and inertial rule;
       table summarizing the five pluggable components and their defaults.
  § 3  Built-in observer callbacks — LoggingCallback (per-iter trace,
       configurable columns + interval) and HistoryCallback (collect
       :k/:F_norm per iter, then plot the convergence curve inline via
       Plots.jl). Documents the :resid-is-NaN-until-termination caveat
       and recommends :F_norm for live convergence data.
  § 4  Stopping criteria are callbacks — explains the
       AbstractStoppingCriterion <: AbstractCallback design, composes
       AnyOf(AbsResidualTol, MaxIters, MaxTime) with a 50 ms wall-clock
       cap to demo MaxTime firing first, surfaces the retcode.
  § 5  Writing a custom callback — implements IterateSnapshotCallback
       from scratch (subtypes AbstractCallback, defines on_event! on
       :post_iter, copies cache.x because the solver mutates in place).
       Closes with the three rules: copy cache.x, return nothing for
       observers, event order :initialize → per-iter :post_linesearch
       → :post_iter → :terminate.
  § 6  Comparative sweep — small loop over 3 inline-defined monotone
       operators × 3 built-in line searches, results aggregated into a
       DataFrame and rendered inline. Closing pointer to the
       DFMethods-starter template for larger sweeps.

The tutorial is library-generic, not paper-reproduction: the source
paper is cited ONCE in the § 0 background paragraph and never mentioned
again in the body. Problem names are deliberately paper-agnostic
(`smooth_exp`, `smooth_sine`, `identity_log`) so the tutorial reads as
a generic showcase of the library's API surface.

docs/Project.toml: add Plots, DataFrames, LinearAlgebra (already in
the library's main env via the test path; need to be in docs/ for the
@example blocks to load).

docs/make.jl: add `"Tutorial" => "tutorial.md"` to the pages list
between Quickstart and Algorithm.

Two reviewer agents ran during T.7:
  - Reference-API audit confirmed Plots/DataFrames are NOT in
    docs/Project.toml yet (now added), enumerated the exact callback
    constructor signatures from src/callbacks.jl, verified MaxTime is
    a positional Float64 and AnyOf takes varargs.
  - Post-impl code review caught one 🔴 bug (1-arg F closures — should
    be 2-arg (u, p)→F per SciMLBase's NonlinearProblem contract) and
    three 🟡 hardening items; all fixed. Paper-framing audit cleared.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bump version from 0.3.0 → 0.3.1 (PATCH per Julia semver — no source
changes, no API additions/removals, 242/242 tests pass unchanged).
Promote CHANGELOG entry [0.3.1] with the tutorial-page details from
the preceding `67df38a` commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.74%. Comparing base (094c18c) to head (fb15d52).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #14   +/-   ##
=======================================
  Coverage   90.74%   90.74%           
=======================================
  Files          12       12           
  Lines         670      670           
=======================================
  Hits          608      608           
  Misses         62       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mmogib
mmogib merged commit b315281 into main May 24, 2026
7 checks passed
@mmogib
mmogib deleted the v0.3.1-dev branch May 24, 2026 09:49
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