idmtools 0.0.0.dev0__tar.gz → 0.0.2__tar.gz
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-0.0.2/.bumpversion.cfg +28 -0
- idmtools-0.0.2/LICENSE.TXT +3 -0
- idmtools-0.0.2/MANIFEST.in +3 -0
- idmtools-0.0.2/Makefile +8 -0
- idmtools-0.0.2/PKG-INFO +120 -0
- idmtools-0.0.2/README.md +47 -0
- idmtools-0.0.2/idmtools/__init__.py +27 -0
- idmtools-0.0.2/idmtools/analysis/__init__.py +5 -0
- idmtools-0.0.2/idmtools/analysis/add_analyzer.py +89 -0
- idmtools-0.0.2/idmtools/analysis/analyze_manager.py +490 -0
- idmtools-0.0.2/idmtools/analysis/csv_analyzer.py +103 -0
- idmtools-0.0.2/idmtools/analysis/download_analyzer.py +96 -0
- idmtools-0.0.2/idmtools/analysis/map_worker_entry.py +100 -0
- idmtools-0.0.2/idmtools/analysis/platform_analysis_bootstrap.py +94 -0
- idmtools-0.0.2/idmtools/analysis/platform_anaylsis.py +291 -0
- idmtools-0.0.2/idmtools/analysis/tags_analyzer.py +93 -0
- idmtools-0.0.2/idmtools/assets/__init__.py +9 -0
- idmtools-0.0.2/idmtools/assets/asset.py +453 -0
- idmtools-0.0.2/idmtools/assets/asset_collection.py +514 -0
- idmtools-0.0.2/idmtools/assets/content_handlers.py +19 -0
- idmtools-0.0.2/idmtools/assets/errors.py +23 -0
- idmtools-0.0.2/idmtools/assets/file_list.py +191 -0
- idmtools-0.0.2/idmtools/builders/__init__.py +11 -0
- idmtools-0.0.2/idmtools/builders/arm_simulation_builder.py +152 -0
- idmtools-0.0.2/idmtools/builders/csv_simulation_builder.py +76 -0
- idmtools-0.0.2/idmtools/builders/simulation_builder.py +348 -0
- idmtools-0.0.2/idmtools/builders/sweep_arm.py +109 -0
- idmtools-0.0.2/idmtools/builders/yaml_simulation_builder.py +82 -0
- idmtools-0.0.2/idmtools/config/__init__.py +7 -0
- idmtools-0.0.2/idmtools/config/idm_config_parser.py +486 -0
- idmtools-0.0.2/idmtools/core/__init__.py +10 -0
- idmtools-0.0.2/idmtools/core/cache_enabled.py +114 -0
- idmtools-0.0.2/idmtools/core/context.py +68 -0
- idmtools-0.0.2/idmtools/core/docker_task.py +207 -0
- idmtools-0.0.2/idmtools/core/enums.py +51 -0
- idmtools-0.0.2/idmtools/core/exceptions.py +91 -0
- idmtools-0.0.2/idmtools/core/experiment_factory.py +71 -0
- idmtools-0.0.2/idmtools/core/id_file.py +70 -0
- idmtools-0.0.2/idmtools/core/interfaces/__init__.py +5 -0
- idmtools-0.0.2/idmtools/core/interfaces/entity_container.py +64 -0
- idmtools-0.0.2/idmtools/core/interfaces/iassets_enabled.py +58 -0
- idmtools-0.0.2/idmtools/core/interfaces/ientity.py +331 -0
- idmtools-0.0.2/idmtools/core/interfaces/iitem.py +206 -0
- idmtools-0.0.2/idmtools/core/interfaces/imetadata_operations.py +89 -0
- idmtools-0.0.2/idmtools/core/interfaces/inamed_entity.py +17 -0
- idmtools-0.0.2/idmtools/core/interfaces/irunnable_entity.py +159 -0
- idmtools-0.0.2/idmtools/core/logging.py +387 -0
- idmtools-0.0.2/idmtools/core/platform_factory.py +316 -0
- idmtools-0.0.2/idmtools/core/system_information.py +104 -0
- idmtools-0.0.2/idmtools/core/task_factory.py +145 -0
- idmtools-0.0.2/idmtools/entities/__init__.py +10 -0
- idmtools-0.0.2/idmtools/entities/command_line.py +229 -0
- idmtools-0.0.2/idmtools/entities/command_task.py +155 -0
- idmtools-0.0.2/idmtools/entities/experiment.py +787 -0
- idmtools-0.0.2/idmtools/entities/generic_workitem.py +43 -0
- idmtools-0.0.2/idmtools/entities/ianalyzer.py +163 -0
- idmtools-0.0.2/idmtools/entities/iplatform.py +1106 -0
- idmtools-0.0.2/idmtools/entities/iplatform_default.py +39 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/__init__.py +5 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/iplatform_asset_collection_operations.py +148 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/iplatform_experiment_operations.py +415 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/iplatform_simulation_operations.py +315 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/iplatform_suite_operations.py +322 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/iplatform_workflowitem_operations.py +301 -0
- idmtools-0.0.2/idmtools/entities/iplatform_ops/utils.py +185 -0
- idmtools-0.0.2/idmtools/entities/itask.py +316 -0
- idmtools-0.0.2/idmtools/entities/iworkflow_item.py +167 -0
- idmtools-0.0.2/idmtools/entities/platform_requirements.py +20 -0
- idmtools-0.0.2/idmtools/entities/relation_type.py +14 -0
- idmtools-0.0.2/idmtools/entities/simulation.py +255 -0
- idmtools-0.0.2/idmtools/entities/suite.py +188 -0
- idmtools-0.0.2/idmtools/entities/task_proxy.py +37 -0
- idmtools-0.0.2/idmtools/entities/templated_simulation.py +325 -0
- idmtools-0.0.2/idmtools/frozen/frozen_dict.py +71 -0
- idmtools-0.0.2/idmtools/frozen/frozen_list.py +66 -0
- idmtools-0.0.2/idmtools/frozen/frozen_set.py +86 -0
- idmtools-0.0.2/idmtools/frozen/frozen_tuple.py +18 -0
- idmtools-0.0.2/idmtools/frozen/frozen_utils.py +179 -0
- idmtools-0.0.2/idmtools/frozen/ifrozen.py +66 -0
- idmtools-0.0.2/idmtools/plugins/__init__.py +5 -0
- idmtools-0.0.2/idmtools/plugins/git_commit.py +117 -0
- idmtools-0.0.2/idmtools/registry/__init__.py +4 -0
- idmtools-0.0.2/idmtools/registry/experiment_specification.py +105 -0
- idmtools-0.0.2/idmtools/registry/functions.py +28 -0
- idmtools-0.0.2/idmtools/registry/hook_specs.py +132 -0
- idmtools-0.0.2/idmtools/registry/master_plugin_registry.py +51 -0
- idmtools-0.0.2/idmtools/registry/platform_specification.py +138 -0
- idmtools-0.0.2/idmtools/registry/plugin_specification.py +129 -0
- idmtools-0.0.2/idmtools/registry/task_specification.py +104 -0
- idmtools-0.0.2/idmtools/registry/utils.py +119 -0
- idmtools-0.0.2/idmtools/services/__init__.py +5 -0
- idmtools-0.0.2/idmtools/services/ipersistance_service.py +135 -0
- idmtools-0.0.2/idmtools/services/platforms.py +13 -0
- idmtools-0.0.2/idmtools/utils/__init__.py +5 -0
- idmtools-0.0.2/idmtools/utils/caller.py +24 -0
- idmtools-0.0.2/idmtools/utils/collections.py +246 -0
- idmtools-0.0.2/idmtools/utils/command_line.py +45 -0
- idmtools-0.0.2/idmtools/utils/decorators.py +300 -0
- idmtools-0.0.2/idmtools/utils/display/__init__.py +22 -0
- idmtools-0.0.2/idmtools/utils/display/displays.py +181 -0
- idmtools-0.0.2/idmtools/utils/display/settings.py +25 -0
- idmtools-0.0.2/idmtools/utils/dropbox_location.py +30 -0
- idmtools-0.0.2/idmtools/utils/entities.py +127 -0
- idmtools-0.0.2/idmtools/utils/file.py +72 -0
- idmtools-0.0.2/idmtools/utils/file_parser.py +151 -0
- idmtools-0.0.2/idmtools/utils/filter_simulations.py +182 -0
- idmtools-0.0.2/idmtools/utils/filters/__init__.py +5 -0
- idmtools-0.0.2/idmtools/utils/filters/asset_filters.py +88 -0
- idmtools-0.0.2/idmtools/utils/general.py +286 -0
- idmtools-0.0.2/idmtools/utils/gitrepo.py +336 -0
- idmtools-0.0.2/idmtools/utils/hashing.py +239 -0
- idmtools-0.0.2/idmtools/utils/info.py +124 -0
- idmtools-0.0.2/idmtools/utils/json.py +82 -0
- idmtools-0.0.2/idmtools/utils/language.py +107 -0
- idmtools-0.0.2/idmtools/utils/local_os.py +40 -0
- idmtools-0.0.2/idmtools/utils/time.py +22 -0
- idmtools-0.0.2/idmtools.egg-info/PKG-INFO +120 -0
- idmtools-0.0.2/idmtools.egg-info/SOURCES.txt +123 -0
- idmtools-0.0.2/idmtools.egg-info/entry_points.txt +9 -0
- idmtools-0.0.2/idmtools.egg-info/requires.txt +60 -0
- idmtools-0.0.2/pyproject.toml +136 -0
- idmtools-0.0.2/requirements-idmtools_idmtools_core-test.txt +15 -0
- {idmtools-0.0.0.dev0 → idmtools-0.0.2}/setup.cfg +4 -4
- idmtools-0.0.0.dev0/PKG-INFO +0 -41
- idmtools-0.0.0.dev0/README.md +0 -21
- idmtools-0.0.0.dev0/idmtools/__init__.py +0 -8
- idmtools-0.0.0.dev0/idmtools.egg-info/PKG-INFO +0 -41
- idmtools-0.0.0.dev0/idmtools.egg-info/SOURCES.txt +0 -7
- idmtools-0.0.0.dev0/pyproject.toml +0 -32
- {idmtools-0.0.0.dev0 → idmtools-0.0.2}/idmtools.egg-info/dependency_links.txt +0 -0
- {idmtools-0.0.0.dev0 → idmtools-0.0.2}/idmtools.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[bumpversion]
|
|
2
|
+
current_version = 3.0.0+nightly
|
|
3
|
+
commit = False
|
|
4
|
+
tag = False
|
|
5
|
+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<release>\+\w+)?(\.(?P<build>\d+))?
|
|
6
|
+
serialize =
|
|
7
|
+
{major}.{minor}.{patch}{release}.{build}
|
|
8
|
+
{major}.{minor}.{patch}{release}
|
|
9
|
+
{major}.{minor}.{patch}
|
|
10
|
+
|
|
11
|
+
[bumpversion:part:release]
|
|
12
|
+
optional_value = prod
|
|
13
|
+
first_value = prod
|
|
14
|
+
values =
|
|
15
|
+
prod
|
|
16
|
+
+nightly
|
|
17
|
+
|
|
18
|
+
[bumpversion:file:./idmtools/__init__.py]
|
|
19
|
+
search = __version__ = "{current_version}"
|
|
20
|
+
replace = __version__ = "{new_version}"
|
|
21
|
+
serialize = {major}.{minor}.{patch}{release}
|
|
22
|
+
{major}.{minor}.{patch}
|
|
23
|
+
|
|
24
|
+
[bumpversion:file:./pyproject.toml]
|
|
25
|
+
search = version = "{current_version}"
|
|
26
|
+
replace = version = "{new_version}"
|
|
27
|
+
serialize = {major}.{minor}.{patch}{release}
|
|
28
|
+
{major}.{minor}.{patch}
|
idmtools-0.0.2/Makefile
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
PACKAGE_NAME=idmtools_core
|
|
2
|
+
include $(abspath ../dev_scripts/package_general.mk)
|
|
3
|
+
|
|
4
|
+
help:
|
|
5
|
+
help-from-makefile -f ../dev_scripts/package_general.mk -f ./Makefile
|
|
6
|
+
|
|
7
|
+
update-dependent-libraries: ## update any libraries in repo that depend on core
|
|
8
|
+
$(PDS)update_core_version.py
|
idmtools-0.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: idmtools
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Core tools for modeling
|
|
5
|
+
Author-email: Zhaowei Du <zdu@idmod.org>, Sharon Chen <shchen@idmod.org>, Clinton Collins <ccollins@idmod.org>, Benoit Raybaud <braybaud@idmod.org>, Clark Kirkman IV <ckirkman@idmod.org>, Emily Claps <emily.claps@gatesfoundation.org>, Jen Schripsema <jschripsema@idmod.org>, Ross Carter <rcarter@idmod.org>, Mandy Izzo <mizzo@idmod.org>, Mary Fisher <mafisher@idmod.org>, Lauren George <lgeorge@idmod.org>
|
|
6
|
+
License: Proprietary or specify if known
|
|
7
|
+
Project-URL: Homepage, https://github.com/InstituteforDiseaseModeling/idmtools
|
|
8
|
+
Project-URL: Documentation, https://idmtools.readthedocs.io
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/InstituteforDiseaseModeling/idmtools/issues
|
|
10
|
+
Keywords: modeling,IDM,IDMTools
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE.TXT
|
|
19
|
+
Requires-Dist: backoff<2.3,>=1.10.0
|
|
20
|
+
Requires-Dist: coloredlogs~=15.0
|
|
21
|
+
Requires-Dist: diskcache~=5.4.0
|
|
22
|
+
Requires-Dist: filelock
|
|
23
|
+
Requires-Dist: more-itertools~=10.3.0
|
|
24
|
+
Requires-Dist: numpy!=1.19.4
|
|
25
|
+
Requires-Dist: pandas>=1.1.4
|
|
26
|
+
Requires-Dist: pluggy~=1.5
|
|
27
|
+
Requires-Dist: PyYAML<6.1,>=5.3.0
|
|
28
|
+
Requires-Dist: tabulate<0.10,>=0.8.9
|
|
29
|
+
Requires-Dist: tqdm<5,>=4.52.0
|
|
30
|
+
Requires-Dist: jinja2~=3.1.3
|
|
31
|
+
Requires-Dist: packaging<25.0,>=20.4
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: allure-pytest<2.16,>=2.8.34; extra == "test"
|
|
34
|
+
Requires-Dist: junitparser>=4.0.2; extra == "test"
|
|
35
|
+
Requires-Dist: livereload~=2.6.3; extra == "test"
|
|
36
|
+
Requires-Dist: pytest>=7.4.4; extra == "test"
|
|
37
|
+
Requires-Dist: pytest-cache>=1.0; extra == "test"
|
|
38
|
+
Requires-Dist: pytest-cov>=2.11.1; extra == "test"
|
|
39
|
+
Requires-Dist: pytest-html>=3.1.1; extra == "test"
|
|
40
|
+
Requires-Dist: py>=1.11.0; extra == "test"
|
|
41
|
+
Requires-Dist: pytest-mock; extra == "test"
|
|
42
|
+
Requires-Dist: pytest-timeout~=2.4.0; extra == "test"
|
|
43
|
+
Requires-Dist: pytest-xdist~=3.8; extra == "test"
|
|
44
|
+
Requires-Dist: flake8>=7.0; extra == "test"
|
|
45
|
+
Requires-Dist: flake8-docstrings~=1.7; extra == "test"
|
|
46
|
+
Requires-Dist: coverage>=7.13; extra == "test"
|
|
47
|
+
Requires-Dist: twine>=3.4.1; extra == "test"
|
|
48
|
+
Provides-Extra: notebooks
|
|
49
|
+
Requires-Dist: docker>5.0; extra == "notebooks"
|
|
50
|
+
Provides-Extra: packaging
|
|
51
|
+
Provides-Extra: idm
|
|
52
|
+
Requires-Dist: idmtools_platform_comps; extra == "idm"
|
|
53
|
+
Requires-Dist: idmtools_cli; extra == "idm"
|
|
54
|
+
Requires-Dist: idmtools_models; extra == "idm"
|
|
55
|
+
Provides-Extra: full
|
|
56
|
+
Requires-Dist: idmtools_platform_comps; extra == "full"
|
|
57
|
+
Requires-Dist: idmtools_cli; extra == "full"
|
|
58
|
+
Requires-Dist: idmtools_models; extra == "full"
|
|
59
|
+
Requires-Dist: idmtools_platform_general; extra == "full"
|
|
60
|
+
Requires-Dist: idmtools_platform_slurm; extra == "full"
|
|
61
|
+
Requires-Dist: idmtools_platform_container; extra == "full"
|
|
62
|
+
Provides-Extra: container
|
|
63
|
+
Requires-Dist: idmtools_cli; extra == "container"
|
|
64
|
+
Requires-Dist: idmtools_models; extra == "container"
|
|
65
|
+
Requires-Dist: idmtools_platform_general; extra == "container"
|
|
66
|
+
Requires-Dist: idmtools_platform_container; extra == "container"
|
|
67
|
+
Provides-Extra: slurm
|
|
68
|
+
Requires-Dist: idmtools_cli; extra == "slurm"
|
|
69
|
+
Requires-Dist: idmtools_models; extra == "slurm"
|
|
70
|
+
Requires-Dist: idmtools_platform_general; extra == "slurm"
|
|
71
|
+
Requires-Dist: idmtools_platform_slurm; extra == "slurm"
|
|
72
|
+
Dynamic: license-file
|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+
# idmtools-core
|
|
77
|
+
|
|
78
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
79
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
80
|
+
**Table of Contents**
|
|
81
|
+
|
|
82
|
+
- [Overview](#overview)
|
|
83
|
+
- [Installing](#installing)
|
|
84
|
+
- [Development Tips](#development-tips)
|
|
85
|
+
- [Future Work](#future-work)
|
|
86
|
+
|
|
87
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
88
|
+
|
|
89
|
+
# Overview
|
|
90
|
+
|
|
91
|
+
idmtools provides the APIS, logic, and other operations to provision, execute, analysis, and manage jobs running on an HPC cluster
|
|
92
|
+
|
|
93
|
+
To see the full API documentation, see https://institutefordiseasemodeling.github.io/idmtools/idmtools_index.html
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Installing
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install idmtools --index-url=https://packages.idmod.org/api/pypi/pypi-production/simple
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
# Development Tips
|
|
103
|
+
|
|
104
|
+
There is a Makefile file available for most common development tasks. Here is a list of commands
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
clean - Clean up temproary files
|
|
108
|
+
lint - Lint package and tests
|
|
109
|
+
test - Run All tests
|
|
110
|
+
coverage - Run tests and generate coverage report that is shown in browser
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
On Windows, you can use `pymake` instead of `make`
|
|
114
|
+
|
|
115
|
+
# Future Work
|
|
116
|
+
|
|
117
|
+
* Add new analyze api to platform
|
|
118
|
+
* Where does this go?
|
|
119
|
+
* Move current code to Comps
|
|
120
|
+
* Add support for platform specific bootstrap scripts
|
idmtools-0.0.2/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# idmtools-core
|
|
4
|
+
|
|
5
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
6
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
7
|
+
**Table of Contents**
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [Installing](#installing)
|
|
11
|
+
- [Development Tips](#development-tips)
|
|
12
|
+
- [Future Work](#future-work)
|
|
13
|
+
|
|
14
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
15
|
+
|
|
16
|
+
# Overview
|
|
17
|
+
|
|
18
|
+
idmtools provides the APIS, logic, and other operations to provision, execute, analysis, and manage jobs running on an HPC cluster
|
|
19
|
+
|
|
20
|
+
To see the full API documentation, see https://institutefordiseasemodeling.github.io/idmtools/idmtools_index.html
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Installing
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install idmtools --index-url=https://packages.idmod.org/api/pypi/pypi-production/simple
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# Development Tips
|
|
30
|
+
|
|
31
|
+
There is a Makefile file available for most common development tasks. Here is a list of commands
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
clean - Clean up temproary files
|
|
35
|
+
lint - Lint package and tests
|
|
36
|
+
test - Run All tests
|
|
37
|
+
coverage - Run tests and generate coverage report that is shown in browser
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
On Windows, you can use `pymake` instead of `make`
|
|
41
|
+
|
|
42
|
+
# Future Work
|
|
43
|
+
|
|
44
|
+
* Add new analyze api to platform
|
|
45
|
+
* Where does this go?
|
|
46
|
+
* Move current code to Comps
|
|
47
|
+
* Add support for platform specific bootstrap scripts
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""idmtools core package.
|
|
2
|
+
|
|
3
|
+
This init installs a system exception hook for idmtools.
|
|
4
|
+
It also ensures the configuration is loaded.
|
|
5
|
+
|
|
6
|
+
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from idmtools.core.exceptions import idmtools_error_handler
|
|
10
|
+
from idmtools.config.idm_config_parser import IdmConfigParser # noqa: F401
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
14
|
+
except ImportError:
|
|
15
|
+
# Python < 3.8
|
|
16
|
+
from importlib_metadata import version, PackageNotFoundError
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
__version__ = version("idmtools") # Use your actual package name
|
|
20
|
+
except PackageNotFoundError:
|
|
21
|
+
# Package not installed, use fallback
|
|
22
|
+
__version__ = "0.0.0+unknown"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# only set exception hook if it has not been overridden
|
|
26
|
+
if sys.excepthook == sys.__excepthook__:
|
|
27
|
+
sys.excepthook = idmtools_error_handler
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""idmtools add analyzer.
|
|
2
|
+
|
|
3
|
+
More of an example.
|
|
4
|
+
|
|
5
|
+
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
|
|
6
|
+
"""
|
|
7
|
+
import os
|
|
8
|
+
from idmtools.entities.ianalyzer import IAnalyzer, ANALYZABLE_ITEM
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AddAnalyzer(IAnalyzer):
|
|
12
|
+
"""
|
|
13
|
+
A simple base class to add analyzers.
|
|
14
|
+
|
|
15
|
+
Examples:
|
|
16
|
+
.. literalinclude:: ../../examples/analyzers/example_analysis_AddAnalyzer.py
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, filenames=None, output_path='output'):
|
|
20
|
+
"""
|
|
21
|
+
Initialize our analyzer.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
filenames: Filename to fetch
|
|
25
|
+
output_path: Path to write output to
|
|
26
|
+
"""
|
|
27
|
+
super().__init__()
|
|
28
|
+
self.output_path = output_path
|
|
29
|
+
self.filenames = filenames or []
|
|
30
|
+
|
|
31
|
+
# We only want the raw files -> disable parsing
|
|
32
|
+
self.parse = True
|
|
33
|
+
|
|
34
|
+
def filter(self, item: ANALYZABLE_ITEM) -> bool:
|
|
35
|
+
"""
|
|
36
|
+
Determine whether the given item should be included by this analyzer.
|
|
37
|
+
|
|
38
|
+
This implementation accepts all items unconditionally.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
item (ANALYZABLE_ITEM): The item to be evaluated.
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
bool: Always returns True, meaning all items are accepted.
|
|
45
|
+
"""
|
|
46
|
+
return True # download them all!
|
|
47
|
+
|
|
48
|
+
def initialize(self):
|
|
49
|
+
"""
|
|
50
|
+
Initialize our analyzer before running it.
|
|
51
|
+
|
|
52
|
+
We use this to create our output directory.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
None
|
|
56
|
+
"""
|
|
57
|
+
self.output_path = os.path.join(self.working_dir, self.output_path)
|
|
58
|
+
os.makedirs(self.output_path, exist_ok=True)
|
|
59
|
+
|
|
60
|
+
def map(self, data, item: ANALYZABLE_ITEM):
|
|
61
|
+
"""
|
|
62
|
+
Run this on each item and the files we retrieve.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
data: Map of filesnames -> content
|
|
66
|
+
item: Item we are mapping
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
Values added up
|
|
70
|
+
"""
|
|
71
|
+
number = int(list(data.values())[0].split()[10])
|
|
72
|
+
result = number + 100
|
|
73
|
+
return result
|
|
74
|
+
|
|
75
|
+
# ck4, should we pass objects as the keys? e.g. Item-type, not just their id
|
|
76
|
+
def reduce(self, data):
|
|
77
|
+
"""
|
|
78
|
+
Combine all the data we mapped.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
data: Map of results in form Item -> map results
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Sum of all the results
|
|
85
|
+
"""
|
|
86
|
+
# data is currently a dict with item_id: value entries
|
|
87
|
+
value = sum(data.values())
|
|
88
|
+
print(value)
|
|
89
|
+
return value
|