data_sources.datetime

Datetime data sources and functions

data_sources.datetime.datetime_data_source

Datetime DataSource - add hour and year features

DatetimeDataSource Objects

@dataclass
class DatetimeDataSource(DataSource)

Add hour_of_day_{sin, cos} and day_of_year_{sin, cos} features.

__post_init__

def __post_init__()

Post init

get_example

def get_example(t0_dt: pd.Timestamp, x_meters_center: Number, y_meters_center: Number) -> Datetime

Get example data

Arguments:

  • t0_dt - list of timestamps
  • x_meters_center - x center of patches - not needed
  • y_meters_center - y center of patches - not needed

  • Returns - batch data of datetime features

get_locations_for_batch

def get_locations_for_batch(t0_datetimes: pd.DatetimeIndex) -> Tuple[List[Number], List[Number]]

This method is not needed for DatetimeDataSource

datetime_index

def datetime_index() -> pd.DatetimeIndex

This method is not needed for DatetimeDataSource

data_sources.datetime.datetime_model

Model for output of datetime data

Datetime Objects

class Datetime(DataSourceOutput)

Class to store Datetime data as a xr.Dataset with some validation

DatetimeML Objects

class DatetimeML(DataSourceOutputML)

Model for output of datetime data

sequence_length

@property
def sequence_length()

The sequence length of the pv data

v_hour_of_day_cos

@validator("hour_of_day_cos")
def v_hour_of_day_cos(cls, v, values)

Validate 'hour_of_day_cos'

v_day_of_year_sin

@validator("day_of_year_sin")
def v_day_of_year_sin(cls, v, values)

Validate 'day_of_year_sin'

v_day_of_year_cos

@validator("day_of_year_cos")
def v_day_of_year_cos(cls, v, values)

Validate 'day_of_year_cos'

fake

@staticmethod
def fake(batch_size, seq_length_5)

Make a fake Datetime object

to_xr_dataset

def to_xr_dataset(_)

Make a xr dataset

from_xr_dataset

@staticmethod
def from_xr_dataset(xr_dataset)

Change xr dataset to model. If data does not exist, then return None