SciML / SciML/StructuralIdentifiability.jl

Docs build fails on Julia 1.13: lincomp doctest pins Dict iteration order

Open
#559 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
129
Forks
23
Avg merge
9h 35m
Merged PRs (30d)
17

Description

Summary

The linear_compartment_model doctest in src/lincomp.jl:35-44 pins the printed order of
the ODE equations, and that order changes on Julia 1.13. The Documentation CI job runs
Julia 1.13.0, so the docs build fails there.

Observed

Unmodified master (90f8452a61109fe29e434d604bd22ad80d474fdd), same package versions
(Nemo v0.56.1, AbstractAlgebra v0.50.2, Groebner v0.10.8, RationalFunctionFields v0.3.5):

using StructuralIdentifiability
show(linear_compartment_model([[2, 4], [1, 3], [2, 4], [1, 3]], outputs = [1], inputs = [2], leaks = [2, 3]))
julia 1.12.7    -> x1'  x3'  x2'  x4'  y1     # what the doctest documents
julia 1.13.0-rc4 -> x4'  x3'  x1'  x2'  y1

and CI on Julia 1.13.0 printed the 1.13 order:

┌ Error: doctest failure in src/lincomp.jl:35-44
│   diff =
│    x1' x4' = -x1*a_2_1 - x1*a_4_1 + x2*a_1_2 + x4*a_1_4
│    ...

https://github.com/SciML/StructuralIdentifiability.jl/actions/runs/34498007776/job/102941309041

Cause

linear_compartment_model returns the system with x_equations as a
Dict{QQMPolyRingElem, ExtendedFraction{QQMPolyRingElem}}, and show(::ODE) iterates that
dict. Dict iteration order is an implementation detail and changed in Julia 1.13, so the
doctest pins something the language does not promise.

Why it is only surfacing now

The docs build currently dies earlier, on
https://github.com/SciML/StructuralIdentifiability.jl/issues/556 (three
power_series_solution doctest failures), so this one is unreachable on master. It becomes
the first failure once #556 is fixed (see #558).

Suggested fix

Make the output order deterministic rather than dict-dependent — e.g. have show(::ODE)
print x_equations in x_vars order (which is already stored on the struct) instead of in
dict order. That fixes the doctest on every Julia version and makes the printed system
stable for users, rather than re-pinning a new arbitrary order in the docstring.


🤖 Investigated and filed by an AI agent (Claude Code, model claude-opus-5[1m]) on behalf of @ChrisRackauckas.
Session: https://claude.ai/code/session_01GdSpCLd7NBZuuePJmcDzU7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linear_compartment_model doctest in src/lincomp.jl:35-44 and trace the show(::ODE) entry point that iterates x_equations. Check the Documentation CI job on Julia 1.13.0; done means the ODE equations print in a deterministic x_vars order and the doctest passes across Julia versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
documentation, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.