metasyn.distribution.uniform.TimeUniformDistribution
- class metasyn.distribution.uniform.TimeUniformDistribution(lower, upper, precision='microseconds')
Uniform time distribution.
Time objects will be uniformly distributed between a start and end time.
- Parameters:
lower (str or datetime.time) – Earliest possible time to be generated from this distribution. String formatted in ISO format, see examples below or use time objects from the python standard library datetime.
upper (str or datetime.time) – Latest possible time to be generated from this distribution. String formatted in ISO format, see examples below or use time objects from the python standard library datetime.
precision (str) – Most precise measure of time 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”].
Examples
>>> TimeUniformDistribution(lower="10:39:12", upper="10:39:45", precision="seconds")
- name
core.uniform
- unique
False
- version
1.0
- var_type
time
- __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_deltaGet the minimum time delta.
The identifier for the implemented distribution
precision_possibilitiesWhether the distribution creates only unique values
The variable type of the distribution
Version of the implemented distribution