Skip to content

Delta

Delta Manual

Overview

The delta codec takes a single numeric input. The numeric input is interpreted as unsigned integers of the given element width (either 1, 2, 4, or 8).

Inputs

A single numeric input.

Outputs

A single numeric output.

Use Cases

The delta codec is useful when handling numeric data which has some consistent relationship between its consecutive elements. For example, the delta codec might be useful for the timestamp column of a time series which has monotonically increasing values.

There are many reasonable successors to the delta codec, depending on the relationship between the input elements. constant is an ideal successor if the input is an arithmetic series, i.e. has a constant delta. fieldlz might be a good successor if there is a lot of repetition of deltas or if there is a consistent pattern. entropy could also be a good next state if the deltas are small, but otherwise do not have a lot of repetition. Similarly transpose + entropy could be useful for well-clustered larger numbers, since it separates highly predictable high bytes from less predictable ones.

openzl.ext.nodes.DeltaInt

Bases: Node

Output the deltas between each int in the input. The first value is written into the header.

Inputs: input: Type.Numeric

Singleton Outputs: deltas: Type.Numeric

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
class DeltaInt(Node):
    """
    Output the deltas between each int in the input. The first value is written into the header.

    Inputs:
    input: Type.Numeric


    Singleton Outputs:
    deltas: Type.Numeric
    """

    def __init__(self) -> None: ...

    def __call__(self, compressor: ext.Compressor, successor: ext.GraphID | ext.graphs.Graph) -> ext.GraphID: ...

    def run(self, edge: ext.Edge) -> list[ext.Edge]: ...

    def run_multi_input(self, edges: Sequence[ext.Edge]) -> list[ext.Edge]: ...

    def build_graph(self, compressor: ext.Compressor, successors: Sequence[ext.GraphID]) -> ext.GraphID: ...

    def parameterize(self, compressor: ext.Compressor) -> ext.NodeID: ...

    @property
    def base_node(self) -> ext.NodeID: ...

base_node property

__call__(compressor, successor)

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
def __call__(self, compressor: ext.Compressor, successor: ext.GraphID | ext.graphs.Graph) -> ext.GraphID: ...

__init__()

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
def __init__(self) -> None: ...

build_graph(compressor, successors)

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
def build_graph(self, compressor: ext.Compressor, successors: Sequence[ext.GraphID]) -> ext.GraphID: ...

parameterize(compressor)

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
def parameterize(self, compressor: ext.Compressor) -> ext.NodeID: ...

run(edge)

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
def run(self, edge: ext.Edge) -> list[ext.Edge]: ...

run_multi_input(edges)

Source code in build-openzl/py/site-packages/openzl/ext/nodes.pyi
def run_multi_input(self, edges: Sequence[ext.Edge]) -> list[ext.Edge]: ...