@grnsft/if 0.1.1 → 0.1.3-beta
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/.github/ISSUE_TEMPLATE/agenda.md +4 -3
- package/.github/ISSUE_TEMPLATE/bug-report.md +32 -0
- package/.github/ISSUE_TEMPLATE/dev-ticket.md +44 -0
- package/.github/ISSUE_TEMPLATE/sprint-planning.md +39 -0
- package/.github/ISSUE_TEMPLATE/sprint-retro.md +41 -0
- package/CONTRIBUTING.md +13 -17
- package/README.md +36 -18
- package/build/config/config.d.ts +12 -0
- package/build/config/config.js +54 -0
- package/build/config/strings.d.ts +8 -3
- package/build/config/strings.js +10 -6
- package/build/index.js +15 -8
- package/build/lib/models-universe.d.ts +10 -2
- package/build/lib/models-universe.js +52 -34
- package/build/lib/observatory.d.ts +20 -0
- package/build/lib/observatory.js +31 -0
- package/build/lib/planet-aggregator.d.ts +6 -0
- package/build/lib/planet-aggregator.js +35 -0
- package/build/lib/supercomputer.d.ts +7 -0
- package/build/lib/supercomputer.js +45 -6
- package/build/models/index.d.ts +1 -0
- package/build/models/index.js +6 -0
- package/build/models/time-sync.d.ts +55 -0
- package/build/models/time-sync.js +235 -0
- package/build/types/helpers.d.ts +1 -0
- package/build/types/helpers.js +3 -0
- package/build/types/impl.d.ts +14 -9
- package/build/types/impl.js +3 -1
- package/build/types/model-interface.d.ts +14 -0
- package/build/types/model-interface.js +3 -0
- package/build/types/models-universe.d.ts +5 -6
- package/build/types/models-universe.js +1 -1
- package/build/types/planet-aggregator.d.ts +6 -0
- package/build/types/planet-aggregator.js +3 -0
- package/build/types/process-args.d.ts +7 -0
- package/build/types/process-args.js +3 -0
- package/build/types/supercomputer.d.ts +4 -0
- package/build/types/supercomputer.js +3 -0
- package/build/types/time-sync.d.ts +9 -0
- package/build/types/time-sync.js +3 -0
- package/build/types/units-dealer.d.ts +3 -0
- package/build/types/units-dealer.js +3 -0
- package/build/types/units.d.ts +11 -0
- package/build/types/units.js +37 -0
- package/build/util/args.js +58 -0
- package/build/util/errors.d.ts +6 -0
- package/build/util/errors.js +25 -0
- package/build/util/helpers.js +18 -0
- package/build/util/units-dealer.d.ts +10 -0
- package/build/util/units-dealer.js +32 -0
- package/build/util/validations.d.ts +4 -0
- package/build/util/validations.js +29 -1
- package/build/util/yaml.d.ts +1 -2
- package/build/util/yaml.js +1 -1
- package/coverage/clover.xml +165 -114
- package/coverage/coverage-final.json +10 -9
- package/coverage/lcov-report/config/config.ts.html +12 -3
- package/coverage/lcov-report/config/index.html +17 -17
- package/coverage/lcov-report/config/index.ts.html +3 -3
- package/coverage/lcov-report/config/strings.ts.html +26 -20
- package/coverage/lcov-report/index.html +33 -33
- package/coverage/lcov-report/lib/index.html +41 -26
- package/coverage/lcov-report/lib/models-universe.ts.html +82 -40
- package/coverage/lcov-report/lib/observatory.ts.html +7 -7
- package/coverage/lcov-report/lib/planet-aggregator.ts.html +253 -0
- package/coverage/lcov-report/lib/supercomputer.ts.html +217 -58
- package/coverage/lcov-report/util/args.ts.html +11 -11
- package/coverage/lcov-report/util/errors.ts.html +10 -7
- package/coverage/lcov-report/util/index.html +11 -11
- package/coverage/lcov-report/util/yaml.ts.html +6 -6
- package/coverage/lcov.info +273 -185
- package/examples/impls/case-studies/aggregation.yml +97 -0
- package/examples/impls/test/aggregation-test.yml +109 -0
- package/examples/impls/test/large-impl.yml +257303 -0
- package/examples/impls/test/sci.yml +13 -37
- package/examples/impls/test/time-sync.yml +75 -0
- package/examples/ompls/aggregation-test.yml +340 -0
- package/examples/ompls/test/time-sync.yml +255 -0
- package/examples/ompls/time-sync.yml +212 -0
- package/hack-banner.png +0 -0
- package/package.json +3 -1
- package/src/config/units.yaml +11 -24
- package/src/models/README.md +266 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/build/types/azure-importer.d.ts +0 -29
- package/build/types/azure-importer.js +0 -3
- package/build/types/boavizta.d.ts +0 -7
- package/build/types/boavizta.js +0 -3
- package/build/types/common.d.ts +0 -7
- package/build/types/common.js +0 -9
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Agenda
|
|
3
|
-
about: The standard agenda template for
|
|
3
|
+
about: The standard agenda template for Impact Framework
|
|
4
4
|
title: "GSF IEF Meeting Agenda yyyy-mm-dd"
|
|
5
5
|
labels: agenda
|
|
6
6
|
assignees: ''
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Time
|
|
10
|
+
Time 10:30am (GMT) / 4:00pm (IST) - See the time in your [timezone](https://everytimezone.com/s/e7e219dd)
|
|
11
11
|
|
|
12
12
|
- Lead – @srini1978 (Microsoft)
|
|
13
13
|
- Co-Lead @navveenb (Accenture)
|
|
14
|
-
-
|
|
14
|
+
- Co-Lead – @jawache (GSF)
|
|
15
|
+
- PM - @jmcook1186 (GSF)
|
|
15
16
|
|
|
16
17
|
## Antitrust Policy
|
|
17
18
|
Joint Development Foundation meetings may involve participation by industry competitors, and it is the intention of the Joint Development Foundation to conduct all of its activities in accordance with applicable antitrust and competition laws. It is therefore extremely important that attendees adhere to meeting agendas, and be aware of, and not participate in, any activities that are prohibited under applicable US state, federal or foreign antitrust and competition laws.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Issue tracker is **ONLY** used for reporting bugs.
|
|
2
|
+
|
|
3
|
+
<!--- Provide a general summary of the issue in the Title above -->
|
|
4
|
+
|
|
5
|
+
## Expected Behavior
|
|
6
|
+
<!--- Tell us what should happen -->
|
|
7
|
+
|
|
8
|
+
## Actual Behavior
|
|
9
|
+
<!--- Tell us what happens instead of the expected behavior -->
|
|
10
|
+
|
|
11
|
+
## Ideas for Solution
|
|
12
|
+
<!--- Not required, but suggest a fix/reason for the bug if possible -->
|
|
13
|
+
|
|
14
|
+
## Steps to Reproduce
|
|
15
|
+
<!--- Provide a link to a live example, or a set of specific instructions to -->
|
|
16
|
+
<!--- reproduce the bug. Include code, if relevant -->
|
|
17
|
+
1.
|
|
18
|
+
2.
|
|
19
|
+
3.
|
|
20
|
+
4.
|
|
21
|
+
|
|
22
|
+
## Context (Environment)
|
|
23
|
+
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
|
24
|
+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
|
25
|
+
|
|
26
|
+
<!--- Provide a general summary of the issue in the Title above -->
|
|
27
|
+
|
|
28
|
+
## Detailed Description
|
|
29
|
+
<!--- Provide a detailed description of the change or addition you are proposing -->
|
|
30
|
+
|
|
31
|
+
## Possible Implementation
|
|
32
|
+
<!--- Not obligatory, but suggest an idea for implementing addition or change -->
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Dev-ticket
|
|
3
|
+
about: General developer ticket
|
|
4
|
+
title: "Dev ticket - "
|
|
5
|
+
labels: dev-ticket
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<!--- Provide a general summary of the issue in the Title above -->
|
|
10
|
+
|
|
11
|
+
## Story
|
|
12
|
+
<!--- Describe the benefits of this change, ideally in the following format: -->
|
|
13
|
+
<!--- As a < type of user >, I want < some goal > so that < some reason >. -->
|
|
14
|
+
|
|
15
|
+
## Rationale
|
|
16
|
+
<!--- Provide the relevant background information to udnerstand why this change is needed -->
|
|
17
|
+
<!--- This is where you can provide more details thathelp the reader understand why you want to make this change -->
|
|
18
|
+
|
|
19
|
+
## Implementation details
|
|
20
|
+
<!--- Explain the steps you will take to implement this change. If you do not have specific steps yet, write your implementation ideas or outline general approach -->
|
|
21
|
+
|
|
22
|
+
## Priority
|
|
23
|
+
<!--- How urgent is this issue, and why? -->
|
|
24
|
+
<!--- Explain in writing or give a numerical value from 1 (nice-to-have) to 5 (critical) -->
|
|
25
|
+
|
|
26
|
+
## Scope
|
|
27
|
+
<!--- Which parts of the project/codebase does this affect? -->
|
|
28
|
+
<!--- What are the possibel downstream impacts or side-effects of this change?? -->
|
|
29
|
+
|
|
30
|
+
## Size
|
|
31
|
+
<!--- How long do you expect this to take? -->
|
|
32
|
+
<!--- How many people/person-hours are required? -->
|
|
33
|
+
|
|
34
|
+
## What does "done" look like?
|
|
35
|
+
<!--- Explain what needs to happen in order for this to be considered complete -->
|
|
36
|
+
|
|
37
|
+
## Does this require updaes to documentation or other materials??
|
|
38
|
+
<!--- Are there documentation, website or other media changes required after this change is implemented?. -->
|
|
39
|
+
|
|
40
|
+
## What testing is required?
|
|
41
|
+
<!--- Describe what tests are required to ensure this change has been delivered as expected -->
|
|
42
|
+
|
|
43
|
+
## Is this a known/expected update?
|
|
44
|
+
<!--- Has this been discussed with the core team or in a discussion forum? Provide links if possible. -->
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Sprint planning
|
|
3
|
+
about: The standard template for IF sprint planning
|
|
4
|
+
title: "GSF IEF Sprint planning yyyy-mm-dd"
|
|
5
|
+
labels: sprint planning
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Time 11:00am - 12:00pm (GMT) every other Monday
|
|
11
|
+
|
|
12
|
+
## Roll Call
|
|
13
|
+
- [ ]
|
|
14
|
+
Please add 'Attended' to this issue during the meeting to denote attendance.
|
|
15
|
+
|
|
16
|
+
## Backlog audit
|
|
17
|
+
- [ ]
|
|
18
|
+
What tickets are on the backlog, blocked or still in progress?
|
|
19
|
+
|
|
20
|
+
## Prioritization
|
|
21
|
+
- [ ]
|
|
22
|
+
What are the most urgent tickets that should be worked on this sprint, and why?
|
|
23
|
+
|
|
24
|
+
## Readiness check
|
|
25
|
+
- [ ]
|
|
26
|
+
Are the issues `READY`? Do the tickets conform to our dev-ticket template, and do they contain sufficient information to get started?
|
|
27
|
+
Are the issues sized? How much person-power do we have available in the coming sprint?
|
|
28
|
+
Is there a clear and specific definition of done for each issue?
|
|
29
|
+
|
|
30
|
+
## Assignment
|
|
31
|
+
- [ ]
|
|
32
|
+
Who will work on which issue? What are the deadlines?
|
|
33
|
+
|
|
34
|
+
## Support
|
|
35
|
+
- [ ]
|
|
36
|
+
What opportunities are there to raise concerns, resize, course correct, ask for support during the coming sprint?
|
|
37
|
+
|
|
38
|
+
### Discussions and AOB
|
|
39
|
+
- [ ]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
name: Sprint retro
|
|
4
|
+
about: The standard template for IF sprint retrospectives
|
|
5
|
+
title: "GSF IEF Sprint retro yyyy-mm-dd"
|
|
6
|
+
labels: sprint retro
|
|
7
|
+
assignees: ''
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Time 11:00am - 12:00pm (GMT) every other Friday
|
|
12
|
+
|
|
13
|
+
## Roll Call
|
|
14
|
+
- [ ]
|
|
15
|
+
Please add 'Attended' to this issue during the meeting to denote attendance.
|
|
16
|
+
|
|
17
|
+
## What went well?
|
|
18
|
+
- [ ]
|
|
19
|
+
What did we ship, what progress did we make, what are we proud of?
|
|
20
|
+
|
|
21
|
+
## What unexpected issues arose?
|
|
22
|
+
- [ ]
|
|
23
|
+
What issues, delays or otherwise unexpected events did we encounter this week that caused us to diverge from our plan?
|
|
24
|
+
|
|
25
|
+
## What can be improved?
|
|
26
|
+
- [ ]
|
|
27
|
+
What did we identify as areas for improvement? Any process changes required? Any reflections that can inform how we operate in the next sprint?
|
|
28
|
+
|
|
29
|
+
## Board
|
|
30
|
+
- [ ]
|
|
31
|
+
Check the board to see what tickets can be closed out or moved to a new column. Any details need adding to tickets?
|
|
32
|
+
|
|
33
|
+
## Support
|
|
34
|
+
- [ ]
|
|
35
|
+
Any concerns, resizing or course correcting required? Any other support needed arising from the recent sprint?
|
|
36
|
+
|
|
37
|
+
### Discussions and AOB
|
|
38
|
+
- [ ]
|
|
39
|
+
|
|
40
|
+
### Actions
|
|
41
|
+
- [ ]
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
## Contribution Guidelines <!-- omit from toc -->
|
|
2
|
+
|
|
2
3
|
|
|
3
4
|
First off, thanks for taking the time to contribute! 🎉
|
|
4
5
|
|
|
@@ -7,7 +8,7 @@ The following document is a rule set of guidelines for contributing.
|
|
|
7
8
|
## Table of Contents <!-- omit from toc -->
|
|
8
9
|
|
|
9
10
|
- [Code Contributions](#code-contributions)
|
|
10
|
-
- [Step 1:
|
|
11
|
+
- [Step 1: Fork](#step-1-fork)
|
|
11
12
|
- [Step 2: Branch](#step-2-branch)
|
|
12
13
|
- [Step 3: Commit](#step-3-commit)
|
|
13
14
|
- [Step 4: Sync](#step-4-sync)
|
|
@@ -24,20 +25,15 @@ The following document is a rule set of guidelines for contributing.
|
|
|
24
25
|
|
|
25
26
|
## Code Contributions
|
|
26
27
|
|
|
27
|
-
#### Step 1:
|
|
28
|
+
#### Step 1: Fork
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
$ git clone git@github.com:Green-Software-Foundation/ief.git
|
|
33
|
-
$ cd ief
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
For developing new features and bug fixes, the development branch should be pulled and built upon.
|
|
30
|
+
Fork the project on [GitHub](git@github.com:Green-Software-Foundation/if.git)
|
|
31
|
+
|
|
32
|
+
You then have your own copy of the repository that you can change.
|
|
37
33
|
|
|
38
34
|
#### Step 2: Branch
|
|
39
35
|
|
|
40
|
-
Create new branch
|
|
36
|
+
Create new branch in your forked copy of the `if` repository, which will contain your new feature, fix or change.
|
|
41
37
|
|
|
42
38
|
```bash
|
|
43
39
|
$ git checkout -b <topic-branch-name>
|
|
@@ -71,15 +67,15 @@ Please adhere to these [Commit message guidelines](#commit-message-guidelines)
|
|
|
71
67
|
|
|
72
68
|
#### Step 4: Sync
|
|
73
69
|
|
|
74
|
-
Use git pull/merge to synchronize your work with the
|
|
70
|
+
Use git pull/merge to synchronize your work with the IF repository.
|
|
75
71
|
|
|
76
72
|
```bash
|
|
77
|
-
$ git pull
|
|
73
|
+
$ git pull upstream dev
|
|
78
74
|
```
|
|
79
75
|
|
|
80
76
|
#### Step 5: Push
|
|
81
77
|
|
|
82
|
-
Push your topic branch:
|
|
78
|
+
Push your topic branch to your fork:
|
|
83
79
|
|
|
84
80
|
```bash
|
|
85
81
|
$ git push origin <topic-branch-name>
|
|
@@ -87,7 +83,7 @@ Push your topic branch:
|
|
|
87
83
|
|
|
88
84
|
#### Step 6: Pull Request
|
|
89
85
|
|
|
90
|
-
Open a Pull Request with a clear title and description according to [template](.github/PULL_REQUEST_TEMPLATE.md).
|
|
86
|
+
Open a Pull Request from your fork of the repository to the `dev` branch of the IF repository with a clear title and description according to [template](.github/PULL_REQUEST_TEMPLATE.md).
|
|
91
87
|
|
|
92
88
|
Pull request should pass all CI which are defined, should have at least one approve. It should adher to the specification for getting approved.
|
|
93
89
|
|
|
@@ -191,4 +187,4 @@ describe('util/args: ', () => {
|
|
|
191
187
|
})
|
|
192
188
|
```
|
|
193
189
|
|
|
194
|
-
*[⬅️ back to the root](/README.md#ief)*
|
|
190
|
+
*[⬅️ back to the root](/README.md#ief)*
|
package/README.md
CHANGED
|
@@ -1,7 +1,35 @@
|
|
|
1
|
+
<div id="header" align="center">
|
|
2
|
+
<img style=”margin: 0px” src=hack-banner.png alt=”banner” height=”500" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
----------------------------
|
|
6
|
+
|
|
7
|
+
**Welcome to [CarbonHack 24](https://grnsft.org/hack/github) from the Green Software Foundation.**
|
|
8
|
+
|
|
9
|
+
> From Monday, February 26 - Friday, March 15, 2024, participants will compete to showcase their best application of IF in measuring the environmental impacts of software.
|
|
10
|
+
>
|
|
11
|
+
> Carbon Hack is a dynamic competition that combines healthy rivalry with collaborative innovation. Hackers will push the limits of the framework, uncover potential weaknesses, and create innovations to enhance the tool.
|
|
12
|
+
>
|
|
13
|
+
> CarbonHack is open to all, including software practitioners and those with a passion for Green Software.
|
|
14
|
+
>
|
|
15
|
+
> Find out more about CarbonHack 2024 on the [CarbonHack website](https://grnsft.org/hack/github). Check out the [FAQ on GitHub](https://github.com/Green-Software-Foundation/hack/blob/main/FAQ.md).
|
|
16
|
+
>
|
|
17
|
+
> Registration opens 15th January!
|
|
18
|
+
----------------------------
|
|
19
|
+
|
|
20
|
+
|
|
1
21
|
# Impact Framework
|
|
2
22
|
|
|
23
|
+
|
|
24
|
+
> [!IMPORTANT]
|
|
25
|
+
> Incubation Project: This project is an incubation project being run inside the Green Software Foundation; as such, we DON’T recommend using it in any critical use case. Incubation projects are experimental, offer no support guarantee, have minimal governance and process, and may be retired at any moment. This project may one day Graduate, in which case this disclaimer will be removed.
|
|
26
|
+
|
|
3
27
|
[Impact Framework](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/17072136/Opensource+Impact+Engine+Framework) (IF) is an [Incubation](https://oc.greensoftware.foundation/project-lifecycle.html#incubation) project from the [Open Source Working Group](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/852049/Open+Source+Working+Group) in the [Green Software Foundation](https://greensoftware.foundation/).
|
|
4
28
|
|
|
29
|
+
|
|
30
|
+
**Our documentation is online at [if.greensoftware.foundation]([if.greensoftware.foundation](https://if.greensoftware.foundation/))**
|
|
31
|
+
|
|
32
|
+
|
|
5
33
|
**IF** is a framework to **M**odel, **M**easure, si**M**ulate and **M**onitor the environmental impacts of software
|
|
6
34
|
|
|
7
35
|
Modern applications are composed of many smaller pieces of software (components) running on many different environments, for example, private cloud, public cloud, bare-metal, virtualized, containerized, mobile, laptops, and desktops.
|
|
@@ -10,7 +38,7 @@ Every environment requires a different model of measurement, and there is no sin
|
|
|
10
38
|
|
|
11
39
|
The friction to measuring software emissions isn't that we need to know how, it's that we run software on many things and each thing has several different ways to measure.
|
|
12
40
|
|
|
13
|
-
Read the [specification and design docs](https://
|
|
41
|
+
Read the [specification and design docs](https://if.greensoftware.foundation) to begin.
|
|
14
42
|
|
|
15
43
|
|
|
16
44
|
## Get started
|
|
@@ -78,29 +106,19 @@ yarn impact-engine -- --impl <path-to-your-impl-file> --ompl <your-savepath>
|
|
|
78
106
|
|
|
79
107
|
The `impact-engine` CLI tool will configure and run the models defined in your input `yaml` (`impl`) and return the results as an output `yaml` (`ompl`).
|
|
80
108
|
|
|
109
|
+
## Documentation
|
|
110
|
+
|
|
111
|
+
Please read our documentation at [if.greensoftware.foundation](https://if.greensoftware.foundation/)
|
|
81
112
|
|
|
82
113
|
## Video walk-through
|
|
83
114
|
|
|
84
115
|
Watch this video to learn how to create and run an `impl`.
|
|
85
116
|
|
|
86
|
-
[](https://youtu.be/
|
|
87
|
-
|
|
88
|
-
## Run tests
|
|
89
|
-
|
|
90
|
-
To run the complete set of tests simply run
|
|
91
|
-
|
|
92
|
-
```sh
|
|
93
|
-
yarn test
|
|
94
|
-
```
|
|
117
|
+
[](https://youtu.be/GW37Qd4AQbU)
|
|
95
118
|
|
|
96
|
-
To refresh the set of `ompl`s used for validating the output files, run the `scripts/impact-test.sh` bash script (for unix only) as follows:
|
|
97
119
|
|
|
98
|
-
|
|
99
|
-
./scripts/impact-test.sh
|
|
100
|
-
```
|
|
120
|
+
## Contributing
|
|
101
121
|
|
|
102
|
-
|
|
122
|
+
To contribute to IF, please fork this repository and raise a pull request from your fork. The same process is also appropriate for updates to `if-docs`, `if-models` and `if-unofficial-models`.
|
|
103
123
|
|
|
104
|
-
|
|
105
|
-
yarn test
|
|
106
|
-
```
|
|
124
|
+
Please read the full contribution guidelines at [if.greensoftware.foundation](https://if.greensoftware.foundation/Contributing)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArgumentConfig } from 'ts-command-line-args';
|
|
2
|
+
import { impactProcessArgs } from '../types/process-args';
|
|
3
|
+
export declare const CONFIG: {
|
|
4
|
+
AGGREGATION_METRICS: string[];
|
|
5
|
+
AGGREGATION_METHODS: string[];
|
|
6
|
+
impact: {
|
|
7
|
+
ARGS: ArgumentConfig<impactProcessArgs>;
|
|
8
|
+
HELP: string;
|
|
9
|
+
};
|
|
10
|
+
GITHUB_PATH: string;
|
|
11
|
+
NATIVE_MODEL: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONFIG = void 0;
|
|
4
|
+
exports.CONFIG = {
|
|
5
|
+
AGGREGATION_METRICS: ['carbon', 'energy'],
|
|
6
|
+
AGGREGATION_METHODS: ['sum', 'avg'],
|
|
7
|
+
impact: {
|
|
8
|
+
ARGS: {
|
|
9
|
+
impl: {
|
|
10
|
+
type: String,
|
|
11
|
+
optional: true,
|
|
12
|
+
alias: 'i',
|
|
13
|
+
description: 'Path to an input IMPL file.',
|
|
14
|
+
},
|
|
15
|
+
ompl: {
|
|
16
|
+
type: String,
|
|
17
|
+
optional: true,
|
|
18
|
+
description: 'Path to the output IMPL file where the results as saved, if none is provided it prints to stdout.',
|
|
19
|
+
},
|
|
20
|
+
format: {
|
|
21
|
+
type: String,
|
|
22
|
+
optional: true,
|
|
23
|
+
description: 'The output file format. default to yaml but if csv is specified then it formats the outputs as a csv file for loading into another program.',
|
|
24
|
+
defaultValue: 'yaml',
|
|
25
|
+
},
|
|
26
|
+
verbose: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
optional: true,
|
|
29
|
+
description: 'How much information to output about the calculation to aid investigation and debugging.',
|
|
30
|
+
},
|
|
31
|
+
help: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
optional: true,
|
|
34
|
+
alias: 'h',
|
|
35
|
+
description: 'Prints this usage guide.',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
HELP: `impact
|
|
39
|
+
-impl [path to the input impl file]
|
|
40
|
+
-ompl [path to the output impl file]
|
|
41
|
+
-format [yaml|csv]
|
|
42
|
+
-verbose
|
|
43
|
+
-help
|
|
44
|
+
impl: path to an input IMPL file
|
|
45
|
+
ompl: path to the output IMPL file where the results as saved, if none is provided it prints to stdout.
|
|
46
|
+
format: the output file format. default to yaml but if csv is specified then it formats the outputs as a csv file for loading into another program.
|
|
47
|
+
verbose: how much information to output about the calculation to aid investigation and debugging.
|
|
48
|
+
help: prints out the above help instruction.
|
|
49
|
+
`,
|
|
50
|
+
},
|
|
51
|
+
GITHUB_PATH: 'https://github.com',
|
|
52
|
+
NATIVE_MODEL: 'if-models',
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZy9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBSWEsUUFBQSxNQUFNLEdBQUc7SUFDcEIsbUJBQW1CLEVBQUUsQ0FBQyxRQUFRLEVBQUUsUUFBUSxDQUFDO0lBQ3pDLG1CQUFtQixFQUFFLENBQUMsS0FBSyxFQUFFLEtBQUssQ0FBQztJQUNuQyxNQUFNLEVBQUU7UUFDTixJQUFJLEVBQUU7WUFDSixJQUFJLEVBQUU7Z0JBQ0osSUFBSSxFQUFFLE1BQU07Z0JBQ1osUUFBUSxFQUFFLElBQUk7Z0JBQ2QsS0FBSyxFQUFFLEdBQUc7Z0JBQ1YsV0FBVyxFQUFFLDZCQUE2QjthQUMzQztZQUNELElBQUksRUFBRTtnQkFDSixJQUFJLEVBQUUsTUFBTTtnQkFDWixRQUFRLEVBQUUsSUFBSTtnQkFDZCxXQUFXLEVBQ1QsbUdBQW1HO2FBQ3RHO1lBQ0QsTUFBTSxFQUFFO2dCQUNOLElBQUksRUFBRSxNQUFNO2dCQUNaLFFBQVEsRUFBRSxJQUFJO2dCQUNkLFdBQVcsRUFDVCw2SUFBNkk7Z0JBQy9JLFlBQVksRUFBRSxNQUFNO2FBQ3JCO1lBQ0QsT0FBTyxFQUFFO2dCQUNQLElBQUksRUFBRSxPQUFPO2dCQUNiLFFBQV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IGltcGwgZmlsZV1cbiAgLWZvcm1hdCBbeWFtbHxjc3ZdIFxuICAtdmVyYm9zZVxuICAtaGVscCBcbiAgaW1wbDogcGF0aCB0byBhbiBpbnB1dCBJTVBMIGZpbGVcbiAgb21wbDogcGF0aCB0byB0aGUgb3V0cHV0IElNUEwgZmlsZSB3aGVyZSB0aGUgcmVzdWx0cyBhcyBzYXZlZCwgaWYgbm9uZSBpcyBwcm92aWRlZCBpdCBwcmludHMgdG8gc3Rkb3V0LlxuICBmb3JtYXQ6IHRoZSBvdXRwdXQgZmlsZSBmb3JtYXQuIGRlZmF1bHQgdG8geWFtbCBidXQgaWYgY3N2IGlzIHNwZWNpZmllZCB0aGVuIGl0IGZvcm1hdHMgdGhlIG91dHB1dHMgYXMgYSBjc3YgZmlsZSBmb3IgbG9hZGluZyBpbnRvIGFub3RoZXIgcHJvZ3JhbS5cbiAgdmVyYm9zZTogaG93IG11Y2ggaW5mb3JtYXRpb24gdG8gb3V0cHV0IGFib3V0IHRoZSBjYWxjdWxhdGlvbiB0byBhaWQgaW52ZXN0aWdhdGlvbiBhbmQgZGVidWdnaW5nLlxuICBoZWxwOiBwcmludHMgb3V0IHRoZSBhYm92ZSBoZWxwIGluc3RydWN0aW9uLlxuICBgLFxuICB9LFxuICBHSVRIVUJfUEFUSDogJ2h0dHBzOi8vZ2l0aHViLmNvbScsXG4gIE5BVElWRV9NT0RFTDogJ2lmLW1vZGVscycsXG59O1xuIl19
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import { ClassContainerParams } from '../types/models-universe';
|
|
1
2
|
export declare const STRINGS: {
|
|
2
3
|
FILE_IS_NOT_YAML: string;
|
|
3
4
|
IMPL_IS_MISSING: string;
|
|
4
5
|
MISSING_CLASSNAME: string;
|
|
5
6
|
MISSING_PATH: string;
|
|
6
|
-
|
|
7
|
-
NOT_OUTPUT_MODEL_EXTENSION: string;
|
|
7
|
+
NOT_MODEL_PLUGIN_EXTENSION: string;
|
|
8
8
|
STRUCTURE_MALFORMED: (childName: string) => string;
|
|
9
|
-
NOT_INITIALIZED_MODEL: (
|
|
9
|
+
NOT_INITIALIZED_MODEL: (className: string) => string;
|
|
10
10
|
DISCLAIMER_MESSAGE: string;
|
|
11
11
|
NOT_NATIVE_MODEL: string;
|
|
12
12
|
SOMETHING_WRONG: string;
|
|
13
13
|
ISSUE_TEMPLATE: string;
|
|
14
|
+
NOT_CONSTRUCTABLE_MODEL: (params: ClassContainerParams) => string;
|
|
15
|
+
INVALID_MODULE_PATH: (path: string) => string;
|
|
16
|
+
INVALID_TIME_NORMALIZATION: string;
|
|
17
|
+
INVALID_TIME_INTERVAL: string;
|
|
18
|
+
INVALID_OBSERVATION_OVERLAP: string;
|
|
14
19
|
};
|
package/build/config/strings.js
CHANGED
|
@@ -4,12 +4,11 @@ exports.STRINGS = void 0;
|
|
|
4
4
|
exports.STRINGS = {
|
|
5
5
|
FILE_IS_NOT_YAML: 'Provided impl file is not in yaml format.',
|
|
6
6
|
IMPL_IS_MISSING: 'Impl file is missing.',
|
|
7
|
-
MISSING_CLASSNAME:
|
|
8
|
-
MISSING_PATH:
|
|
9
|
-
|
|
10
|
-
NOT_OUTPUT_MODEL_EXTENSION: 'Provided model does not extend ModelInterface.',
|
|
7
|
+
MISSING_CLASSNAME: "Initalization param 'model' is missing.",
|
|
8
|
+
MISSING_PATH: "Initalization param 'path' is missing.",
|
|
9
|
+
NOT_MODEL_PLUGIN_EXTENSION: "Provided model does not extend 'ModelPluginInterface'.",
|
|
11
10
|
STRUCTURE_MALFORMED: (childName) => `Graph is malformed: graph.children.${childName} is not valid.`,
|
|
12
|
-
NOT_INITIALIZED_MODEL: (
|
|
11
|
+
NOT_INITIALIZED_MODEL: (className) => `You're trying to use not initalized model: ${className}.`,
|
|
13
12
|
DISCLAIMER_MESSAGE: `
|
|
14
13
|
[!important] Incubation Project
|
|
15
14
|
|
|
@@ -26,5 +25,10 @@ You are using models that are not part of the Impact Framework standard library.
|
|
|
26
25
|
Impact Framework is an alpha release from the Green Software Foundation and is released to capture early feedback. If you'd like to offer some feedback, please use this issue template:
|
|
27
26
|
https://github.com/Green-Software-Foundation/if/issues/new?assignees=&labels=feedback&projects=&template=feedback.md&title=Feedback+-+
|
|
28
27
|
`,
|
|
28
|
+
NOT_CONSTRUCTABLE_MODEL: (params) => `Provided model '${params.model}' is not constructable or does not belong to given plugin '${params.path}'.`,
|
|
29
|
+
INVALID_MODULE_PATH: (path) => `Provided module path: '${path}' is invalid.`,
|
|
30
|
+
INVALID_TIME_NORMALIZATION: 'Start time or end time is missing.',
|
|
31
|
+
INVALID_TIME_INTERVAL: 'Interval is missing.',
|
|
32
|
+
INVALID_OBSERVATION_OVERLAP: 'Observation timestamps overlap.',
|
|
29
33
|
};
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5ncy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWcvc3RyaW5ncy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFYSxRQUFBLE9BQU8sR0FBRztJQUNyQixnQkFBZ0IsRUFBRSwyQ0FBMkM7SUFDN0QsZUFBZSxFQUFFLHVCQUF1QjtJQUN4QyxpQkFBaUIsRUFBRSx5Q0FBeUM7SUFDNUQsWUFBWSxFQUFFLHdDQUF3QztJQUN0RCwwQkFBMEIsRUFDeEIsd0RBQXdEO0lBQzFELG1CQUFtQixFQUFFLENBQUMsU0FBaUIsRUFBRSxFQUFFLENBQ3pDLHNDQUFzQyxTQUFTLGdCQUFnQjtJQUNqRSxxQkFBcUIsRUFBRSxDQUFDLFNBQWlCLEVBQUUsRUFBRSxDQUMzQyw4Q0FBOEMsU0FBUyxHQUFHO0lBQzVELGtCQUFrQixFQUFFOzs7OztDQUtyQjtJQUNDLGdCQUFnQixFQUFFOzs7O0NBSW5CO0lBQ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Zy4nLFxuICBJTlZBTElEX1RJTUVfSU5URVJWQUw6ICdJbnRlcnZhbCBpcyBtaXNzaW5nLicsXG4gIElOVkFMSURfT0JTRVJWQVRJT05fT1ZFUkxBUDogJ09ic2VydmF0aW9uIHRpbWVzdGFtcHMgb3ZlcmxhcC4nLFxufTtcbiJdfQ==
|
package/build/index.js
CHANGED
|
@@ -14,10 +14,11 @@ const { DISCLAIMER_MESSAGE, SOMETHING_WRONG } = config_1.STRINGS;
|
|
|
14
14
|
/**
|
|
15
15
|
* 1. Parses yml input/output process arguments.
|
|
16
16
|
* 2. Opens yaml file as an object.
|
|
17
|
-
* 3.
|
|
18
|
-
* 4. Initializes
|
|
19
|
-
* 5.
|
|
20
|
-
*
|
|
17
|
+
* 3. Validates given impl to match basic structure.
|
|
18
|
+
* 4. Initializes requested models.
|
|
19
|
+
* 5. Initializes graph, does computing.
|
|
20
|
+
* 6. Saves processed object as a yaml file.
|
|
21
|
+
* @example run `yarn impact-engine --impl ./test.yml --ompl ./result.yml`
|
|
21
22
|
*/
|
|
22
23
|
const impactEngine = async () => {
|
|
23
24
|
console.log(DISCLAIMER_MESSAGE);
|
|
@@ -29,10 +30,16 @@ const impactEngine = async () => {
|
|
|
29
30
|
const impl = (0, validations_1.validateImpl)(rawImpl);
|
|
30
31
|
// Lifecycle Initialize Models
|
|
31
32
|
const modelsHandbook = new models_universe_1.ModelsUniverse();
|
|
32
|
-
impl.initialize.models
|
|
33
|
+
for (const model of impl.initialize.models) {
|
|
34
|
+
await modelsHandbook.writeDown(model);
|
|
35
|
+
}
|
|
33
36
|
// Lifecycle Computing
|
|
34
|
-
const
|
|
35
|
-
const ompl = await
|
|
37
|
+
const engine = new supercomputer_1.Supercomputer(impl, modelsHandbook);
|
|
38
|
+
const ompl = await engine.compute();
|
|
39
|
+
if (impl.aggregation) {
|
|
40
|
+
const aggregations = engine.calculateAggregation();
|
|
41
|
+
ompl['aggregated-outputs'] = aggregations;
|
|
42
|
+
}
|
|
36
43
|
if (!outputPath) {
|
|
37
44
|
console.log(JSON.stringify(ompl));
|
|
38
45
|
return;
|
|
@@ -43,4 +50,4 @@ const impactEngine = async () => {
|
|
|
43
50
|
return Promise.reject(new CliInputError(SOMETHING_WRONG));
|
|
44
51
|
};
|
|
45
52
|
impactEngine().catch(helpers_1.andHandle);
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsMkRBQXFEO0FBQ3JELHVEQUFrRDtBQUVsRCxzQ0FBaUQ7QUFDakQsMENBQXFDO0FBQ3JDLDRDQUF5QztBQUN6QyxvREFBZ0Q7QUFDaEQsc0NBQWlFO0FBRWpFLHFDQUFpQztBQUlqQyxNQUFNLEVBQUMsYUFBYSxFQUFDLEdBQUcsZUFBTSxDQUFDO0FBRS9CLE1BQU0sRUFBQyxrQkFBa0IsRUFBRSxlQUFlLEVBQUMsR0FBRyxnQkFBTyxDQUFDO0FBRXREOzs7Ozs7OztHQVFHO0FBQ0gsTUFBTSxZQUFZLEdBQUcsS0FBSyxJQUFJLEVBQUU7SUFDOUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0lBRWhDLE1BQU0sYUFBYSxHQUFHLElBQUEsMkJBQW9CLEdBQUUsQ0FBQztJQUU3QyxJQUFJLGFBQWEsRUFBRSxDQUFDO1FBQ2xCLE1BQU0sRUFBQyxTQUFTLEVBQUUsVUFBVSxFQUFDLEdBQUcsYUFBYSxDQUFDO1FBQzlDLE1BQU0sT0FBTyxHQUFHLE1BQU0sSUFBQSwyQkFBb0IsRUFBTyxTQUFTLENBQUMsQ0FBQztRQUU1RCx1QkFBdUI7UUFDdkIsTUFBTSxJQUFJL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AgICAgY29uc3QgYWdncmVnYXRpb25zID0gZW5naW5lLmNhbGN1bGF0ZUFnZ3JlZ2F0aW9uKCk7XG4gICAgICBvbXBsWydhZ2dyZWdhdGVkLW91dHB1dHMnXSA9IGFnZ3JlZ2F0aW9ucztcbiAgICB9XG5cbiAgICBpZiAoIW91dHB1dFBhdGgpIHtcbiAgICAgIGNvbnNvbGUubG9nKEpTT04uc3RyaW5naWZ5KG9tcGwpKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBhd2FpdCBzYXZlWWFtbEZpbGVBcyhvbXBsLCBvdXRwdXRQYXRoKTtcblxuICAgIHJldHVybjtcbiAgfVxuXG4gIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgQ2xpSW5wdXRFcnJvcihTT01FVEhJTkdfV1JPTkcpKTtcbn07XG5cbmltcGFjdEVuZ2luZSgpLmNhdGNoKGFuZEhhbmRsZSk7XG4iXX0=
|
|
@@ -11,16 +11,24 @@ export declare class ModelsUniverse {
|
|
|
11
11
|
* Checks if model is instance of `IOutputModelInterface`.
|
|
12
12
|
*/
|
|
13
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;
|
|
14
22
|
/**
|
|
15
23
|
* Returns plugin model. Checks if model is missing then rejects with error.
|
|
16
24
|
* Then checks if `path` is starting with github, then grabs the repository name.
|
|
17
25
|
* Imports module, then checks if it's a class which implements input model interface.
|
|
18
26
|
*/
|
|
19
|
-
private
|
|
27
|
+
private handModel;
|
|
20
28
|
/**
|
|
21
29
|
* Initializes and registers model.
|
|
22
30
|
*/
|
|
23
|
-
writeDown(modelToInitalize: ImplInitializeModel): InitalizedModels
|
|
31
|
+
writeDown(modelToInitalize: ImplInitializeModel): Promise<InitalizedModels>;
|
|
24
32
|
/**
|
|
25
33
|
* Returns existing model by `name`.
|
|
26
34
|
*/
|