Skip to content

Conversation

@ajjackson
Copy link
Member

@ajjackson ajjackson commented Sep 4, 2025

Closes #407

Following established conventions for python list and numpy array, if a slice exceeds the array length the result can quietly return up to the last available item. This allows things like [:10] to mean "up to first ten items" which is nice for printing etc.

As discussed in #407 this might be a dubious API break. But it's difficult to see the real-world harm.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Test Results

    26 files   -     8      26 suites   - 8   1h 42m 6s ⏱️ - 3h 1m 32s
 1 111 tests  -     1   1 105 ✅  -     1   6 💤 ± 0  0 ❌ ±0 
15 341 runs   - 8 439  15 255 ✅  - 8 400  86 💤  - 39  0 ❌ ±0 

Results for commit 0b79fc6. ± Comparison against base commit 22772b7.

This pull request removes 1 test.
tests_and_analysis.test.euphonic_test.test_spectrum1dcollection.TestSpectrum1DCollectionIndexAccess ‑ test_index_errors[spectrum3-index3-IndexError]

♻️ This comment has been updated with latest results.

Following established conventions for python list and numpy array, if
a slice exceeds the array length the result can quietly return up to
the last available item. This allows things like [:10] to mean "up to
first ten items" which is nice for printing etc.
@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (22772b7) to head (0b79fc6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #422      +/-   ##
==========================================
- Coverage   97.26%   97.26%   -0.01%     
==========================================
  Files          32       32              
  Lines        4312     4307       -5     
  Branches      635      633       -2     
==========================================
- Hits         4194     4189       -5     
  Misses         70       70              
  Partials       48       48              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ajjackson ajjackson marked this pull request as ready for review September 4, 2025 13:27
@ajjackson ajjackson added this to the v2.0 milestone Sep 10, 2025
@ajjackson ajjackson added the breaking API-breaking or results change: generally reserved for major version number changes label Sep 10, 2025
@ajjackson
Copy link
Member Author

ajjackson commented Sep 10, 2025

As this is quite low priority and technically breaking, let's defer it until Euphonic 2.0.

Let's also not wait too long to make Euphonic 2.0. API-breaking version numbers don't have to be major "political" releases, that is a trap larger projects often fall into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking API-breaking or results change: generally reserved for major version number changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More elegant use of slice argument

2 participants