Conversation
…overload
CHUNK-003: swap λt/ϕs argument order in temporal penalty! and penalty to
match Julia's data-first convention.
CHUNK-004: widen Vector{D<:GridDeformation} to AbstractVector{<:GridDeformation}
in temporal penalty! and penalty, dropping the unused D type variable.
CHUNK-005: add penalty!(g, ϕ, ::Nothing, ...) overloads as a self-documenting
alias for identity ("no prior deformation").
CHUNK-006: widen vec2ϕs x::Array{T} to x::AbstractArray{T}, consistent with
the downstream convert_to_fixed signature; add view-based test.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace AffinePenalty{T,N}(F, λ, _) dummy-arg inner constructor with a clean
2-arg form AffinePenalty{T,N}(F, λ) calling new directly, and update
Base.convert to drop the dummy argument.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collapse the 6-method eltype/ndims chain to 4 methods. Replace the
exact-type + supertype-delegation pair with a single ::Type{<:DeformationPenalty{T,N}}
wildcard overload for each, preserving the two instance-dispatch wrappers.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CachedInterpolations, CenterIndexedArrays, RegisterCore, RegisterDeformation, and RegisterUtilities have all released v1; drop pre-1.0 compat entries. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #23 +/- ##
==========================================
+ Coverage 98.55% 99.03% +0.48%
==========================================
Files 1 1
Lines 208 208
==========================================
+ Hits 205 206 +1
+ Misses 3 2 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…tests
CHUNK-007 replaced AffinePenalty{T,N}(F, λ, _) with a 2-arg (F::Matrix{T},
λ::T) constructor, which inadvertently shadowed the (nodes::AbstractMatrix, λ)
inner constructor — Matrix{T} is more specific than AbstractMatrix, so
AffinePenalty(nodes_mat, 1.0) silently stored the raw node coordinates as F
without computing QR. Fix by restoring a typed sentinel constructor
(F, λ, Val(:_precomputed)) used only by Base.convert, removing the ambiguous
2-arg form.
Tests added:
- AffinePenalty(AbstractMatrix, λ): assert dp.F is orthonormal (catches the bug)
- AffinePenalty(Vector{AbstractVector}, λ): type check
- penalty!(g, ϕ, mmis) with mismatched gradient length: checks the error message
Note: itptype(::Type{Linear}) / interpolate_mm!(mm, Linear) is a pre-existing
broken path (Gridded interpolation does not support interpolate!); left as-is.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
penalty!/penaltyargument order — swap(g, λt, ϕs)→(g, ϕs, λt)to match Julia's data-first convention (CHUNK-003)Vector{D<:GridDeformation}→AbstractVector{<:GridDeformation>in temporal penalty methods;Array{T}→AbstractArray{T}invec2ϕs(CHUNK-004, CHUNK-006)nothingas alias foridentityinpenalty!(g, ϕ, ϕ_old, ...)— self-documenting way to say "no prior deformation" (CHUNK-005)AffinePenaltysentinel constructor — replace(F, λ, _)dummy-arg form with clean(F, λ)inner constructor; updateBase.convertaccordingly (CHUNK-007)eltype/ndimsdispatch chain — collapse 6-methodsupertype-delegation chain to 4 methods using::Type{<:DeformationPenalty{T,N}}wildcard (CHUNK-008)Test plan
Pkg.test()): Doctests, Aqua, ExplicitImports, Affine penalty, Data penalty, Total penalty, Temporal penaltyTest.detect_ambiguities(RegisterPenalty) == 0(verified throughout)penalty!(g, ϕs, λt)andpenalty(ϕs, λt)round-trip correctly against ForwardDiffpenalty!(g, ϕ, nothing, dp, mmis)produces identical values and gradients toidentityformvec2ϕscallable with aviewargument🤖 Generated with Claude Code