Schedule#

class sigtech.framework.schedules.schedule.Schedule

Base class handling delivery operations.

Keyword arguments:

  • Delivery offset - Determine the publication lag from the data date to the actual publication/delivery date in the system.

  • Delivery business day count convention.

  • Delivery time - Time of the day when the delivery/publication of the data points occurs.

  • Delivery timezone - Timezone for the delivery/publication of the data points of the schedule.

  • Delivery holidays - Holiday calendar driving the schedule data points.

Example of object creation:

schedule = Schedule(
               delivery_offset='1BD',
               delivery_bdc=None,
               delivery_time=time(9, 0, 0),
               delivery_timezone='Europe/London',
               delivery_holidays='London'
           )
delivery_kwargs()

Return a dict containing the class attributes.

prev_reference_datetime(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) pandas._libs.tslibs.timestamps.Timestamp

Return the past delivery datetime for the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

pandas Timestamp.

prev_reference_date(d: datetime.date) datetime.date

Return the past delivery date for the input date.

Parameters

d – Input date.

Returns

date.

date_increment(d: datetime.date, n: int) Any

Move a given date d exactly n business days forward or backward.

Parameters
  • d – Input date.

  • n – Number of business days for bump.

Returns

New bumped date from the input date.

get_exact_business_dates(d: datetime.date, n: int) list[datetime.date]

Return n business days after date d.

Parameters
  • d – Start date.

  • n – Number of days.

Returns

List of dates.

all_data_dates() list[datetime.date]

Return the timestamps of all data dates from calculation_start_date to calculation_end_date inclusive.

all_data_ts() pandas.core.indexes.datetimes.DatetimeIndex

Return the timestamps of all data dates from calculation_start_date to calculation_end_date inclusive.

all_reference_datetimes()

Timeseries indexed by data dates between start and end with corresponding reference times for that date.

approximate_holidays() str

A possibly not exact holiday set for this schedule.

calculation_end_date() datetime.date

Return the date on which the calculation of all data dates ends.

calculation_end_ts() pandas._libs.tslibs.timestamps.Timestamp

Date on which calculation of all data dates ends.

calculation_start_date() datetime.date

Return the date on which the calculation of all data dates starts.

calculation_start_ts() pandas._libs.tslibs.timestamps.Timestamp

Date on which calculation of all data dates starts.

current_next_data_date(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) datetime.date

Returns the first data date on or after the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

date.

current_next_data_ts(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) pandas._libs.tslibs.timestamps.Timestamp

Return the first data date on or after date d.

Parameters

d – Input date, datetime or timestamp.

Returns

pandas Timestamp.

current_previous_data_date(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) datetime.date

Returns the first data date on or before the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

date.

current_previous_data_ts(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) pandas._libs.tslibs.timestamps.Timestamp

Return the first data date on or before date d.

Parameters

d – Input date, datetime or timestamp.

Returns

pandas Timestamp.

data_dates(start: Optional[Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]] = None, end: Optional[Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]] = None) list[Union[datetime.datetime, datetime.date]]

List of value dates for which data is published between start and end dates inclusive.

Parameters
  • start – Start date, datetime or timestamp.

  • end – End date, datetime ot timestamp.

Returns

date or datetime.

data_ts(start: Optional[Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]] = None, end: Optional[Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]] = None) pandas.core.indexes.datetimes.DatetimeIndex

List of value dates for which data is published between start and end dates inclusive.

Parameters
  • start – Start date, datetime or timestamp.

  • end – End date, datetime ot timestamp.

Returns

pandas DatetimeIndex.

dependencies(input_dependency: sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency, valuation_currency: Optional[str] = None, use_start: bool = False) list[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency]

Dependencies of this schedule

end_date() datetime.date

Return the last date on which data will be available, typically date.max if no end date is set.

end_ts() pandas._libs.tslibs.timestamps.Timestamp

The last date on which data will be available, typically date.max if no end date is set.

is_data_date(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) bool

Return True if the input date is part of the schedule, otherwise False.

Parameters

d – Input date, datetime or timestamp.

Returns

bool.

is_data_ts(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) bool

Return True if the input date is part of the schedule, otherwise False.

Parameters

d – Input date, datetime or timestamp.

Returns

bool.

next_data_date(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) datetime.date

Return the first data date after the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

date.

next_data_ts(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) pandas._libs.tslibs.timestamps.Timestamp

Return the first data date after the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

pandas Timestamp.

previous_data_date(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) datetime.date

Return the first data date prior to the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

date.

previous_data_ts(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) pandas._libs.tslibs.timestamps.Timestamp

Return the first data date prior to the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

pandas Timestamp.

reference_datetime(d: Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]) pandas._libs.tslibs.timestamps.Timestamp

Return the delivery datetime for the input date.

Parameters

d – Input date, datetime or timestamp.

Returns

pandas Timestamp.

reference_datetimes(start: Optional[Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]] = None, end: Optional[Union[datetime.date, datetime.datetime, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Return the reference datetimes restricted to data dates between start and end inclusive.

Parameters
  • start – Input date, datetime or timestamp (optional).

  • end – Input date, datetime or timestamp (optional).

Returns

pandas Series.

start_date() datetime.date

The first date on which data will be available.

start_ts() pandas._libs.tslibs.timestamps.Timestamp

The first date on which data will be available.