Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

This PR improves the documentation quality with focused corrections to code examples:

  • Fixed function naming conventions to follow Julia's in-place mutation convention (lorenz!, HH_acceleration!)
  • Updated deprecated vars keyword to idxs in plotting examples
  • Improved docs/make.jl robustness to handle execution from both repo root and docs directory

Specific Changes

docs/src/usage.md

  1. Function naming conventions: Changed lorenzlorenz! and HH_accelerationHH_acceleration! to follow Julia convention for in-place functions that mutate their first argument
  2. API updates: Changed deprecated plot(sol, vars = (1, 2, 3)) to plot(sol, idxs = (1, 2, 3)) to use current Plots.jl API
  3. Consistency: Updated all corresponding function calls in ODEProblem and SecondOrderODEProblem

docs/make.jl

  • Added path detection logic to handle running from both repository root and docs directory
  • Prevents "no such file or directory" errors during documentation builds

Testing

  • Documentation builds successfully without new warnings
  • Examples follow current best practices and API conventions

cc: @ChrisRackauckas

🤖 Generated with Claude Code

This commit improves the documentation quality with the following changes:

1. **Fix function naming conventions in usage.md**:
   - Changed `lorenz` to `lorenz!` to follow Julia's in-place function convention
   - Changed `HH_acceleration` to `HH_acceleration!` for consistency
   - Updated corresponding ODEProblem calls

2. **Update deprecated keyword argument**:
   - Changed `vars` to `idxs` in plot() call to use current API

3. **Improve docs/make.jl path handling**:
   - Added logic to handle running from both repo root and docs directory
   - Prevents "no such file or directory" errors when building docs

These changes ensure documentation examples follow best practices and work
correctly with the current OrdinaryDiffEq.jl API.

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
docs/make.jl Outdated
Comment on lines 3 to 7
# Handle both running from repo root and from docs directory
manifest_src = isfile("./docs/Manifest.toml") ? "./docs/Manifest.toml" : "Manifest.toml"
project_src = isfile("./docs/Project.toml") ? "./docs/Project.toml" : "Project.toml"
manifest_dst = isfile("./docs/src/assets/Manifest.toml") || isdir("./docs/src/assets") ? "./docs/src/assets/Manifest.toml" : "src/assets/Manifest.toml"
project_dst = isfile("./docs/src/assets/Project.toml") || isdir("./docs/src/assets") ? "./docs/src/assets/Project.toml" : "src/assets/Project.toml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to use @__DIR__, e.g., joinpath(@__DIR__, "Manifest.toml")?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would yes, just did this change in another repo. I'll add it to its prompt because I think the cp("./docs/Manifest.toml", "./docs/src/assets/Manifest.toml", force = true) is in every repo so as this goes around it should do the same change everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion! Updated to use joinpath(@__DIR__, ...) which is much cleaner and more robust. Thanks for the review!

Address review feedback from @ranocha: Use joinpath(@__DIR__, ...) instead
of complex path detection logic. This is simpler and more robust since
@__DIR__ always returns the directory containing the current file.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit 590e4ba into SciML:master Jan 3, 2026
198 of 214 checks passed
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.

4 participants