-
-
Notifications
You must be signed in to change notification settings - Fork 32
Fix: Handle Single-Timestamp Case and Add Test Cases for other functions like intersection of 2 DF` #198
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
Conversation
…amp case and improve validation for min_seq_length
raise ValueError( | ||
"Only one timestamp found, but min_seq_length > 1. No valid periods.", | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are good changes! But there's a ToDo in this same file here that needs to be addressed for some edge cases to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As i can see in original file, there is a Todo but it is at line 256 in original file and in updated file it is at line 267.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is the same Todo I meant! We have to allow overlap of 1 timestamp between intervals for single timestamp data to work correctly, otherwise some cases won't be covered - e g, when one source's interval ends exactly where the single timestamp of another source lies.
Speaking of edge cases, it would be great if you could add tests to this. I would check that a single timestamp is located correctly, that a t0 can be created when it requires just one timestamp from satellite, and that interval selection works when one of them is a single timestamp and is located inside the other, outside the other, and at the endpoints. The t0 one can be tricky, let me know if you would like me to help with it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the issue only mentioned the find_contiguous_time_periods function
, I initially focused on that one and overlooked the other. I have now addressed the other function as well and added a clearer way to visualize the intersection of the two dataframes. Please review it and let me know if anything is missing.
…ove argument formatting in compute_icon_mean_stddev.py
@AUdaltsova , Actually during ruff and linting, i got the problem as so i update the pyprject.toml file can you review and merge now? |
…gle-point overlaps and improve intersection logic with detailed documentation and test cases.
min_seq_length
…clude precise timestamps and enhance coverage for various overlap scenarios.
Hi @AUdaltsova, can you take a moment to review it now? |
@MAYANK12SHARMA thanks for having a go at this issue, I just want to flag that since this issue does not have the |
"Hi @Sukh-P, no worries at all. Whenever you have some time, I’d appreciate it if you could review it. I’ve been contributing to OCF since January. I have worked on ocf proejcts like open_data_pvnet, analysis dashboard, pvsitedatamodel, nowcasting datamodel and more. I feel it's worth for me to work with this org. |
@peterdudfield, @Sukh-P Could you please take a moment to review the PR. It's been 3 weeks. |
Hi @MAYANK12SHARMA, thanks a lot for your patience. We have done some work on this internally, specifically in the tests and the If you still want to work on this PR, the initial changes to |
Hi, @AUdaltsova i am really sorry for late reply. I will raise the new PR soon. |
Description
This PR updates the
find_contiguous_time_periods
function to allow for single-timestamp sequences whenmin_seq_length
is set to1
. Previously, the function requiredmin_seq_length
to be strictly greater than1
, which prevented valid single-point time periods (e.g., single satellite image selection).Key Changes:
min_seq_length
can now be1
.min_seq_length == 1
, a valid period is returned withstart_dt
andend_dt
set to the same value.>= min_seq_length
, instead of strictly greater.Fixes #192
How Has This Been Tested?
Tested with various time series scenarios:
min_seq_length = 1
min_seq_length > 1
(raises expected error)Added new test cases to cover these conditions.
min_seq_length = 1
Checklist: