metasyn.distribution.uniform.DateTimeUniformDistribution

class metasyn.distribution.uniform.DateTimeUniformDistribution(lower, upper, precision='microseconds')

Uniform DateTime distribution.

Datetime objects will be uniformly distributed between a start and end date time.

Parameters:
  • lower (str or datetime.datetime) – Earliest possible datetime to be generated from this distribution. String formatted in ISO format, see examples below or use datetime objects from the python standard library datetime.

  • upper (str or datetime.datetime) – Latest possible datetime to be generated from this distribution. String formatted in ISO format, see examples below or use datetime objects from the python standard library datetime.

  • precision (str) – Most precise measure of datetime that the distribution will take into account. For example, if precision == “seconds”, then the microseconds will always be set to 0. Possible values: [“microseconds”, “seconds”, “minutes”, “hours”, “days”].

Examples

>>> DateTimeUniformDistribution(lower="2022-07-15T10:39", upper="2022-08-15T10:39",
                                precision="minutes")
name

core.uniform

unique

False

version

1.0

var_type

datetime

__init__(lower, upper, precision='microseconds')
Parameters:
  • lower (Any)

  • upper (Any)

  • precision (str)

Methods

__init__(lower, upper[, precision])

default_distribution([var_type])

Get a distribution with default parameters.

draw()

Draw a random element from the fitted distribution.

draw_list(n)

Draw a list of values from the distribution.

draw_reset()

Reset the drawing of elements to start again.

from_dict(dist_dict)

Create a distribution from a dictionary.

fromisoformat(dt_obj)

Convert string to iso format.

information_criterion(values)

Get the BIC value for a particular set of values.

matches_name(name)

Check whether the name matches the distribution.

provides_var_type(var_type)

round(time_obj)

Round down any time object with the precision.

schema()

Create sub-schema to validate GMF file.

to_dict()

Convert the distribution to a dictionary.

Attributes

minimum_delta

Get the minimum time delta.

name

The identifier for the implemented distribution

precision_possibilities

unique

Whether the distribution creates only unique values

var_type

The variable type of the distribution

version

Version of the implemented distribution