Skip to content

Fix VectorContinuousCallback affect! for DifferentialEquations v8 - #10

Merged
Oddan merged 1 commit into
SUrbAreafrom
fix-diffeq-v8-callback-api
May 20, 2026
Merged

Oddan merged 1 commit into
SUrbAreafrom
fix-diffeq-v8-callback-api

Conversation

@Oddan

@Oddan Oddan commented May 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • DifferentialEquations v8 changed the affect! callback signature for VectorContinuousCallback: ix is now a Vector{Int8} of per-event flags (1 = fired, 0 = not) rather than a scalar integer index of the single event that fired.
  • The affect! in _compute_exact_fill was assigning ix directly into condition_reached (a Vector{Int64}), causing a MethodError: Cannot convert Vector{Int8} to Int64.
  • Fix uses findfirst(!iszero, ix) to extract the scalar index from the flag vector, with an isa guard to stay compatible with older DiffEq versions that pass a scalar.

Test plan

  • Run fill_sequence against the debug dataset — previously crashed, now completes successfully
  • Verify condition_reached correctly captures event 1 (full), 2 (empty), or 3 (stagnation) in all cases

🤖 Generated with Claude Code

DiffEq v8 changed the affect! signature for VectorContinuousCallback:
ix is now a Vector{Int8} of event flags rather than a scalar event index.
Use findfirst(!iszero, ix) to extract the scalar index, with a fallback
for older API versions that still pass a scalar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Oddan
Oddan changed the base branch from main to SUrbArea May 20, 2026 09:09
@Oddan
Oddan merged commit 0866f5a into SUrbArea May 20, 2026
0 of 2 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.

2 participants