Skip to content

streaming

StreamingOfflineEnvironment(environment, batch_size, *, size=None)

Bases: IncrementalEnvironment

Streaming offline environment.

This environment streams data from an offline environment in batches.

Initialize the streaming offline environment.

Parameters:

Name Type Description Default
environment OfflineEnvironment

The offline environment to stream.

required
batch_size int

The batch size of the streaming environment.

required
size int | None

The number of samples in the environment. If provided, the number of steps will be calculated based on this value.

None
Source code in src/flowcean/polars/environments/streaming.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(
    self,
    environment: OfflineEnvironment,
    batch_size: int,
    *,
    size: int | None = None,
) -> None:
    """Initialize the streaming offline environment.

    Args:
        environment: The offline environment to stream.
        batch_size: The batch size of the streaming environment.
        size: The number of samples in the environment. If provided, the
            number of steps will be calculated based on this value.
    """
    super().__init__()
    self.environment = environment
    self.batch_size = batch_size
    self.sample_count = size