base_analyzer_set#

class arte.dataelab.base_analyzer_set.BaseAnalyzerSet(from_or_list, to=None, recalc=False, *, file_walker, analyzer_type)#

Bases: object

Collection of Analyzer objects for batch analysis.

AnalyzerSet manages multiple Analyzer instances across a range of tags, enabling batch analysis and comparison of datasets. It provides:

  • Lazy instantiation of analyzers (created only when accessed)

  • Iteration over all analyzers in the set

  • Array-like access by tag or index

  • Automatic attribute forwarding to all analyzers

Parameters:
  • from_or_list (str or list) – Either a single tag, a list of tags, or a start tag

  • to (str, optional) – End tag when using a date range. If None, from_or_list must be a list of tags

  • recalc (bool, optional) – If True, force recalculation of cached data for all analyzers (default: False)

  • file_walker (AbstractFileNameWalker instance) – File walker to find tags and their data (required keyword argument)

  • analyzer_type (BaseAnalyzer class) – Analyzer class to instantiate (not an instance). Must implement a get() classmethod (required keyword argument)

tag_list#

Sorted list of tags in this set

Type:

list of str

Examples

>>> # Create analyzer set from tag range
>>> aset = MyAnalyzerSet(
...     '20240101_000000', '20240101_235959',
...     file_walker=my_walker,
...     analyzer_type=MyAnalyzer
... )
>>> # Remove invalid tags
>>> aset.remove_invalids()
>>> # Iterate over analyzers
>>> for analyzer in aset:
...     print(analyzer.residual_modes.time_std())
>>> # Access by tag
>>> analyzer = aset['20240101_120000']
>>> # Attribute forwarding (returns list of results)
>>> all_std = aset.residual_modes.time_std()

Notes

Attribute access on AnalyzerSet returns an _AnalyzerStub that forwards the same attribute/method call to all analyzers and returns the results as a list.

Methods

get(tag[, recalc])

Returns the Analyzer instance for this tag

remove_invalids()

Remove tags that evaluate to NotAvailable when created

set_analyzer_args(*args, **kwargs)

Set the additional arguments to pass to Analyzers' contructors

wiki()

Print wiki info on stdout

append

generate_tags

insert

remove

append(tag)#
generate_tags()#
get(tag, recalc=False)#

Returns the Analyzer instance for this tag

insert(idx, tag)#
remove(tag)#
remove_invalids()#

Remove tags that evaluate to NotAvailable when created

set_analyzer_args(*args, **kwargs)#

Set the additional arguments to pass to Analyzers’ contructors

wiki()#

Print wiki info on stdout