Merged
Conversation
- Properly deprecate `dualcache` with `Base.depwarn` instead of plain
const alias. The old `const dualcache = DiffCache` silently allowed
usage without any deprecation notice. Now using `dualcache(...)` emits
a deprecation warning directing users to `DiffCache`.
- Rename redefined test functions to eliminate method overwrite warnings:
- `foo` → `foo_lbc` and `foo_larray` in test/core_odes.jl
- `objfun` → `objfun2` (with corresponding `fn2`) in
test/core_nesteddual.jl
All tests pass with `--depwarn=error` on Julia 1.12.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 <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
dualcacheusingBase.depwarninstead of a silentconstalias. Nowdualcache(...)emits a deprecation warning directing users to useDiffCacheinstead.foo→foo_lbc/foo_larrayincore_odes.jl,objfun→objfun2incore_nesteddual.jl).Details
dualcachedeprecationThe previous code had:
This allowed
dualcache(...)to work silently with no deprecation notice, even with--depwarn=error. The fix replaces this with a proper deprecation function:Method overwrite warnings
Tests defined the same function name (
foo,objfun) multiple times in the same@safetestsetmodule, causingWARNING: Method definition ... overwrittenmessages. While not deprecation errors, these warnings are noise that can mask real issues. Fixed by using unique function names.Upstream deprecation status
Ran full test suite with
--depwarn=erroron Julia 1.12.4. No deprecation warnings from upstream dependencies (ArrayInterface, Adapt, SciMLBase, ForwardDiff, OrdinaryDiffEq, Optimization, etc.) were triggered. All current API usages are non-deprecated.Test plan
--depwarn=errordualcacheproperly emits deprecation warning with--depwarn=yesdualcacheproperly throws error with--depwarn=errortest_undefined_exports)🤖 Generated with Claude Code