Repository navigation
Conversation
With fixed_event_spacing=False, event times were drawn uniformly from 0, so an event within first_chunk_left (1 ms) of 0 put the first chunk's start below 0 and strax raised 'chunk with negative start time'. The deterministic seed made every retry fail the same way. Add the same 1 s offset the fixed spacing already uses, and bump ChunkInput to 0.4.2.
Collaborator
|
Looks good to me! Once we have the checks working we can merge this! |
All three call sites pass 1-D arrays, so the result is unchanged.
DonNabla
marked this pull request as ready for review
November 3, 2026 08:50
HenningSE
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the code in this PR do / what does it improve?
Fixes the
Attempt to create chunk ... with negative start timeerror raised by strax for some jobs simulated with random event times (fixed_event_spacing=False).ChunkInputstarts the first chunkfirst_chunk_left(1 ms by default) before the first interaction. With fixed spacing, event times get a 1 s offset, so that margin always fits. With random times there is no offset: times are drawn uniformly from 0, so whenever the first event lands within 1 ms of 0, the first chunk starts below 0. At the default 1 Hz rate that is about 1 job in 1000. The seed is deterministic, so the affected jobs fail identically on every retry.Can you briefly describe how it works?
The random-times branch now adds the same 1 s offset as the fixed-spacing branch, so the full
first_chunk_leftmargin is kept for every job (nothing is clamped). The fixed-spacing branch is unchanged.Lineage impact:
ChunkInputgoes from 0.4.1 to 0.4.2. With random times, every event is shifted by 1 s, so output differs from 0.4.1 by that constant offset. The new version also changes the lineage, and with it the deterministic seeds, of everything downstream, so it is not bit-for-bit comparable with earlier productions. That applies to fixed-spacing simulations too, even though their output is unchanged. No reprocessing of existing simulations is implied; the jobs that already succeeded are valid.Note:
cut_delayedis compared against the full interaction time, event time included, so with random times it now sees the same 1 s offset that fixed spacing already had. With the default (1e18 ns) this makes no difference.NumPy 2.4 compatibility: NumPy 2.4 removed
np.in1d, which broke thelatestCI job (54 tests failing withmodule 'numpy' has no attribute 'in1d') inSecondaryScintillation,S1PhotonPropagationandLineageClustering. The three calls are replaced bynp.isin. All three inputs are 1-D, so the result is identical and no plugin versions change.Can you give a minimal working example (or illustrate with a figure)?
tests/test_random_event_times.pydrivesfile_loaderwith a small CSV and a random generator that puts every event at the lower edge (t = 0):main: the first chunk starts at -1000000 ns, so the test fails;Please include the following if applicable:
ChunkInput0.4.2)