Support sympy 1.11 to 1.14#306
Draft
kwabenantim wants to merge 10 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates chaste_codegen to work with newer SymPy releases by broadening dependency constraints, adapting placeholder math-function substitution for SymPy’s stricter sympification behavior, and updating tests/reference outputs to support per-SymPy-version “golden” files.
Changes:
- Updated
setup.pydependency minimums/maximums (including SymPy, Pint, NetworkX, etc.) to target newer ecosystems. - Added SymPy-version-aware reference selection and updated Jacobian tests to use it, alongside new
--sympy_X_Yreference variants. - Regenerated/adjusted stored reference models and removed legacy Python 3.6 reference artifacts.
Reviewed changes
Copilot reviewed 20 out of 72 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Bumps runtime dependency constraints to support newer SymPy and related packages. |
| docs/index.rst | Updates contributor instructions for dependency bumps and versioned reference files. |
| dev-requirements/dev.txt | Updates pinned dev dependency versions (notably Pint). |
| chaste_codegen/tests/test_jacobian.py | Switches Jacobian tests to SymPy-versioned reference reading. |
| chaste_codegen/tests/conftest.py | Adds SymPy-versioned reference selection and optional reference regeneration mode. |
| chaste_codegen/model_with_conversions.py | Uses subs_math_func_placeholders to avoid SymPy subs sympification issues. |
| chaste_codegen/_math_functions.py | Documents correct placeholder substitution approach for SymPy >= 1.12. |
| chaste_codegen/data/tests/test_jacobian_matrix_2.txt_python36 | Removes legacy Python 3.6-specific expected output. |
| chaste_codegen/data/tests/test_jacobian_matrix_2.txt_alt | Removes alternate legacy expected output format. |
| chaste_codegen/data/tests/test_jacobian_matrix_2--sympy_1_13.txt | Adds SymPy 1.13-specific Jacobian matrix expected output. |
| chaste_codegen/data/tests/test_jacobian_matrix_2--sympy_1_11.txt | Adds SymPy 1.11-specific Jacobian matrix expected output. |
| chaste_codegen/data/tests/test_jacobian_matrix_1.txt_python36 | Removes legacy Python 3.6-specific expected output. |
| chaste_codegen/data/tests/test_jacobian_matrix_1.txt_alt | Removes alternate legacy expected output format. |
| chaste_codegen/data/tests/test_jacobian_matrix_1--sympy_1_11.txt | Adds SymPy 1.11-specific Jacobian matrix expected output. |
| chaste_codegen/data/tests/test_jacobian_equations_2.txt_python36 | Removes legacy Python 3.6-specific expected output. |
| chaste_codegen/data/tests/test_jacobian_equations_2.txt_alt | Removes alternate legacy expected output format. |
| chaste_codegen/data/tests/test_jacobian_equations_2.txt | Updates baseline expected output to match newer SymPy behavior. |
| chaste_codegen/data/tests/test_jacobian_equations_1.txt_python36 | Removes legacy Python 3.6-specific expected output. |
| chaste_codegen/data/tests/test_jacobian_equations_1.txt_alt | Removes alternate legacy expected output format. |
| chaste_codegen/data/tests/test_jacobian_equations_1.txt | Updates baseline expected output to match newer SymPy behavior. |
| chaste_codegen/data/tests/chaste_reference_models/RLopt/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Updates generated reference output for SymPy 1.13 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/RL/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Adds generated reference output for SymPy 1.13 (RL model type). |
| chaste_codegen/data/tests/chaste_reference_models/Opt/test_luo_rudy_1991_with_range_cap_dimensionless.cpp_python36 | Removes legacy Python 3.6 generated reference output. |
| chaste_codegen/data/tests/chaste_reference_models/Opt/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Updates generated reference output for SymPy 1.13 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/Opt/beeler_reuter_model_1977_lookup_tables.cpp_python36 | Removes legacy Python 3.6 generated reference output. |
| chaste_codegen/data/tests/chaste_reference_models/GRL2Opt/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Updates generated reference output for SymPy 1.13 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/GRL2/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Updates generated reference output for SymPy 1.13 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/GRL1Opt/beeler_reuter_model_1977--sympy_1_11.cpp | Updates generated reference output for SymPy 1.11 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/GRL1/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Updates generated reference output for SymPy 1.13 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/Cvode_with_jacobian/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Adds generated reference output for SymPy 1.13 (Cvode + Jacobian). |
| chaste_codegen/data/tests/chaste_reference_models/Cvode_with_jacobian/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_11.cpp | Updates generated reference output for SymPy 1.11 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/Cvode_opt_with_jacobian/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Adds generated reference output for SymPy 1.13 (Cvode opt + Jacobian). |
| chaste_codegen/data/tests/chaste_reference_models/Cvode_opt_with_jacobian/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_11.cpp | Updates generated reference output for SymPy 1.11 behavior. |
| chaste_codegen/data/tests/chaste_reference_models/CVODE_DATA_CLAMP_OPT/hodgkin_huxley_squid_axon_model_1952_modified--sympy_1_13.cpp | Updates generated reference output for SymPy 1.13 behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Add support for newer versions of sympy
Motivation and Context
Fixes #285
Types of changes
Documentation checklist
Testing