Skip to content

Add installation documentation #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![PowSyBl Logo](_static/logos/logo_lfe_powsybl.svg)
# PowSyBl Metrix

## Presentation

[MappingTool](mapping.md) provides a mapping configuration from csv timeseries to network.
This configuration allows to generate iidm network at specified times. Furthermore,
Expand All @@ -11,6 +12,113 @@ networks generated by the mapping tool. Its outputs are completed by synthesis.

MetrixTool calls *[metrix simulator](metrix-simulator.md)* as an external program. This program has its own requirements.

## Installation

PowSyBl-Metrix can be installed easily in just a few steps, so that you can use it in command line:

### Downloads

First, on [the release page](https://github.com/powsybl/powsybl-metrix/releases), you can download:

* itools-metrix
* metrix-simulator

*itools-metrix* is written in Java, so there is only one version per release, and it works for
every OS. *metrix-simulator* however is written in C++ so you will need to
choose the version corresponding to your OS.

Note: Current versions of *metrix-simulator-ubuntu* were compiled on Ubuntu 24. If
you encounter issues regarding the compiler, don't hesitate to use the *metrix-simulator-centos*
version that has been compiled with an older version of the compiler.

Once the two zip are downloaded, unzip them in a repository of your choosing.

### Configuration

#### itools command

Now we need to make the *itools* command available. For this, you need to add itools to your PATH.

On Linux, you can for example do this by adding a few lines in your `.bashrc` file (or equivalent):

```shell
# PowSyBl-Metrix itools repository
export POWSYBL_METRIX_HOME=<repository_where_you_unzipped_itools-metrix>
# Add the repository to the path
export PATH=$POWSYBL_METRIX_HOME/bin:$PATH
```

On Windows, follow for example [this guide](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/).

To check if it works, open a new terminal and type the `itools` command. You should see
the following answer:

```
$ itools
usage: itools [OPTIONS] COMMAND [ARGS]

Available options are:
--config-name <CONFIG_NAME> Override configuration file name

Available commands are:

Computation:
loadflow Run loadflow

Data conversion:
convert-network convert a network from one format to another

Metrix:
mapping Time series to network mapping tool
metrix Run Metrix
metrix-die Generate Metrix DIE files

Misc:
generate-completion-script Generates a bash autocompletion script
plugins-info List the available plugins

Script:
run-script run script (only groovy is supported)
```

*Note: If you already have another version of itools installed (for example if you use powsybl-dependency),
you may want to have another configuration to use a specific command so that you can
use both independently:*

```shell
alias itoolsmetrix='<repository_where_you_unzipped_itools-metrix>/bin/itools'
```

#### Metrix configuration

Now you need to add some configuration to your PowSyBl `config.yml` file. By default,
this file should be in the `<USER_HOME>/.itools` directory. Create the file if it does not already exist.
Then add the following lines:

```yml
metrix:
home-dir: <directory_where_you_unzipped_metrix-simulator> # required
command: metrix-simulator

iidm-export-version: "1.11" # default to latest available version
constant-loss-factor: false # enable constant loss factor
chunk-size: 10 # size of the batch processed by Metrix
result-limit: 10000 # max allowed output count
debug: false # enable debug mode
log-level: 2 # Metrix log level, available values: 0 (trace), 1 (debug), 2 (info), 3 (warn), 4 (error), 5 (critical)
debug-log-level: 0 # Metrix log level when debug mode is enabled, available values: 0 (trace), 1 (debug), 2 (info), 3 (warn), 4 (error), 5 (critical)

mapping-default-parameters:
tolerance-threshold: 0.0001f

metrix-default-parameters:
computation-type: LF # default computation type
loss-factor: 0f # default loss factor value
nominal-u: 100 # default nominal U
```



```{toctree}
---
maxdepth: 2
Expand Down
Loading