zae_engine.operation package¶
Submodules¶
zae_engine.operation.run_length module¶
- class zae_engine.operation.run_length.Run(start_index: int, end_index: int, value: int)[소스]¶
기반 클래스:
object
Represents a run in Run-Length Encoding (RLE).
- start_index¶
The starting index of the run.
- Type:
int
- end_index¶
The ending index of the run.
- Type:
int
- value¶
The value of the run.
- Type:
int
- end_index: int¶
- start_index: int¶
- value: int¶
- class zae_engine.operation.run_length.RunLengthCodec(tol_merge: int = 20, remove_incomplete: bool = False, merge_closed: bool = False, base_class: int = 0)[소스]¶
기반 클래스:
object
A codec class for Run-Length Encoding (RLE) and decoding.
- 매개변수:
tol_merge (int, optional) – The tolerance value to merge close runs. Default is 20.
remove_incomplete (bool, optional) – Whether to remove incomplete runs during sanitization. Default is False.
merge_closed (bool, optional) – Whether to merge close runs during sanitization. Default is False.
base_class (int, optional) – The base class value to be excluded from runs. Default is 0.
- decode(encoded_runs: RunList) List[int]: [소스]¶
Decodes RLE runs back into the original list of integers.
- __call__(data: List[int] | List[List[int]] | RunList | List[RunList], sense: int | None = None) Union[RunList, List[RunList], List[int], List[List[int]]]: [소스]¶
Encodes or decodes data based on the input type.
- decode(encoded_runs: RunList) List[int] [소스]¶
Decode a list of RLE runs back to the original list of integers.
This method reconstructs the original sequence of integers from a RunList object. Each Run specifies the start index, end index, and the value to be filled in that range. The length of the output list is determined by the original_length stored in RunList.
- 매개변수:
encoded_runs (RunList) – A RunList object containing runs to be decoded.
- 반환:
The decoded list of integers reconstructed from the runs.
- 반환 형식:
List[int]
- encode(x: List[int], sense: int) RunList [소스]¶
Encode a list of integers using Run-Length Encoding (RLE).
This method converts a sequence of integers into a list of runs. Each run is represented as a Run object containing the start index, end index, and the value of the run. Runs with a length smaller than the specified sense are ignored in the filtered() method.
- 매개변수:
x (List[int]) – The input list of integers to be encoded.
sense (int) – The minimum length of runs to be considered. Runs shorter than this value are excluded from the output when calling filtered().
- 반환:
A RunList object containing all runs, the sense value, and the original list length.
- 반환 형식:
- class zae_engine.operation.run_length.RunList(all_runs: List[Run], sense: int, original_length: int)[소스]¶
기반 클래스:
object
Stores the results of Run-Length Encoding (RLE) and provides methods to access raw and filtered runs.
- sense¶
The minimum length of runs to be considered in filtering.
- Type:
int
- original_length¶
The length of the original list that was encoded.
- Type:
int