Skip to content

ENH: Prefer excluding upper bound in streamline length filtering - #1344

Open
jhlegarreta wants to merge 1 commit into
scilus:masterfrom
jhlegarreta:enh/prefer-excluding-upper-bound-length
Open

ENH: Prefer excluding upper bound in streamline length filtering#1344
jhlegarreta wants to merge 1 commit into
scilus:masterfrom
jhlegarreta:enh/prefer-excluding-upper-bound-length

Conversation

@jhlegarreta

@jhlegarreta jhlegarreta commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Quick description

Change streamline length filtering to use a half-open interval, including streamlines at the minimum length threshold while excluding those exactly matching the maximum length threshold.

Using a half-open interval simplifies length binning by allowing natural bin definitions (e.g., [80, 90), [90, 100), etc.), avoiding arbitrary floating-point thresholds (e.g. [80-89.99], [90-99.99] or [80.01-90], [90.01-100], etc.) and preventing duplicate assignments at bin boundaries.

Also, this allows the philosophy to be consistent with major Python packages like NumPy, etc. when dealing with intervals.

Type of change

Check the relevant options.

  • 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 not work as expected)
  • This change requires a documentation update

Provide data, screenshots, command line to test (if relevant)

N/A

Checklist

  • My code follows the style guidelines of this project (run autopep8)
  • I added relevant citations to scripts, modules and functions docstrings and descriptions
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I moved all functions from the script file (except the argparser and main) to scilpy modules
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Change streamline length filtering to use a half-open interval,
including streamlines at the minimum length threshold while excluding
those exactly matching the maximum length threshold.

Using a half-open interval simplifies length binning by allowing natural
bin definitions (e.g., [80, 90), [90, 100), etc.), avoiding arbitrary
floating-point thresholds (e.g. [80-89.99], [90-99.99] or [80.01-90],
[90.01-100], etc.) and preventing duplicate assignments at bin
boundaries.

Also, this allows the philosophy to be consistent with major Python
packages like NumPy, etc. when dealing with intervals.
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.59%. Comparing base (31cf4e5) to head (792999c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1344   +/-   ##
=======================================
  Coverage   72.59%   72.59%           
=======================================
  Files         301      301           
  Lines       26283    26283           
  Branches     3700     3700           
=======================================
+ Hits        19080    19081    +1     
+ Misses       5651     5650    -1     
  Partials     1552     1552           
Flag Coverage Δ
smoketests 69.75% <ø> (+<0.01%) ⬆️
unittests 14.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Scripts 75.32% <ø> (+<0.01%) ⬆️
Library 69.32% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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