Skip to content

Interval ratio removed criterion combination#283

Merged
glichtner merged 45 commits intomainfrom
interval-ratio-removed-criterion-combination
Mar 28, 2025
Merged

Interval ratio removed criterion combination#283
glichtner merged 45 commits intomainfrom
interval-ratio-removed-criterion-combination

Conversation

@glichtner
Copy link
Copy Markdown
Member

No description provided.

scymtym and others added 20 commits March 13, 2025 14:24
Also rewrite CappedMinCount to use find_rectangles.

Co-authored-by: Gregor Lichtner <gregor.lichtner@med.uni-greifswald.de>
…tervals

Also rewrite NoDataPreservingAnd to use find_rectangles
…tervals

Also rewrite LeftDependentToggle to use find_rectangles
…tor windows

Before this change, an indicator window which was partially within the
population interval and did not satisfy the temporal count condition
produced a "not applicable" result. With this change, such indicator
windows produce a negative result.

Also implement TemporalCount via find_rectangles and remove
find_overlapping_windows.
This avoids sorting twice and some other work
The _replace method already returns a new instance.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 22, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 32 lines in your changes missing coverage. Please review.

Project coverage is 85.11%. Comparing base (cbd44c8) to head (65e815c).
Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
execution_engine/task/task.py 83.04% 29 Missing ⚠️
execution_engine/task/process/rectangle_python.py 96.34% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #283      +/-   ##
==========================================
- Coverage   85.24%   85.11%   -0.13%     
==========================================
  Files          96       97       +1     
  Lines        6297     6370      +73     
==========================================
+ Hits         5368     5422      +54     
- Misses        929      948      +19     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

scymtym added 3 commits March 24, 2025 16:51
Add the negative intervals in a single find_rectangles call instead of
computing negative intervals and then merging.
Also implement the operators via find_rectangles and remove from the
process module the functions count_intervals and
filter_count_intervals.
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch 2 times, most recently from f1c5638 to c1e8c6e Compare March 24, 2025 21:04
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from c1e8c6e to 8ab56e3 Compare March 24, 2025 21:06
scymtym and others added 2 commits March 25, 2025 17:29
Do not require a positive number of intervals of type POSITIVE if
count_min is 0.

Add a test case.
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from 9cde5a9 to 0659747 Compare March 25, 2025 19:20
scymtym added 3 commits March 26, 2025 10:47
The comparison of events with the same timestamp and the same "track"
was too simplistic: for an open-and-close event pair for
single (point-shaped) interval, the open event should go before the
close event. however, for the close event from one interval and the
open event from a different, adjacent interval, the close event should
go before the open interval.

With the new sorting in place, the processing of event clusters can
restrict the "1 second lookahead" to open events (instead of all
events). The mechanism is intended to detect adjacent intervals by
possibly "pulling in" the open event of a following interval if that
open event happens in the next second after the close event of the
previous interval.
And handle empty inputs slightly better in
rectangle_[pc]ython.find_rectangles.
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from 486fd19 to 160a47b Compare March 26, 2025 11:26
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from 5f1d4c0 to 701c2b3 Compare March 26, 2025 21:15
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from 2158579 to 70393e0 Compare March 28, 2025 07:59
the intended behavior - which is :TemporalMinCount should return NEGATIVE (instead of NOT_APPLICABLE) if all inputs are NO_DATA) - can be achieved much simpler by treating NO_DATA in the data_intervals (in update_window_type) the same as NEGATIVE intervals.
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch 8 times, most recently from 565823f to 7d6a863 Compare March 28, 2025 12:54
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from 7d6a863 to aaa89c3 Compare March 28, 2025 13:02
…with PostgreSQL

Remove microseconds from start and end datetimes to ensure consistent behavior
across Python and PostgreSQL. Python uses floor when casting to int, while
PostgreSQL may round, potentially causing off-by-one-second bugs. Added
assertions to enforce the truncation.
@glichtner glichtner force-pushed the interval-ratio-removed-criterion-combination branch from da870f9 to 65e815c Compare March 28, 2025 22:05
@glichtner glichtner merged commit 5a396d0 into main Mar 28, 2025
3 checks passed
@glichtner glichtner deleted the interval-ratio-removed-criterion-combination branch March 31, 2025 16:35
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.

2 participants