pylag.utils module

PyLag utility functions

pylag.utils.round_time(datetime_raw, rounding_interval=3600)[source]

Apply rounding to datetime objects

Rounding is sometimes required when simulation times are written to file with limited precision.

Parameters
  • datetime_raw (List, Datetime) – List of datetime objects to which rounding should be applied

  • rounding_interval (int, optional) – No. of seconds to round to (default 3600, or one hour)

Returns

datetime_rounded – List of rounded datetime objects

Return type

List, Datetime