Skip to content

Support sympy 1.11 to 1.14#306

Draft
kwabenantim wants to merge 10 commits into
masterfrom
285-support-sympy-114
Draft

Support sympy 1.11 to 1.14#306
kwabenantim wants to merge 10 commits into
masterfrom
285-support-sympy-114

Conversation

@kwabenantim

Copy link
Copy Markdown
Member

Description

Add support for newer versions of sympy

Motivation and Context

Fixes #285

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Documentation checklist

  • I have updated all documentation in the code where necessary.
  • I have checked spelling in all (new) comments and documentation.
  • I have added a note to RELEASE.md if relevant (new feature, breaking change, or notable bug fix).
  • I have updated version & citation.txt & citation.cff version.

Testing

  • Testing is done automatically and codecov shows test coverage
  • This cannot be tested automatically

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py dependency 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_Y reference 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.

Comment thread docs/index.rst Outdated
Comment thread docs/index.rst Outdated
Comment thread docs/index.rst
Comment thread setup.py
Comment thread setup.py Outdated
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.

Support sympy 1.11 - 1.14

2 participants