Fix TemporalOrderDataset bug and improve test coverage#56
Merged
Conversation
- Split window extraction into pre and post halves - Shift post window time coordinates to follow pre window - Concatenate windows directly instead of slicing - Add debugging attributes for pre and post coordinates
- Move individual count validation to WindowDataset - Remove redundant checks from subclasses - Replace min_delay/max_delay with max_shift in TemporalShiftDataset - Replace min_speed/max_speed with max_warp in TemporalWarpDataset - Update docstrings and error messages for clarity and consistency - Adjust label logic for new parameter conventions
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the TemporalOrderDataset and improves test coverage by refactoring parameter validation, adding debugging metadata, and simplifying configuration parameters.
- Implements stricter input validations and unified error messaging for time shift and warp configurations
- Refactors window selection logic and introduces additional debugging attributes for deeper insight during testing
Comments suppressed due to low confidence (2)
src/lisbet/datasets.py:705
- The error message refers to 'max_warp' as a positive integer while it is defined as a float and expressed as a percentage in the docstring. Consider updating the error message for consistency.
if not (0 < max_warp <= 100):
src/lisbet/datasets.py:619
- The variable 'frame_idx_delay' is used but not defined in this context. Please define 'frame_idx_delay' before using it in the debugging information.
x.attrs["shift_coords"] = [rec_idx, frame_idx_delay, delta_delay]
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.
This pull request refactors the
lisbet/datasets.pymodule to improve parameter validation, enhance debugging capabilities, and simplify dataset configuration. Key changes include stricter input validation, the addition of debugging metadata, and renaming parameters for clarity.Validation Improvements:
max_shiftis positive andmax_warpis within valid bounds.Debugging Enhancements:
attrs) to track original and transformed coordinates for datasets, includingorig_coords,swap_coords,pre_coords,post_coords,shift_coords, andwarp_coords.Parameter Simplifications:
min_delay/max_delaywithmax_shiftfor time shifts andmin_speed/max_speedwithmax_warpfor temporal warping, simplifying configuration and improving clarity.Dataset Logic Adjustments:
Functional Updates: