@grnsft/if 0.5.0 → 0.6.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.
- package/README.md +5 -17
- package/Refactor-migration-guide.md +110 -164
- package/build/common/config/index.d.ts +1 -0
- package/build/common/config/index.js +6 -0
- package/build/common/config/strings.d.ts +8 -0
- package/build/common/config/strings.js +16 -0
- package/build/common/lib/load.d.ts +6 -0
- package/build/common/lib/load.js +18 -0
- package/build/{types → common/types}/manifest.d.ts +4 -1
- package/build/common/types/manifest.js +3 -0
- package/build/common/util/debug-logger.js +115 -0
- package/build/common/util/fs.js +94 -0
- package/build/common/util/helpers.d.ts +15 -0
- package/build/common/util/helpers.js +80 -0
- package/build/{util → common/util}/logger.js +1 -1
- package/build/{util → common/util}/validations.d.ts +149 -47
- package/build/common/util/validations.js +141 -0
- package/build/common/util/yaml.js +59 -0
- package/build/if-check/config/config.d.ts +6 -0
- package/build/if-check/config/config.js +31 -0
- package/build/{config → if-check/config}/index.d.ts +0 -1
- package/build/if-check/config/index.js +8 -0
- package/build/if-check/config/strings.d.ts +12 -0
- package/build/if-check/config/strings.js +16 -0
- package/build/if-check/index.js +98 -0
- package/build/if-check/types/process-args.d.ts +4 -0
- package/build/if-check/types/process-args.js +3 -0
- package/build/if-check/util/args.d.ts +10 -0
- package/build/if-check/util/args.js +56 -0
- package/build/if-check/util/helpers.d.ts +4 -0
- package/build/if-check/util/helpers.js +18 -0
- package/build/if-check/util/npm.d.ts +4 -0
- package/build/if-check/util/npm.js +59 -0
- package/build/if-csv/config/config.d.ts +6 -0
- package/build/if-csv/config/config.js +37 -0
- package/build/if-csv/config/index.d.ts +2 -0
- package/build/if-csv/config/index.js +8 -0
- package/build/if-csv/config/strings.d.ts +4 -0
- package/build/if-csv/config/strings.js +8 -0
- package/build/if-csv/index.js +63 -0
- package/build/if-csv/types/csv.d.ts +7 -0
- package/build/if-csv/types/csv.js +3 -0
- package/build/if-csv/types/process-args.d.ts +5 -0
- package/build/if-csv/types/process-args.js +3 -0
- package/build/if-csv/util/args.d.ts +12 -0
- package/build/if-csv/util/args.js +51 -0
- package/build/if-csv/util/helpers.d.ts +9 -0
- package/build/if-csv/util/helpers.js +95 -0
- package/build/if-diff/config/config.d.ts +6 -0
- package/build/if-diff/config/config.js +31 -0
- package/build/if-diff/config/index.d.ts +2 -0
- package/build/if-diff/config/index.js +8 -0
- package/build/if-diff/config/strings.d.ts +6 -0
- package/build/if-diff/config/strings.js +10 -0
- package/build/if-diff/index.js +46 -0
- package/build/{lib → if-diff/lib}/compare.d.ts +1 -1
- package/build/if-diff/lib/compare.js +56 -0
- package/build/{lib → if-diff/lib}/load.d.ts +16 -18
- package/build/if-diff/lib/load.js +51 -0
- package/build/if-diff/types/args.js +3 -0
- package/build/if-diff/types/compare.js +3 -0
- package/build/if-diff/types/process-args.d.ts +4 -0
- package/build/if-diff/types/process-args.js +3 -0
- package/build/if-diff/util/args.d.ts +5 -0
- package/build/if-diff/util/args.js +51 -0
- package/build/if-diff/util/helpers.d.ts +13 -0
- package/build/if-diff/util/helpers.js +75 -0
- package/build/if-env/config/config.d.ts +6 -0
- package/build/if-env/config/config.js +37 -0
- package/build/if-env/config/index.d.ts +2 -0
- package/build/if-env/config/index.js +8 -0
- package/build/if-env/config/strings.d.ts +7 -0
- package/build/if-env/config/strings.js +11 -0
- package/build/if-env/index.js +40 -0
- package/build/if-env/types/if-env.js +3 -0
- package/build/if-env/types/npm.js +3 -0
- package/build/if-env/types/process-args.d.ts +5 -0
- package/build/if-env/types/process-args.js +3 -0
- package/build/if-env/util/args.d.ts +12 -0
- package/build/if-env/util/args.js +47 -0
- package/build/if-env/util/helpers.d.ts +20 -0
- package/build/if-env/util/helpers.js +94 -0
- package/build/{util → if-env/util}/npm.d.ts +0 -4
- package/build/if-env/util/npm.js +126 -0
- package/build/if-run/builtins/coefficient/index.d.ts +2 -0
- package/build/if-run/builtins/coefficient/index.js +67 -0
- package/build/if-run/builtins/copy-param/index.d.ts +2 -0
- package/build/if-run/builtins/copy-param/index.js +70 -0
- package/build/if-run/builtins/csv-lookup/index.d.ts +2 -0
- package/build/if-run/builtins/csv-lookup/index.js +190 -0
- package/build/if-run/builtins/divide/index.d.ts +2 -0
- package/build/if-run/builtins/divide/index.js +80 -0
- package/build/if-run/builtins/exponent/index.d.ts +2 -0
- package/build/if-run/builtins/exponent/index.js +60 -0
- package/build/{builtins → if-run/builtins}/export-log.d.ts +1 -1
- package/build/{builtins → if-run/builtins}/export-log.js +1 -1
- package/build/{builtins → if-run/builtins}/export-yaml.d.ts +1 -1
- package/build/if-run/builtins/export-yaml.js +30 -0
- package/build/{builtins → if-run/builtins}/index.d.ts +1 -2
- package/build/{builtins → if-run/builtins}/index.js +4 -6
- package/build/if-run/builtins/interpolation/index.d.ts +2 -0
- package/build/if-run/builtins/interpolation/index.js +151 -0
- package/build/if-run/builtins/mock-observations/helpers/common-generator.js +29 -0
- package/build/if-run/builtins/mock-observations/helpers/rand-int-generator.js +48 -0
- package/build/if-run/builtins/mock-observations/index.d.ts +2 -0
- package/build/if-run/builtins/mock-observations/index.js +116 -0
- package/build/if-run/builtins/mock-observations/interfaces/index.js +3 -0
- package/build/if-run/builtins/multiply/index.d.ts +2 -0
- package/build/if-run/builtins/multiply/index.js +59 -0
- package/build/if-run/builtins/regex/index.d.ts +2 -0
- package/build/if-run/builtins/regex/index.js +76 -0
- package/build/if-run/builtins/sci/config.js +44 -0
- package/build/if-run/builtins/sci/index.d.ts +2 -0
- package/build/if-run/builtins/sci/index.js +92 -0
- package/build/if-run/builtins/sci-embodied/index.d.ts +2 -0
- package/build/if-run/builtins/sci-embodied/index.js +156 -0
- package/build/if-run/builtins/shell/index.d.ts +2 -0
- package/build/if-run/builtins/shell/index.js +60 -0
- package/build/if-run/builtins/subtract/index.d.ts +2 -0
- package/build/if-run/builtins/subtract/index.js +61 -0
- package/build/if-run/builtins/sum/index.d.ts +2 -0
- package/build/if-run/builtins/sum/index.js +66 -0
- package/build/if-run/builtins/time-sync/index.d.ts +17 -0
- package/build/if-run/builtins/time-sync/index.js +339 -0
- package/build/if-run/config/config.d.ts +9 -0
- package/build/if-run/config/config.js +73 -0
- package/build/if-run/config/index.d.ts +2 -0
- package/build/if-run/config/index.js +8 -0
- package/build/{config → if-run/config}/strings.d.ts +28 -54
- package/build/if-run/config/strings.js +76 -0
- package/build/if-run/index.d.ts +2 -0
- package/build/if-run/index.js +63 -0
- package/build/if-run/lib/aggregate.d.ts +15 -0
- package/build/if-run/lib/aggregate.js +123 -0
- package/build/if-run/lib/compute.js +136 -0
- package/build/{lib → if-run/lib}/environment.d.ts +1 -1
- package/build/if-run/lib/environment.js +75 -0
- package/build/{lib → if-run/lib}/exhaust.d.ts +1 -1
- package/build/if-run/lib/exhaust.js +27 -0
- package/build/if-run/lib/explain.d.ts +9 -0
- package/build/if-run/lib/explain.js +43 -0
- package/build/if-run/lib/initialize.d.ts +6 -0
- package/build/if-run/lib/initialize.js +109 -0
- package/build/if-run/lib/regroup.d.ts +5 -0
- package/build/if-run/lib/regroup.js +64 -0
- package/build/if-run/types/aggregation.d.ts +5 -0
- package/build/if-run/types/aggregation.js +6 -0
- package/build/{types → if-run/types}/compute.d.ts +12 -8
- package/build/if-run/types/compute.js +3 -0
- package/build/if-run/types/environment.js +3 -0
- package/build/{types → if-run/types}/exhaust-plugin-interface.d.ts +1 -1
- package/build/if-run/types/exhaust-plugin-interface.js +3 -0
- package/build/if-run/types/explain.d.ts +10 -0
- package/build/if-run/types/explain.js +3 -0
- package/build/if-run/types/interface.d.ts +3 -0
- package/build/if-run/types/interface.js +6 -0
- package/build/if-run/types/plugin-storage.js +3 -0
- package/build/if-run/types/process-args.d.ts +25 -0
- package/build/if-run/types/process-args.js +3 -0
- package/build/if-run/types/time-sync.js +3 -0
- package/build/{util → if-run/util}/aggregation-helper.d.ts +2 -1
- package/build/if-run/util/aggregation-helper.js +47 -0
- package/build/if-run/util/args.d.ts +9 -0
- package/build/if-run/util/args.js +60 -0
- package/build/if-run/util/helpers.d.ts +14 -0
- package/build/if-run/util/helpers.js +57 -0
- package/build/if-run/util/log-memoize.js +19 -0
- package/build/if-run/util/os-checker.js +97 -0
- package/build/{util → if-run/util}/plugin-storage.d.ts +1 -1
- package/build/if-run/util/plugin-storage.js +34 -0
- package/jest.config.js +2 -6
- package/manifests/examples/builtins/coefficient/failure-invalid-config-input-param.yml +2 -2
- package/manifests/examples/builtins/coefficient/failure-output-param-is-null.yaml +3 -3
- package/manifests/examples/builtins/coefficient/success.yml +2 -2
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +3 -3
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +3 -3
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yml +3 -3
- package/manifests/examples/builtins/csv-lookup/cloud-metadata/success.yml +3 -3
- package/manifests/examples/builtins/csv-lookup/region-metadata/failure-missing-column.yml +3 -3
- package/manifests/examples/builtins/csv-lookup/region-metadata/failure-missing-output.yml +3 -3
- package/manifests/examples/builtins/csv-lookup/region-metadata/success-renaming.yml +4 -4
- package/manifests/examples/builtins/csv-lookup/region-metadata/success.yml +3 -3
- package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yml +2 -2
- package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +2 -2
- package/manifests/examples/builtins/csv-lookup/tdp-finder/success.yml +2 -2
- package/manifests/examples/builtins/divide/failure-denominator-equal-zero.yml +4 -4
- package/manifests/examples/builtins/divide/failure-invalid-config-denominator.yml +5 -5
- package/manifests/examples/builtins/divide/failure-missing-numerator.yml +4 -4
- package/manifests/examples/builtins/divide/success.yml +4 -6
- package/manifests/examples/builtins/exponent/success.yml +5 -7
- package/manifests/examples/builtins/interpolation/interpolation.yml +2 -2
- package/manifests/examples/builtins/interpolation/success.yml +2 -1
- package/manifests/examples/builtins/mock-observations/failure-invalid-config-cpu-range.yml +2 -2
- package/manifests/examples/builtins/mock-observations/failure-invalid-memory-utilization-range.yml +2 -2
- package/manifests/examples/builtins/mock-observations/failure-missing-timestamp-from-param.yml +2 -2
- package/manifests/examples/builtins/mock-observations/success.yml +2 -2
- package/manifests/examples/builtins/multiply/failure-input-parameter-is-missing.yml +2 -4
- package/manifests/examples/builtins/multiply/success-with-multiple-inputs.yml +2 -4
- package/manifests/examples/builtins/multiply/success.yml +3 -4
- package/manifests/examples/builtins/regex/failure-missing-input-param.yml +2 -4
- package/manifests/examples/builtins/regex/failure-not-matching-with-regex.yml +2 -4
- package/manifests/examples/builtins/regex/success.yml +2 -4
- package/manifests/examples/builtins/sci/failure-invalid-config-value.yml +2 -2
- package/manifests/examples/builtins/sci/failure-missing-input-param.yml +3 -2
- package/manifests/examples/builtins/sci/success.yml +2 -3
- package/manifests/examples/builtins/sci-embodied/failure-invalid-default-emission-value.yml +3 -3
- package/manifests/examples/builtins/sci-embodied/failure-missing-expected-lifespan.yml +2 -2
- package/manifests/examples/builtins/sci-embodied/success.yml +2 -2
- package/manifests/examples/builtins/shell/failure-invalid-command.yml +2 -2
- package/manifests/examples/builtins/shell/success.yml +2 -1
- package/manifests/examples/builtins/subtract/success.yml +6 -8
- package/manifests/examples/builtins/sum/failure-missing-input-param.yml +2 -4
- package/manifests/examples/builtins/sum/failure-missing-output-param.yml +3 -5
- package/manifests/examples/builtins/sum/success.yml +2 -4
- package/manifests/examples/builtins/time-sync/failure-config-start-later-end.yml +3 -3
- package/manifests/examples/builtins/time-sync/failure-missing-global-config.yml +3 -3
- package/manifests/examples/builtins/time-sync/success.yml +2 -2
- package/manifests/examples/{builtins/groupby/failure-invalid-config-group.yml → features/regroup/failure-invalid-regroup.yml} +4 -11
- package/manifests/examples/{builtins/groupby → features/regroup}/failure-missing-cloud-instance-type.yml +5 -12
- package/manifests/examples/{builtins/groupby → features/regroup}/success.yml +4 -11
- package/manifests/examples/pipelines/generics.yml +12 -13
- package/manifests/examples/pipelines/instance-metadata.yml +4 -5
- package/manifests/examples/pipelines/nesting.yml +157 -50
- package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-aggregate.yaml +997 -0
- package/manifests/examples/pipelines/outputs-if-diff/pipeline-with-mocks.yaml +1059 -0
- package/manifests/examples/pipelines/pipeline-teads-sci.yml +11 -11
- package/manifests/examples/pipelines/pipeline-with-aggregate.yml +114 -37
- package/manifests/examples/pipelines/pipeline-with-mocks.yml +193 -103
- package/manifests/examples/pipelines/scenario-1.yml +34 -0
- package/manifests/examples/pipelines/scenario-2.yml +52 -0
- package/manifests/examples/pipelines/scenario-3.yml +86 -0
- package/manifests/examples/pipelines/scenario-4.yml +46 -0
- package/manifests/examples/pipelines/scenario-5.yml +46 -0
- package/manifests/examples/pipelines/sci.yml +15 -17
- package/manifests/examples/pipelines/teads-curve.yml +7 -6
- package/manifests/examples/pipelines/zeros.yml +15 -16
- package/manifests/outputs/bugs/aggregation-error-wrong-metric.yaml +51 -59
- package/manifests/outputs/bugs/input-error-missing-duration.yaml +14 -16
- package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +14 -16
- package/manifests/outputs/bugs/pipeline-error-naming-mismatch.yaml +14 -16
- package/manifests/outputs/bugs/pipeline-error-uninitialized-plugin.yaml +15 -17
- package/manifests/outputs/bugs/pipeline-ordering-error.yaml +23 -26
- package/manifests/outputs/bugs/sci-embodied-missing-resources-total.yaml +13 -14
- package/manifests/outputs/{plugins → builtins}/coefficient/failure-invalid-config-input-param.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/coefficient/failure-output-param-is-null.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/coefficient/success.yaml +11 -16
- package/manifests/outputs/builtins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +76 -0
- package/manifests/outputs/{plugins → builtins}/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yaml +16 -19
- package/manifests/outputs/{plugins → builtins}/csv-lookup/cloud-metadata/success.yaml +16 -19
- package/manifests/outputs/{plugins → builtins}/csv-lookup/region-metadata/failure-missing-column.yaml +14 -15
- package/manifests/outputs/{plugins → builtins}/csv-lookup/region-metadata/failure-missing-output.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/csv-lookup/region-metadata/success-renaming.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/csv-lookup/region-metadata/success.yaml +14 -16
- package/manifests/outputs/{plugins → builtins}/csv-lookup/tdp-finder/failure-missing-input-param.yaml +13 -16
- package/manifests/outputs/{plugins → builtins}/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/csv-lookup/tdp-finder/success.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/divide/failure-invalid-config-denominator.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/divide/failure-missing-numerator.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/divide/success-denominator-equal-zero.yaml +14 -18
- package/manifests/outputs/{plugins → builtins}/divide/success.yaml +14 -18
- package/manifests/outputs/{plugins → builtins}/exponent/success.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/interpolation/interpolation.yaml +14 -16
- package/manifests/outputs/{plugins → builtins}/interpolation/success.yaml +14 -16
- package/manifests/outputs/{plugins → builtins}/mock-observations/failure-invalid-config-cpu-range.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/mock-observations/failure-invalid-memory-utilization-range.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/mock-observations/failure-missing-timestamp-from-param.yaml +13 -15
- package/manifests/outputs/builtins/mock-observations/success.yaml +358 -0
- package/manifests/outputs/{plugins → builtins}/multiply/failure-input-parameter-is-missing.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/multiply/success-with-multiple-inputs.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/multiply/success.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/regex/failure-missing-input-param.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/regex/success.yaml +14 -19
- package/manifests/outputs/{plugins → builtins}/sci/failure-invalid-config-value.yaml +14 -16
- package/manifests/outputs/{plugins → builtins}/sci/failure-missing-input-param.yaml +13 -15
- package/manifests/outputs/{plugins/sci/success.yml.yaml → builtins/sci/success.yaml} +13 -16
- package/manifests/outputs/{plugins → builtins}/sci-embodied/failure-invalid-default-emission-value.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/sci-embodied/failure-missing-expected-lifespan.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/sci-embodied/success.yaml +13 -15
- package/manifests/outputs/{plugins → builtins}/shell/failure-invalid-command.yaml +14 -16
- package/manifests/outputs/{plugins → builtins}/shell/success.yaml +14 -16
- package/manifests/outputs/{plugins → builtins}/subtract/success.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/sum/failure-missing-input-param.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/sum/failure-missing-output-param.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/sum/success.yaml +13 -17
- package/manifests/outputs/{plugins → builtins}/time-sync/failure-config-start-later-end.yaml +20 -23
- package/manifests/outputs/{plugins → builtins}/time-sync/success.yaml +38 -35
- package/manifests/outputs/features/aggregate-failure-invalid-metrics.yaml +17 -18
- package/manifests/outputs/features/aggregate-failure-missing-metric-in-inputs.yaml +17 -18
- package/manifests/outputs/features/aggregate-horizontal.yaml +27 -23
- package/manifests/outputs/features/aggregate-vertical.yaml +33 -29
- package/manifests/outputs/features/aggregate.yaml +33 -29
- package/manifests/outputs/{plugins/groupby/failure-invalid-config-group.yaml → features/failure-invalid-regroup.yaml} +16 -25
- package/manifests/outputs/{plugins/groupby → features}/failure-missing-cloud-instance-type.yaml +16 -25
- package/manifests/outputs/pipelines/cloud-metadata-divide.yaml +14 -18
- package/manifests/outputs/pipelines/generics.yaml +239 -0
- package/manifests/outputs/pipelines/instance-metadata.yaml +98 -0
- package/manifests/outputs/pipelines/mock-obs-time-sync.yaml +246 -147
- package/manifests/outputs/pipelines/nesting.yaml +1799 -0
- package/manifests/outputs/pipelines/pipeline-teads-sci.yaml +276 -0
- package/manifests/outputs/pipelines/sci.yaml +297 -0
- package/manifests/outputs/pipelines/teads-curve.yaml +188 -0
- package/manifests/outputs/pipelines/zeros.yaml +198 -0
- package/package.json +15 -16
- package/src/__mocks__/mock-manifest.yaml +2 -3
- package/src/{config → if-env/config}/env-template.yml +2 -3
- package/src/{builtins → if-run/builtins}/coefficient/README.md +31 -9
- package/src/{builtins → if-run/builtins}/copy-param/README.md +30 -11
- package/src/{builtins → if-run/builtins}/csv-lookup/README.md +32 -20
- package/src/{builtins → if-run/builtins}/divide/README.md +21 -8
- package/src/{builtins → if-run/builtins}/exponent/README.md +19 -8
- package/src/{builtins → if-run/builtins}/interpolation/README.md +21 -6
- package/src/{builtins → if-run/builtins}/mock-observations/README.md +18 -4
- package/src/{builtins → if-run/builtins}/multiply/README.md +20 -8
- package/src/{builtins → if-run/builtins}/regex/README.md +19 -9
- package/src/{builtins → if-run/builtins}/sci/README.md +19 -9
- package/src/{builtins → if-run/builtins}/sci-embodied/README.md +17 -5
- package/src/{builtins → if-run/builtins}/shell/README.md +19 -7
- package/src/{builtins → if-run/builtins}/subtract/README.md +17 -6
- package/src/{builtins → if-run/builtins}/sum/README.md +34 -8
- package/src/if-run/builtins/time-sync/README.md +267 -0
- package/build/builtins/coefficient/index.d.ts +0 -2
- package/build/builtins/coefficient/index.js +0 -65
- package/build/builtins/copy-param/index.d.ts +0 -2
- package/build/builtins/copy-param/index.js +0 -68
- package/build/builtins/csv-lookup/index.d.ts +0 -2
- package/build/builtins/csv-lookup/index.js +0 -188
- package/build/builtins/divide/index.d.ts +0 -2
- package/build/builtins/divide/index.js +0 -78
- package/build/builtins/exponent/index.d.ts +0 -2
- package/build/builtins/exponent/index.js +0 -58
- package/build/builtins/export-csv-raw.d.ts +0 -4
- package/build/builtins/export-csv-raw.js +0 -132
- package/build/builtins/export-csv.d.ts +0 -10
- package/build/builtins/export-csv.js +0 -96
- package/build/builtins/export-yaml.js +0 -30
- package/build/builtins/group-by.d.ts +0 -5
- package/build/builtins/group-by.js +0 -71
- package/build/builtins/interpolation/index.d.ts +0 -2
- package/build/builtins/interpolation/index.js +0 -148
- package/build/builtins/mock-observations/helpers/common-generator.js +0 -29
- package/build/builtins/mock-observations/helpers/rand-int-generator.js +0 -48
- package/build/builtins/mock-observations/index.d.ts +0 -2
- package/build/builtins/mock-observations/index.js +0 -114
- package/build/builtins/mock-observations/interfaces/index.js +0 -3
- package/build/builtins/multiply/index.d.ts +0 -2
- package/build/builtins/multiply/index.js +0 -57
- package/build/builtins/regex/index.d.ts +0 -2
- package/build/builtins/regex/index.js +0 -74
- package/build/builtins/sci/config.js +0 -44
- package/build/builtins/sci/index.d.ts +0 -2
- package/build/builtins/sci/index.js +0 -70
- package/build/builtins/sci-embodied/index.d.ts +0 -2
- package/build/builtins/sci-embodied/index.js +0 -114
- package/build/builtins/shell/index.d.ts +0 -2
- package/build/builtins/shell/index.js +0 -58
- package/build/builtins/subtract/index.d.ts +0 -2
- package/build/builtins/subtract/index.js +0 -59
- package/build/builtins/sum/index.d.ts +0 -2
- package/build/builtins/sum/index.js +0 -64
- package/build/builtins/time-sync.d.ts +0 -2
- package/build/builtins/time-sync.js +0 -300
- package/build/check.js +0 -95
- package/build/config/config.d.ts +0 -29
- package/build/config/config.js +0 -147
- package/build/config/index.js +0 -10
- package/build/config/params.d.ts +0 -2
- package/build/config/params.js +0 -196
- package/build/config/strings.js +0 -105
- package/build/diff.js +0 -46
- package/build/env.js +0 -38
- package/build/index.js +0 -48
- package/build/lib/aggregate.d.ts +0 -6
- package/build/lib/aggregate.js +0 -77
- package/build/lib/compare.js +0 -56
- package/build/lib/compute.js +0 -91
- package/build/lib/environment.js +0 -75
- package/build/lib/exhaust.js +0 -53
- package/build/lib/initialize.d.ts +0 -6
- package/build/lib/initialize.js +0 -101
- package/build/lib/load.js +0 -70
- package/build/lib/parameterize.d.ts +0 -6
- package/build/lib/parameterize.js +0 -55
- package/build/types/aggregation.d.ts +0 -2
- package/build/types/aggregation.js +0 -5
- package/build/types/compute.js +0 -3
- package/build/types/environment.js +0 -3
- package/build/types/exhaust-plugin-interface.js +0 -3
- package/build/types/if-env.js +0 -3
- package/build/types/interface.d.ts +0 -4
- package/build/types/interface.js +0 -8
- package/build/types/lib/compare.js +0 -3
- package/build/types/manifest.js +0 -3
- package/build/types/npm.js +0 -3
- package/build/types/parameters.d.ts +0 -5
- package/build/types/parameters.js +0 -5
- package/build/types/plugin-storage.js +0 -3
- package/build/types/process-args.d.ts +0 -33
- package/build/types/process-args.js +0 -3
- package/build/types/time-sync.js +0 -3
- package/build/types/util/args.js +0 -3
- package/build/util/aggregation-helper.js +0 -55
- package/build/util/args.d.ts +0 -37
- package/build/util/args.js +0 -205
- package/build/util/debug-logger.js +0 -118
- package/build/util/fs.js +0 -94
- package/build/util/helpers.d.ts +0 -57
- package/build/util/helpers.js +0 -251
- package/build/util/json.d.ts +0 -4
- package/build/util/json.js +0 -36
- package/build/util/log-memoize.js +0 -19
- package/build/util/npm.js +0 -152
- package/build/util/os-checker.js +0 -97
- package/build/util/plugin-storage.js +0 -34
- package/build/util/validations.js +0 -124
- package/build/util/yaml.js +0 -59
- package/manifests/outputs/bugs/initialize-error-no-config.yaml +0 -78
- package/manifests/outputs/bugs/initialize-error-no-path.yaml +0 -91
- package/manifests/outputs/bugs/initialize-error-no-plugins.yaml +0 -74
- package/manifests/outputs/divide.yaml +0 -93
- package/manifests/outputs/pipelines/mock-obs-group-by-cloud-meta.yaml +0 -645
- package/manifests/outputs/pipelines/mock-obs-groupby.yaml +0 -178
- package/manifests/outputs/plugins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +0 -27
- package/manifests/outputs/plugins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +0 -27
- package/manifests/outputs/plugins/groupby/success.yaml +0 -101
- package/manifests/outputs/plugins/mock-observations/success.yaml +0 -220
- package/manifests/outputs/plugins/regex/failure-not-matching-with-regex.yaml +0 -76
- package/manifests/outputs/plugins/time-sync/failure-missing-global-config.yaml +0 -78
- package/src/__tests__/integration/templates/integration.yaml +0 -16
- package/src/builtins/README.md +0 -848
- /package/build/{util → common/util}/debug-logger.d.ts +0 -0
- /package/build/{util → common/util}/fs.d.ts +0 -0
- /package/build/{util → common/util}/logger.d.ts +0 -0
- /package/build/{util → common/util}/yaml.d.ts +0 -0
- /package/build/{index.d.ts → if-check/index.d.ts} +0 -0
- /package/build/{check.d.ts → if-csv/index.d.ts} +0 -0
- /package/build/{diff.d.ts → if-diff/index.d.ts} +0 -0
- /package/build/{types/util → if-diff/types}/args.d.ts +0 -0
- /package/build/{types/lib → if-diff/types}/compare.d.ts +0 -0
- /package/build/{env.d.ts → if-env/index.d.ts} +0 -0
- /package/build/{types → if-env/types}/if-env.d.ts +0 -0
- /package/build/{types → if-env/types}/npm.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/mock-observations/helpers/common-generator.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/mock-observations/helpers/rand-int-generator.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/mock-observations/interfaces/index.d.ts +0 -0
- /package/build/{builtins → if-run/builtins}/sci/config.d.ts +0 -0
- /package/build/{lib → if-run/lib}/compute.d.ts +0 -0
- /package/build/{types → if-run/types}/environment.d.ts +0 -0
- /package/build/{types → if-run/types}/plugin-storage.d.ts +0 -0
- /package/build/{types → if-run/types}/time-sync.d.ts +0 -0
- /package/build/{util → if-run/util}/log-memoize.d.ts +0 -0
- /package/build/{util → if-run/util}/os-checker.d.ts +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
name: carbon-intensity plugin demo
|
|
2
|
+
description: null
|
|
3
|
+
tags: null
|
|
4
|
+
initialize:
|
|
5
|
+
plugins:
|
|
6
|
+
interpolate:
|
|
7
|
+
path: builtin
|
|
8
|
+
method: Interpolation
|
|
9
|
+
global-config:
|
|
10
|
+
method: linear
|
|
11
|
+
x:
|
|
12
|
+
- 0
|
|
13
|
+
- 10
|
|
14
|
+
- 50
|
|
15
|
+
- 100
|
|
16
|
+
'y':
|
|
17
|
+
- 0.12
|
|
18
|
+
- 0.32
|
|
19
|
+
- 0.75
|
|
20
|
+
- 1.02
|
|
21
|
+
input-parameter: cpu/utilization
|
|
22
|
+
output-parameter: cpu-factor
|
|
23
|
+
cpu-factor-to-wattage:
|
|
24
|
+
path: builtin
|
|
25
|
+
method: Multiply
|
|
26
|
+
global-config:
|
|
27
|
+
input-parameters:
|
|
28
|
+
- cpu-factor
|
|
29
|
+
- thermal-design-power
|
|
30
|
+
output-parameter: cpu-wattage
|
|
31
|
+
wattage-times-duration:
|
|
32
|
+
path: builtin
|
|
33
|
+
method: Multiply
|
|
34
|
+
global-config:
|
|
35
|
+
input-parameters:
|
|
36
|
+
- cpu-wattage
|
|
37
|
+
- duration
|
|
38
|
+
output-parameter: cpu-wattage-times-duration
|
|
39
|
+
wattage-to-energy-kwh:
|
|
40
|
+
path: builtin
|
|
41
|
+
method: Divide
|
|
42
|
+
global-config:
|
|
43
|
+
numerator: cpu-wattage-times-duration
|
|
44
|
+
denominator: 3600000
|
|
45
|
+
output: cpu-energy-raw
|
|
46
|
+
calculate-vcpu-ratio:
|
|
47
|
+
path: builtin
|
|
48
|
+
method: Divide
|
|
49
|
+
global-config:
|
|
50
|
+
numerator: vcpus-total
|
|
51
|
+
denominator: vcpus-allocated
|
|
52
|
+
output: vcpu-ratio
|
|
53
|
+
correct-cpu-energy-for-vcpu-ratio:
|
|
54
|
+
path: builtin
|
|
55
|
+
method: Divide
|
|
56
|
+
global-config:
|
|
57
|
+
numerator: cpu-energy-raw
|
|
58
|
+
denominator: vcpu-ratio
|
|
59
|
+
output: cpu-energy-kwh
|
|
60
|
+
execution:
|
|
61
|
+
command: >-
|
|
62
|
+
/Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
|
|
63
|
+
/Users/mariamkhalatova/Projects/UK/if/src/if-run/index.ts -m
|
|
64
|
+
manifests/examples/pipelines/teads-curve.yml -o
|
|
65
|
+
manifests/outputs/pipelines/teads-curve
|
|
66
|
+
environment:
|
|
67
|
+
if-version: 0.5.0
|
|
68
|
+
os: macOS
|
|
69
|
+
os-version: '14.5'
|
|
70
|
+
node-version: 18.14.2
|
|
71
|
+
date-time: 2024-07-19T06:35:33.728Z (UTC)
|
|
72
|
+
dependencies:
|
|
73
|
+
- '@babel/core@7.22.10'
|
|
74
|
+
- '@babel/preset-typescript@7.23.3'
|
|
75
|
+
- '@commitlint/cli@18.6.0'
|
|
76
|
+
- '@commitlint/config-conventional@18.6.0'
|
|
77
|
+
- '@grnsft/if-core@0.0.10'
|
|
78
|
+
- '@jest/globals@29.7.0'
|
|
79
|
+
- '@types/jest@29.5.8'
|
|
80
|
+
- '@types/js-yaml@4.0.9'
|
|
81
|
+
- '@types/luxon@3.4.2'
|
|
82
|
+
- '@types/node@20.9.0'
|
|
83
|
+
- axios-mock-adapter@1.22.0
|
|
84
|
+
- axios@1.7.2
|
|
85
|
+
- cross-env@7.0.3
|
|
86
|
+
- csv-parse@5.5.6
|
|
87
|
+
- csv-stringify@6.4.6
|
|
88
|
+
- fixpack@4.0.0
|
|
89
|
+
- gts@5.2.0
|
|
90
|
+
- husky@8.0.3
|
|
91
|
+
- jest@29.7.0
|
|
92
|
+
- js-yaml@4.1.0
|
|
93
|
+
- lint-staged@15.2.2
|
|
94
|
+
- luxon@3.4.4
|
|
95
|
+
- release-it@16.3.0
|
|
96
|
+
- rimraf@5.0.5
|
|
97
|
+
- ts-command-line-args@2.5.1
|
|
98
|
+
- ts-jest@29.1.1
|
|
99
|
+
- typescript-cubic-spline@1.0.1
|
|
100
|
+
- typescript@5.2.2
|
|
101
|
+
- winston@3.11.0
|
|
102
|
+
- zod@3.22.4
|
|
103
|
+
status: success
|
|
104
|
+
tree:
|
|
105
|
+
children:
|
|
106
|
+
child:
|
|
107
|
+
pipeline:
|
|
108
|
+
compute:
|
|
109
|
+
- interpolate
|
|
110
|
+
- cpu-factor-to-wattage
|
|
111
|
+
- wattage-times-duration
|
|
112
|
+
- wattage-to-energy-kwh
|
|
113
|
+
- calculate-vcpu-ratio
|
|
114
|
+
- correct-cpu-energy-for-vcpu-ratio
|
|
115
|
+
defaults:
|
|
116
|
+
thermal-design-power: 100
|
|
117
|
+
vcpus-total: 8
|
|
118
|
+
vcpus-allocated: 2
|
|
119
|
+
inputs:
|
|
120
|
+
- timestamp: 2023-08-06T00:00
|
|
121
|
+
duration: 360
|
|
122
|
+
cpu/utilization: 1
|
|
123
|
+
carbon: 30
|
|
124
|
+
- timestamp: 2023-09-06T00:00
|
|
125
|
+
duration: 360
|
|
126
|
+
carbon: 30
|
|
127
|
+
cpu/utilization: 10
|
|
128
|
+
- timestamp: 2023-10-06T00:00
|
|
129
|
+
duration: 360
|
|
130
|
+
carbon: 30
|
|
131
|
+
cpu/utilization: 50
|
|
132
|
+
- timestamp: 2023-10-06T00:00
|
|
133
|
+
duration: 360
|
|
134
|
+
carbon: 30
|
|
135
|
+
cpu/utilization: 100
|
|
136
|
+
outputs:
|
|
137
|
+
- timestamp: 2023-08-06T00:00
|
|
138
|
+
duration: 360
|
|
139
|
+
cpu/utilization: 1
|
|
140
|
+
carbon: 30
|
|
141
|
+
thermal-design-power: 100
|
|
142
|
+
vcpus-total: 8
|
|
143
|
+
vcpus-allocated: 2
|
|
144
|
+
cpu-factor: 0.13999999999999999
|
|
145
|
+
cpu-wattage: 13.999999999999998
|
|
146
|
+
cpu-wattage-times-duration: 5039.999999999999
|
|
147
|
+
cpu-energy-raw: 0.0013999999999999998
|
|
148
|
+
vcpu-ratio: 4
|
|
149
|
+
cpu-energy-kwh: 0.00034999999999999994
|
|
150
|
+
- timestamp: 2023-09-06T00:00
|
|
151
|
+
duration: 360
|
|
152
|
+
carbon: 30
|
|
153
|
+
cpu/utilization: 10
|
|
154
|
+
thermal-design-power: 100
|
|
155
|
+
vcpus-total: 8
|
|
156
|
+
vcpus-allocated: 2
|
|
157
|
+
cpu-factor: 0.32
|
|
158
|
+
cpu-wattage: 32
|
|
159
|
+
cpu-wattage-times-duration: 11520
|
|
160
|
+
cpu-energy-raw: 0.0032
|
|
161
|
+
vcpu-ratio: 4
|
|
162
|
+
cpu-energy-kwh: 0.0008
|
|
163
|
+
- timestamp: 2023-10-06T00:00
|
|
164
|
+
duration: 360
|
|
165
|
+
carbon: 30
|
|
166
|
+
cpu/utilization: 50
|
|
167
|
+
thermal-design-power: 100
|
|
168
|
+
vcpus-total: 8
|
|
169
|
+
vcpus-allocated: 2
|
|
170
|
+
cpu-factor: 0.75
|
|
171
|
+
cpu-wattage: 75
|
|
172
|
+
cpu-wattage-times-duration: 27000
|
|
173
|
+
cpu-energy-raw: 0.0075
|
|
174
|
+
vcpu-ratio: 4
|
|
175
|
+
cpu-energy-kwh: 0.001875
|
|
176
|
+
- timestamp: 2023-10-06T00:00
|
|
177
|
+
duration: 360
|
|
178
|
+
carbon: 30
|
|
179
|
+
cpu/utilization: 100
|
|
180
|
+
thermal-design-power: 100
|
|
181
|
+
vcpus-total: 8
|
|
182
|
+
vcpus-allocated: 2
|
|
183
|
+
cpu-factor: 1.02
|
|
184
|
+
cpu-wattage: 102
|
|
185
|
+
cpu-wattage-times-duration: 36720
|
|
186
|
+
cpu-energy-raw: 0.0102
|
|
187
|
+
vcpu-ratio: 4
|
|
188
|
+
cpu-energy-kwh: 0.00255
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
name: generics
|
|
2
|
+
description: >-
|
|
3
|
+
a pipeline that does arbitrary calculations using our generic arithmetic
|
|
4
|
+
builtins
|
|
5
|
+
tags: null
|
|
6
|
+
initialize:
|
|
7
|
+
plugins:
|
|
8
|
+
sum-zero-and-one:
|
|
9
|
+
path: builtin
|
|
10
|
+
method: Sum
|
|
11
|
+
global-config:
|
|
12
|
+
input-parameters:
|
|
13
|
+
- some-value
|
|
14
|
+
- zero-value
|
|
15
|
+
output-parameter: one-plus-zero
|
|
16
|
+
sum-zero-and-zero:
|
|
17
|
+
path: builtin
|
|
18
|
+
method: Sum
|
|
19
|
+
global-config:
|
|
20
|
+
input-parameters:
|
|
21
|
+
- zero-value
|
|
22
|
+
- zero-value
|
|
23
|
+
output-parameter: zero-plus-zero
|
|
24
|
+
subtract-one-and-zero:
|
|
25
|
+
path: builtin
|
|
26
|
+
method: Subtract
|
|
27
|
+
global-config:
|
|
28
|
+
input-parameters:
|
|
29
|
+
- some-value
|
|
30
|
+
- zero-value
|
|
31
|
+
output-parameter: one-minus-zero
|
|
32
|
+
subtract-zero-and-zero:
|
|
33
|
+
path: builtin
|
|
34
|
+
method: Sum
|
|
35
|
+
global-config:
|
|
36
|
+
input-parameters:
|
|
37
|
+
- zero-value
|
|
38
|
+
- zero-value
|
|
39
|
+
output-parameter: zero-minus-zero
|
|
40
|
+
subtract-zero-and-one:
|
|
41
|
+
path: builtin
|
|
42
|
+
method: Subtract
|
|
43
|
+
global-config:
|
|
44
|
+
input-parameters:
|
|
45
|
+
- zero-value
|
|
46
|
+
- some-value
|
|
47
|
+
output-parameter: zero-minus-one
|
|
48
|
+
coefficient-one-times-zero:
|
|
49
|
+
path: builtin
|
|
50
|
+
method: Coefficient
|
|
51
|
+
global-config:
|
|
52
|
+
input-parameter: zero-value
|
|
53
|
+
coefficient: 1
|
|
54
|
+
output-parameter: zero-times-one-coefficient
|
|
55
|
+
coefficient-zero-times-one:
|
|
56
|
+
path: builtin
|
|
57
|
+
method: Coefficient
|
|
58
|
+
global-config:
|
|
59
|
+
input-parameter: some-value
|
|
60
|
+
coefficient: 0
|
|
61
|
+
output-parameter: one-times-zero-coefficient
|
|
62
|
+
coefficient-zero-times-zero:
|
|
63
|
+
path: builtin
|
|
64
|
+
method: Coefficient
|
|
65
|
+
global-config:
|
|
66
|
+
input-parameter: zero-value
|
|
67
|
+
coefficient: 0
|
|
68
|
+
output-parameter: zero-times-zero-coefficient
|
|
69
|
+
multiply-one-times-zero:
|
|
70
|
+
path: builtin
|
|
71
|
+
method: Multiply
|
|
72
|
+
global-config:
|
|
73
|
+
input-parameters:
|
|
74
|
+
- some-value
|
|
75
|
+
- zero-value
|
|
76
|
+
output-parameter: one-times-zero
|
|
77
|
+
multiply-zero-times-one:
|
|
78
|
+
path: builtin
|
|
79
|
+
method: Multiply
|
|
80
|
+
global-config:
|
|
81
|
+
input-parameters:
|
|
82
|
+
- zero-value
|
|
83
|
+
- zero-value
|
|
84
|
+
output-parameter: zero-times-one
|
|
85
|
+
exponent-one-to-zero:
|
|
86
|
+
path: builtin
|
|
87
|
+
method: Exponent
|
|
88
|
+
global-config:
|
|
89
|
+
input-parameter: some-value
|
|
90
|
+
exponent: 0
|
|
91
|
+
output-parameter: one-raised-to-zero-power
|
|
92
|
+
exponent-zero-to-zero:
|
|
93
|
+
path: builtin
|
|
94
|
+
method: Exponent
|
|
95
|
+
global-config:
|
|
96
|
+
input-parameter: zero-value
|
|
97
|
+
exponent: 0
|
|
98
|
+
output-parameter: zero-raised-to-zero-power
|
|
99
|
+
exponent-zero-to-one:
|
|
100
|
+
path: builtin
|
|
101
|
+
method: Exponent
|
|
102
|
+
global-config:
|
|
103
|
+
input-parameter: zero-value
|
|
104
|
+
exponent: 1
|
|
105
|
+
output-parameter: zero-raised-to-first-power
|
|
106
|
+
sci:
|
|
107
|
+
path: builtin
|
|
108
|
+
method: Sci
|
|
109
|
+
global-config:
|
|
110
|
+
functional-unit: zero-value
|
|
111
|
+
execution:
|
|
112
|
+
command: >-
|
|
113
|
+
/Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
|
|
114
|
+
/Users/mariamkhalatova/Projects/UK/if/src/if-run/index.ts -m
|
|
115
|
+
manifests/examples/pipelines/zeros.yml -o manifests/outputs/pipelines/zeros
|
|
116
|
+
environment:
|
|
117
|
+
if-version: 0.5.0
|
|
118
|
+
os: macOS
|
|
119
|
+
os-version: '14.5'
|
|
120
|
+
node-version: 18.14.2
|
|
121
|
+
date-time: 2024-07-19T06:36:00.790Z (UTC)
|
|
122
|
+
dependencies:
|
|
123
|
+
- '@babel/core@7.22.10'
|
|
124
|
+
- '@babel/preset-typescript@7.23.3'
|
|
125
|
+
- '@commitlint/cli@18.6.0'
|
|
126
|
+
- '@commitlint/config-conventional@18.6.0'
|
|
127
|
+
- '@grnsft/if-core@0.0.10'
|
|
128
|
+
- '@jest/globals@29.7.0'
|
|
129
|
+
- '@types/jest@29.5.8'
|
|
130
|
+
- '@types/js-yaml@4.0.9'
|
|
131
|
+
- '@types/luxon@3.4.2'
|
|
132
|
+
- '@types/node@20.9.0'
|
|
133
|
+
- axios-mock-adapter@1.22.0
|
|
134
|
+
- axios@1.7.2
|
|
135
|
+
- cross-env@7.0.3
|
|
136
|
+
- csv-parse@5.5.6
|
|
137
|
+
- csv-stringify@6.4.6
|
|
138
|
+
- fixpack@4.0.0
|
|
139
|
+
- gts@5.2.0
|
|
140
|
+
- husky@8.0.3
|
|
141
|
+
- jest@29.7.0
|
|
142
|
+
- js-yaml@4.1.0
|
|
143
|
+
- lint-staged@15.2.2
|
|
144
|
+
- luxon@3.4.4
|
|
145
|
+
- release-it@16.3.0
|
|
146
|
+
- rimraf@5.0.5
|
|
147
|
+
- ts-command-line-args@2.5.1
|
|
148
|
+
- ts-jest@29.1.1
|
|
149
|
+
- typescript-cubic-spline@1.0.1
|
|
150
|
+
- typescript@5.2.2
|
|
151
|
+
- winston@3.11.0
|
|
152
|
+
- zod@3.22.4
|
|
153
|
+
status: success
|
|
154
|
+
tree:
|
|
155
|
+
children:
|
|
156
|
+
child-1:
|
|
157
|
+
pipeline:
|
|
158
|
+
compute:
|
|
159
|
+
- sum-zero-and-one
|
|
160
|
+
- sum-zero-and-zero
|
|
161
|
+
- subtract-one-and-zero
|
|
162
|
+
- subtract-zero-and-zero
|
|
163
|
+
- subtract-zero-and-one
|
|
164
|
+
- coefficient-one-times-zero
|
|
165
|
+
- coefficient-zero-times-one
|
|
166
|
+
- coefficient-zero-times-zero
|
|
167
|
+
- multiply-one-times-zero
|
|
168
|
+
- multiply-zero-times-one
|
|
169
|
+
- exponent-one-to-zero
|
|
170
|
+
- exponent-zero-to-one
|
|
171
|
+
- exponent-zero-to-zero
|
|
172
|
+
- sci
|
|
173
|
+
inputs:
|
|
174
|
+
- timestamp: '2023-12-12T00:00:00.000Z'
|
|
175
|
+
duration: 1
|
|
176
|
+
some-value: 1
|
|
177
|
+
zero-value: 0
|
|
178
|
+
carbon: 10
|
|
179
|
+
outputs:
|
|
180
|
+
- timestamp: '2023-12-12T00:00:00.000Z'
|
|
181
|
+
duration: 1
|
|
182
|
+
some-value: 1
|
|
183
|
+
zero-value: 0
|
|
184
|
+
carbon: 10
|
|
185
|
+
one-plus-zero: 1
|
|
186
|
+
zero-plus-zero: 0
|
|
187
|
+
one-minus-zero: 1
|
|
188
|
+
zero-minus-zero: 0
|
|
189
|
+
zero-minus-one: -1
|
|
190
|
+
zero-times-one-coefficient: 0
|
|
191
|
+
one-times-zero-coefficient: 0
|
|
192
|
+
zero-times-zero-coefficient: 0
|
|
193
|
+
one-times-zero: 0
|
|
194
|
+
zero-times-one: 0
|
|
195
|
+
one-raised-to-zero-power: 1
|
|
196
|
+
zero-raised-to-first-power: 0
|
|
197
|
+
zero-raised-to-zero-power: 1
|
|
198
|
+
sci: 10
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grnsft/if",
|
|
3
3
|
"description": "Impact Framework",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0-beta.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Green Software Foundation",
|
|
7
7
|
"email": "info@gsf.com"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"if-diff": "./build/diff.js",
|
|
11
|
-
"if-run": "./build/index.js",
|
|
12
|
-
"if-env": "./build/env.js",
|
|
13
|
-
"if-check": "./build/check.js"
|
|
10
|
+
"if-diff": "./build/if-diff/index.js",
|
|
11
|
+
"if-run": "./build/if-run/index.js",
|
|
12
|
+
"if-env": "./build/if-env/index.js",
|
|
13
|
+
"if-check": "./build/if-check/index.js",
|
|
14
|
+
"if-csv": "./build/if-csv/index.js"
|
|
14
15
|
},
|
|
15
16
|
"bugs": {
|
|
16
17
|
"url": "https://github.com/Green-Software-Foundation/if/issues/new?assignees=&labels=feedback&projects=&template=feedback.md&title=Feedback+-+"
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"@commitlint/cli": "^18.6.0",
|
|
20
21
|
"@commitlint/config-conventional": "^18.6.0",
|
|
21
|
-
"@grnsft/if-core": "^0.0.
|
|
22
|
+
"@grnsft/if-core": "^0.0.16",
|
|
22
23
|
"axios": "^1.7.2",
|
|
23
24
|
"csv-parse": "^5.5.6",
|
|
24
25
|
"csv-stringify": "^6.4.6",
|
|
@@ -63,7 +64,6 @@
|
|
|
63
64
|
"models"
|
|
64
65
|
],
|
|
65
66
|
"license": "MIT",
|
|
66
|
-
"main": "build/index.js",
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
@@ -73,21 +73,20 @@
|
|
|
73
73
|
"scripts": {
|
|
74
74
|
"build": "npm run clean && tsc --project tsconfig.build.json",
|
|
75
75
|
"clean": "rimraf build/",
|
|
76
|
-
"coverage": "jest --verbose --coverage --testPathPattern=src/__tests__/
|
|
76
|
+
"coverage": "jest --verbose --coverage --testPathPattern=src/__tests__/",
|
|
77
77
|
"fix": "gts fix",
|
|
78
78
|
"fix:package": "fixpack",
|
|
79
|
-
"if-check": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/check.ts",
|
|
80
|
-
"if-
|
|
81
|
-
"if-
|
|
82
|
-
"if-
|
|
79
|
+
"if-check": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-check/index.ts",
|
|
80
|
+
"if-csv": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-csv/index.ts",
|
|
81
|
+
"if-diff": "npx ts-node src/if-diff/index.ts",
|
|
82
|
+
"if-env": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/if-env/index.ts",
|
|
83
|
+
"if-run": "npx ts-node src/if-run/index.ts",
|
|
83
84
|
"lint": "gts lint",
|
|
84
85
|
"pre-commit": "lint-staged",
|
|
85
86
|
"prepare": "husky install",
|
|
86
87
|
"prepublish": "npm run build",
|
|
87
88
|
"release": "release-it",
|
|
88
|
-
"test": "jest --verbose --testPathPattern=src/__tests__/
|
|
89
|
-
"test:integration": "jest --verbose --testPathPattern=src/__tests__/integration"
|
|
89
|
+
"test": "jest --verbose --testPathPattern=src/__tests__/"
|
|
90
90
|
},
|
|
91
|
-
"stability": "stable"
|
|
92
|
-
"types": "src/index.d.ts"
|
|
91
|
+
"stability": "stable"
|
|
93
92
|
}
|
|
@@ -10,8 +10,6 @@ initialize:
|
|
|
10
10
|
input-parameter: memory/utilization
|
|
11
11
|
coefficient: 0.0001
|
|
12
12
|
output-parameter: memory/energy
|
|
13
|
-
outputs:
|
|
14
|
-
- yaml
|
|
15
13
|
execution:
|
|
16
14
|
command: >-
|
|
17
15
|
/Users/manushak/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
|
|
@@ -59,7 +57,8 @@ tree:
|
|
|
59
57
|
children:
|
|
60
58
|
child:
|
|
61
59
|
pipeline:
|
|
62
|
-
|
|
60
|
+
compute:
|
|
61
|
+
- memory-energy-from-memory-util
|
|
63
62
|
config: null
|
|
64
63
|
inputs:
|
|
65
64
|
- timestamp: 2023-12-12T00:00:00.000Z
|
|
@@ -2,8 +2,6 @@ name: template manifest # rename me!
|
|
|
2
2
|
description: auto-generated template # update description!
|
|
3
3
|
tags: # add any tags that will help you to track your manifests
|
|
4
4
|
initialize:
|
|
5
|
-
outputs:
|
|
6
|
-
- yaml # you can add - csv to export to csv
|
|
7
5
|
plugins: # add more plugins for your use-case
|
|
8
6
|
memory-energy-from-memory-util: # you can name this any way you like!
|
|
9
7
|
method: Coefficient # the name of the function exported from the plugin
|
|
@@ -16,7 +14,8 @@ tree:
|
|
|
16
14
|
children: # add a chile for each distinct component you want to measure
|
|
17
15
|
child:
|
|
18
16
|
pipeline: # the pipeline is an ordered list of plugins you want to execute
|
|
19
|
-
|
|
17
|
+
compute:
|
|
18
|
+
- memory-energy-from-memory-util # must match the name in initialize!
|
|
20
19
|
config: # any plugin specific, node-level config
|
|
21
20
|
inputs:
|
|
22
21
|
- timestamp: 2023-12-12T00:00:00.000Z # ISO 8061 string
|
|
@@ -16,6 +16,22 @@ Three parameters are required in global config: `input-parameter`, `coefficient`
|
|
|
16
16
|
- `coefficient`: the value to multiply `input-parameter` by.
|
|
17
17
|
- `output-parameter`: a string defining the name to use to add the product of the input parameters to the output array.
|
|
18
18
|
|
|
19
|
+
### Plugin parameter metadata
|
|
20
|
+
|
|
21
|
+
The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method`
|
|
22
|
+
of the parameters of the inputs and outputs
|
|
23
|
+
|
|
24
|
+
- `inputs`: describe parameters of the `input-parameter` of the global config. Each parameter has:
|
|
25
|
+
|
|
26
|
+
- `description`: description of the parameter
|
|
27
|
+
- `unit`: unit of the parameter
|
|
28
|
+
- `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
|
|
29
|
+
|
|
30
|
+
- `outputs`: describe parameters of the `output-parameter` of the global config. Each parameter has:
|
|
31
|
+
- `description`: description of the parameter
|
|
32
|
+
- `unit`: unit of the parameter
|
|
33
|
+
- `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
|
|
34
|
+
|
|
19
35
|
### Inputs
|
|
20
36
|
|
|
21
37
|
All of `input-parameters` must be available in the input array.
|
|
@@ -53,15 +69,13 @@ const result = coeff.execute([
|
|
|
53
69
|
|
|
54
70
|
## Example manifest
|
|
55
71
|
|
|
56
|
-
IF users will typically call the plugin as part of a pipeline defined in a manifest file. In this case, instantiating the plugin is handled by `
|
|
72
|
+
IF users will typically call the plugin as part of a pipeline defined in a manifest file. In this case, instantiating the plugin is handled by `if-run` and does not have to be done explicitly by the user. The following is an example manifest that calls `coefficient`:
|
|
57
73
|
|
|
58
74
|
```yaml
|
|
59
75
|
name: coefficient-demo
|
|
60
76
|
description:
|
|
61
77
|
tags:
|
|
62
78
|
initialize:
|
|
63
|
-
outputs:
|
|
64
|
-
- yaml
|
|
65
79
|
plugins:
|
|
66
80
|
coefficient:
|
|
67
81
|
method: Coefficient
|
|
@@ -70,13 +84,21 @@ initialize:
|
|
|
70
84
|
input-parameter: 'carbon'
|
|
71
85
|
coefficient: 3
|
|
72
86
|
output-parameter: 'carbon-product'
|
|
87
|
+
parameter-metadata:
|
|
88
|
+
inputs:
|
|
89
|
+
carbon:
|
|
90
|
+
description: "an amount of carbon emitted into the atmosphere"
|
|
91
|
+
unit: "gCO2e"
|
|
92
|
+
outputs:
|
|
93
|
+
carbon-product:
|
|
94
|
+
description: "a product of cabon property and the coefficient"
|
|
95
|
+
unit: "gCO2e"
|
|
73
96
|
tree:
|
|
74
97
|
children:
|
|
75
98
|
child:
|
|
76
99
|
pipeline:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
coefficient:
|
|
100
|
+
compute:
|
|
101
|
+
- coefficient
|
|
80
102
|
inputs:
|
|
81
103
|
- timestamp: 2023-08-06T00:00
|
|
82
104
|
duration: 3600
|
|
@@ -86,12 +108,11 @@ tree:
|
|
|
86
108
|
You can run this example by saving it as `./examples/manifests/coefficient.yml` and executing the following command from the project root:
|
|
87
109
|
|
|
88
110
|
```sh
|
|
89
|
-
if-run --manifest ./examples/manifests/coefficient.yml --output ./examples/outputs/coefficient
|
|
111
|
+
if-run --manifest ./examples/manifests/coefficient.yml --output ./examples/outputs/coefficient
|
|
90
112
|
```
|
|
91
113
|
|
|
92
114
|
The results will be saved to a new `yaml` file in `./examples/outputs`
|
|
93
115
|
|
|
94
|
-
|
|
95
116
|
## Errors
|
|
96
117
|
|
|
97
118
|
`Coefficient` exposes one of the IF error classes.
|
|
@@ -101,10 +122,11 @@ The results will be saved to a new `yaml` file in `./examples/outputs`
|
|
|
101
122
|
You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
|
|
102
123
|
|
|
103
124
|
The required parameters are:
|
|
125
|
+
|
|
104
126
|
- `input-parameter`: this must be a string
|
|
105
127
|
- `coefficient`: this must be a number
|
|
106
128
|
- `output-parameter`: this must be a string
|
|
107
129
|
|
|
108
130
|
You can fix this error by checking you are providing valid values for each parameter in the config.
|
|
109
131
|
|
|
110
|
-
For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors
|
|
132
|
+
For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors)
|
|
@@ -39,6 +39,21 @@ Three parameters are required in config: `from` and `to` and `keep-existing`.
|
|
|
39
39
|
`to`: a string defining the name to use to add the result of summing the input parameters to the output array.
|
|
40
40
|
`keep-existing`: toggles whether to keep or delete the copied parameter (defined in `to`)
|
|
41
41
|
|
|
42
|
+
### Plugin parameter metadata
|
|
43
|
+
|
|
44
|
+
The `parameter-metadata` section contains information about `description`, `unit` and `aggregation-method` of the parameters of the inputs and outputs
|
|
45
|
+
|
|
46
|
+
- `inputs`: describe the parameter of the `from` of the global config. The parameter has the following attributes:
|
|
47
|
+
|
|
48
|
+
- `description`: description of the parameter
|
|
49
|
+
- `unit`: unit of the parameter
|
|
50
|
+
- `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
|
|
51
|
+
|
|
52
|
+
- `outputs`: describe the parameters of the `to` of the global config. The parameter has the following attributes:
|
|
53
|
+
- `description`: description of the parameter
|
|
54
|
+
- `unit`: unit of the parameter
|
|
55
|
+
- `aggregation-method`: aggregation method of the parameter (it can be `sum`, `avg` or `none`)
|
|
56
|
+
|
|
42
57
|
### Inputs
|
|
43
58
|
|
|
44
59
|
As with all plugins, `timestamp` and `duration` are required. The key passed to `from` must exist in the `input` data.
|
|
@@ -47,24 +62,28 @@ As with all plugins, `timestamp` and `duration` are required. The key passed to
|
|
|
47
62
|
|
|
48
63
|
The plugin adds a new parameter with the name defined in `to` to the `input` data.
|
|
49
64
|
|
|
50
|
-
|
|
51
65
|
## Implementation
|
|
52
66
|
|
|
53
67
|
To run the plugin, you must first create an instance of `Copy`. Then, you can call `execute()`.
|
|
54
68
|
|
|
55
69
|
```typescript
|
|
56
|
-
import {
|
|
70
|
+
import {Copy} from '.';
|
|
57
71
|
|
|
58
|
-
const plugin = Copy({
|
|
72
|
+
const plugin = Copy({
|
|
73
|
+
'keep-existing': true,
|
|
74
|
+
from: 'from-param',
|
|
75
|
+
to: 'to-param',
|
|
76
|
+
});
|
|
59
77
|
|
|
60
|
-
const result = plugin.execute([
|
|
61
|
-
|
|
78
|
+
const result = plugin.execute([
|
|
79
|
+
{
|
|
80
|
+
timestamp: '2023-12-12T00:00:13.000Z',
|
|
62
81
|
duration: 30,
|
|
63
82
|
'from-param': 'hello',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
console.log(result)
|
|
83
|
+
},
|
|
84
|
+
]);
|
|
67
85
|
|
|
86
|
+
console.log(result);
|
|
68
87
|
```
|
|
69
88
|
|
|
70
89
|
## Example manifest
|
|
@@ -88,11 +107,11 @@ tree:
|
|
|
88
107
|
children:
|
|
89
108
|
child-1:
|
|
90
109
|
pipeline:
|
|
91
|
-
|
|
110
|
+
compute:
|
|
111
|
+
- copy-param
|
|
92
112
|
inputs:
|
|
93
|
-
- timestamp:
|
|
113
|
+
- timestamp: '2023-12-12T00:00:00.000Z'
|
|
94
114
|
original: 'hello'
|
|
95
|
-
|
|
96
115
|
```
|
|
97
116
|
|
|
98
117
|
You can run this example by saving it as `./manifests/examples/copy.yml` and executing the following command from the project root:
|