-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The dream would be to somehow merge SweepFeature and SweepSetFeature. This would enable the following:
- Features could have the same name, i.e.
Num_APcould exist on the sweep and sweepset level. Depending on if the input is a sweep or sweepset Num_AP either gets computed for only one sweep or the compute method gets broadcasted across the entire sweepset, i.e. applied to every sweep. - only one feature class would need to be defined for every feature containing
_compute,_selectand_aggregatemethods. - Then calling
valueon a sweep feature only calls_compute, while calling it on a sweepset also calls_selectand_aggregateafterwards
from abc import ABC, abstractmethod
class Feature(ABC):
def __init__(self, data, **kwargs):
self.data_init(data)
self.feature_init()
# depending on isinstance(data, Sweep) or isinstance(data, SweepSet),
# methods get called on data directly or broadcasted.
@abstractmethod
def _compute(self):
# compute can be defined however and operate on both sweepsets and sweeps
if isinstance(data, Sweep):
# compute feature for sweep
elif isinstance(data, SweepSet)
# could operate on sweepset directly or just broadcast compute function to sweeps
return value
@abstractmethod
def _select(self, fts):
return fts
@abstractmethod
def _aggregate(self, fts):
return valueIssues with this approach that need to be solved:
- features are currently stored as objects in
sweep.featuresand they + their methods/attrs can be accessed easily. If only one feature object is instantiated for all sweeps of a set this needs to be handled differently (only storing values / diagnostics potentially) - broadcasting is not trivial, since not all functions can be equally applied across all sweeps individually, i.e.
_selector_data_init. - initialising
selffor every sweep does not work. - Should a sweep be handled as a sweepset with only one index? I think this is not ideal.
Ideas and drafts for this proposal are welcome. This is work in progress.
Feasability is questionable at this point.
Metadata
Metadata
Assignees
Labels
No labels