gazelib.conversion package¶
Subpackages¶
Submodules¶
gazelib.conversion.utils module¶
-
gazelib.conversion.utils.
estimate_sampling_interval
(times)[source]¶ Return mean interval in the given list of times. Return None if times is empty or contains only one element.
-
gazelib.conversion.utils.
split_to_ranges_at_change_in_value
(gd, value_converter, time_converter)[source]¶ Similar to gazelib.legacy.igazelib.split_at_change_in_value but returns also starting and ending times. The start time is equal to the end time of the previous range. Invalid values do not cause splits.
- Parameters:
- gd:
- gazedata as list of dicts
- value_converter:
- A function that converts from raw row to the value used for comparison and also in yielded dicts. Must raise ValueError or TypeError if value cannot be converted. On ValueError or TypeError the row will be skipped.
- time_converter:
- A function that converts from raw row to times used in ranges. Must return integer. Must raise ValueError or TypeError if time cannot be converted. On ValueError or TypeError the row will be skipped.
Yields dicts:
{ 'start': <integer, start time of range, inclusive>, 'end': <integer, end time of range, exclusive>, 'value': <the value of the range>, 'first': <first point in range> }
Module contents¶
Tools to convert from a data format to another.
Usage:
icllib.conversion.<source_format>.<target_format>.convert(...)