Skip to content
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

194-align-training-window-with-user-defined-temporal-extent #195

Merged

Conversation

cbutsko
Copy link

@cbutsko cbutsko commented Oct 15, 2024

No description provided.

@cbutsko cbutsko requested a review from kvantricht October 15, 2024 21:46
@cbutsko cbutsko linked an issue Oct 15, 2024 that may be closed by this pull request
Copy link
Contributor

@kvantricht kvantricht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Just few remarks for now.

src/worldcereal/utils/refdata.py Show resolved Hide resolved

def get_best_valid_date(row):
"""
Determine the best valid date for a given row based on forward and backward shifts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a standard Numpy docstring? Hard to see from github changes, just checking with you.


# get the middle of the user-defined temporal extent
start_date, end_date = processing_period.to_datetime()
processing_period_middle_ts = start_date + pd.DateOffset(months=5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the middle is hard to define with an even number of timesteps. Should we be aligned with e.g. this? And therefore rather add 6 months? I may be wrong here, was just wondering.

# save the true valid_date for later
true_valid_date_map = sample_dates.set_index("sample_id")["valid_date"]

# calculate the shifts and assignt new valid date
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo in comment

@kvantricht kvantricht self-requested a review October 16, 2024 12:13
@kvantricht kvantricht merged commit 26b6fb7 into main Oct 16, 2024
4 checks passed
@kvantricht kvantricht deleted the 194-align-training-window-with-user-defined-temporal-extent branch October 16, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align training window with user-defined temporal extent
2 participants