Release v0.3.1: docs-only tutorial enhancement - #14
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
@exampleblocks so the rendered HTML shows real numbers, an inlineconvergence 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):
solve(NonlinearProblem(F, x0), DFProjection())linesearch,inertial, etc.LoggingCallback(per-itertable) +
HistoryCallback(collect data, plot inline convergencecurve via Plots.jl)
AnyOf(AbsResidualTol, MaxIters, MaxTime)composition; documents theAbstractStoppingCriterion <: AbstractCallbackdesignIterateSnapshotCallbackfromscratch, showing the
on_event!(cb, cache, event::Symbol)contractend-to-end (subtyping, event handling, mutating-
cache.xdiscipline)results aggregated into a
DataFramerendered inlineCompanion changes
docs/Project.toml: addedPlots,DataFrames,LinearAlgebra— needed by the new
@exampleblocks (rendered convergence plot in§ 3, results table in § 6).
docs/make.jl: added"Tutorial" => "tutorial.md"to thepageslist between Quickstart and Algorithm.
Test plan
julia --project=docs docs/make.jl) — all@example tutblocks evaluate cleanly; convergence plot rendersvia GR; DataFrame renders inline.
identical.
Notes for AutoMerge
release.shcorrectly classified this and did not require--breaking/--notes-file.Project.toml. Docs-only deps(Plots, DataFrames, LinearAlgebra) are confined to
docs/Project.tomland do not affect AutoMerge's compatibility checks.