mufasa.nodes.tracking.dbstream#
Streaming spatial clustering node backed by DBSTREAM (river).
Classes#
Module Contents#
- class mufasa.nodes.tracking.dbstream.DBSTREAMClusterer(timeout_s: float = 1.0, clustering_threshold: float = 50.0, fading_factor: float = 0.01, cleanup_interval: int = 4, intersection_factor: float = 0.3, minimum_weight: float = 1.0)#
Bases:
mufasa.node.Node- Parameters:
timeout_s (float)
clustering_threshold (float)
fading_factor (float)
cleanup_interval (int)
intersection_factor (float)
minimum_weight (float)
- timeout_s = 1.0#
- clustering_threshold = 50.0#
- fading_factor = 0.01#
- cleanup_interval = 4#
- intersection_factor = 0.3#
- minimum_weight = 1.0#
- configure(crs, bbox, resolution) None#
Receive spatial configuration from the Graph at construction time.
Override in nodes that need crs/bbox/resolution to initialise internal state (e.g. POM creates its map here). Default is a no-op.
- Return type:
None
- process(obs: mufasa.location.Location) None#
Process incoming data and forward results to successors.
Override with the signature appropriate for this node’s role:
Observation-consuming nodes receive one observation per call:
def process(self, obs: Observation) -> None: result = ... # compute result for succ in self._successors: succ.process(result) # push to downstream nodes
Map-consuming nodes are called with no arguments and read their input from the predecessor via its
.mapattribute:def process(self) -> None: m = self._predecessors[0].map # read upstream map ... # update self.map in place self._trigger_successors() # notify downstream nodes
Sink nodes collect data without emitting anything further:
def process(self, obs: Observation) -> None: self._collected.append(obs)
- Parameters:
obs (mufasa.location.Location)
- Return type:
None
- flush() None#
Emit any buffered output remaining at end of stream.
Called by the framework after all inputs are exhausted. Override in nodes that accumulate observations or map data across multiple
process()calls before emitting (e.g. scan-window trackers, batch clusterers). The default is a no-op — stateless nodes need not override this.- Return type:
None
- reset() None#
Clear all runtime state, returning the node to its post-init condition.
Called by the framework between pipeline runs so the same node instance can process a fresh dataset without being reconstructed. Override in nodes that hold mutable state (buffers, accumulators, fitted models). The default is a no-op — stateless nodes need not override this.
- Return type:
None
- get_config() dict#
Return all constructor arguments as a plain JSON-serializable dict.
Requires that the dict is JSON-serializable and that the node is reconstructed when passing the dict as kwargs to its constructor like so:
SomeNode(**some_node.get_config())Used by
Graph.to_config()to serialize the pipeline.- Return type:
dict