idmtools.entities.ianalyzer module¶
-
class
idmtools.entities.ianalyzer.
IAnalyzer
(uid=None, working_dir: Optional[str] = None, parse: bool = True, filenames: Optional[List[str]] = None)¶ Bases:
object
- An abstract base class carrying the lowest level analyzer interfaces called by
ExperimentManager
.
-
initialize
() → NoReturn¶ Call once after the analyzer has been added to the
AnalyzeManager
.Add everything depending on the working directory or unique ID here instead of in __init__.
-
per_group
(items: List[idmtools.core.interfaces.iitem.IItem]) → NoReturn¶ Call once before running the apply on the items.
- Parameters
items – Objects with attributes of type
ItemId
. IDs of one or more higher-level hierarchical objects can be obtained from these IDs in order to perform tasks with them.- Returns
None
-
filter
(item: Union[idmtools.entities.iworkflow_item.IWorkflowItem, idmtools.entities.simulation.Simulation]) → bool¶ Decide whether the analyzer should process a simulation.
- Parameters
item – An
IItem
to be considered for processing with this analyzer.- Returns
A Boolean indicating whether simulation should be analyzed by this analyzer.
-
abstract
map
(data: Dict[str, Any], item: Union[idmtools.entities.iworkflow_item.IWorkflowItem, idmtools.entities.simulation.Simulation]) → Any¶ In parallel for each simulation, consume raw data from filenames and emit selected data.
- Parameters
data – A dictionary associating filename with content for simulation data.
item –
IItem
object that the passed data is associated with.
- Returns
Selected data for the given item.
-
abstract
reduce
(all_data: Dict[Union[idmtools.entities.iworkflow_item.IWorkflowItem, idmtools.entities.simulation.Simulation], Any]) → Any¶ Combine the
map()
data for a set of items into an aggregate result.- Parameters
all_data – A dictionary with entries for the item ID and selected data.
-
destroy
() → NoReturn¶ Call after the analysis is done.
-
class
idmtools.entities.ianalyzer.
BaseAnalyzer
(uid=None, working_dir: Optional[str] = None, parse: bool = True, filenames: Optional[List[str]] = None)¶