plexgis.components.core.utils¶
- cycle_unwrapped_optional(objs: Optional[Iterable[Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]]]) Iterator[Optional[plexgis.components.core.types.T]] ¶
Like cycle_unwrapped, but accepts None as an argument and cycles with None
- maybe_unwrap(obj: Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]) plexgis.components.core.types.T ¶
Return the unwrapped representation of an object. If it is already unwrapped, it will simply be returned.
- multi_cycle(*objss: Iterable[Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]], dominant_index: Optional[int] = None) Iterator[Tuple[plexgis.components.core.types.T, ...]] ¶
This gets a list of object lists and will return an iterator with each element cycled as needed.
Example:
Input a = [1, 2, 3]; b = [4]; c = [5, 6]
Ouput:
(1, 4, 5) (2, 4, 6) (3, 4, 5)
- multi_cycle_unwrapped(*objss: Iterable[Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]], dominant_index: Optional[int] = None) Iterator[Tuple[plexgis.components.core.types.T, ...]] ¶
Like multi_cycle, but returns each element unwrapped
- objects_to_series(values)¶
convert objects to a pandas series
- single(objs: Iterable[Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]]) Optional[Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]] ¶
Return the first object or None if list is empty
- single_or_raise(objs: Iterable[Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]]]) Union[plexgis.components.core.types.T, plexgis.components.core.types.Wrapped[plexgis.components.core.types.T]] ¶
Return the first object or raise a ValueError if list is empty