ostk.physics.time.Duration¶
- class Duration(self: ostk.physics.time.Duration, arg0: datetime.timedelta)¶
Bases:
pybind11_object
Duration format.
Constructor. :param count: A nanosecond count. :type count: int
Methods
Constructs a duration between two instants
Create a duration in days.
Get the absolute duration.
Get the day count.
Get the hour count.
Get the microsecond count.
Get the millisecond count.
Get the minute count.
Get the nanosecond count.
Get the second count.
Get the week count.
Create a duration in hours.
Get the duration in days.
Get the duration in hours.
Get the duration in microseconds.
Get the duration in milliseconds.
Get the duration in minutes.
Get the duration in nanoseconds.
Get the duration in seconds.
Get the duration in a unit.
Get the duration in weeks.
Check if the duration is defined.
Check if the duration is near another duration.
Check if the duration is positive.
Check if the duration is strictly positive.
Check if the duration is zero.
Create a duration in microseconds.
Create a duration in milliseconds.
Create a duration in minutes.
Create a duration in nanoseconds.
Create a duration in seconds.
Overloaded function.
Create an undefined duration.
Create a duration in weeks.
Create a zero duration.
- class Format(self: ostk.physics.time.Duration.Format, value: int)¶
Bases:
pybind11_object
Members:
- Undefined :
Undefined format.
- Standard :
Standard format (d hh:mm:ss.mmm.uuu.nnn)
- ISO8601 :
ISO 8601 format (PnDTnHnMnS)
- property name¶
- __add__(
- self: ostk.physics.time.Duration,
- arg0: ostk.physics.time.Duration,
- __mul__(
- self: ostk.physics.time.Duration,
- arg0: float,
- static between(
- arg0: ostk::physics::time::Instant,
- arg1: ostk::physics::time::Instant,
Constructs a duration between two instants
- Returns:
Duration between two instants.
- Return type:
- static days(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in days.
- Returns:
Duration in days.
- Return type:
- get_absolute(self: ostk.physics.time.Duration) ostk.physics.time.Duration ¶
Get the absolute duration.
- Returns:
Absolute duration.
- Return type:
- get_days(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the day count.
- Returns:
Day count.
- Return type:
- get_hours(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the hour count.
- Returns:
Hour count.
- Return type:
- get_microseconds(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the microsecond count.
- Returns:
Microsecond count.
- Return type:
- get_milliseconds(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the millisecond count.
- Returns:
Millisecond count.
- Return type:
- get_minutes(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the minute count.
- Returns:
Minute count.
- Return type:
- get_nanoseconds(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the nanosecond count.
- Returns:
Nanosecond count.
- Return type:
- get_seconds(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the second count.
- Returns:
Second count.
- Return type:
- get_weeks(self: ostk.physics.time.Duration) ostk.core.type.Integer ¶
Get the week count.
- Returns:
Week count.
- Return type:
- static hours(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in hours.
- Returns:
Duration in hours.
- Return type:
- in_days(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in days.
- Returns:
Duration in days.
- Return type:
- in_hours(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in hours.
- Returns:
Duration in hours.
- Return type:
- in_microseconds(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in microseconds.
- Returns:
Duration in microseconds.
- Return type:
- in_milliseconds(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in milliseconds.
- Returns:
Duration in milliseconds.
- Return type:
- in_minutes(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in minutes.
- Returns:
Duration in minutes.
- Return type:
- in_nanoseconds(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in nanoseconds.
- Returns:
Duration in nanoseconds.
- Return type:
- in_seconds(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in seconds.
- Returns:
Duration in seconds.
- Return type:
- in_unit(
- self: ostk.physics.time.Duration,
- arg0: ostk.physics.unit.Time.Unit,
Get the duration in a unit.
- Returns:
Duration in unit.
- Return type:
- in_weeks(self: ostk.physics.time.Duration) ostk.core.type.Real ¶
Get the duration in weeks.
- Returns:
Duration in weeks.
- Return type:
- is_defined(self: ostk.physics.time.Duration) bool ¶
Check if the duration is defined.
- Returns:
True if defined.
- Return type:
- is_near(
- self: ostk.physics.time.Duration,
- duration: ostk.physics.time.Duration,
- tolerance: ostk.physics.time.Duration,
- duration: ostk.physics.time.Duration,
Check if the duration is near another duration.
- is_positive(self: ostk.physics.time.Duration) bool ¶
Check if the duration is positive.
- Returns:
True if positive.
- Return type:
- is_strictly_positive(self: ostk.physics.time.Duration) bool ¶
Check if the duration is strictly positive.
- Returns:
True if strictly positive.
- Return type:
- is_zero(self: ostk.physics.time.Duration) bool ¶
Check if the duration is zero.
- Returns:
True if zero.
- Return type:
- static microseconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in microseconds.
- Returns:
Duration in microseconds.
- Return type:
- static milliseconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in milliseconds.
- Returns:
Duration in milliseconds.
- Return type:
- static minutes(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in minutes.
- Returns:
Duration in minutes.
- Return type:
- static nanoseconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in nanoseconds.
- Returns:
Duration in nanoseconds.
- Return type:
- static parse(
- string: ostk.core.type.String,
- format: ostk.physics.time.Duration.Format = <Format.Undefined: 0>,
- static seconds(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in seconds.
- Returns:
Duration in seconds.
- Return type:
- to_string(*args, **kwargs)¶
Overloaded function.
to_string(self: ostk.physics.time.Duration) -> ostk.core.type.String
to_string(self: ostk.physics.time.Duration, arg0: ostk::physics::time::Duration::Format) -> ostk.core.type.String
- to_timedelta(self: ostk.physics.time.Duration) datetime.timedelta ¶
- static undefined() ostk.physics.time.Duration ¶
Create an undefined duration.
- Returns:
Undefined duration.
- Return type:
- static weeks(arg0: ostk.core.type.Real) ostk.physics.time.Duration ¶
Create a duration in weeks.
- Returns:
Duration in weeks.
- Return type:
- static zero() ostk.physics.time.Duration ¶
Create a zero duration.
- Returns:
Zero duration.
- Return type: