idmtools 0.0.0.dev0__py3-none-any.whl → 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- idmtools/__init__.py +27 -8
- idmtools/analysis/__init__.py +5 -0
- idmtools/analysis/add_analyzer.py +89 -0
- idmtools/analysis/analyze_manager.py +490 -0
- idmtools/analysis/csv_analyzer.py +103 -0
- idmtools/analysis/download_analyzer.py +96 -0
- idmtools/analysis/map_worker_entry.py +100 -0
- idmtools/analysis/platform_analysis_bootstrap.py +94 -0
- idmtools/analysis/platform_anaylsis.py +291 -0
- idmtools/analysis/tags_analyzer.py +93 -0
- idmtools/assets/__init__.py +9 -0
- idmtools/assets/asset.py +453 -0
- idmtools/assets/asset_collection.py +514 -0
- idmtools/assets/content_handlers.py +19 -0
- idmtools/assets/errors.py +23 -0
- idmtools/assets/file_list.py +191 -0
- idmtools/builders/__init__.py +11 -0
- idmtools/builders/arm_simulation_builder.py +152 -0
- idmtools/builders/csv_simulation_builder.py +76 -0
- idmtools/builders/simulation_builder.py +348 -0
- idmtools/builders/sweep_arm.py +109 -0
- idmtools/builders/yaml_simulation_builder.py +82 -0
- idmtools/config/__init__.py +7 -0
- idmtools/config/idm_config_parser.py +486 -0
- idmtools/core/__init__.py +10 -0
- idmtools/core/cache_enabled.py +114 -0
- idmtools/core/context.py +68 -0
- idmtools/core/docker_task.py +207 -0
- idmtools/core/enums.py +51 -0
- idmtools/core/exceptions.py +91 -0
- idmtools/core/experiment_factory.py +71 -0
- idmtools/core/id_file.py +70 -0
- idmtools/core/interfaces/__init__.py +5 -0
- idmtools/core/interfaces/entity_container.py +64 -0
- idmtools/core/interfaces/iassets_enabled.py +58 -0
- idmtools/core/interfaces/ientity.py +331 -0
- idmtools/core/interfaces/iitem.py +206 -0
- idmtools/core/interfaces/imetadata_operations.py +89 -0
- idmtools/core/interfaces/inamed_entity.py +17 -0
- idmtools/core/interfaces/irunnable_entity.py +159 -0
- idmtools/core/logging.py +387 -0
- idmtools/core/platform_factory.py +316 -0
- idmtools/core/system_information.py +104 -0
- idmtools/core/task_factory.py +145 -0
- idmtools/entities/__init__.py +10 -0
- idmtools/entities/command_line.py +229 -0
- idmtools/entities/command_task.py +155 -0
- idmtools/entities/experiment.py +787 -0
- idmtools/entities/generic_workitem.py +43 -0
- idmtools/entities/ianalyzer.py +163 -0
- idmtools/entities/iplatform.py +1106 -0
- idmtools/entities/iplatform_default.py +39 -0
- idmtools/entities/iplatform_ops/__init__.py +5 -0
- idmtools/entities/iplatform_ops/iplatform_asset_collection_operations.py +148 -0
- idmtools/entities/iplatform_ops/iplatform_experiment_operations.py +415 -0
- idmtools/entities/iplatform_ops/iplatform_simulation_operations.py +315 -0
- idmtools/entities/iplatform_ops/iplatform_suite_operations.py +322 -0
- idmtools/entities/iplatform_ops/iplatform_workflowitem_operations.py +301 -0
- idmtools/entities/iplatform_ops/utils.py +185 -0
- idmtools/entities/itask.py +316 -0
- idmtools/entities/iworkflow_item.py +167 -0
- idmtools/entities/platform_requirements.py +20 -0
- idmtools/entities/relation_type.py +14 -0
- idmtools/entities/simulation.py +255 -0
- idmtools/entities/suite.py +188 -0
- idmtools/entities/task_proxy.py +37 -0
- idmtools/entities/templated_simulation.py +325 -0
- idmtools/frozen/frozen_dict.py +71 -0
- idmtools/frozen/frozen_list.py +66 -0
- idmtools/frozen/frozen_set.py +86 -0
- idmtools/frozen/frozen_tuple.py +18 -0
- idmtools/frozen/frozen_utils.py +179 -0
- idmtools/frozen/ifrozen.py +66 -0
- idmtools/plugins/__init__.py +5 -0
- idmtools/plugins/git_commit.py +117 -0
- idmtools/registry/__init__.py +4 -0
- idmtools/registry/experiment_specification.py +105 -0
- idmtools/registry/functions.py +28 -0
- idmtools/registry/hook_specs.py +132 -0
- idmtools/registry/master_plugin_registry.py +51 -0
- idmtools/registry/platform_specification.py +138 -0
- idmtools/registry/plugin_specification.py +129 -0
- idmtools/registry/task_specification.py +104 -0
- idmtools/registry/utils.py +119 -0
- idmtools/services/__init__.py +5 -0
- idmtools/services/ipersistance_service.py +135 -0
- idmtools/services/platforms.py +13 -0
- idmtools/utils/__init__.py +5 -0
- idmtools/utils/caller.py +24 -0
- idmtools/utils/collections.py +246 -0
- idmtools/utils/command_line.py +45 -0
- idmtools/utils/decorators.py +300 -0
- idmtools/utils/display/__init__.py +22 -0
- idmtools/utils/display/displays.py +181 -0
- idmtools/utils/display/settings.py +25 -0
- idmtools/utils/dropbox_location.py +30 -0
- idmtools/utils/entities.py +127 -0
- idmtools/utils/file.py +72 -0
- idmtools/utils/file_parser.py +151 -0
- idmtools/utils/filter_simulations.py +182 -0
- idmtools/utils/filters/__init__.py +5 -0
- idmtools/utils/filters/asset_filters.py +88 -0
- idmtools/utils/general.py +286 -0
- idmtools/utils/gitrepo.py +336 -0
- idmtools/utils/hashing.py +239 -0
- idmtools/utils/info.py +124 -0
- idmtools/utils/json.py +82 -0
- idmtools/utils/language.py +107 -0
- idmtools/utils/local_os.py +40 -0
- idmtools/utils/time.py +22 -0
- idmtools-0.0.3.dist-info/METADATA +120 -0
- idmtools-0.0.3.dist-info/RECORD +116 -0
- idmtools-0.0.3.dist-info/entry_points.txt +9 -0
- idmtools-0.0.3.dist-info/licenses/LICENSE.TXT +3 -0
- idmtools-0.0.0.dev0.dist-info/METADATA +0 -41
- idmtools-0.0.0.dev0.dist-info/RECORD +0 -5
- {idmtools-0.0.0.dev0.dist-info → idmtools-0.0.3.dist-info}/WHEEL +0 -0
- {idmtools-0.0.0.dev0.dist-info → idmtools-0.0.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The GenericWorkitem when fetches workitems from a server.
|
|
3
|
+
|
|
4
|
+
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
|
|
5
|
+
"""
|
|
6
|
+
from dataclasses import dataclass, InitVar
|
|
7
|
+
from idmtools.assets.file_list import FileList
|
|
8
|
+
from idmtools.entities.command_task import CommandTask
|
|
9
|
+
from idmtools.entities.iworkflow_item import IWorkflowItem
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class GenericWorkItem(IWorkflowItem):
|
|
14
|
+
"""
|
|
15
|
+
Idm GenericWorkItem.
|
|
16
|
+
"""
|
|
17
|
+
command: InitVar[str] = None
|
|
18
|
+
|
|
19
|
+
def __post_init__(self, item_name: str, asset_collection_id: str, asset_files: FileList, user_files: FileList, command: str):
|
|
20
|
+
"""
|
|
21
|
+
Initialize item.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
item_name: Item name to set
|
|
25
|
+
asset_collection_id: Asset Collection ID to use on WorkItem
|
|
26
|
+
asset_files: AssetFiles as file
|
|
27
|
+
user_files: UserFiles to add to WorkItem
|
|
28
|
+
command: Command to run
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
None
|
|
32
|
+
"""
|
|
33
|
+
self.task = CommandTask(command="See workorder.json")
|
|
34
|
+
super().__post_init__(item_name, asset_collection_id, asset_files, user_files)
|
|
35
|
+
|
|
36
|
+
def __hash__(self):
|
|
37
|
+
"""
|
|
38
|
+
Hash item.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Hash id
|
|
42
|
+
"""
|
|
43
|
+
return hash(self.id)
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Defines our IAnalyzer interface used as base of all other analyzers.
|
|
3
|
+
|
|
4
|
+
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
|
|
5
|
+
"""
|
|
6
|
+
from abc import ABCMeta, abstractmethod
|
|
7
|
+
from logging import getLogger
|
|
8
|
+
from typing import Any, NoReturn, List, TypeVar, Dict, Optional, Union, TYPE_CHECKING
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from idmtools.core.interfaces.iitem import IItemList
|
|
12
|
+
from idmtools.entities.iworkflow_item import IWorkflowItem
|
|
13
|
+
from idmtools.entities.simulation import Simulation
|
|
14
|
+
|
|
15
|
+
logger = getLogger(__name__)
|
|
16
|
+
# Items that we support analysis on
|
|
17
|
+
ANALYZABLE_ITEM = Union['IWorkflowItem', 'Simulation']
|
|
18
|
+
# The item type we pass to analysis
|
|
19
|
+
ANALYSIS_ITEM_MAP_DATA_TYPE = Dict[str, Any]
|
|
20
|
+
# The datatype if the reduce input
|
|
21
|
+
ANALYSIS_REDUCE_DATA_TYPE = Dict[ANALYZABLE_ITEM, Any]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class IAnalyzer(metaclass=ABCMeta):
|
|
25
|
+
"""
|
|
26
|
+
An abstract base class carrying the lowest level analyzer interfaces called by :class:`~idmtools.managers.experiment_manager.ExperimentManager`.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def __init__(self, uid=None, working_dir: Optional[str] = None, parse: bool = True, filenames: Optional[List[str]] = None):
|
|
31
|
+
"""
|
|
32
|
+
A constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
uid: The unique id identifying this analyzer.
|
|
36
|
+
working_dir: A working directory to place files.
|
|
37
|
+
parse: True to leverage the :class:`OutputParser`; False to get the raw
|
|
38
|
+
data in the :meth:`select_simulation_data`.
|
|
39
|
+
filenames: The files for the analyzer to download.
|
|
40
|
+
"""
|
|
41
|
+
self.parse = parse
|
|
42
|
+
self.working_dir = working_dir
|
|
43
|
+
self.uid = uid or self.__class__.__name__
|
|
44
|
+
self.results = None # Store what finalize() is returning
|
|
45
|
+
self._filenames = filenames or list()
|
|
46
|
+
self._filenames = [f.replace("\\", '/') for f in self._filenames]
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def filenames(self):
|
|
50
|
+
"""
|
|
51
|
+
Returns user filenames.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
filenames
|
|
55
|
+
|
|
56
|
+
"""
|
|
57
|
+
return self._filenames
|
|
58
|
+
|
|
59
|
+
@filenames.setter
|
|
60
|
+
def filenames(self, value):
|
|
61
|
+
"""
|
|
62
|
+
Set the filenames property.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
value: new filenames
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
None
|
|
69
|
+
|
|
70
|
+
"""
|
|
71
|
+
self._filenames = value or list()
|
|
72
|
+
self._filenames = [f.replace("\\", '/') for f in self._filenames]
|
|
73
|
+
|
|
74
|
+
def initialize(self) -> NoReturn:
|
|
75
|
+
"""
|
|
76
|
+
Call once after the analyzer has been added to the :class:`~idmtools.analysis.AnalyzeManager`.
|
|
77
|
+
|
|
78
|
+
Add everything depending on the working directory or unique ID here instead of in __init__.
|
|
79
|
+
"""
|
|
80
|
+
pass
|
|
81
|
+
|
|
82
|
+
def per_group(self, items: 'IItemList') -> NoReturn:
|
|
83
|
+
"""
|
|
84
|
+
Call once before running the apply on the items.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
items: Objects with attributes of type :class:`~idmtools.core.item_id.ItemId`. IDs of one or
|
|
88
|
+
more higher-level hierarchical objects can be obtained from these IDs in order to perform
|
|
89
|
+
tasks with them.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
None
|
|
93
|
+
"""
|
|
94
|
+
pass
|
|
95
|
+
|
|
96
|
+
def filter(self, item: ANALYZABLE_ITEM) -> bool:
|
|
97
|
+
"""
|
|
98
|
+
Decide whether the analyzer should process a simulation/work item.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
item: An :class:`~idmtools.entities.iitem.IItem` to be considered for processing with this analyzer.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
A Boolean indicating whether simulation/work item should be analyzed by this analyzer.
|
|
105
|
+
"""
|
|
106
|
+
return True
|
|
107
|
+
|
|
108
|
+
@abstractmethod
|
|
109
|
+
def map(self, data: ANALYSIS_ITEM_MAP_DATA_TYPE, item: ANALYZABLE_ITEM) -> Any:
|
|
110
|
+
"""
|
|
111
|
+
In parallel for each simulation/work item, consume raw data from filenames and emit selected data.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
data: A dictionary associating filename with content for simulation data.
|
|
115
|
+
item: :class:`~idmtools.entities.iitem.IItem` object that the passed data is associated with.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
Selected data for the given simulation/work item.
|
|
119
|
+
"""
|
|
120
|
+
return None
|
|
121
|
+
|
|
122
|
+
@abstractmethod
|
|
123
|
+
def reduce(self, all_data: ANALYSIS_REDUCE_DATA_TYPE) -> Any:
|
|
124
|
+
"""
|
|
125
|
+
Combine the :meth:`map` data for a set of items into an aggregate result.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
all_data: A dictionary with entries for the item ID and selected data.
|
|
129
|
+
"""
|
|
130
|
+
pass
|
|
131
|
+
|
|
132
|
+
def destroy(self) -> NoReturn:
|
|
133
|
+
"""
|
|
134
|
+
Call after the analysis is done.
|
|
135
|
+
"""
|
|
136
|
+
pass
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
# Alias IAnalyzer for computability with old code but print a deprecation warning
|
|
140
|
+
|
|
141
|
+
class BaseAnalyzer(IAnalyzer, metaclass=ABCMeta):
|
|
142
|
+
"""
|
|
143
|
+
BaseAnalyzer to allow using previously used dtk-tools analyzers within idmtools.
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
def __init__(self, uid=None, working_dir: Optional[str] = None, parse: bool = True, filenames: Optional[List[str]] = None):
|
|
147
|
+
"""
|
|
148
|
+
Constructor for Base Analyzer.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
uid: The unique id identifying this analyzer.
|
|
152
|
+
working_dir: A working directory to place files.
|
|
153
|
+
parse: True to leverage the :class:`OutputParser`; False to get the raw
|
|
154
|
+
data in the :meth:`select_simulation_data`.
|
|
155
|
+
filenames: The files for the analyzer to download.
|
|
156
|
+
"""
|
|
157
|
+
logger.warning('Base analyzer name will soon be deprecated in favor of IAnalyzer')
|
|
158
|
+
# TODO: Make transition documentation so we can deprecat this
|
|
159
|
+
super().__init__(uid, working_dir, parse, filenames)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
TAnalyzer = TypeVar("TAnalyzer", bound=IAnalyzer)
|
|
163
|
+
TAnalyzerList = List[TAnalyzer]
|