Skip to content

Move examples into doctests and fix the in-place Jacobian example - #304

Merged
devmotion merged 1 commit into
masterfrom
dmw/doctest-examples
Sep 24, 2026
Merged

devmotion merged 1 commit into
masterfrom
dmw/doctest-examples

Conversation

@devmotion

Copy link
Copy Markdown
Member

Fixes #114. #128 attempted to fix it by porting A_mul_Bc!(out, A, B) (= A * B') to mul!(out, a + b, a * b), which drops the adjoint. Since then, g! in examples/jacobian.jl has not matched f, and nothing checked it.

This PR:

  • turns examples/gradient.jl and examples/jacobian.jl into doctested examples in the Gradients and Jacobians sections of the API docs, with the adjoint restored (g!(out, a, b) = mul!(out, a + b, (a * b)')), and removes examples/
  • defines f and ∇f! inline in the README benchmark instead of include(joinpath(Pkg.dir("ReverseDiff"), "examples/gradient.jl"))

🤖 Generated with Claude Code

 #114)

#128 ported `A_mul_Bc!(out, A, B)` (= `A * B'`) to `mul!(out, a + b, a * b)`,
dropping the adjoint, so `g!` no longer matched `f`. The examples are now
doctests in the Gradients and Jacobians sections of the API docs, so CI checks
them, and `examples/` is removed.

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

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.21%. Comparing base (92f263c) to head (bc37fa0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #304   +/-   ##
=======================================
  Coverage   88.21%   88.21%           
=======================================
  Files          19       19           
  Lines        1934     1934           
=======================================
  Hits         1706     1706           
  Misses        228      228           

☔ View full report in Codecov by Harness.
📢 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.

@devmotion
devmotion merged commit 68c5a56 into master Sep 24, 2026
8 checks passed
@devmotion
devmotion deleted the dmw/doctest-examples branch September 24, 2026 10:47
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.

Missing A_mul_Bc! Function in Example

1 participant