fix: remove key_prefix from time features #162
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.
Pull Request
Description
This pull request removes the
key_prefix
argument from themake_datetime_numpy_dict
andmake_sun_position_numpy_sample
functions and updates all call sites and tests accordingly. Thekey_prefix
was originally introduced for flexibility in naming output dictionary keys, primarily within the context of the now-deprecatedocf_datapipes
library. Sinceocf-data-sampler
uses a different approach (PyTorch Datasets instead of DataPipes), this flexibility is no longer needed and introduces unnecessary complexity.This PR simplifies the code by hardcoding consistent key names for the datetime and sun position features:
make_datetime_numpy_dict
: Keys are now"date_sin"
,"date_cos"
,"time_sin"
,"time_cos"
.make_sun_position_numpy_sample
: Keys are now"solar_azimuth"
,"solar_elevation"
.This change improves code readability and maintainability by removing a parameter that is no longer relevant and ensuring consistent naming across the codebase.
Fixes #159
Checklist: