idmtools 0.0.0.dev0__tar.gz → 0.0.3__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.
Files changed (131) hide show
  1. idmtools-0.0.3/.bumpversion.cfg +28 -0
  2. idmtools-0.0.3/LICENSE.TXT +3 -0
  3. idmtools-0.0.3/MANIFEST.in +3 -0
  4. idmtools-0.0.3/Makefile +8 -0
  5. idmtools-0.0.3/PKG-INFO +120 -0
  6. idmtools-0.0.3/README.md +47 -0
  7. idmtools-0.0.3/idmtools/__init__.py +27 -0
  8. idmtools-0.0.3/idmtools/analysis/__init__.py +5 -0
  9. idmtools-0.0.3/idmtools/analysis/add_analyzer.py +89 -0
  10. idmtools-0.0.3/idmtools/analysis/analyze_manager.py +490 -0
  11. idmtools-0.0.3/idmtools/analysis/csv_analyzer.py +103 -0
  12. idmtools-0.0.3/idmtools/analysis/download_analyzer.py +96 -0
  13. idmtools-0.0.3/idmtools/analysis/map_worker_entry.py +100 -0
  14. idmtools-0.0.3/idmtools/analysis/platform_analysis_bootstrap.py +94 -0
  15. idmtools-0.0.3/idmtools/analysis/platform_anaylsis.py +291 -0
  16. idmtools-0.0.3/idmtools/analysis/tags_analyzer.py +93 -0
  17. idmtools-0.0.3/idmtools/assets/__init__.py +9 -0
  18. idmtools-0.0.3/idmtools/assets/asset.py +453 -0
  19. idmtools-0.0.3/idmtools/assets/asset_collection.py +514 -0
  20. idmtools-0.0.3/idmtools/assets/content_handlers.py +19 -0
  21. idmtools-0.0.3/idmtools/assets/errors.py +23 -0
  22. idmtools-0.0.3/idmtools/assets/file_list.py +191 -0
  23. idmtools-0.0.3/idmtools/builders/__init__.py +11 -0
  24. idmtools-0.0.3/idmtools/builders/arm_simulation_builder.py +152 -0
  25. idmtools-0.0.3/idmtools/builders/csv_simulation_builder.py +76 -0
  26. idmtools-0.0.3/idmtools/builders/simulation_builder.py +348 -0
  27. idmtools-0.0.3/idmtools/builders/sweep_arm.py +109 -0
  28. idmtools-0.0.3/idmtools/builders/yaml_simulation_builder.py +82 -0
  29. idmtools-0.0.3/idmtools/config/__init__.py +7 -0
  30. idmtools-0.0.3/idmtools/config/idm_config_parser.py +486 -0
  31. idmtools-0.0.3/idmtools/core/__init__.py +10 -0
  32. idmtools-0.0.3/idmtools/core/cache_enabled.py +114 -0
  33. idmtools-0.0.3/idmtools/core/context.py +68 -0
  34. idmtools-0.0.3/idmtools/core/docker_task.py +207 -0
  35. idmtools-0.0.3/idmtools/core/enums.py +51 -0
  36. idmtools-0.0.3/idmtools/core/exceptions.py +91 -0
  37. idmtools-0.0.3/idmtools/core/experiment_factory.py +71 -0
  38. idmtools-0.0.3/idmtools/core/id_file.py +70 -0
  39. idmtools-0.0.3/idmtools/core/interfaces/__init__.py +5 -0
  40. idmtools-0.0.3/idmtools/core/interfaces/entity_container.py +64 -0
  41. idmtools-0.0.3/idmtools/core/interfaces/iassets_enabled.py +58 -0
  42. idmtools-0.0.3/idmtools/core/interfaces/ientity.py +331 -0
  43. idmtools-0.0.3/idmtools/core/interfaces/iitem.py +206 -0
  44. idmtools-0.0.3/idmtools/core/interfaces/imetadata_operations.py +89 -0
  45. idmtools-0.0.3/idmtools/core/interfaces/inamed_entity.py +17 -0
  46. idmtools-0.0.3/idmtools/core/interfaces/irunnable_entity.py +159 -0
  47. idmtools-0.0.3/idmtools/core/logging.py +387 -0
  48. idmtools-0.0.3/idmtools/core/platform_factory.py +316 -0
  49. idmtools-0.0.3/idmtools/core/system_information.py +104 -0
  50. idmtools-0.0.3/idmtools/core/task_factory.py +145 -0
  51. idmtools-0.0.3/idmtools/entities/__init__.py +10 -0
  52. idmtools-0.0.3/idmtools/entities/command_line.py +229 -0
  53. idmtools-0.0.3/idmtools/entities/command_task.py +155 -0
  54. idmtools-0.0.3/idmtools/entities/experiment.py +787 -0
  55. idmtools-0.0.3/idmtools/entities/generic_workitem.py +43 -0
  56. idmtools-0.0.3/idmtools/entities/ianalyzer.py +163 -0
  57. idmtools-0.0.3/idmtools/entities/iplatform.py +1106 -0
  58. idmtools-0.0.3/idmtools/entities/iplatform_default.py +39 -0
  59. idmtools-0.0.3/idmtools/entities/iplatform_ops/__init__.py +5 -0
  60. idmtools-0.0.3/idmtools/entities/iplatform_ops/iplatform_asset_collection_operations.py +148 -0
  61. idmtools-0.0.3/idmtools/entities/iplatform_ops/iplatform_experiment_operations.py +415 -0
  62. idmtools-0.0.3/idmtools/entities/iplatform_ops/iplatform_simulation_operations.py +315 -0
  63. idmtools-0.0.3/idmtools/entities/iplatform_ops/iplatform_suite_operations.py +322 -0
  64. idmtools-0.0.3/idmtools/entities/iplatform_ops/iplatform_workflowitem_operations.py +301 -0
  65. idmtools-0.0.3/idmtools/entities/iplatform_ops/utils.py +185 -0
  66. idmtools-0.0.3/idmtools/entities/itask.py +316 -0
  67. idmtools-0.0.3/idmtools/entities/iworkflow_item.py +167 -0
  68. idmtools-0.0.3/idmtools/entities/platform_requirements.py +20 -0
  69. idmtools-0.0.3/idmtools/entities/relation_type.py +14 -0
  70. idmtools-0.0.3/idmtools/entities/simulation.py +255 -0
  71. idmtools-0.0.3/idmtools/entities/suite.py +188 -0
  72. idmtools-0.0.3/idmtools/entities/task_proxy.py +37 -0
  73. idmtools-0.0.3/idmtools/entities/templated_simulation.py +325 -0
  74. idmtools-0.0.3/idmtools/frozen/frozen_dict.py +71 -0
  75. idmtools-0.0.3/idmtools/frozen/frozen_list.py +66 -0
  76. idmtools-0.0.3/idmtools/frozen/frozen_set.py +86 -0
  77. idmtools-0.0.3/idmtools/frozen/frozen_tuple.py +18 -0
  78. idmtools-0.0.3/idmtools/frozen/frozen_utils.py +179 -0
  79. idmtools-0.0.3/idmtools/frozen/ifrozen.py +66 -0
  80. idmtools-0.0.3/idmtools/plugins/__init__.py +5 -0
  81. idmtools-0.0.3/idmtools/plugins/git_commit.py +117 -0
  82. idmtools-0.0.3/idmtools/registry/__init__.py +4 -0
  83. idmtools-0.0.3/idmtools/registry/experiment_specification.py +105 -0
  84. idmtools-0.0.3/idmtools/registry/functions.py +28 -0
  85. idmtools-0.0.3/idmtools/registry/hook_specs.py +132 -0
  86. idmtools-0.0.3/idmtools/registry/master_plugin_registry.py +51 -0
  87. idmtools-0.0.3/idmtools/registry/platform_specification.py +138 -0
  88. idmtools-0.0.3/idmtools/registry/plugin_specification.py +129 -0
  89. idmtools-0.0.3/idmtools/registry/task_specification.py +104 -0
  90. idmtools-0.0.3/idmtools/registry/utils.py +119 -0
  91. idmtools-0.0.3/idmtools/services/__init__.py +5 -0
  92. idmtools-0.0.3/idmtools/services/ipersistance_service.py +135 -0
  93. idmtools-0.0.3/idmtools/services/platforms.py +13 -0
  94. idmtools-0.0.3/idmtools/utils/__init__.py +5 -0
  95. idmtools-0.0.3/idmtools/utils/caller.py +24 -0
  96. idmtools-0.0.3/idmtools/utils/collections.py +246 -0
  97. idmtools-0.0.3/idmtools/utils/command_line.py +45 -0
  98. idmtools-0.0.3/idmtools/utils/decorators.py +300 -0
  99. idmtools-0.0.3/idmtools/utils/display/__init__.py +22 -0
  100. idmtools-0.0.3/idmtools/utils/display/displays.py +181 -0
  101. idmtools-0.0.3/idmtools/utils/display/settings.py +25 -0
  102. idmtools-0.0.3/idmtools/utils/dropbox_location.py +30 -0
  103. idmtools-0.0.3/idmtools/utils/entities.py +127 -0
  104. idmtools-0.0.3/idmtools/utils/file.py +72 -0
  105. idmtools-0.0.3/idmtools/utils/file_parser.py +151 -0
  106. idmtools-0.0.3/idmtools/utils/filter_simulations.py +182 -0
  107. idmtools-0.0.3/idmtools/utils/filters/__init__.py +5 -0
  108. idmtools-0.0.3/idmtools/utils/filters/asset_filters.py +88 -0
  109. idmtools-0.0.3/idmtools/utils/general.py +286 -0
  110. idmtools-0.0.3/idmtools/utils/gitrepo.py +336 -0
  111. idmtools-0.0.3/idmtools/utils/hashing.py +239 -0
  112. idmtools-0.0.3/idmtools/utils/info.py +124 -0
  113. idmtools-0.0.3/idmtools/utils/json.py +82 -0
  114. idmtools-0.0.3/idmtools/utils/language.py +107 -0
  115. idmtools-0.0.3/idmtools/utils/local_os.py +40 -0
  116. idmtools-0.0.3/idmtools/utils/time.py +22 -0
  117. idmtools-0.0.3/idmtools.egg-info/PKG-INFO +120 -0
  118. idmtools-0.0.3/idmtools.egg-info/SOURCES.txt +123 -0
  119. idmtools-0.0.3/idmtools.egg-info/entry_points.txt +9 -0
  120. idmtools-0.0.3/idmtools.egg-info/requires.txt +60 -0
  121. idmtools-0.0.3/pyproject.toml +136 -0
  122. idmtools-0.0.3/requirements-idmtools_idmtools_core-test.txt +15 -0
  123. {idmtools-0.0.0.dev0 → idmtools-0.0.3}/setup.cfg +4 -4
  124. idmtools-0.0.0.dev0/PKG-INFO +0 -41
  125. idmtools-0.0.0.dev0/README.md +0 -21
  126. idmtools-0.0.0.dev0/idmtools/__init__.py +0 -8
  127. idmtools-0.0.0.dev0/idmtools.egg-info/PKG-INFO +0 -41
  128. idmtools-0.0.0.dev0/idmtools.egg-info/SOURCES.txt +0 -7
  129. idmtools-0.0.0.dev0/pyproject.toml +0 -32
  130. {idmtools-0.0.0.dev0 → idmtools-0.0.3}/idmtools.egg-info/dependency_links.txt +0 -0
  131. {idmtools-0.0.0.dev0 → idmtools-0.0.3}/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}
@@ -0,0 +1,3 @@
1
+ idmtools is licensed under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 License.
2
+
3
+ To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
@@ -0,0 +1,3 @@
1
+ include README.md
2
+ include LICENSE.TXT
3
+ prune tests
@@ -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
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: idmtools
3
+ Version: 0.0.3
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
+ ![Staging: idmtools-core](https://github.com/InstituteforDiseaseModeling/idmtools/workflows/Staging:%20idmtools-core/badge.svg?branch=dev)
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
@@ -0,0 +1,47 @@
1
+ ![Staging: idmtools-core](https://github.com/InstituteforDiseaseModeling/idmtools/workflows/Staging:%20idmtools-core/badge.svg?branch=dev)
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,5 @@
1
+ """idmtools analyzer framework
2
+
3
+ Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
4
+ """
5
+ # flake8: noqa F821
@@ -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