Skip to content

Remove CT_SUNDIALS_VERSION constant in favor of SUNDIALS-defined constants#1746

Merged
speth merged 7 commits intoCantera:mainfrom
bryanwweber:bryan-remove-ct_sundials_version
Aug 1, 2024
Merged

Remove CT_SUNDIALS_VERSION constant in favor of SUNDIALS-defined constants#1746
speth merged 7 commits intoCantera:mainfrom
bryanwweber:bryan-remove-ct_sundials_version

Conversation

@bryanwweber
Copy link
Copy Markdown
Member

@bryanwweber bryanwweber commented Jul 29, 2024

Changes proposed in this pull request

  • Replace CT_SUNDIALS_VERSION with SUNDIALS_VERSION_MAJOR. In all the existing cases, the comparison was to x0 (where x was one of 4, 6, or 7) indicating only the major version was being considered.
  • Ensured that the version checks for SUNDIALS in SConstruct are still relevant

If applicable, fill in the issue number this pull request is fixing

Closes Cantera/enhancements#209

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@bryanwweber bryanwweber marked this pull request as draft July 29, 2024 22:04
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.12%. Comparing base (5893f3f) to head (8ac9fcf).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1746      +/-   ##
==========================================
+ Coverage   73.04%   73.12%   +0.08%     
==========================================
  Files         381      381              
  Lines       54164    54134      -30     
  Branches     9240     9222      -18     
==========================================
+ Hits        39562    39587      +25     
+ Misses      11633    11589      -44     
+ Partials     2969     2958      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bryanwweber bryanwweber marked this pull request as ready for review July 30, 2024 18:32
@bryanwweber bryanwweber requested review from a team and speth and removed request for speth July 30, 2024 18:33
@bryanwweber bryanwweber force-pushed the bryan-remove-ct_sundials_version branch from 53ef06c to 2015e46 Compare July 30, 2024 18:55
The CT_SUNDIALS_VERSION constant was originally defined when SUNDIALS
only defined a string version number, so we couldn't do comparisons.
Since SUNDIALS v3.0, the version parts have been available as integers,
enabling comparison with the SUNDIALS-defined constants. This change
simplifies building the libraries because it removes the custom constant
and simplifies building the sdist/wheel because its one fewer constant
that has to be templated in.
@bryanwweber bryanwweber force-pushed the bryan-remove-ct_sundials_version branch 2 times, most recently from 2271065 to 805b629 Compare July 31, 2024 15:12
#endif

#if CT_SUNDIALS_VERION >= 60
#if SUNDIALS_VERSION_MAJOR >= 6
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

By the way, this line had a typo before, so these lines were not being included, I believe.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gotta love the C preprocessor 🤦

@bryanwweber bryanwweber force-pushed the bryan-remove-ct_sundials_version branch from 805b629 to 4c25795 Compare July 31, 2024 15:22
@bryanwweber bryanwweber force-pushed the bryan-remove-ct_sundials_version branch from 4c25795 to 96a7479 Compare July 31, 2024 15:26
Copy link
Copy Markdown
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @bryanwweber. This looks good to me.

@speth speth merged commit f1b98ee into Cantera:main Aug 1, 2024
@bryanwweber bryanwweber deleted the bryan-remove-ct_sundials_version branch August 1, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the custom CT_SUNDIALS_VERSION macro

3 participants