Skip to main content

PySchedule

Struct PySchedule 

pub(crate) struct PySchedule {
    inner: Schedule,
}
Expand description

A generated set of calculation-period boundary dates.

Fields§

§inner: Schedule

Implementations§

§

impl PySchedule

pub(crate) fn calculation_periods(&self) -> Vec<(NaiveDate, NaiveDate)>

This schedule’s calculation periods, for a sibling module compiling a coupon strip from them.

pub(crate) fn core(&self) -> &Schedule

The core schedule, for a sibling module building a leg on it.

§

impl PySchedule

fn __repr__(&self) -> String

fn __len__(&self) -> usize

fn dates(&self) -> Vec<NaiveDate>

The boundary dates, ascending. n boundaries delimit n - 1 periods.

fn periods(&self) -> Vec<(NaiveDate, NaiveDate)>

The periods as (start, end) pairs.

fn from_dates(dates: Vec<NaiveDate>) -> PyResult<Self>

A schedule from boundary dates stated verbatim — no calendar, no roll, no business-day adjustment.

A stated boundary has already had all three applied by whoever stated it, so this is the entry point for a schedule read off a confirm or another system’s output, where schedule() is the one for a schedule generated from conventions.

Unconventional dates are not refused — a boundary on a weekend, or periods of unequal length, are what stating dates is for. Raises ValueError only where the list is ill-formed: fewer than two dates, a descending pair, or a repeated date.

fn paying( &self, lag_days: i32, calendar: &PyCalendar, business_day_convention: Named<BusinessDayConvention>, ) -> Vec<NaiveDate>

The payment date of every period under a lag_days business-day lag on calendar — one date per period, so one fewer than dates().

The schedule carries no lag of its own. When a period pays belongs to the coupon: two legs sharing one schedule may pay under different lags against different calendars, so the lag is given here rather than stored. A lag of 0 returns each period’s accrual end.

This is the same operation a leg computes its payment dates by, so these are the dates an instrument on this schedule and this lag reports in its cashflow records.

Trait Implementations§

§

impl DerefToPyAny for PySchedule

§

impl IntoPy<Py<PyAny>> for PySchedule

§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
§

impl PyClass for PySchedule

§

type Frozen = True

Whether the pyclass is frozen. Read more
§

impl PyClassImpl for PySchedule

§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
§

type BaseType = PyAny

Base class
§

type ThreadChecker = SendablePyClass<PySchedule>

This handles following two situations: Read more
§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild

Immutable or mutable
§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
§

fn items_iter() -> PyClassItemsIter

§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<isize>

§

fn weaklist_offset() -> Option<isize>

§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PySchedule

§

type Holder = Option<PyRef<'py, PySchedule>>

§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

§

impl PyMethods<PySchedule> for PyClassImplCollector<PySchedule>

§

fn py_methods(self) -> &'static PyClassItems

§

impl PyTypeInfo for PySchedule

§

const NAME: &'static str = "Schedule"

Class name.
§

const MODULE: Option<&'static str>

Module name, if any.
§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
§

fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

§

const NAME: &'static str = <T as PyTypeInfo>::NAME

Name of self. This is used in error messages, for example.
§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Ungil for T
where T: Send,