mufasa.io.outputs.python_object#
Classes#
Collects Observations or Locations in a list. |
|
Base for all pipeline output nodes. Has no output type. |
Module Contents#
- class mufasa.io.outputs.python_object.LocationOutput#
Bases:
mufasa.io.outputs.base.OutputNodeCollects Observations or Locations in a list.
Results are accessible via the .result property after the pipeline runs.
- property result: list[mufasa.location.Location]#
- Return type:
list[mufasa.location.Location]
- process(loc: 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:
loc (mufasa.location.Location)
- 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
- save() None#
Persist any buffered output to its destination.
No-op by default. Subclasses that buffer results (GeoJsonOutput, GeoTiffOutput, etc.) override this to flush to disk. Called by Graph.run() after all inputs have been processed.
- Return type:
None
- get_config() dict#
Return all constructor arguments as a plain JSON-serializable dict.
Used by
Graph.to_config()to serialise the pipeline. Every key must be a string; every value must be JSON-serializable.- Return type:
dict
- class mufasa.io.outputs.python_object.MapOutput(snapshot_interval_s: float = 5.0)#
Bases:
mufasa.io.outputs.base.OutputNodeBase for all pipeline output nodes. Has no output type.
- Parameters:
snapshot_interval_s (float)
- snapshot_interval_s = 5.0#
- property result: list[mufasa.map.Map]#
- Return type:
list[mufasa.map.Map]
- process() 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)
- 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
- save() None#
Persist any buffered output to its destination.
No-op by default. Subclasses that buffer results (GeoJsonOutput, GeoTiffOutput, etc.) override this to flush to disk. Called by Graph.run() after all inputs have been processed.
- Return type:
None
- get_config() dict#
Return all constructor arguments as a plain JSON-serializable dict.
Used by
Graph.to_config()to serialise the pipeline. Every key must be a string; every value must be JSON-serializable.- Return type:
dict