@grnsft/if 0.4.0 → 0.5.0-beta.0

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 (181) hide show
  1. package/CONTRIBUTING.md +4 -5
  2. package/README.md +14 -33
  3. package/Refactor-migration-guide.md +5 -6
  4. package/build/builtins/coefficient/index.d.ts +1 -2
  5. package/build/builtins/coefficient/index.js +18 -4
  6. package/build/builtins/copy-param/index.d.ts +2 -0
  7. package/build/builtins/copy-param/index.js +68 -0
  8. package/build/builtins/csv-lookup/index.d.ts +1 -1
  9. package/build/builtins/csv-lookup/index.js +44 -37
  10. package/build/builtins/divide/index.d.ts +1 -1
  11. package/build/builtins/divide/index.js +22 -11
  12. package/build/builtins/exponent/index.d.ts +1 -2
  13. package/build/builtins/exponent/index.js +9 -23
  14. package/build/builtins/export-csv-raw.d.ts +4 -2
  15. package/build/builtins/export-csv-raw.js +7 -7
  16. package/build/builtins/export-csv.js +8 -11
  17. package/build/builtins/export-log.js +1 -1
  18. package/build/builtins/export-yaml.js +6 -6
  19. package/build/builtins/group-by.d.ts +1 -1
  20. package/build/builtins/group-by.js +5 -5
  21. package/build/builtins/index.d.ts +1 -0
  22. package/build/builtins/index.js +4 -2
  23. package/build/builtins/interpolation/index.d.ts +1 -1
  24. package/build/builtins/interpolation/index.js +10 -8
  25. package/build/builtins/mock-observations/helpers/common-generator.d.ts +2 -2
  26. package/build/builtins/mock-observations/helpers/common-generator.js +10 -13
  27. package/build/builtins/mock-observations/helpers/rand-int-generator.d.ts +2 -2
  28. package/build/builtins/mock-observations/helpers/rand-int-generator.js +14 -24
  29. package/build/builtins/mock-observations/index.d.ts +1 -2
  30. package/build/builtins/mock-observations/index.js +2 -4
  31. package/build/builtins/multiply/index.d.ts +1 -2
  32. package/build/builtins/multiply/index.js +10 -16
  33. package/build/builtins/regex/index.d.ts +1 -2
  34. package/build/builtins/regex/index.js +8 -12
  35. package/build/builtins/sci/index.d.ts +1 -2
  36. package/build/builtins/sci/index.js +23 -22
  37. package/build/builtins/sci-embodied/index.d.ts +1 -1
  38. package/build/builtins/sci-embodied/index.js +16 -17
  39. package/build/builtins/shell/index.d.ts +1 -2
  40. package/build/builtins/shell/index.js +4 -4
  41. package/build/builtins/subtract/index.d.ts +1 -2
  42. package/build/builtins/subtract/index.js +7 -23
  43. package/build/builtins/sum/index.d.ts +1 -2
  44. package/build/builtins/sum/index.js +14 -11
  45. package/build/builtins/time-sync.d.ts +1 -2
  46. package/build/builtins/time-sync.js +62 -67
  47. package/build/check.d.ts +2 -0
  48. package/build/check.js +85 -0
  49. package/build/config/config.d.ts +13 -1
  50. package/build/config/config.js +61 -1
  51. package/build/config/params.js +1 -6
  52. package/build/config/strings.d.ts +41 -5
  53. package/build/config/strings.js +46 -9
  54. package/build/diff.js +2 -2
  55. package/build/env.d.ts +2 -0
  56. package/build/env.js +38 -0
  57. package/build/lib/aggregate.js +1 -1
  58. package/build/lib/compute.js +1 -1
  59. package/build/lib/exhaust.js +4 -4
  60. package/build/lib/initialize.js +20 -24
  61. package/build/lib/load.js +4 -4
  62. package/build/types/compute.d.ts +1 -1
  63. package/build/types/compute.js +1 -1
  64. package/build/types/if-env.d.ts +8 -0
  65. package/build/types/if-env.js +3 -0
  66. package/build/types/interface.d.ts +1 -19
  67. package/build/types/interface.js +1 -1
  68. package/build/types/npm.d.ts +9 -0
  69. package/build/types/npm.js +3 -0
  70. package/build/types/process-args.d.ts +9 -0
  71. package/build/types/process-args.js +1 -1
  72. package/build/util/aggregation-helper.d.ts +1 -1
  73. package/build/util/aggregation-helper.js +5 -5
  74. package/build/util/args.d.ts +23 -1
  75. package/build/util/args.js +91 -14
  76. package/build/util/fs.d.ts +20 -0
  77. package/build/util/fs.js +94 -0
  78. package/build/util/helpers.d.ts +25 -5
  79. package/build/util/helpers.js +110 -15
  80. package/build/util/npm.d.ts +28 -0
  81. package/build/util/npm.js +152 -0
  82. package/build/util/plugin-storage.js +4 -4
  83. package/build/util/validations.js +4 -4
  84. package/jest.config.js +1 -1
  85. package/manifests/bugs/aggregation-error-wrong-metric.yml +73 -23
  86. package/manifests/bugs/azure-importer-ignoring-defaults.yml +6 -3
  87. package/manifests/bugs/azure-importer-incorrect-calculation.yml +6 -3
  88. package/manifests/bugs/initialize-error-no-config.yml +4 -5
  89. package/manifests/bugs/initialize-error-no-path.yml +9 -5
  90. package/manifests/bugs/input-error-missing-duration.yml +10 -6
  91. package/manifests/bugs/pipeline-error-naming-mismatch.yml +8 -4
  92. package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +9 -5
  93. package/manifests/bugs/pipeline-ordering-error.yml +43 -34
  94. package/manifests/examples/copy.yaml +20 -0
  95. package/manifests/examples/generics.yml +48 -13
  96. package/manifests/examples/instance-metadata.yml +4 -4
  97. package/manifests/examples/mock-cpu-util-to-carbon.yml +8 -2
  98. package/manifests/examples/nesting.yml +82 -35
  99. package/manifests/examples/pipeline-teads-sci.yml +54 -18
  100. package/manifests/examples/pipeline-with-aggregate.yml +66 -24
  101. package/manifests/examples/pipeline-with-mocks.yml +65 -22
  102. package/manifests/examples/region-metadata.yml +26 -0
  103. package/manifests/examples/tdp-finder.yml +23 -0
  104. package/manifests/examples/zeros.yaml +130 -0
  105. package/manifests/features/{aggregate-failure-inalid-metrics.yml → aggregate-failure-invalid-metrics.yml} +9 -3
  106. package/manifests/features/aggregate-failure-missing-metric-in-inputs.yml +9 -3
  107. package/manifests/features/aggregate-horizontal.yml +8 -2
  108. package/manifests/features/aggregate-vertical.yml +8 -2
  109. package/manifests/features/aggregate.yml +8 -2
  110. package/manifests/integrations/{cloud-metadata-divide-boavizta.yml → cloud-metadata-divide.yml} +8 -9
  111. package/manifests/integrations/instance-metadata/failure-invalid-instance-type.yaml +33 -0
  112. package/manifests/integrations/instance-metadata/failure-invalid-provider.yaml +33 -0
  113. package/manifests/integrations/instance-metadata/failure-missing-queried-input.yml +33 -0
  114. package/manifests/integrations/instance-metadata/success.yml +33 -0
  115. package/manifests/integrations/mock-obs-group-by-cloud-meta.yml +8 -2
  116. package/manifests/integrations/mock-obs-time-sync.yml +50 -5
  117. package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/failure-invalid-instance-type.yaml +9 -3
  118. package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/failure-invalid-vendor.yaml +8 -2
  119. package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/failure-missing-cloud-vendor.yml +9 -3
  120. package/manifests/plugins/{cloud-metadata → csv-lookup/cloud-metadata}/success.yml +8 -2
  121. package/manifests/plugins/csv-lookup/{success.yml → region-metadata/success.yml} +1 -1
  122. package/manifests/plugins/csv-lookup/tdp-finder/failure-missing-input-param.yml +23 -0
  123. package/manifests/plugins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +24 -0
  124. package/manifests/plugins/csv-lookup/tdp-finder/success.yml +24 -0
  125. package/manifests/plugins/divide/failure-denominator-equal-zero.yml +8 -9
  126. package/manifests/plugins/divide/failure-invalid-config-denominator.yml +8 -9
  127. package/manifests/plugins/divide/failure-missing-numerator.yml +8 -9
  128. package/manifests/plugins/divide/success.yml +9 -10
  129. package/manifests/plugins/exponent/success.yml +26 -0
  130. package/manifests/plugins/interpolation/success.yml +24 -0
  131. package/manifests/plugins/sci/failure-missing-input-param.yml +2 -6
  132. package/manifests/plugins/sci/success.yml +0 -3
  133. package/manifests/plugins/subtract/success.yml +25 -0
  134. package/manifests/plugins/sum/success.yml +1 -1
  135. package/package.json +10 -4
  136. package/src/__mocks__/mock-manifest.yaml +72 -0
  137. package/src/builtins/README.md +1 -1
  138. package/src/builtins/coefficient/README.md +19 -1
  139. package/src/builtins/copy-param/README.md +104 -0
  140. package/src/builtins/csv-lookup/README.md +39 -1
  141. package/src/builtins/divide/README.md +29 -3
  142. package/src/builtins/exponent/README.md +21 -1
  143. package/src/builtins/interpolation/README.md +29 -1
  144. package/src/builtins/mock-observations/README.md +1 -1
  145. package/src/builtins/multiply/README.md +16 -1
  146. package/src/builtins/regex/README.md +32 -2
  147. package/src/builtins/sci/README.md +24 -1
  148. package/src/builtins/sci-embodied/README.md +15 -1
  149. package/src/builtins/shell/README.md +12 -1
  150. package/src/builtins/subtract/README.md +12 -1
  151. package/src/builtins/sum/README.md +28 -1
  152. package/src/config/env-template.yml +24 -0
  153. package/build/builtins/coefficient/types.d.ts +0 -5
  154. package/build/builtins/coefficient/types.js +0 -3
  155. package/build/builtins/exponent/types.d.ts +0 -5
  156. package/build/builtins/exponent/types.js +0 -3
  157. package/build/builtins/interpolation/types.d.ts +0 -5
  158. package/build/builtins/interpolation/types.js +0 -10
  159. package/build/builtins/mock-observations/types.d.ts +0 -13
  160. package/build/builtins/mock-observations/types.js +0 -3
  161. package/build/builtins/multiply/types.d.ts +0 -4
  162. package/build/builtins/multiply/types.js +0 -3
  163. package/build/builtins/subtract/types.d.ts +0 -4
  164. package/build/builtins/subtract/types.js +0 -3
  165. package/build/builtins/sum/types.d.ts +0 -4
  166. package/build/builtins/sum/types.js +0 -3
  167. package/build/types/common.d.ts +0 -4
  168. package/build/types/common.js +0 -3
  169. package/build/types/group-by.d.ts +0 -3
  170. package/build/types/group-by.js +0 -3
  171. package/build/types/helpers.d.ts +0 -4
  172. package/build/types/helpers.js +0 -3
  173. package/build/util/errors.d.ts +0 -6
  174. package/build/util/errors.js +0 -33
  175. package/manifests/examples/basic.yml +0 -28
  176. package/manifests/plugins/tdp-finder/failure-missing-input-param.yml +0 -18
  177. package/manifests/plugins/tdp-finder/failure-unsupported-physical-processor.yml +0 -19
  178. package/manifests/plugins/tdp-finder/success.yml +0 -19
  179. /package/manifests/plugins/csv-lookup/{failure-missing-column.yml → region-metadata/failure-missing-column.yml} +0 -0
  180. /package/manifests/plugins/csv-lookup/{failure-missing-output.yml → region-metadata/failure-missing-output.yml} +0 -0
  181. /package/manifests/plugins/csv-lookup/{success-renaming.yml → region-metadata/success-renaming.yml} +0 -0
@@ -164,5 +164,33 @@ You can execute this by passing it to `ie`. Run the impact using the following c
164
164
 
165
165
  ```sh
166
166
  npm i -g @grnsft/if
167
- ie --manifest ./manifests/examples/interpolation.yml --output ./manifests/outputs/interpolation.yml
167
+ if-run --manifest ./manifests/examples/interpolation.yml --output ./manifests/outputs/interpolation.yml
168
168
  ```
169
+
170
+ ## Errors
171
+
172
+ `Interpolation` exposes one of IF's error classes.
173
+
174
+ ## `GlobalConfigError`
175
+
176
+ ### GlobalConfigError
177
+
178
+ You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
179
+
180
+ The required parameters are:
181
+ - `method`: a string containing either `linear`, `spline` or `polynomial`
182
+ - `x`: an array of numbers
183
+ - `y`: an array of numbers
184
+ - `input-parameter`: a string containing the name of a value present in the `inputs` array'
185
+ - `output-parameter`: a string
186
+
187
+ You can fix this error by checking you are providing valid values for each parameter in the config.
188
+
189
+ ### Validation errors
190
+
191
+ There are also several validation errors that can arise, including:
192
+ - if the lengths of `x` and `y` are not equal
193
+ - if `x` or `y` are empty
194
+ - if the requested point to interpolate at is outside the range of `x`
195
+
196
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -91,7 +91,7 @@ You can run this example `manifest` by saving it as `manifests/plugins/mock-obse
91
91
 
92
92
  ```sh
93
93
  npm i -g @grnsft/if
94
- ie --manifest ./examples/manifests/test/mock-observation.yml --output ./examples/outputs/mock-observation
94
+ if-run --manifest ./examples/manifests/test/mock-observation.yml --output ./examples/outputs/mock-observation
95
95
  ```
96
96
 
97
97
  The results will be saved to a new `yaml` file in `./examples/outputs`.
@@ -88,7 +88,22 @@ You can run this example by saving it as `./examples/manifests/test/multiply.yml
88
88
 
89
89
  ```sh
90
90
  npm i -g @grnsft/if
91
- ie --manifest ./examples/manifests/test/multiply.yml --output ./examples/outputs/multiply.yml
91
+ if-run --manifest ./examples/manifests/test/multiply.yml --output ./examples/outputs/multiply.yml
92
92
  ```
93
93
 
94
94
  The results will be saved to a new `yaml` file in `./examples/outputs`
95
+
96
+
97
+ ## Errors
98
+
99
+ `Multiply` uses one of the IF error classes.
100
+
101
+ ### `MissingInputDataError`
102
+
103
+ This error arises when a necessary piece of input data is missing from the `inputs` array.
104
+ Every element in the `inputs` array must contain:
105
+ - `timestamp`
106
+ - `duration`
107
+ - whatever values you passed to `input-parameters`
108
+
109
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -4,8 +4,6 @@
4
4
 
