Repository navigation
Fix BUG-018, BUG-019: StateVector dict interface and facet-autodiff docs - #103
Merged
Merged
Conversation
BUG-018: get_state/get_old_state were documented as returning a plain
Dict{Int,S}, but actually return StateVector, which only supported
indexing, assignment, and equality (not keys/values/pairs/iteration/
haskey/get). Made StateVector <: AbstractDict{Int,S} and forwarded the
read-only AbstractDict interface to the internal Dict, and corrected the
docstrings/docs to describe the actual return type instead of promising
a plain Dict.
BUG-019: the assembler docs claimed facet routines fall back to
automatic differentiation like element routines do; no such fallback
exists for facets (setup_facetbuffer(::Val{true}, ...) explicitly
errors). Corrected docs/src/Workers/Assemblers.md and the facet_routine!
docstring to state this plainly.
Dual-review workflow: Codex plan review (thread 01a0f2e2-06e0-7ca2-9526-
d00df60e679f) flagged that the planned StateVector methods omitted
Base.get, which is needed for AbstractDict's generic `==`/`in` to work
symmetrically with a plain Dict (Dict == StateVector and (k=>v) in
StateVector otherwise throw MethodError) - confirmed via a live repro
and fixed by adding the forwarding. Codex final-diff review (same
thread, resumed) returned NO_FINDINGS.
Tests: Pkg.test() all green, including the new "StateVector dict
interface" regression testset in test/states.jl (keys/values/pairs/
iteration/haskey/get/length, checked before and after mode=:flip and
revert_states!) and the existing test/setup.jl:94 check that facet
autodiff still errors clearly. Full docs/make.jl build was also run;
it fails with 24 pre-existing @example-block errors (MethodError on
work!/set_time_increment!/get_dofhandler across most tutorials/how-tos)
that reproduce identically on unmodified main (8d5af51), confirming
they are unrelated to this change - logged as new BUG-024 in
identified_bugs.md for separate investigation (likely caused by the
unpinned [sources] git dependencies on MechanicalMaterialModels.jl/
Newton.jl resolving to newer, incompatible commits).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KySgpVgJ5fWR9AvPK1JQoU
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
==========================================
+ Coverage 97.22% 97.31% +0.08%
==========================================
Files 32 32
Lines 1368 1376 +8
==========================================
+ Hits 1330 1339 +9
+ Misses 38 37 -1 ☔ View full report in Codecov by Harness. 🚀 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.
Summary
get_state/get_old_statewere documented as returning a plainDict{Int,S}, but actually returnStateVector, which only supported indexing/assignment/equality. MadeStateVector <: AbstractDict{Int,S}and forwarded the read-onlyAbstractDictinterface (keys,values,pairs, iteration,haskey,get) to the internalDict, and corrected the docstrings/docs to describe the actual type instead of promising a plainDict.setup_facetbuffer(::Val{true}, ...)explicitly errors, already covered bytest/setup.jl:94). Correcteddocs/src/Workers/Assemblers.mdand thefacet_routine!docstring.Dual-review
StateVectormethods omittedBase.get, needed forAbstractDict's generic==/into work symmetrically with a plainDict(Dict == StateVectorand(k=>v) in StateVectorotherwise throwMethodError) — confirmed with a live repro and fixed.NO_FINDINGS.Test plan
Pkg.test()— all green, including a new "StateVector dict interface" regression testset intest/states.jl(keys/values/pairs/iteration/haskey/get/length, checked before and aftermode=:flipandrevert_states!) and the existingtest/setup.jl:94facet-autodiff error check.test/quadpoint_evaluation.jlupdated to iterate theStateVectordirectly instead of reaching into.vals.docs/make.jl— fails with 24 pre-existing@example-block errors (MethodErroronwork!/set_time_increment!/get_dofhandleracross most tutorials/how-tos). Confirmed these reproduce identically on unmodifiedmain(8d5af51) — same count, same locations — so they are unrelated to this change. Logged as newBUG-024inidentified_bugs.md(untracked, local work-queue file) for separate investigation; suspected cause is the unpinned[sources]git dependencies onMechanicalMaterialModels.jl/Newton.jlresolving to newer, incompatible commits.🤖 Generated with Claude Code
https://claude.ai/code/session_01KySgpVgJ5fWR9AvPK1JQoU