chimcla.util_file_sorting

This Module contains classes and functions for the Lot Preparation step of the processing pipeline.

used by cli.py.

Module Contents

Classes

Lot

A Lot-instance models a production lot (typically spanning several days)

Functions

diff_to_days

fname_to_date_str

split_into_lots

Distribute a big list of files (with time stamp names) into a structure of subdirectories (“lots” which contain “parts”).

API

chimcla.util_file_sorting.diff_to_days(diff)[source]
chimcla.util_file_sorting.fname_to_date_str(fname)[source]
class chimcla.util_file_sorting.Lot(start_index, part_size: int = 1000)[source]

Bases: addict.Addict

A Lot-instance models a production lot (typically spanning several days)

Initialization

Initialize self. See help(type(self)) for accurate signature.

set_var_values(dt_objs: numpy.ndarray, fnamelist: list[str])[source]
__setattr__(name, value)
__setitem__(name, value)
__add__(other)
classmethod _hook(item)
__getattr__(item)
__missing__(name)
__delattr__(name)
to_dict()
copy()
deepcopy()
__deepcopy__(memo)
update(*args, **kwargs)
__getnewargs__()
__getstate__()
__setstate__(state)
__or__(other)
__ror__(other)
__ior__(other)
setdefault(key, default=None)
freeze(shouldFreeze=True)
unfreeze()
__contains__()
__delitem__()
__dir__()
__eq__()
__format__()
__ge__()
__getattribute__()
__getitem__()
__gt__()
__iter__()
__le__()
__len__()
__lt__()
__ne__()
__new__()
__reduce__()
__reduce_ex__()
__repr__()
__reversed__()
__sizeof__()
__str__()
__subclasshook__()
clear()
get()
items()
keys()
pop()
popitem()
values()
chimcla.util_file_sorting.split_into_lots(pathlist: str, part_size: int = 1000)[source]

Distribute a big list of files (with time stamp names) into a structure of subdirectories (“lots” which contain “parts”).

:param pathlist: a text file with one path per line :param lot_size: number of files per lot

Each lot corresponds to a production cycle without major interruptions (e.g. 3 days).