5
5
  You provide the name of the value you want to match, and a name to use to add the regex to the output array.
6
6
 
7
- For example, `boavizta-cpu` need `cpu/name` to work, however `cloud-metadata` returns `physical-processor` which usually contains a long string of processors that the instance could be separated by `,`, like so:
8
-
9
7
  ```
10
8
  Intel® Xeon® Platinum 8272CL,Intel® Xeon® 8171M 2.1 GHz,Intel® Xeon® E5-2673 v4 2.3 GHz,Intel® Xeon® E5-2673 v3 2.4 GHz
11
9
  ```
@@ -89,3 +87,35 @@ if --manifest manifests/examples/regex.yml --output manifests/outputs/regex.yml
89
87
  ```
90
88
 
91
89
  The results will be saved to a new `yaml` file in `manifests/outputs`.
90
+
91
+ ## Errors
92
+
93
+ `Regex` uses three of IF's error classes:
94
+
95
+ ### `MissingInputDataError`
96
+
97
+ This error arises when a necessary piece of input data is missing from the `inputs` array.
98
+ Every element in the `inputs` array must contain:
99
+ - `timestamp`
100
+ - `duration`
101
+ - whatever value you passed to `parameter`
102
+
103
+
104
+ ### `GlobalConfigError`
105
+
106
+ You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
107
+
108
+ The required parameters are:
109
+
110
+ - `parameter`: a string containing the name of a value in the inputs array
111
+ - `match`: a valid regex pattern
112
+ - `output`: a string
113
+
114
+ You can fix this error by checking you are providing valid values for each parameter in the config.
115
+
116
+
117
+ ### `RegexMismatchError`
118
+
119
+ This error arises when the requested regex cannot find any matches in the given data. If there are multiple matches, the plugin returns the first, but if there are none, it throws this error.
120
+
121
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -19,6 +19,8 @@
19
19
 
20
20
  - `sci`: carbon expressed in terms of the given functional unit
21
21
 
22
+ >Note: Plugin will warn and return `carbon` value in case if `functional-unit`'s value is zero.
23
+
22
24
  ## Calculation
23
25
 
24
26
  SCI is calculated as:
@@ -83,7 +85,28 @@ You can run this example `manifest` by saving it as `./manifests/plugins/sci.yml
83
85
 
84
86
  ```sh
85
87
  npm i -g @grnsft/if
86
- ie --manifest manifests/plugins/sci.yml --output manifests/outputs/sci.yml
88
+ if-run --manifest manifests/plugins/sci.yml --output manifests/outputs/sci.yml
87
89
  ```
88
90
 
89
91
  The results will be saved to a new `yaml` file.
92
+
93
+ ## Errors
94
+
95
+ `SCI` uses one of the IF error classes.
96
+
97
+ ### `MissingInputDataError`
98
+
99
+ This error arises when a necessary piece of input data is missing from the `inputs` array.
100
+
101
+ Every element in the `inputs` array must contain:
102
+ - `timestamp`
103
+ - `duration`
104
+ - `carbon`: a numeric value named `carbon` must exist in the inputs array
105
+ - whatever value you passed to `functional-unit`
106
+
107
+
108
+ ### Validation errors
109
+
110
+ There is also a validation step that checks that the `functional-unit` was provided in the plugin config. If you see an error reporting this value as missing, please check you have provided it.
111
+
112
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -104,7 +104,21 @@ You can run this example `manifest` by executing the following command from the
104
104
 
105
105
  ```sh
106
106
  npm i -g @grnsft/if
107
- ie --manifest manifests/plugins/sci-embodied.yml --output manifests/outputs/sci-embodied.yml
107
+ if-run --manifest manifests/plugins/sci-embodied.yml --output manifests/outputs/sci-embodied.yml
108
108
  ```
109
109
 
110
110
  The results will be saved to a new `yaml` file in `./examples/outputs`.
111
+
112
+
113
+ ## Errors
114
+
115
+ `SciEmbodied` uses one of IF's error classes
116
+
117
+ ### `SciEmbodiedError`
118
+
119
+ This error class is used to describe a problem with one of the input values to `sci-embodied`. This is typically due to an incorrect type or a reference to a value that is not available.
120
+
121
+ You will receive a specific error message explaining which parameter is problematic, and you can check and replace where appropriate.
122
+
123
+
124
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -124,7 +124,18 @@ You can run this example `manifest` by saving it as `manifests/plugins/shell.yml
124
124
 
125
125
  ```sh
