This repository was archived by the owner on May 12, 2026. It is now read-only.
Interface compatibility: Fix type genericity for SDE noise generation#168
Merged
ChrisRackauckas merged 1 commit intoDec 30, 2025
Conversation
The `zeros()` and `randn()` calls in `analyticless_test_convergence` and related functions were creating Float64 arrays regardless of the element type of `prob.u0`. This prevented proper BigFloat support for SDE convergence testing. Changes: - Use `zeros(T, size(prob.u0))` instead of `zeros(size(prob.u0))` - Use `randn(T, size(prob.u0))` instead of `randn(size(prob.u0))` - Extract `T = eltype(prob.u0)` for consistent type inference This enables: - BigFloat-precision SDE convergence testing - Proper type preservation for custom numeric types - Better adherence to SciML's array/number interface 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
zeros()andrandn()calls in SDE functions to respecteltype(prob.u0)instead of defaulting to Float64Changes
In
src/convergence.jlandsrc/benchmark.jl:T = eltype(prob.u0)for type inferencezeros(T, size(prob.u0))instead ofzeros(size(prob.u0))randn(T, size(prob.u0))instead ofrandn(size(prob.u0))Interface Testing Performed
constructEuler(BigFloat)andstability_regionpreserves precisionTest plan
Pkg.test()- all tests passcc @ChrisRackauckas
🤖 Generated with Claude Code