ostk.physics.time.Duration

class Duration(self, arg: datetime.timedelta, /)
class Duration(self, duration: ostk.physics.time.Duration)

Bases: object

Duration format.

Overloaded function.

  1. __init__(self, arg: datetime.timedelta, /) -> None

    Constructor. Args:

    count (int): A nanosecond count.

  2. __init__(self, duration: ostk.physics.time.Duration) -> None

    Copy constructor.

    Args:

    duration (Duration): The Duration.

Attributes

between

days

get_absolute

Get the absolute duration.

get_days

Get the day count.

get_hours

Get the hour count.

get_microseconds

Get the microsecond count.

get_milliseconds

Get the millisecond count.

get_minutes

Get the minute count.

get_nanoseconds

Get the nanosecond count.

get_seconds

Get the second count.

get_weeks

Get the week count.

hours

in_days

Get the duration in days.

in_hours

Get the duration in hours.

in_microseconds

Get the duration in microseconds.

in_milliseconds

Get the duration in milliseconds.

in_minutes

Get the duration in minutes.

in_nanoseconds

Get the duration in nanoseconds.

in_seconds

Get the duration in seconds.

in_unit

Get the duration in a unit.

in_weeks

Get the duration in weeks.

is_near

Check if the duration is near another duration.

is_positive

Check if the duration is positive.

is_strictly_positive

Check if the duration is strictly positive.

is_zero

Check if the duration is zero.

microseconds

milliseconds

minutes

nanoseconds

parse

seconds

to_string

to_timedelta

weeks

zero

class Format(
value,
names=None,
*,
module=None,
qualname=None,
type=None,
start=1,
boundary=None,
)

Bases: Enum

Standard = 0
ISO8601 = 1
__add__
__mul__
between = <nanobind.nb_func object>
days = <nanobind.nb_func object>
get_absolute

Get the absolute duration.

Returns:

Absolute duration.

Return type:

Duration

get_days

Get the day count.

Returns:

Day count.

Return type:

int

get_hours

Get the hour count.

Returns:

Hour count.

Return type:

int

get_microseconds

Get the microsecond count.

Returns:

Microsecond count.

Return type:

int

get_milliseconds

Get the millisecond count.

Returns:

Millisecond count.

Return type:

int

get_minutes

Get the minute count.

Returns:

Minute count.

Return type:

int

get_nanoseconds

Get the nanosecond count.

Returns:

Nanosecond count.

Return type:

int

get_seconds

Get the second count.

Returns:

Second count.

Return type:

int

get_weeks

Get the week count.

Returns:

Week count.

Return type:

int

hours = <nanobind.nb_func object>
in_days

Get the duration in days.

Returns:

Duration in days.

Return type:

float

in_hours

Get the duration in hours.

Returns:

Duration in hours.

Return type:

float

in_microseconds

Get the duration in microseconds.

Returns:

Duration in microseconds.

Return type:

float

in_milliseconds

Get the duration in milliseconds.

Returns:

Duration in milliseconds.

Return type:

float

in_minutes

Get the duration in minutes.

Returns:

Duration in minutes.

Return type:

float

in_nanoseconds

Get the duration in nanoseconds.

Returns:

Duration in nanoseconds.

Return type:

float

in_seconds

Get the duration in seconds.

Returns:

Duration in seconds.

Return type:

float

in_unit

Get the duration in a unit.

Returns:

Duration in unit.

Return type:

float

in_weeks

Get the duration in weeks.

Returns:

Duration in weeks.

Return type:

float

is_near

Check if the duration is near another duration.

Parameters:
  • duration (Duration) -- Duration to compare with.

  • tolerance (Duration) -- Tolerance.

Returns:

True if near.

Return type:

bool

is_positive

Check if the duration is positive.

Returns:

True if positive.

Return type:

bool

is_strictly_positive

Check if the duration is strictly positive.

Returns:

True if strictly positive.

Return type:

bool

is_zero

Check if the duration is zero.

Returns:

True if zero.

Return type:

bool

microseconds = <nanobind.nb_func object>
milliseconds = <nanobind.nb_func object>
minutes = <nanobind.nb_func object>
nanoseconds = <nanobind.nb_func object>
parse = <nanobind.nb_func object>
seconds = <nanobind.nb_func object>
to_string
to_timedelta
weeks = <nanobind.nb_func object>
zero = <nanobind.nb_func object>