Skip to content

Commit

Permalink
Merge pull request #45 from Green-Software-Foundation/rename-script
Browse files Browse the repository at this point in the history
Rename script to ie
  • Loading branch information
narekhovhannisyan authored Mar 3, 2024
2 parents 53ba1d1 + b45cc29 commit 052c836
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions docs/developers/how-to-build-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ This will append the new parameter informatrion to the object loaded from `param
However, if you are an advanced user and you want to use something other than out recommended standard set of parameters, you can provide a replacement `params.ts` file on the command line. This file should be a `json` or `js`/`ts` file with the ame structure as our `params.ts`. You can rename the file. You then pass the path to the file to the `override-params` command.

```sh
if --manifest <path-to-manifest> --override-params <path-to-your-params-file>
ie --manifest <path-to-manifest> --override-params <path-to-your-params-file>
```

## Summary of steps
Expand Down Expand Up @@ -215,7 +215,7 @@ carbon:
aggregation: sum
```

This information allows `if` to programmatically make decisions about how to handle values in features such as aggregation, time normalization and visualizations, and also acts as a global reference document for understanding IF data. The example above is for `carbon`.
This information allows `ie` to programmatically make decisions about how to handle values in features such as aggregation, time normalization and visualizations, and also acts as a global reference document for understanding IF data. The example above is for `carbon`.

You should add your new data, give a name, define a unit and short description. The `aggregation` field determines how the value is treated when some manipulation has to be done to spread the value over time or aggregate it.

Expand All @@ -225,7 +225,7 @@ For proportional metrics, the right value is `avg`. For example, you would want

Finally, values that should always be presented identically regardless of any aggregation, such as names or global constants, should be given the `aggregation-method` value `none`.

Now you are ready to run your plugin using the `if` CLI tool!
Now you are ready to run your plugin using the `ie` CLI tool!

## Running your plugin

Expand Down Expand Up @@ -271,16 +271,16 @@ tree:
inputs:
```

Now, when you run the manifest file using the `if`, it will load the plugin automatically.
Now, when you run the manifest file using the `ie`, it will load the plugin automatically.

For local development we recommend running with `npm run`:

```sh
npm run if -- --manifest <path-to-your-manifest> --output <path-to-save-output>
npm run ie --manifest <path-to-your-impl> --output <path-to-save-output>
```

For production use, you should globally install the latest release of the framework and your plugin and use the following command to run it:

```sh
if --manifest <path-to-your-manifest>
ie --manifest <path-to-your-manifest>
```
4 changes: 2 additions & 2 deletions docs/major-concepts/if.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ The only required command is `--manifest`. Without a valid path to a manifest fi
To use `if`, you must first [write a manifest file](../users/how-to-write-manifests.md). Then, you can simply pass the path to the manifest file to `if` on the command line.

```sh
if --manifest /my-manifest.yml
ie --manifest /my-manifest.yml
```

You can also pass a path where you would like to save the output file to. For example:

```sh
if --manifest ./my-manifest.yml --output ./my-results.yml
ie --manifest ./my-manifest.yml --output ./my-results.yml
```

If you omit the `--output` command, your results will be displayed in the console.
Expand Down
16 changes: 8 additions & 8 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Command line tool

A core feature of the Impact Framework is the `if` command line tool (CLI). This is how you trigger Impact Framework to execute a certain manifest file.
A core feature of the Impact Framework is the `ie` command line tool (CLI). This is how you trigger Impact Framework to execute a certain manifest file.

Let's take a look at the various commands exposed by `if`.
Let's take a look at the various commands exposed by `ie`.

## `if`
## `ie`

If you have globally installed our `if` npm package, you can invoke the CLI using the `if` command directly in your terminal. The `if` command is an alias to `npx ts-node src/index.ts`, which executes the Impact Framework's `src/index.ts` script and acts as the entry point for Impact Framework.
If you have globally installed our `if` npm package, you can invoke the CLI using the `ie` command directly in your terminal. The `ie` command is an alias to `npx ts-node src/index.ts`, which executes the Impact Framework's `src/index.ts` script and acts as the entry point for Impact Framework.

`if <args>`
`ie <args>`

## `--manifest`

The `--manifest` flag is the only required flag and tells `if` where to find the manifest file that you want to execute. This command expects to receive the path where your manifest file is saved, as shown in the following example:
The `--manifest` flag is the only required flag and tells `ie` where to find the manifest file that you want to execute. This command expects to receive the path where your manifest file is saved, as shown in the following example:

```sh
if --manifest examples/manifests/my-manifest.yml
ie --manifest examples/manifests/my-manifest.yml
```

## `--output`
Expand All @@ -25,5 +25,5 @@ The `--output` flag is optional and is used for defining a path to save your out
Here is an example of `--output` being used to define a path:

```sh
if --manifest examples/manifests/my-manifest.yml --output examples/outputs/my-outdata.yml
ie --manifest examples/manifests/my-manifest.yml --output examples/outputs/my-outdata.yml
```
2 changes: 1 addition & 1 deletion docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In this section you will find reference documentation for the core data structur

This includes:

- [CLI (`if`)](cli.md)
- [CLI (`ie`)](cli.md)
- [Plugins](plugins.md)

These are developer focused reference docs. If you are not a developer and looking for usage guides, please head over to the [`Using IF`](../using-if/) section.
4 changes: 2 additions & 2 deletions docs/users/how-to-install-if.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ You can install Impact Framework either globally or locally. For most users, we
npm install -g @grnsft/if
```

