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

Slove the bug when salting peaks overlap #73

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

dachengx
Copy link
Collaborator

When the environment is messy, the event can overlap with multiple salting peaks. Then we will see errors like:

  File "/home/xudc/straxen/straxen/plugins/events/event_basics.py", line 242, in fill_events
    raise ValueError(f"No peaks within event?\n{events[event_i]}")
ValueError: No peaks within event?
(27361, 1632306160955726312, 1632306161173099400, 27361, False)

This is because strax._fully_contained_in(which is used by strax.split_by_containment in EventBasics) will only return the first container of things. So strax.split_by_containment will return zero peaks in the event even if the peaks belong to the event, when events are duplicated.

@dachengx dachengx marked this pull request as ready for review May 13, 2024 02:26
@coveralls
Copy link

coveralls commented May 13, 2024

Pull Request Test Coverage Report for Build 9056299985

Details

  • 4 of 28 (14.29%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 50.401%

Changes Missing Coverage Covered Lines Changed/Added Lines %
axidence/plugins/salting/event_fields.py 2 6 33.33%
axidence/plugins/salting/event_building.py 2 22 9.09%
Files with Coverage Reduction New Missed Lines %
axidence/plugins/salting/event_building.py 2 35.24%
Totals Coverage Status
Change from base Build 9055051104: -0.2%
Covered Lines: 692
Relevant Lines: 1373

💛 - Coveralls

@dachengx dachengx merged commit c29b16f into main May 13, 2024
5 checks passed
@dachengx dachengx deleted the zero_n_peaks_fix branch May 13, 2024 02:28
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