126
126
  npm i -g @grnsft/if
127
- ie --manifest manifests/plugins/shell.yml --output manifests/outputs/shell.yml
127
+ if-run --manifest manifests/plugins/shell.yml --output manifests/outputs/shell.yml
128
128
  ```
129
129
 
130
130
  The results will be saved to a new `yaml` file.
131
+
132
+
133
+ ## Errors
134
+
135
+ `Shell` uses one of the error classes provided by IF
136
+
137
+ ### `ProcessExecutionError`
138
+
139
+ This error is thrown when the program invoked in the spawned shell fails for some reason that is not known to IF. Since the shell executes arbitrary code, it is difficult for IF to provide specific errors - this is delegated to the developers of the executed program.
140
+
141
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -88,7 +88,18 @@ You can run this example by saving it as `./examples/manifests/test/subrtact.yml
88
88
 
89
89
  ```sh
90
90
  npm i -g @grnsft/if
91
- ie --manifest /manifests/plugins/subtract.yml --output manifests/outputs/subtract.yml
91
+ if-run --manifest /manifests/plugins/subtract.yml --output manifests/outputs/subtract.yml
92
92
  ```
93
93
 
94
94
  The results will be saved to a new `yaml` file in `manifests/outputs`.
95
+
96
+
97
+ ## Errors
98
+
99
+ `Subtract` uses one of IF's error classes:
100
+
101
+ ### `InputValidationError`
102
+
103
+ This error arises when an invalid value is passed to `Subtract`. Typically, this can occur when a non-numeric value (such as a string made of alphabetic characters) is passed where a number or numeric string is expected. Please check that the types are correct for all the relevant fields in your `inputs` array.
104
+
105
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
@@ -85,7 +85,34 @@ tree:
85
85
  You can run this example by saving it as `./examples/manifests/sum.yml` and executing the following command from the project root:
86
86
 
87
87
  ```sh
88
- ie --manifest ./examples/manifests/sum.yml --output ./examples/outputs/sum.yml
88
+ if-run --manifest ./examples/manifests/sum.yml --output ./examples/outputs/sum.yml
89
89
  ```
90
90
 
91
91
  The results will be saved to a new `yaml` file in `./examples/outputs`.
