Skip to content
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

Make IndexError consistent #1851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Feb 6, 2025

Changes proposed in this pull request

Minor follow-up to #1850. IndexError and ArraySizeError have different APIs (one uses max index and the other array size), where the former has the wrinkle that it won't work for empty arrays (with npos being a workaround). The update avoids having to call IndexError with array size - 1.

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

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 35.00000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 74.40%. Comparing base (fd1a410) to head (82329fc).

Files with missing lines Patch % Lines
src/equil/MultiPhase.cpp 0.00% 3 Missing ⚠️
src/base/ctexceptions.cpp 33.33% 1 Missing and 1 partial ⚠️
src/kinetics/Kinetics.cpp 33.33% 2 Missing ⚠️
include/cantera/base/Solution.h 0.00% 1 Missing ⚠️
include/cantera/oneD/Domain1D.h 50.00% 1 Missing ⚠️
include/cantera/oneD/OneDim.h 0.00% 1 Missing ⚠️
src/base/SolutionArray.cpp 0.00% 1 Missing ⚠️
src/thermo/Phase.cpp 50.00% 1 Missing ⚠️
src/zeroD/ReactorNet.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1851   +/-   ##
=======================================
  Coverage   74.40%   74.40%           
=======================================
  Files         386      386           
  Lines       53630    53630           
  Branches     9064     9064           
=======================================
  Hits        39905    39905           
  Misses      10653    10653           
  Partials     3072     3072           

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

@ischoegl ischoegl marked this pull request as ready for review February 6, 2025 04:49
@ischoegl ischoegl requested a review from a team February 6, 2025 04:49
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.

1 participant