@grnsft/if 0.1.8 → 0.2.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 (208) hide show
  1. package/.commitlintrc.js +45 -0
  2. package/.husky/commit-msg +4 -0
  3. package/.husky/pre-commit +6 -0
  4. package/CONTRIBUTING.md +81 -98
  5. package/README.md +16 -12
  6. package/build/config/config.d.ts +4 -5
  7. package/build/config/config.js +16 -12
  8. package/build/config/index.d.ts +1 -0
  9. package/build/config/index.js +4 -2
  10. package/build/config/params.d.ts +2 -0
  11. package/build/config/params.js +146 -0
  12. package/build/config/strings.d.ts +14 -8
  13. package/build/config/strings.js +18 -12
  14. package/build/index.js +18 -38
  15. package/build/lib/aggregate.d.ts +6 -0
  16. package/build/lib/aggregate.js +72 -0
  17. package/build/lib/compute.d.ts +5 -0
  18. package/build/lib/compute.js +84 -0
  19. package/build/lib/exhaust.d.ts +6 -0
  20. package/build/lib/exhaust.js +47 -0
  21. package/build/lib/initialize.d.ts +6 -0
  22. package/build/lib/initialize.js +98 -0
  23. package/build/lib/load.d.ts +6 -0
  24. package/build/lib/load.js +24 -0
  25. package/build/lib/parameterize.d.ts +5 -0
  26. package/build/lib/parameterize.js +49 -0
  27. package/build/models/export-csv.d.ts +2 -0
  28. package/build/models/export-csv.js +129 -0
  29. package/build/models/export-log.d.ts +4 -0
  30. package/build/models/export-log.js +18 -0
  31. package/build/models/export-yaml.d.ts +4 -0
  32. package/build/models/export-yaml.js +24 -0
  33. package/build/models/group-by.d.ts +11 -0
  34. package/build/models/group-by.js +56 -0
  35. package/build/models/index.d.ts +2 -1
  36. package/build/models/index.js +5 -3
  37. package/build/models/time-sync.d.ts +2 -54
  38. package/build/models/time-sync.js +216 -147
  39. package/build/types/aggregation.d.ts +3 -0
  40. package/build/types/aggregation.js +5 -0
  41. package/build/types/compute.d.ts +25 -0
  42. package/build/types/compute.js +3 -0
  43. package/build/types/exhaust-plugin-interface.d.ts +7 -0
  44. package/build/types/exhaust-plugin-interface.js +3 -0
  45. package/build/types/group-by.d.ts +3 -0
  46. package/build/types/group-by.js +3 -0
  47. package/build/types/initialize.d.ts +4 -0
  48. package/build/types/initialize.js +3 -0
  49. package/build/types/interface.d.ts +8 -0
  50. package/build/types/interface.js +3 -0
  51. package/build/types/load.d.ts +7 -0
  52. package/build/types/load.js +3 -0
  53. package/build/types/manifest.d.ts +40 -0
  54. package/build/types/manifest.js +3 -0
  55. package/build/types/parameters.d.ts +15 -0
  56. package/build/types/parameters.js +5 -0
  57. package/build/types/process-args.d.ts +4 -5
  58. package/build/types/process-args.js +1 -1
  59. package/build/types/time-sync.d.ts +10 -2
  60. package/build/types/time-sync.js +1 -1
  61. package/build/util/aggregation-helper.d.ts +6 -0
  62. package/build/util/aggregation-helper.js +56 -0
  63. package/build/util/args.d.ts +7 -3
  64. package/build/util/args.js +46 -18
  65. package/build/util/errors.d.ts +1 -1
  66. package/build/util/errors.js +8 -4
  67. package/build/util/helpers.d.ts +4 -0
  68. package/build/util/helpers.js +23 -4
  69. package/build/util/json.d.ts +4 -0
  70. package/build/util/json.js +16 -0
  71. package/build/util/logger.d.ts +5 -0
  72. package/build/util/logger.js +40 -0
  73. package/build/util/validations.d.ts +30 -21
  74. package/build/util/validations.js +54 -55
  75. package/build/util/yaml.js +27 -4
  76. package/examples/manifests/azure-importer.yml +24 -0
  77. package/examples/manifests/basic-demo.yml +75 -0
  78. package/examples/manifests/basic.yml +27 -0
  79. package/examples/manifests/boavizta-pipeline.yml +85 -0
  80. package/examples/{impls/case-studies → manifests}/boavizta.yml +14 -14
  81. package/examples/{impls/test → manifests}/ccf.yml +9 -10
  82. package/examples/manifests/cim.yml +20 -0
  83. package/examples/manifests/cloud-metadata.yml +41 -0
  84. package/examples/manifests/co2js.yml +30 -0
  85. package/examples/manifests/coefficient.yml +23 -0
  86. package/examples/manifests/csv-export.yml +34 -0
  87. package/examples/manifests/e-mem.yml +21 -0
  88. package/examples/{impls/test → manifests}/e-net.yml +9 -8
  89. package/examples/manifests/generics.yml +71 -0
  90. package/examples/manifests/group-by.yml +48 -0
  91. package/examples/manifests/mock-observation.yml +33 -0
  92. package/examples/manifests/multiply.yml +23 -0
  93. package/examples/manifests/nesting-demo.yml +89 -0
  94. package/examples/manifests/nesting.yml +215 -0
  95. package/examples/manifests/pipeline-demo-1.yml +85 -0
  96. package/examples/manifests/pipeline-demo-2.yml +149 -0
  97. package/examples/manifests/pipeline-demo.yml +128 -0
  98. package/examples/manifests/pipeline-teads-sci.yml +82 -0
  99. package/examples/manifests/pipeline-with-generics.yml +147 -0
  100. package/examples/manifests/pipeline-with-mocks.yml +146 -0
  101. package/examples/{impls/test → manifests}/sci-e.yml +6 -8
  102. package/examples/manifests/sci-m.yml +23 -0
  103. package/examples/{impls/test → manifests}/sci-o.yml +10 -10
  104. package/examples/{impls/test → manifests}/sci.yml +10 -9
  105. package/examples/manifests/shell.yml +20 -0
  106. package/examples/manifests/sum.yml +23 -0
  107. package/examples/{impls/test → manifests}/tdp-finder.yml +6 -7
  108. package/examples/manifests/teads-aws.yml +22 -0
  109. package/examples/manifests/teads-curve.yml +20 -0
  110. package/examples/manifests/time-sync.yml +32 -0
  111. package/examples/manifests/watt-time.yml +42 -0
  112. package/jest.config.js +6 -1
  113. package/package.json +13 -8
  114. package/src/__tests__/integration/templates/integration.yaml +16 -0
  115. package/src/models/README.md +9 -7
  116. package/tsconfig.test.json +1 -1
  117. package/Makefile +0 -16
  118. package/build/config/units.yaml +0 -112
  119. package/build/lib/models-universe.d.ts +0 -36
  120. package/build/lib/models-universe.js +0 -113
  121. package/build/lib/observatory.d.ts +0 -20
  122. package/build/lib/observatory.js +0 -31
  123. package/build/lib/planet-aggregator.d.ts +0 -6
  124. package/build/lib/planet-aggregator.js +0 -35
  125. package/build/lib/supercomputer.d.ts +0 -37
  126. package/build/lib/supercomputer.js +0 -148
  127. package/build/types/helpers.d.ts +0 -1
  128. package/build/types/helpers.js +0 -3
  129. package/build/types/impl.d.ts +0 -45
  130. package/build/types/impl.js +0 -5
  131. package/build/types/model-interface.d.ts +0 -14
  132. package/build/types/model-interface.js +0 -3
  133. package/build/types/models-universe.d.ts +0 -23
  134. package/build/types/models-universe.js +0 -3
  135. package/build/types/planet-aggregator.d.ts +0 -6
  136. package/build/types/planet-aggregator.js +0 -3
  137. package/build/types/supercomputer.d.ts +0 -4
  138. package/build/types/supercomputer.js +0 -3
  139. package/build/types/units-dealer.d.ts +0 -3
  140. package/build/types/units-dealer.js +0 -3
  141. package/build/types/units.d.ts +0 -11
  142. package/build/types/units.js +0 -37
  143. package/build/util/units-dealer.d.ts +0 -10
  144. package/build/util/units-dealer.js +0 -32
  145. package/coverage/clover.xml +0 -379
  146. package/coverage/coverage-final.json +0 -14
  147. package/coverage/lcov-report/base.css +0 -224
  148. package/coverage/lcov-report/block-navigation.js +0 -87
  149. package/coverage/lcov-report/config/config.ts.html +0 -250
  150. package/coverage/lcov-report/config/index.html +0 -146
  151. package/coverage/lcov-report/config/index.ts.html +0 -91
  152. package/coverage/lcov-report/config/strings.ts.html +0 -208
  153. package/coverage/lcov-report/favicon.png +0 -0
  154. package/coverage/lcov-report/index.html +0 -161
  155. package/coverage/lcov-report/lib/index.html +0 -161
  156. package/coverage/lcov-report/lib/models-universe.ts.html +0 -517
  157. package/coverage/lcov-report/lib/observatory.ts.html +0 -187
  158. package/coverage/lcov-report/lib/planet-aggregator.ts.html +0 -274
  159. package/coverage/lcov-report/lib/supercomputer.ts.html +0 -472
  160. package/coverage/lcov-report/models/index.html +0 -131
  161. package/coverage/lcov-report/models/index.ts.html +0 -88
  162. package/coverage/lcov-report/models/planet-aggregator.ts.html +0 -271
  163. package/coverage/lcov-report/models/time-sync.ts.html +0 -1165
  164. package/coverage/lcov-report/prettify.css +0 -1
  165. package/coverage/lcov-report/prettify.js +0 -2
  166. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  167. package/coverage/lcov-report/sorter.js +0 -196
  168. package/coverage/lcov-report/util/args.ts.html +0 -289
  169. package/coverage/lcov-report/util/errors.ts.html +0 -166
  170. package/coverage/lcov-report/util/index.html +0 -161
  171. package/coverage/lcov-report/util/units-dealer.ts.html +0 -199
  172. package/coverage/lcov-report/util/yaml.ts.html +0 -193
  173. package/coverage/lcov.info +0 -637
  174. package/examples/impls/case-studies/accenture.yml +0 -155
  175. package/examples/impls/case-studies/aggregation.yml +0 -97
  176. package/examples/impls/case-studies/aveva.yaml +0 -48
  177. package/examples/impls/case-studies/azure-yassine.yaml +0 -67
  178. package/examples/impls/case-studies/dow_msft.yml +0 -173
  179. package/examples/impls/case-studies/farm-insights.yaml +0 -35
  180. package/examples/impls/case-studies/gsf-website.yaml +0 -93
  181. package/examples/impls/case-studies/msft-eshoppen.yaml +0 -162
  182. package/examples/impls/case-studies/msft-green-ai.yaml +0 -58
  183. package/examples/impls/case-studies/ntt-data-on-premise.yaml +0 -201
  184. package/examples/impls/test/aggregation-test.yml +0 -109
  185. package/examples/impls/test/azure.yml +0 -26
  186. package/examples/impls/test/if-demo.yml +0 -61
  187. package/examples/impls/test/large-impl.yml +0 -257303
  188. package/examples/impls/test/metadata.yml +0 -21
  189. package/examples/impls/test/nesting.yml +0 -113
  190. package/examples/impls/test/sci-m.yml +0 -24
  191. package/examples/impls/test/shell.yml +0 -19
  192. package/examples/impls/test/time-sync.yml +0 -75
  193. package/examples/ompls/aggregation-test.yml +0 -340
  194. package/examples/ompls/azure.yml +0 -145
  195. package/examples/ompls/ccf.yml +0 -29
  196. package/examples/ompls/complex-pipeline.yml +0 -105
  197. package/examples/ompls/full-sci.yml +0 -64
  198. package/examples/ompls/if-demo.yml +0 -517
  199. package/examples/ompls/metadata.yml +0 -29
  200. package/examples/ompls/nesting.yml +0 -113
  201. package/examples/ompls/sci-e.yml +0 -23
  202. package/examples/ompls/sci-m.yml +0 -33
  203. package/examples/ompls/sci-o.yml +0 -29
  204. package/examples/ompls/sci.yml +0 -37
  205. package/examples/ompls/shell.yml +0 -23
  206. package/examples/ompls/time-sync.yml +0 -212
  207. package/src/config/units.yaml +0 -112
  208. package/tsconfig.build.tsbuildinfo +0 -1
@@ -2,16 +2,16 @@ name: sci-o-demo
2
2
  description:
3
3
  tags:
4
4
  initialize:
5
- models:
6
- - name: sci-e
5
+ plugins:
6
+ sci-e:
7
7
  kind: plugin
8
- model: SciEModel
9
- path: "@grnsft/if-models"
10
- - name: sci-o
8
+ method: SciE
9
+ path: "@grnsft/if-plugins"
10
+ sci-o:
11
11
  verbose: false
12
- model: SciOModel
13
- path: "@grnsft/if-models"
14
- graph:
12
+ method: SciO
13
+ path: "@grnsft/if-plugins"
14
+ tree:
15
15
  children:
16
16
  child:
17
17
  pipeline:
@@ -22,5 +22,5 @@ graph:
22
22
  inputs:
23
23
  - timestamp: 2023-08-06T00:00
24
24
  duration: 3600
25
- energy-cpu: 0.001
26
- grid-carbon-intensity: 800
25
+ cpu/energy: 0.001
26
+ grid/carbon-intensity: 800
@@ -2,25 +2,26 @@ name: sci-demo
2
2
  description: example invoking sci model
3
3
  tags:
4
4
  initialize:
5
- models:
6
- - name: sci
5
+ plugins:
6
+ sci:
7
7
  kind: plugin
8
- model: SciModel
9
- path: "@grnsft/if-models"
10
- graph:
8
+ method: Sci
9
+ path: "@grnsft/if-plugins"
10
+ # global-config:
11
+ # functional-unit-time: 1 minute
12
+ tree:
11
13
  children:
12
14
  child:
13
15
  pipeline:
14
16
  - sci
15
17
  config:
16
18
  sci:
17
- functional-unit-duration: 1
18
- functional-unit-time: "1 minute"
19
+ functional-unit-time: 1 sec
19
20
  functional-unit: requests # factor to convert per time to per f.unit
20
21
  inputs:
21
22
  - timestamp: 2023-07-06T00:00
22
23
  duration: 3600
23
24
  energy: 5
24
- operational-carbon: 5
25
- embodied-carbon: 0.02
25
+ carbon-operational: 5
26
+ carbon-embodied: 0.02
26
27
  requests: 100
@@ -0,0 +1,20 @@
1
+ name: shell-demo
2
+ description: example impl invoking shell model
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ shell:
7
+ method: Shell
8
+ path: "@grnsft/if-plugins"
9
+ global-config:
10
+ command: python3 /usr/local/bin/sampler
11
+ tree:
12
+ children:
13
+ child:
14
+ pipeline:
15
+ - shell
16
+ inputs:
17
+ - timestamp: "2023-11-02T10:35:31.820Z"
18
+ duration: 3600
19
+ cpu/energy: 0.002
20
+ memory/energy: 0.000005
@@ -0,0 +1,23 @@
1
+ name: sci-e-demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ sum:
7
+ method: Sum
8
+ path: "@grnsft/if-plugins"
9
+ global-config:
10
+ input-parameters: ["cpu/energy", "network/energy"]
11
+ output-parameter: "energy"
12
+ tree:
13
+ children:
14
+ child:
15
+ pipeline:
16
+ - sum
17
+ config:
18
+ sum:
19
+ inputs:
20
+ - timestamp: 2023-08-06T00:00
21
+ duration: 3600
22
+ cpu/energy: 0.001
23
+ network/energy: 0.001
@@ -2,18 +2,17 @@ name: tdp-finder
2
2
  description: demo
3
3
  tags:
4
4
  initialize:
5
- models:
6
- - name: tdp-finder # a model that returns an embodied value given the sci embodied attribution equation.
7
- model: TdpFinderModel
8
- path: "@grnsft/if-models"
9
- graph:
5
+ plugins:
6
+ tdp-finder: # a model that returns an embodied value given the sci embodied attribution equation.
7
+ method: TdpFinder
8
+ path: "@grnsft/if-plugins"
9
+ tree:
10
10
  children:
11
11
  child:
12
- pipeline:
12
+ pipeline:
13
13
  - tdp-finder
14
14
  config:
15
15
  inputs:
16
16
  - timestamp: 2023-07-06T00:00
17
17
  duration: 300
18
18
  physical-processor: AMD 3020e
19
-
@@ -0,0 +1,22 @@
1
+ name: teads-aws
2
+ description: simple demo invoking TeadsAWS model
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ teads-aws:
7
+ method: TeadsAWS
8
+ path: "@grnsft/if-unofficial-plugins"
9
+ global-config:
10
+ interpolation: linear
11
+ tree:
12
+ children:
13
+ child:
14
+ pipeline:
15
+ - teads-aws # duration & config -> embodied
16
+ defaults:
17
+ cloud/instance-type: m5n.large
18
+ cpu/expected-lifespan: 252288000
19
+ inputs:
20
+ - timestamp: 2023-07-06T00:00
21
+ duration: 3600
22
+ cpu/utilization: 10
@@ -0,0 +1,20 @@
1
+ name: teads-curve
2
+ description: simple demo invoking teads-curve
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ teads-curve:
7
+ method: TeadsCurve
8
+ path: "@grnsft/if-unofficial-plugins"
9
+ global-config:
10
+ interpolation: spline
11
+ tree:
12
+ children:
13
+ child:
14
+ pipeline:
15
+ - teads-curve
16
+ inputs:
17
+ - timestamp: 2023-07-06T00:00
18
+ duration: 3600
19
+ cpu/utilization: 50
20
+ cpu/thermal-design-power: 100
@@ -0,0 +1,32 @@
1
+ name: time-sync-demo
2
+ description:
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ 'time-sync':
7
+ method: TimeSync
8
+ path: "builtin"
9
+ global-config:
10
+ start-time: '2023-12-12T00:00:00.000Z'
11
+ end-time: '2023-12-12T00:01:00.000Z'
12
+ interval: 5
13
+ allow-padding: true
14
+ tree:
15
+ children:
16
+ child:
17
+ pipeline:
18
+ - time-sync
19
+ config:
20
+ inputs:
21
+ - timestamp: '2023-12-12T00:00:00.000Z'
22
+ duration: 1
23
+ energy-cpu: 0.001
24
+ - timestamp: '2023-12-12T00:00:01.000Z'
25
+ duration: 5
26
+ energy-cpu: 0.001
27
+ - timestamp: '2023-12-12T00:00:06.000Z'
28
+ duration: 7
29
+ energy-cpu: 0.001
30
+ - timestamp: '2023-12-12T00:00:13.000Z'
31
+ duration: 30
32
+ energy-cpu: 0.001
@@ -0,0 +1,42 @@
1
+ name: watt-time-demo
2
+ description: null
3
+ tags: null
4
+ initialize:
5
+ plugins:
6
+ mock-observations:
7
+ path: "@grnsft/if-plugins"
8
+ method: MockObservations
9
+ global-config:
10
+ timestamp-from: 2024-02-26T00:00
11
+ timestamp-to: 2024-02-26T00:10
12
+ duration: 60
13
+ components:
14
+ - cloud/instance-type: Standard_A1_v2
15
+ - cloud/instance-type: Standard_A2_v2
16
+ generators:
17
+ common:
18
+ cloud/vendor: azure
19
+ cloud/region: uk-west
20
+ geolocation: 37.7749,-122.4194
21
+ randint:
22
+ cpu/utilization:
23
+ min: 1
24
+ max: 99
25
+ watttime:
26
+ path: "@grnsft/if-unofficial-plugins"
27
+ method: WattTimeGridEmissions
28
+ tree:
29
+ children:
30
+ application:
31
+ pipeline:
32
+ - mock-observations
33
+ - watttime
34
+ config:
35
+ inputs:
36
+ - timestamp: "2024-02-26 00:00:00"
37
+ duration: 60
38
+ cloud/instance-type: Standard_A1_v2
39
+ cloud/vendor: azure
40
+ cloud/region: uk-west
41
+ geolocation: 37.7749,-122.4194
42
+ cpu/utilization: 15
package/jest.config.js CHANGED
@@ -10,5 +10,10 @@ module.exports = {
10
10
  },
11
11
  ],
12
12
  },
13
- modulePathIgnorePatterns: ['./build', './src/__tests__/unit/lib/impls'],
13
+ modulePathIgnorePatterns: [
14
+ './build',
15
+ './src/__tests__/unit/lib/manifest',
16
+ './src/__tests__/integration/helpers',
17
+ './src/__tests__/integration/test-data',
18
+ ],
14
19
  };
package/package.json CHANGED
@@ -1,24 +1,25 @@
1
1
  {
2
2
  "name": "@grnsft/if",
3
3
  "description": "Impact Framework",
4
- "version": "v0.1.8",
4
+ "version": "v0.2.0",
5
5
  "author": {
6
6
  "name": "Green Software Foundation",
7
7
  "email": "info@gsf.com"
8
8
  },
9
9
  "bin": {
10
- "impact-engine": "./build/index.js"
10
+ "if": "./build/index.js"
11
11
  },
12
12
  "bugs": {
13
13
  "url": "https://github.com/Green-Software-Foundation/if/issues/new?assignees=&labels=feedback&projects=&template=feedback.md&title=Feedback+-+"
14
14
  },
15
15
  "dependencies": {
16
- "copyfiles": "^2.4.1",
16
+ "@commitlint/cli": "^18.6.0",
17
+ "@commitlint/config-conventional": "^18.6.0",
17
18
  "js-yaml": "^4.1.0",
18
- "moment": "^2.29.4",
19
- "moment-range": "^4.0.2",
19
+ "luxon": "^3.4.4",
20
20
  "ts-command-line-args": "^2.5.1",
21
21
  "typescript": "^5.1.6",
22
+ "winston": "^3.11.0",
22
23
  "zod": "^3.22.4"
23
24
  },
24
25
  "devDependencies": {
@@ -27,9 +28,11 @@
27
28
  "@jest/globals": "^29.6.1",
28
29
  "@types/jest": "^29.5.7",
29
30
  "@types/js-yaml": "^4.0.5",
31
+ "@types/luxon": "^3.4.2",
30
32
  "@types/node": "^20.8.9",
31
33
  "fixpack": "^4.0.0",
32
34
  "gts": "^5.0.0",
35
+ "husky": "^8.0.0",
33
36
  "jest": "^29.6.1",
34
37
  "ts-jest": "^29.1.1"
35
38
  },
@@ -55,14 +58,16 @@
55
58
  "url": "https://github.com/Green-Software-Foundation/if"
56
59
  },
