Make the NPM timestamp unit a session-wide parameter - #412
Merged
Conversation
The unit recorded in .npm_params.json did not always match the one applied: the Step 1 form fabricated "seconds" for files it never asked about, while _decompose_streams divided header-less (data_np) timestamps by 1000. The unit is now one value per session folder, supplied as a plain parameter defaulting to seconds with no inference from file layout, and persisted resolved so the recorded value is always the applied one. The unit and timestamp-column questions are asked independently: the unit always, the column only when the files offer more than one. That removes the accumulating column-name list that asked which timestamp column to use for the second file of a session -- a question with one possible answer whose real effect was choosing the divisor for the whole folder. Also extracts the file listing and layout classification that _decompose_streams, has_multiple_event_ttls and the column probe each had their own copy of, so the form and the extractor can no longer classify a session differently. Fixes #411 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pauladkisson
enabled auto-merge
August 4, 2026 14:57
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Fixes #411
Details (AI-generated)
Fixes #411.
The NPM timestamp unit is now one value per session folder, supplied as a plain parameter that
defaults to seconds, with no inference from file layout. It is persisted resolved, so
.npm_params.jsonalways states the unit the run was read with.The unit and timestamp-column questions are now asked independently: the unit always, the column
only when the session's files offer more than one. That drops the accumulating column-name list
behind the asymmetry in #411 —
sampleData_NPM_2andsampleData_NPM_4are the same layout, butonly the former was asked which timestamp column to use, on a dropdown with one option, and the
answer set the divisor for the whole folder.
Scope:
npm_time_units/npm_timestamp_column_namesbecome the scalarsnpm_time_unit/npm_timestamp_column_namethroughout (extractor,guppy.testing.api,.npm_params.json).needs_ts_unitis replaced bytimestamp_column_options, which reports each file's owntimestamp columns.
_decompose_streams,has_multiple_event_ttlsand the column probe each had their own copy of are extracted into
_list_npm_files/_classify_npm_file, so the form and the extractor cannot classify a session differently.load_npm_paramsrejects files written by v2.0.0-alpha7/8, whose recorded unit cannot betrusted, with a message to re-run Step 1.
Two consequences worth flagging:
GuPPy previously assumed milliseconds. No magnitude sanity check is included.
sampleData_NPM_4andsampleData_NPM_5previously showed none.All four NPM consistency cases pass against the v1.3.0 references, so no numeric output changed.
🤖 Generated with Claude Code