Skip to content

Conversation

@ChrisRackauckas
Copy link
Member

Summary

Fixes the DiffEqDocs.jl build failure that was occurring due to incorrect @example block references in the SDE tutorial documentation.

Problem

The documentation build was failing with this error:

┌ Error: failed to run `@example` block in docs/src/tutorials/sde_example.md:195-197
│ ```@example sde
│ Plots.plot(sol, idxs = (1, 2, 3))
│ ```
│   exception =
│    ArgumentError: Collection has multiple elements, must contain exactly 1 element

Root Cause

In Documenter.jl, variables are scoped to their @example block name. The issue was that plotting commands in @example sde blocks were trying to reference sol variables that were defined in different blocks (@example sde2 and @example sde3), making them inaccessible.

Solution

  • Line 195: Changed @example sde to @example sde2 so the plot can access the Lorenz SDE solution variable defined in the sde2 block
  • Line 235: Changed @example sde to @example sde3 so the plot can access the scalar noise SDE solution variable defined in the sde3 block

Test Plan

  • Verified the changes fix the variable scoping issues
  • Confirmed the diff shows only the intended changes (2 line modifications)
  • Documentation build should now complete successfully

🤖 Generated with Claude Code

claude added 5 commits August 1, 2025 07:44
Resolves build failure where plotting commands tried to reference solution variables from different @example blocks.

- Changed `@example sde` to `@example sde2` for Lorenz SDE plot (line 195)
- Changed `@example sde` to `@example sde3` for scalar noise SDE plot (line 235)

This fixes the ArgumentError: "Collection has multiple elements, must contain exactly 1 element" that occurred when Documenter.jl tried to execute plotting commands without access to the required solution variables.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fixes MissingRemoteError for StochasticDiffEq docstrings by adding remotes configuration to makedocs().

Since OrdinaryDiffEq and StochasticDiffEq are developed via Pkg.develop(), Documenter needs explicit remote repository information to generate proper source URLs for their docstrings.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
The previous remotes configuration had incorrect syntax (Module => Remote instead of path => Remote).
Since OrdinaryDiffEq and StochasticDiffEq are developed via Pkg.develop(), the simplest solution
is to disable remote source links entirely by setting remotes = nothing.

This prevents the MissingRemoteError while allowing the documentation to build successfully.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Instead of disabling remotes entirely, correctly map the local development
paths to their GitHub repositories using pathof() to find the actual
package locations.

This approach:
- Provides proper source links for docstrings from developed packages
- Uses dirname(dirname(pathof(Package))) to get the package root directory
- Maps OrdinaryDiffEq and StochasticDiffEq to their SciML GitHub repositories

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
The previous attempt to map local package paths to GitHub repositories failed because
packages installed via Pkg.develop() in the Julia depot are not full git repositories
- they lack git history and .git directories.

Setting remotes = nothing disables source link generation entirely, which resolves
the MissingRemoteError while allowing documentation to build successfully.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit 08853db into master Aug 1, 2025
2 of 3 checks passed
@ChrisRackauckas ChrisRackauckas deleted the fix-sde-example-block-references branch August 1, 2025 22:44
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.

3 participants