57
60
  "scripts": {
58
- "build": "rm -rf build && tsc --project tsconfig.build.json && copyfiles -u 2 src/config/units.yaml build/config",
61
+ "build": "rm -rf build && tsc --project tsconfig.build.json",
59
62
  "coverage": "jest --verbose --coverage",
60
63
  "fix": "gts fix",
61
64
  "fix:package": "fixpack",
62
- "impact-engine": "npx ts-node src/index.ts",
65
+ "if": "npx ts-node src/index.ts",
63
66
  "lint": "gts lint",
67
+ "prepare": "husky install",
64
68
  "prepublish": "npm run build",
65
- "test": "jest --verbose"
69
+ "test": "jest --verbose --testPathPattern=src/__tests__/unit",
70
+ "test:integration": "jest --verbose --testPathPattern=src/__tests__/integration"
66
71
  },
67
72
  "stability": "stable",
68
73
  "types": "src/index.d.ts"
@@ -0,0 +1,16 @@
1
+ name: integration-template
2
+ description:
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ 'sci-e':
7
+ model: ${model}
8
+ path: ${path}
9
+ tree:
10
+ children:
11
+ child:
12
+ pipeline:
13
+ - ${name}
14
+ config:
15
+ inputs:
16
+ - ${input}
@@ -10,6 +10,7 @@ The following should be defined in the model initialization:
10
10
  - `start-time`: global start time as ISO 8061 string
11
11
  - `stop`: global end time as ISO 8061 string
12
12
  - `interval`: temporal resolution in seconds
13
+ - `error-on-padding`: avoid zero/'zeroish' padding (if needed) and error out instead. `False` by defult.
13
14
 
14
15
  ### Inputs:
15
16
 
@@ -114,6 +115,7 @@ The end result of this gap-filling is that we have continuous 1 second resolutio
114
115
  {timestamp: 2023-12-12T00:00:09.000Z, duration: 1, cpu-util: 12, carbon: 2.5, energy: 5, grid-carbon-intensity: 471}
115
116
  ]