92
+
93
+
94
+ ## Errors
95
+
96
+ `Sum` exposes two of the IF error classes.
97
+
98
+ ### GlobalConfigError
99
+
100
+ You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
101
+
102
+ The required parameters are:
103
+ - `input-parameters`: this must be an array of strings, each being the name of a value in the `inputs` array
104
+ - `output-parameter`: this must be a string
105
+
106
+ You can fix this error by checking you are providing valid values for each parameter in the config.
107
+
108
+ ### `MissingInputDataError`
109
+
110
+ This error arises when a necessary piece of input data is missing from the `inputs` array.
111
+ Every element in the ``inputs` array must contain:
112
+
113
+ - `timestamp`
114
+ - `duration`
115
+ - whatever values you passed to `input-parameters`
116
+
117
+
118
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors).
@@ -0,0 +1,24 @@
1
+ name: template manifest # rename me!
2
+ description: auto-generated template # update description!
3
+ tags: # add any tags that will help you to track your manifests
4
+ initialize:
5
+ outputs:
6
+ - yaml # you can add - csv to export to csv
7
+ plugins: # add more plugins for your use-case
8
+ memory-energy-from-memory-util: # you can name this any way you like!
9
+ method: Coefficient # the name of the function exported from the plugin
10
+ path: "builtin" # the import path
11
+ global-config: # anmy config required by the plugin
12
+ input-parameter: "memory/utilization"
13
+ coefficient: 0.0001 #kwH/GB
14
+ output-parameter: "memory/energy"
15
+ tree:
16
+ children: # add a chile for each distinct component you want to measure
17
+ child:
18
+ pipeline: # the pipeline is an ordered list of plugins you want to execute
19
+ - memory-energy-from-memory-util # must match the name in initialize!
20
+ config: # any plugin specific, node-level config
21
+ inputs:
22
+ - timestamp: 2023-12-12T00:00:00.000Z # ISO 8061 string
23
+ duration: 3600 # units of seconds
24
+ memory/utilization: 10
@@ -1,5 +0,0 @@
1
- export type CoefficientConfig = {
2
- 'input-parameter': string;
3
- coefficient: number;
4
- 'output-parameter': string;
5
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvY29lZmZpY2llbnQvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIENvZWZmaWNpZW50Q29uZmlnID0ge1xuICAnaW5wdXQtcGFyYW1ldGVyJzogc3RyaW5nO1xuICBjb2VmZmljaWVudDogbnVtYmVyO1xuICAnb3V0cHV0LXBhcmFtZXRlcic6IHN0cmluZztcbn07XG4iXX0=
@@ -1,5 +0,0 @@
1
- export type ExponentConfig = {
2
- 'input-parameter': string;
3
- exponent: number;
4
- 'output-parameter': string;
5
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvZXhwb25lbnQvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIEV4cG9uZW50Q29uZmlnID0ge1xuICAnaW5wdXQtcGFyYW1ldGVyJzogc3RyaW5nO1xuICBleHBvbmVudDogbnVtYmVyO1xuICAnb3V0cHV0LXBhcmFtZXRlcic6IHN0cmluZztcbn07XG4iXX0=
@@ -1,5 +0,0 @@
1
- export declare enum Method {
2
- LINEAR = "linear",
3
- SPLINE = "spline",
4
- POLYNOMIAL = "polynomial"
5
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Method = void 0;
4
- var Method;
5
- (function (Method) {
6
- Method["LINEAR"] = "linear";
7
- Method["SPLINE"] = "spline";
8
- Method["POLYNOMIAL"] = "polynomial";
9
- })(Method || (exports.Method = Method = {}));
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvaW50ZXJwb2xhdGlvbi90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxJQUFZLE1BSVg7QUFKRCxXQUFZLE1BQU07SUFDaEIsMkJBQWlCLENBQUE7SUFDakIsMkJBQWlCLENBQUE7SUFDakIsbUNBQXlCLENBQUE7QUFDM0IsQ0FBQyxFQUpXLE1BQU0sc0JBQU4sTUFBTSxRQUlqQiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIE1ldGhvZCB7XG4gIExJTkVBUiA9ICdsaW5lYXInLFxuICBTUExJTkUgPSAnc3BsaW5lJyxcbiAgUE9MWU5PTUlBTCA9ICdwb2x5bm9taWFsJyxcbn1cbiJdfQ==
@@ -1,13 +0,0 @@
1
- import { DateTime } from 'luxon';
2
- import { Generator } from './interfaces/index';
3
- export type ObservationParams = {
4
- duration: number;
5
- timeBucket: DateTime;
6
- component: Record<string, string>;
7
- generators: Generator[];
8
- };
9
- export type RandIntGeneratorParams = {
10
- name: string;
11
- min: number;
12
- max: number;
13
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvbW9jay1vYnNlcnZhdGlvbnMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7RGF0ZVRpbWV9IGZyb20gJ2x1eG9uJztcblxuaW1wb3J0IHtHZW5lcmF0b3J9IGZyb20gJy4vaW50ZXJmYWNlcy9pbmRleCc7XG5cbmV4cG9ydCB0eXBlIE9ic2VydmF0aW9uUGFyYW1zID0ge1xuICBkdXJhdGlvbjogbnVtYmVyO1xuICB0aW1lQnVja2V0OiBEYXRlVGltZTtcbiAgY29tcG9uZW50OiBSZWNvcmQ8c3RyaW5nLCBzdHJpbmc+O1xuICBnZW5lcmF0b3JzOiBHZW5lcmF0b3JbXTtcbn07XG5cbmV4cG9ydCB0eXBlIFJhbmRJbnRHZW5lcmF0b3JQYXJhbXMgPSB7XG4gIG5hbWU6IHN0cmluZztcbiAgbWluOiBudW1iZXI7XG4gIG1heDogbnVtYmVyO1xufTtcbiJdfQ==
@@ -1,4 +0,0 @@
1
- export type MultiplyConfig = {
2
- 'input-parameters': string[];
3
- 'output-parameter': string;
4
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvbXVsdGlwbHkvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIE11bHRpcGx5Q29uZmlnID0ge1xuICAnaW5wdXQtcGFyYW1ldGVycyc6IHN0cmluZ1tdO1xuICAnb3V0cHV0LXBhcmFtZXRlcic6IHN0cmluZztcbn07XG4iXX0=
@@ -1,4 +0,0 @@
1
- export type SubtractConfig = {
2
- 'input-parameters': string[];
3
- 'output-parameter': string;
4
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvc3VidHJhY3QvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIFN1YnRyYWN0Q29uZmlnID0ge1xuICAnaW5wdXQtcGFyYW1ldGVycyc6IHN0cmluZ1tdO1xuICAnb3V0cHV0LXBhcmFtZXRlcic6IHN0cmluZztcbn07XG4iXX0=
@@ -1,4 +0,0 @@
1
- export type SumConfig = {
2
- 'input-parameters': string[];
3
- 'output-parameter': string;
4
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYnVpbHRpbnMvc3VtL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBTdW1Db25maWcgPSB7XG4gICdpbnB1dC1wYXJhbWV0ZXJzJzogc3RyaW5nW107XG4gICdvdXRwdXQtcGFyYW1ldGVyJzogc3RyaW5nO1xufTtcbiJdfQ==
@@ -1,4 +0,0 @@
1
- export type KeyValuePair = {
2
- [key: string]: any;
3
- };
4
- export type ConfigParams = Record<string, any>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3R5cGVzL2NvbW1vbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgS2V5VmFsdWVQYWlyID0ge1xuICBba2V5OiBzdHJpbmddOiBhbnk7XG59O1xuXG5leHBvcnQgdHlwZSBDb25maWdQYXJhbXMgPSBSZWNvcmQ8c3RyaW5nLCBhbnk+O1xuIl19
@@ -1,3 +0,0 @@
1
- export type GroupByConfig = {
2
- group: string[];
3
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JvdXAtYnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvZ3JvdXAtYnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB0eXBlIEdyb3VwQnlDb25maWcgPSB7XG4gIGdyb3VwOiBzdHJpbmdbXTtcbn07XG4iXX0=
@@ -1,4 +0,0 @@
1
- export type ErrorFormatParams = {
2
- scope?: string;
3
- message: string;
4
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90eXBlcy9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBFcnJvckZvcm1hdFBhcmFtcyA9IHtcbiAgc2NvcGU/OiBzdHJpbmc7XG4gIG1lc3NhZ2U6IHN0cmluZztcbn07XG4iXX0=
@@ -1,6 +0,0 @@
1
- declare const CUSTOM_ERRORS: readonly ["CliInputError", "ConfigNotFoundError", "ConfigValidationError", "ExhaustError", "FileNotFoundError", "MakeDirectoryError", "ManifestValidationError", "ModuleInitializationError", "InputValidationError", "InvalidAggregationParamsError", "InvalidGroupingError", "PluginCredentialError", "PluginInitalizationError", "WriteFileError", "ConfigNotFoundError"];
2
- type CustomErrors = {
3
- [K in (typeof CUSTOM_ERRORS)[number]]: ErrorConstructor;
4
- };
5
- export declare const ERRORS: CustomErrors;
6
- export {};
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ERRORS = void 0;
4
- const CUSTOM_ERRORS = [
5
- 'CliInputError',
6
- 'ConfigNotFoundError',
7
- 'ConfigValidationError',
8
- 'ExhaustError',
9
- 'FileNotFoundError',
10
- 'MakeDirectoryError',
11
- 'ManifestValidationError',
12
- 'ModuleInitializationError',
13
- 'InputValidationError',
14
- 'InvalidAggregationParamsError',
15
- 'InvalidGroupingError',
16
- 'PluginCredentialError',
17
- 'PluginInitalizationError',
18
- 'WriteFileError',
19
- 'ConfigNotFoundError',
20
- ];
21
- exports.ERRORS = CUSTOM_ERRORS.reduce((acc, className) => {
22
- acc = {
23
- ...acc,
24
- [className]: class extends Error {
25
- constructor(message) {
26
- super(message);
27
- this.name = this.constructor.name;
28
- }
29
- },
30
- };
31
- return acc;
32
- }, {});
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvZXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLE1BQU0sYUFBYSxHQUFHO0lBQ3BCLGVBQWU7SUFDZixxQkFBcUI7SUFDckIsdUJBQXVCO0lBQ3ZCLGNBQWM7SUFDZCxtQkFBbUI7SUFDbkIsb0JBQW9CO0lBQ3BCLHlCQUF5QjtJQUN6QiwyQkFBMkI7SUFDM0Isc0JBQXNCO0lBQ3RCLCtCQUErQjtJQUMvQixzQkFBc0I7SUFDdEIsdUJBQXVCO0lBQ3ZCLDBCQUEwQjtJQUMxQixnQkFBZ0I7SUFDaEIscUJBQXFCO0NBQ2IsQ0FBQztBQU1FLFFBQUEsTUFBTSxHQUFHLGFBQWEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLEVBQUUsU0FBUyxFQUFFLEVBQUU7SUFDNUQsR0FBRyxHQUFHO1FBQ0osR0FBRyxHQUFHO1FBQ04sQ0FBQyxTQUFTLENBQUMsRUFBRSxLQUFNLFNBQVEsS0FBSztZQUM5QixZQUFZLE9BQWU7Z0JBQ3pCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztnQkFDZixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDO1lBQ3BDLENBQUM7U0FDRjtLQUNGLENBQUM7SUFFRixPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUMsRUFBRSxFQUFrQixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBDVVNUT01fRVJST1JTID0gW1xuICAnQ2xpSW5wdXRFcnJvcicsXG4gICdDb25maWdOb3RGb3VuZEVycm9yJyxcbiAgJ0NvbmZpZ1ZhbGlkYXRpb25FcnJvcicsXG4gICdFeGhhdXN0RXJyb3InLFxuICAnRmlsZU5vdEZvdW5kRXJyb3InLFxuICAnTWFrZURpcmVjdG9yeUVycm9yJyxcbiAgJ01hbmlmZXN0VmFsaWRhdGlvbkVycm9yJyxcbiAgJ01vZHVsZUluaXRpYWxpemF0aW9uRXJyb3InLFxuICAnSW5wdXRWYWxpZGF0aW9uRXJyb3InLFxuICAnSW52YWxpZEFnZ3JlZ2F0aW9uUGFyYW1zRXJyb3InLFxuICAnSW52YWxpZEdyb3VwaW5nRXJyb3InLFxuICAnUGx1Z2luQ3JlZGVudGlhbEVycm9yJyxcbiAgJ1BsdWdpbkluaXRhbGl6YXRpb25FcnJvcicsXG4gICdXcml0ZUZpbGVFcnJvcicsXG4gICdDb25maWdOb3RGb3VuZEVycm9yJyxcbl0gYXMgY29uc3Q7XG5cbnR5cGUgQ3VzdG9tRXJyb3JzID0ge1xuICBbSyBpbiAodHlwZW9mIENVU1RPTV9FUlJPUlMpW251bWJlcl1dOiBFcnJvckNvbnN0cnVjdG9yO1xufTtcblxuZXhwb3J0IGNvbnN0IEVSUk9SUyA9IENVU1RPTV9FUlJPUlMucmVkdWNlKChhY2MsIGNsYXNzTmFtZSkgPT4ge1xuICBhY2MgPSB7XG4gICAgLi4uYWNjLFxuICAgIFtjbGFzc05hbWVdOiBjbGFzcyBleHRlbmRzIEVycm9yIHtcbiAgICAgIGNvbnN0cnVjdG9yKG1lc3NhZ2U6IHN0cmluZykge1xuICAgICAgICBzdXBlcihtZXNzYWdlKTtcbiAgICAgICAgdGhpcy5uYW1lID0gdGhpcy5jb25zdHJ1Y3Rvci5uYW1lO1xuICAgICAgfVxuICAgIH0sXG4gIH07XG5cbiAgcmV0dXJuIGFjYztcbn0sIHt9IGFzIEN1c3RvbUVycm9ycyk7XG4iXX0=
@@ -1,28 +0,0 @@
1
- name: basic
2
- description: a minimal manifest executing a single plugin on a single component for a single timestep
3
- tags:
4
- initialize:
5
- plugins:
6
- teads-curve:
7
- path: '@grnsft/if-unofficial-plugins'
8
- method: TeadsCurve
9
- global-config:
10
- interpolation: spline
11
- outputs: ['yaml']
12
- tree:
13
- children:
14
- child-0:
15
- defaults:
16
- cpu/thermal-design-power: 100
17
- pipeline:
18
- - teads-curve
19
- inputs:
20
- - timestamp: 2023-07-06T00:00
21
- duration: 1
22
- cpu/utilization: 20
23
- - timestamp: 2023-07-06T00:01
24
- duration: 1
25
- cpu/utilization: 80
26
- - timestamp: 2023-07-06T00:02
27
- duration: 1
28
- cpu/utilization: 20
@@ -1,18 +0,0 @@
1
- name: tdp-finder
2
- description: failure with `inputs` missing `physical-processor` param
3
- tags:
4
- initialize:
5
- outputs: ['yaml']
6
- plugins:
7
- tdp-finder: # a model that returns an embodied value given the sci embodied attribution equation.
8
- method: TdpFinder
9
- path: "@grnsft/if-plugins"
10
- tree:
11
- children:
12
- child:
13
- pipeline:
14
- - tdp-finder
15
- config:
16
- inputs:
17
- - timestamp: 2023-07-06T00:00
18
- duration: 300
@@ -1,19 +0,0 @@
1
- name: tdp-finder
2
- description: successful path
3
- tags:
4
- initialize:
5
- outputs: ['yaml']
6
- plugins:
7
- tdp-finder: # a model that returns an embodied value given the sci embodied attribution equation.
8
- method: TdpFinder
9
- path: "@grnsft/if-plugins"
10
- tree:
11
- children:
12
- child:
13
- pipeline:
14
- - tdp-finder
15
- config:
16
- inputs:
17
- - timestamp: 2023-07-06T00:00
18
- duration: 300
19
- physical-processor: AMD 302
@@ -1,19 +0,0 @@
1
- name: tdp-finder
2
- description: successful path
3
- tags:
4
- initialize:
5
- outputs: ['yaml']
6
- plugins:
7
- tdp-finder: # a model that returns an embodied value given the sci embodied attribution equation.
8
- method: TdpFinder
9
- path: "@grnsft/if-plugins"
10
- tree:
11
- children:
12
- child:
13
- pipeline:
14
- - tdp-finder
15
- config:
16
- inputs:
17
- - timestamp: 2023-07-06T00:00
18
- duration: 300
19
- physical-processor: AMD 3020e