Skip to content

Fix deprecated constructor usage in tests #1308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

ChrisRackauckas
Copy link
Member

@ChrisRackauckas ChrisRackauckas commented Aug 1, 2025

Summary

Replace deprecated constructor usage in tests to eliminate CI deprecation warnings.

Problem

CI logs show deprecation warnings:

Warning: JumpProblem(rn::ReactionSystem, prob, ...) is deprecated and will be removed in Catalyst 16. Use JumpProblem(JumpInputs(rn, ...), ...) instead.
Warning: DiscreteProblem(rn::ReactionSystem, ...) is deprecated and will be removed in Catalyst 16. Use JumpInputs(rn, ...) instead.

Solution

Updated test files to use the new API:

  • test/reactionsystem_core/parameter_type_designation.jl:76 - Changed DiscreteProblem(rs, ...) to JumpInputs(rs, ...)
  • test/reactionsystem_core/reactionsystem.jl:674 - Changed JumpProblem(rs, dprob, ...) to JumpProblem(JumpInputs(rs, dprob.u0, dprob.tspan, dprob.p), ...)

Test plan

  • Verify deprecation warnings are eliminated from CI
  • Confirm tests pass with new constructor syntax

🤖 Generated with Claude Code

claude added 3 commits August 1, 2025 15:56
Replace deprecated ReactionSystem constructor calls:
- Changed JumpProblem(rs, dprob, ...) to JumpProblem(JumpInputs(rs, dprob), ...)
- Changed DiscreteProblem(rs, u0, tspan, p) to JumpInputs(rs, u0, tspan, p)

This fixes deprecation warnings about using ReactionSystem directly in
JumpProblem and DiscreteProblem constructors, which will be removed in
Catalyst 16.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Revert all formatting changes (spacing, line breaks, indentation)
- Keep deprecation fixes: DiscreteProblem -> JumpInputs and JumpProblem(rs, ...) -> JumpProblem(JumpInputs(...), ...)
- Focus PR scope on deprecation warnings removal only

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The previous changes incorrectly replaced DiscreteProblem with JumpInputs,
which are different types entirely. JumpInputs doesn't have getindex methods
that work with Symbolics.Num, causing 30 test errors.

Reverted:
- test/reactionsystem_core/parameter_type_designation.jl:76 - Changed JumpInputs back to DiscreteProblem
- test/reactionsystem_core/reactionsystem.jl:674 - Reverted JumpProblem constructor to use original rs, dprob pattern
- Also reverted unrelated formatting changes that may have introduced issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas deleted the fix-constructor-deprecations branch August 3, 2025 01:20
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