116
117
  ```
118
+ Note that when `error-on-padding` is `true` no gap-filling is performed and the model will error out instead.
117
119
 
118
120
  #### Trimming and padding
119
121
 
@@ -149,7 +151,7 @@ For example, for `startTime = 2023-12-12T00:00:00.000Z` and `endTime = 2023-12-1
149
151
 
150
152
  ]
151
153
  ```
152
-
154
+ Note that when `error-on-padding` is `true` no padding is performed and the model will error out instead.
153
155
 
154
156
  #### Resampling rules
155
157
 
@@ -199,8 +201,8 @@ const results = timeSyncModel.execute([
199
201
 
200
202
  IEF users will typically call the model as part of a pipeline defined in an `impl`
201
203
  file. In this case, instantiating and configuring the model is handled by
202
- `impact-engine` and does not have to be done explicitly by the user.
203
- The following is an example `impl` that calls `time-sync`:
204
+ `if` and does not have to be done explicitly by the user.
205
+ The following is an example `manifest` that calls `time-sync`:
204
206
 
205
207
  ```yaml
206
208
  name: time-sync-demo
@@ -210,16 +212,16 @@ initialize:
210
212
  models:
211
213
  - name: teads-curve
212
214
  model: TeadsCurveModel
213
- path: "@grnsft/if-unofficial-models"
215
+ path: "@grnsft/if-unofficial-plugins"
214
216
  - name: sci-e
215
217
  model: SciEModel
216
- path: "@grnsft/if-models"
218
+ path: "@grnsft/if-plugins"
217
219
  - name: sci-m
218
- path: "@grnsft/if-models"
220
+ path: "@grnsft/if-plugins"
219
221
  model: SciMModel
220
222
  - name: sci-o
221
223
  model: SciOModel
222
- path: "@grnsft/if-models"
224
+ path: "@grnsft/if-plugins"
223
225
  - name: time-synchronization
224
226
  model: TimeSyncModel
225
227
  path: builtin
@@ -9,7 +9,7 @@
9
9
  "experimentalDecorators": true,
10
10
  "incremental": true,
11
11
  "lib": [
12
- "es2020"
12
+ "ES2021"
13
13
  ],
14
14
  "module": "CommonJS",
15
15
  "noEmitOnError": true,
