superleaf.utils.parallel#
Functions
|
Apply |
Classes
|
|
|
Abstract base class for PyArrow data containers. |
|
|
|
|
|
|
Abstract base class for shared memory containers. |
|
|
- superleaf.utils.parallel.parmap(func, iterable, star=False, mode='process', n_workers=None, nthreads_per_process=None, pbar_desc=None, verbose=False)[source]#
Apply
func
to every item initerable
.- mode:
“thread”: use ThreadPoolExecutor with n_workers.
“process”: use ProcessPoolExecutor; each process runs a ThreadPoolExecutor of size nthreads_per_process.
A tqdm progress bar shows overall progress.
Bases:
ABC
Abstract base class for shared memory containers.
Load the data from shared memory.
Close the shared memory.
Unlink the shared memory.
Bases:
SharedMemoryContainer
Load the data from shared memory.
Close the shared memory.
Unlink the shared memory.
Bases:
SharedMemoryContainer
Load the data from shared memory.
Close the shared memory.
Unlink the shared memory.
- class superleaf.utils.parallel.PyArrowData(path: str)[source]#
Bases:
SharedMemoryContainer
Abstract base class for PyArrow data containers.
- abstractmethod classmethod create(data, path: str | None = None, dir: str | None = None, overwrite: bool = False) Self [source]#
- property metadata: dict#
- class superleaf.utils.parallel.PyArrowDataFrame(path: str)[source]#
Bases:
PyArrowData
- class superleaf.utils.parallel.PyArrowArray(path: str)[source]#
Bases:
PyArrowDataFrame
Bases:
SharedMemoryContainer
Load the data from shared memory.
Close the shared memory.
Unlink the shared memory.