radioviz.models.data_model

Data model definitions for RadioViz application.

This module defines core data structures for representing data sources, their origins, storage configurations, and states within the RadioViz application. It provides immutable dataclasses for data integrity and enumerations for tracking data provenance and status.

Classes

DataKind(*values)

Enumeration of data kinds.

DataOrigin(*values)

Enumeration of possible data origins.

DataSource(label, origin[, parent, derivation])

Immutable data source representation.

DataState(*values)

Flags representing data state.

DataStorage(path)

Data storage configuration.

SpatialDerivation(parent_id, roi[, transform])

Immutable spatial derivation representation.

class radioviz.models.data_model.DataKind(*values)[source]

Bases: StrEnum

Enumeration of data kinds.

Defines different categories of data based on their nature and usage within the application.

static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

AGGREGATE = 'Aggregate'

Aggregated data formed by combining multiple data sources.

DERIVED = 'Derived'

Data that has been derived from other sources.

ORIGINAL = 'Original'

Original data that has not been processed or modified.

class radioviz.models.data_model.DataOrigin(*values)[source]

Bases: StrEnum

Enumeration of possible data origins.

Represents different sources from which data can originate in the application. This enumeration is used to categorize data based on how it was obtained or created.

static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

DERIVED = 'derived'

Data is derived from other sources.

FILE = 'file'

Data originates from a file.

IMPORT = 'import'

Data is imported from external sources.

SIMULATION = 'simulation'

Data is generated through simulation.

USER = 'user'

Data is provided by a user.

class radioviz.models.data_model.DataSource(label: str, origin: DataOrigin, parent: DataSource | None = None, derivation: SpatialDerivation | None = None)[source]

Bases: object

Immutable data source representation.

Represents a data source with its label, origin, and optional parent relationship. This class is immutable (frozen) to ensure data integrity once created.

label: str
Parameters:

label (str) – Human-readable name for the data source

origin: DataOrigin
Parameters:

origin (DataOrigin) – The origin type of the data source

parent: DataSource | None = None
Parameters:

parent (DataSource | None) – Optional parent data source, defaults to None

class radioviz.models.data_model.DataState(*values)[source]

Bases: Flag

Flags representing data state.

Provides a bitmask-based system for tracking various states of data, such as whether it has been modified, is persistent, or is transient.

static _generate_next_value_(name, start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_values: the last value assigned or None

MODIFIED = 1

Data has been modified since last save.

NONE = 0

No specific state flags set.

PERSISTENT = 2

Data is persisted to storage.

TRANSIENT = 4

Data exists only temporarily in memory.

class radioviz.models.data_model.DataStorage(path: Path | None)[source]

Bases: object

Data storage configuration.

Represents the storage configuration for data, including the path where data is stored. This class is mutable to allow updates to storage paths during runtime.

path: Path | None
Parameters:

path (Path | None) – Path to the data storage location, or None if not specified

class radioviz.models.data_model.SpatialDerivation(parent_id: UUID, roi: ROI, transform: Transform | None = None)[source]

Bases: object

Immutable spatial derivation representation.

Represents the spatial relationship between a derived data source and its parent, including the region of interest (ROI) and optional transformation applied. This class is immutable (frozen) to ensure data integrity once created.

parent_id: UUID
Parameters:

parent_id (UUID) – Unique identifier of the parent data source

roi: ROI
Parameters:

roi (ROI) – Region of interest defining the spatial extent of the derivation

transform: Transform | None = None
Parameters:

transform (Transform | None) – Optional spatial transformation applied during derivation, defaults to None