package/Makefile DELETED
@@ -1,16 +0,0 @@
1
-
2
-
3
- #Converts the CSV files from CCF Coefficients Database to JSON.
4
- ccf-data:
5
- cat third-party/ccf-coefficients/data/aws-instances.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/aws-instances.json
6
- cat third-party/ccf-coefficients/output/coefficients-aws-use.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/aws-use.json
7
- cat third-party/ccf-coefficients/output/coefficients-aws-embodied.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/aws-embodied.json
8
- cat third-party/ccf-coefficients/data/gcp-instances.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/gcp-instances.json
9
- cat third-party/ccf-coefficients/output/coefficients-gcp-use.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/gcp-use.json
10
- cat third-party/ccf-coefficients/output/coefficients-gcp-embodied.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/gcp-embodied.json
11
- cat third-party/ccf-coefficients/data/azure-instances.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/azure-instances.json
12
- cat third-party/ccf-coefficients/output/coefficients-azure-use.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/azure-use.json
13
- cat third-party/ccf-coefficients/output/coefficients-azure-embodied.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/azure-embodied.json
14
-
15
- install-shell-imp:
16
- cp src/lib/shell-imp/sampler /usr/local/bin/sampler
@@ -1,112 +0,0 @@
1
- carbon:
2
- description: an amount of carbon emitted into the atmosphere
3
- unit: gCO2e
4
- aggregation: sum
5
- core-units:
6
- description: number of cores available
7
- unit: cores
8
- aggregation: none
9
- cpu-util:
10
- description: refers to CPU utilization.
11
- unit: percentage
12
- aggregation: avg
13
- disk-io:
14
- description: refers to GB of data written/read from disk
15
- unit: GB
16
- aggregation: sum
17
- duration:
18
- description: refers to the duration of the input
19
- unit: seconds
20
- aggregation: sum
21
- energy:
22
- description: amount of energy utilised by the component
23
- unit: kWh
24
- aggregation: sum
25
- energy-cpu:
26
- description: Energy consumed by the CPU of the component
27
- unit: kWh
28
- aggregation: sum
29
- expected-lifespan:
30
- description: Total Expected Lifespan of the Component in Seconds
31
- unit: seconds
32
- aggregation: sum
33
- energy-memory:
34
- description: Energy consumed by the Memory of the component
35
- unit: kWh
36
- aggregation: sum
37
- embodied-carbon:
38
- description: Embodied Emissions of the component
39
- unit: gCO2e
40
- aggregation: sum
41
- energy-network:
42
- description: Energy consumed by the Network of the component
43
- unit: kWh
44
- aggregation: sum
45
- functional-unit:
46
- description: the name of the functional unit in which the final SCI value should be expressed, e.g. requests, users
47
- unit: none
48
- aggregation: sum
49
- functional-unit-time:
50
- description: string describing the unit of time in which the final SCI calculation should be expressed, e.g. "1-min"
51
- unit: none
52
- aggregation: none
53
- gpu-util:
54
- description: refers to CPU utilization.
55
- unit: percentage
56
- aggregation: avg
57
- grid-carbon-intensity:
58
- description: Carbon intensity for the grid
59
- unit: gCO2eq/kWh
60
- aggregation: avg
61
- instance-type:
62
- description: Type of Cloud Instance name used in the cloud provider APIs
63
- unit: None
64
- aggregation: None
65
- location:
66
- description: Geographic location of provider as string (for watt-time model it is provided as latitude and longitude, comma separated, in decimal degrees)
67
- unit: None (decimal degrees for watt-time model)
68
- aggregation: None
69
- operational-carbon:
70
- description: Operational Emissions of the component
71
- unit: gCO2e
72
- aggregation: sum
73
- physical-processor:
74
- description: Name of the physical processor
75
- unit: None
76
- aggregation: none
77
- vendor:
78
- description: Name of the cloud service provider in the ccf model. Can be aws, gcp or azure
79
- unit: None
80
- aggregation: none
81
- ram-alloc:
82
- description: refers to GB of memory allocated.
83
- unit: GB
84
- aggregation: avg
85
- ram-util:
86
- description: refers to percentage of memory utilized.
87
- unit: percentage
88
- aggregation: avg
89
- resources-reserved:
90
- description: resources reserved for an application
91
- unit: count
92
- aggregation: none
93
- thermal-design-power:
94
- description: thermal design power for a processor
95
- unit: kwh
96
- aggregation: avg
97
- total-embodied-emissions:
98
- description: total embodied emissions of some component
99
- unit: gCO2e
100
- aggregation: sum
101
- timestamp:
102
- description: refers to the time of occurrence of the input
103
- unit: RFC3339
104
- aggregation: none
105
- time-reserved:
106
- description: time reserved for a component
107
- unit: seconds
108
- aggregation: none
109
- total-resources:
110
- description: total resources available
111
- unit: count
112
- aggregation: none
@@ -1,36 +0,0 @@
1
- import { ImplInitializeModel, InitalizedModels } from '../types/models-universe';
2
- /**
3
- * Models Initialization Lifecycle.
4
- */
5
- export declare class ModelsUniverse {
6
- /**
7
- * Models list.
8
- */
9
- initalizedModels: InitalizedModels;
10
- /**
11
- * Checks if model is instance of `IOutputModelInterface`.
12
- */
13
- private instanceOfModel;
14
- /**
15
- * Imports module by given `path`.
16
- */
17
- private importModuleFrom;
18
- /**
19
- * Imports `module` from given `path`, then checks if it's `ModelPluginInterface` extension.
20
- */
21
- private importAndVerifyModule;
22
- /**
23
- * Returns plugin model. Checks if model is missing then rejects with error.
24
- * Then checks if `path` is starting with github, then grabs the repository name.
25
- * Imports module, then checks if it's a class which implements input model interface.
26
- */
27
- private handModel;
28
- /**
29
- * Initializes and registers model.
30
- */
31
- writeDown(modelToInitalize: ImplInitializeModel): Promise<InitalizedModels>;
32
- /**
33
- * Returns existing model by `name`.
34
- */
35
- getInitializedModel(modelName: string, config: any): Promise<import("../types/model-interface").ModelPluginInterface>;
36
- }