Then, run the package using the `if` command:
Then, run the package using the `ie` command:

```sh
if --manifest <path to manifest file>
ie --manifest <path to manifest file>
```

There is only one plugin that is built in to the core Impact Framework codebase (`time-sync`). If you only want to use Impact Framework with your own, locally-developed plugins or plugins loaded from remote Github repositories, then you have already installed everything you need to get started. However, most likely you will want to install some of our plugins too.
Expand Down
2 changes: 1 addition & 1 deletion docs/users/how-to-write-manifests.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,5 @@ We have deliberately made the plugins modular and composable so that you can be
You run a manifest by providing its path to our command line tool and a path to save the results file to. You can run a manifest named `my-manifest.yml` using the following command:

```sh
if --manifest my-manifest.yml
ie --manifest my-manifest.yml
```
8 changes: 4 additions & 4 deletions docs/users/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,24 @@ Read our detailed guide to [writing manifest files](./how-to-write-manifests.md)
## 4: Compute your manifest file
Run the pipeline by passing the path to your manifest file to the `if` command line tool:
Run the pipeline by passing the path to your manifest file to the `ie` command line tool:

```sh
if --manifest <path-to-your-manifest>
ie --manifest <path-to-your-manifest>
```

:tada:**Congratulations** :tada:! You have just used the Impact Framework to compute the energy consumed by an application!

## Next steps

Now you know how to use the `if` you can start building more complex pipelines of plugins and more complicated manifest files. Your overall aim is to create a manifest file that accurately represents a real software application, and a plugin pipeline that yields an environmental metric that's important to you (e.g. `carbon`).
Now you know how to use the `ie` you can start building more complex pipelines of plugins and more complicated manifest files. Your overall aim is to create a manifest file that accurately represents a real software application, and a plugin pipeline that yields an environmental metric that's important to you (e.g. `carbon`).

Experiment by adding more plugins to the pipeline, for example add `sci-o` to convert energy into `operational-carbon`. Your output data will be displayed in your console.

You can also configure `if` to save your output data to another `yaml` file. To do this, add the `--output` flag and the path to save the file to:

```sh
if --manifest <path-to-your-impl> --output <save-path>
ie --manifest <path-to-your-impl> --output <save-path>
```

Explore our user documentation for walkthrough guides to common Impact Framework tasks:
Expand Down

0 comments on commit 052c836

Please sign in to comment.