pat2vec.util.get_start_end_year_month
Functions
|
Calculates start and end date components based on a time interval. |
- pat2vec.util.get_start_end_year_month.get_start_end_year_month(target_date_range, config_obj=None)[source]
Calculates start and end date components based on a time interval.
This function takes a starting date and adds a time interval defined in a configuration object to determine the end date. It then returns the year, month, and day for both the start and end dates.
- Parameters:
target_date_range (
Tuple
[int
,int
,int
]) – A tuple of (year, month, day) representing the start date.config_obj (
Optional
[Any
]) – A configuration object that must contain the time_window_interval_delta attribute. This delta is added to the start date to calculate the end date. Defaults to None.
- Returns:
- (start_year, start_month, end_year,
end_month, start_day, end_day).
- Return type:
A tuple of six integers
- Raises:
ValueError – If config_obj is not provided.
AttributeError – If config_obj does not have time_window_interval_delta.