Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/new_quad_solvers' into f…
Browse files Browse the repository at this point in the history
…eature/new_quad_solvers
  • Loading branch information
pet-mit committed Feb 14, 2025
2 parents 0cac24c + 97aadda commit 1f66833
Show file tree
Hide file tree
Showing 365 changed files with 5,101 additions and 2,397 deletions.
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
read the instructions from file 6-Contributing.md
2 changes: 1 addition & 1 deletion .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
git apply ../docs/antares-simulator-doxygen.patch
- name: Doxygen
uses: mattnotmitt/doxygen-action@v1.9.8
uses: mattnotmitt/doxygen-action@v1.12.0
with:
doxyfile-path: docs/Doxyfile

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ jobs:
unzip ortools.zip
rm ortools.zip
- name: Init submodule
run: git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests

- name: Install dependencies
run: |
pip3 install -r src/tests/examples/requirements.txt
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Init submodule
run: |
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests_NR
- name: Configure
run: |
Expand Down Expand Up @@ -140,6 +140,14 @@ jobs:
batch-name: short-tests
os: ${{ matrix.os }}

- name: Run tests on adequacy patch (CSR)
continue-on-error: true
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: adequacy-patch-CSR
os: ${{ matrix.os }}

- name: Collect coverage into one XML report
run: |
gcovr --sonarqube --output coverage.xml
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ jobs:
run: |
echo "SIMTEST=${{ fromJson(env.SIMTEST_JSON).version }}" >> $GITHUB_ENV
- name: Init submodule Antares_Simulator_Tests
run: |
git submodule update --init --remote --recursive src/tests/resources/Antares_Simulator_Tests
- name: Init submodule Antares_Simulator_Tests_NR
run: |
git submodule update --init --remote --recursive src/tests/resources/Antares_Simulator_Tests_NR
Expand Down Expand Up @@ -204,15 +200,6 @@ jobs:
batch-name: adequacy-patch-CSR
os: ${{ env.os }}

- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-parallel
os: ${{ env.os }}
variant: "parallel"

- name: Run tests introduced in 8.6.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
Expand Down Expand Up @@ -256,7 +243,7 @@ jobs:
- name: Run cucumber on short-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/short_tests.feature"
feature: "features/solver-features/short_tests.feature"

- name: Run mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
Expand Down Expand Up @@ -295,7 +282,7 @@ jobs:
- name: Run cucumber on medium-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/medium_tests.feature"
feature: "features/solver-features/medium_tests.feature"

- name: Run long-tests-1
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
Expand All @@ -321,6 +308,11 @@ jobs:
batch-name: long-tests-3
os: ${{ env.os }}

- name: Run cucumber on modeler
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/modeler-features"

- name: Barrier
if: ${{ !success() }}
run: exit 1
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ jobs:
run: |
echo "SIMTEST=${{ fromJson(env.SIMTEST_JSON).version }}" >> $GITHUB_ENV
- name: Init submodule Antares_Simulator_Tests
run: |
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests
- name: Init submodule Antares_Simulator_Tests_NR
run: |
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests_NR
Expand Down Expand Up @@ -248,7 +244,7 @@ jobs:
- name: Run cucumber on short-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/short_tests.feature"
feature: "features/solver-features/short_tests.feature"

- name: Run mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
Expand Down Expand Up @@ -287,7 +283,7 @@ jobs:
- name: Run cucumber on medium-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/medium_tests.feature"
feature: "features/solver-features/medium_tests.feature"

- name: Run long-tests-1
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
Expand All @@ -313,6 +309,11 @@ jobs:
batch-name: long-tests-3
os: ${{ env.os }}

- name: Run cucumber on modeler
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/modeler-features"

- name: Barrier
if: ${{ !success() }}
run: exit 1
Expand Down
6 changes: 2 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[submodule "src/tests/resources/Antares_Simulator_Tests"]
path = src/tests/resources/Antares_Simulator_Tests
url = https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests.git
branch = master
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
[submodule "src/tests/resources/Antares_Simulator_Tests_NR"]
path = src/tests/resources/Antares_Simulator_Tests_NR
url = https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests_NR.git
branch = main
ignore = dirty
38 changes: 4 additions & 34 deletions docs/developer-guide/2-Dependencies-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,27 @@ toc_depth: 2

- [Sirius Solver](https://github.com/AntaresSimulatorTeam/sirius-solver/tree/Antares_VCPKG) (fork from [RTE](https://github.com/rte-france/sirius-solver/tree/Antares_VCPKG))
- [OR-Tools](https://github.com/rte-france.com/or-tools) (fork from [Google](https://github.com/google/or-tools))
- [wxWidgets](https://github.com/wxWidgets/wxWidgets)
(Only for the complete Antares Simulator solution with GUI)
- [minizip](https://github.com/zlib-ng/minizip-ng) library, with its dependency zlib
- [Boost](https://www.boost.org/) libraries: header libraries and boost-test library
- [libuuid](https://linux.die.net/man/3/libuuid) on Linux systems

We favor using [vcpkg](https://github.com/microsoft/vcpkg) for building and installing most of those dependencies,
see [build instructions](3-Build.md) which explain how it integrates with CMake build.
However, we still have a few exceptions that must be installed in a different way, see next sections.

Although not encouraged, it's still possible to install those dependencies yourself and add
Although not encouraged, it's still possible to install those dependencies yourself and add
their installation path to your `CMAKE_PREFIX_PATH`.

## OR-Tools

OR-Tools may be installed in one of 2 ways:

1. **As a pre-compiled dependency**
1. **As a pre-compiled dependency**

You can [download](https://github.com/rte-france/or-tools/releases) a precompiled OR-Tools archive that contains headers & static libraries.

Please note that dynamic linking with OR-Tools is only supported in Linux.

Decompress the archive, and provide its path as a `CMAKE_PREFIX_PATH`.

2. **As part of the build**
Expand All @@ -40,31 +38,3 @@ OR-Tools may be installed in one of 2 ways:

The drawback of this second approach is that OR-Tools may need to be built again when you
run again a cmake configure step, therefore it's not advised for developers.


## Linux: libuuid and wxWidgets

On Linux systems, libuuid development packages need to be installed with your
OS package manager.
You will also need to install wxWidgets if you want to build the GUI.

=== "Centos"

```
sudo yum install libuuid-devel
sudo yum install wxGTK3-devel
```

=== "Ubuntu 20.04 or 22.04 / Debian 11"

```
sudo apt install uuid-dev
sudo apt install libwxgtk3.0-gtk3-dev
```

=== "Ubuntu 23.04 / Debian 12"

```
sudo apt install uuid-dev
sudo apt install libwxgtk3.2-dev
```
15 changes: 6 additions & 9 deletions docs/developer-guide/3-Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Before building, make sure that dependencies are [installed](2-Dependencies-inst

## Install VCPKG

Although you may install third party dependencies yourself, the preferred way is
Although you may install third party dependencies yourself, the preferred way is
to rely on [vcpkg](https://github.com/microsoft/vcpkg) and its CMake integration
to build and install most of them.

Expand Down Expand Up @@ -67,10 +67,10 @@ Here is a list of mandatory or optional CMake configuration options:
| `CMAKE_TOOLCHAIN_FILE` | no | Path to VCPKG toolchain file, allows to integrate VCPKG with cmake build | `../vcpkg/scripts/buildsystems/vcpkg.cmake` | |
| `VCPKG_TARGET_TRIPLET` | no | Define VCPKG triplet (build type for dependencies etc.) | `x64-windows-antares` / `x64-linux-antares` | |

> 💡 **Disable the UI build to make builds faster**
> 💡 **Disable the UI build to make builds faster**
> The UI takes up a good chunk of compilation time. It is enabled by default, but you can disable it by turning off `BUILD_UI`
> 💡 **Use Ninja to speed up target generation by CMake**
> 💡 **Use Ninja to speed up target generation by CMake**
> At configure time, you may specify Ninja for generation instead of traditional Make. This will speed up the update
> step after you make small changes to the code.
> ```
Expand All @@ -96,15 +96,13 @@ Here is a list of mandatory or optional CMake configuration options:
```
> 💡 Compilation can be done on several processors with `-j` option.
The final GUI file can be executed at `_build/ui/simulator/antares-X.Y-ui-simulator`
## Developer tips
### Use a compiler cache
### Use a compiler cache
In order to avoid unnecessary rebuilds, for example when you switch branches, you may use a compiler cache
such as ccache. Using it under Linux systems is pretty easy with CMake, you only need to specify it
such as ccache. Using it under Linux systems is pretty easy with CMake, you only need to specify it
as the compiler launcher at configure time:
```
cmake ... -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ...
Expand All @@ -119,5 +117,4 @@ This way git won't waste time computing diff on these when checking out, diffing
Keep in mind that your submodules won't be updated.
[^1]: GUI support has been dropped in favor of [Antares Web](https://antares-web.readthedocs.io)
[^1]: GUI support has been dropped in favor of [Antares Web](https://antares-web.readthedocs.io)
11 changes: 2 additions & 9 deletions docs/developer-guide/5-Installer-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ CPack can be used to create the installer after the build phase:
cd _build
cpack3 -G TGZ
```

### Required system libraries
There are still some system libraries that must be installed if you want to use *Antares Simulator*:
There are still some system libraries that must be installed if you want to use *Antares Simulator*:
```
sudo yum install epel-release
sudo yum install wxGTK3
```

=== "Ubuntu/Debian"
Expand All @@ -49,9 +48,3 @@ CPack can be used to create the installer after the build phase:
cd _build
cpack -G TGZ
```

### Required system libraries
There are still some system libraries that must be installed if you want to use *Antares Simulator*:
```
sudo apt install libwxgtk3.0-gtk3-0v5
```
10 changes: 5 additions & 5 deletions docs/developer-guide/6-Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ v = w * (x + z);
## Logging functions:
- Use `Antares::logs.[level]() << message` for logging, below is more detailed description for level:
- `logs.info() << msg` - always prints log message
- `logs.debug() << msg` - logs only in DEBUG
- `logs.warning() << msg` - the same as `logs.info()` but catches your attention
- `logs.error()` - the same as `logs.warning()`, but triggers an error when loading a study, with exceptions
- `logs.fatal()` - same as `logs.error()`
- `logs.fatal()`: indicates an error that causes a sudden shutdown of the application (e.g. null pointer exception, stack overflow, etc.). **Must not be used in antares-simulator** (use `error()` instead)
- `logs.error()`: indicates an error that causes unexpected processing behavior or interruption. Use it for anything that causes the simulation to stop (missing or malformed data, optimization error, etc.)
- `logs.warning() << msg`: indicates undesired behavior that is not an error, and that does not interrupt processing or the application. Use if for issues that do not interrupt simulation (obsolete parameter ignored, input data ignored, etc.).
- `logs.info() << msg`: information message explaining how the simulator works, intended for the person or application using it
- `logs.debug() << msg`: information message to facilitate debugging, intended for developers
Binary file not shown.
60 changes: 22 additions & 38 deletions docs/user-guide/04-migration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ The following properties were removed from **settings/generaldata.ini**.
- `adequacy patch/set-to-null-ntc-between-physical-out-for-first-step`
- `other preferences/initial-reservoir-levels`

If the user provides any of the key/values below
- `adequacy patch/enable-first-step = true`
- `adequacy patch/set-to-null-ntc-between-physical-out-for-first-step = false`
- `other preferences/initial-reservoir-levels = hot start`
the simulation will fail with a warning. We recommend removing these properties from `settings/generaldata.ini`. Other values (e.g `adequacy patch/enable-first-step = false`) will be ignored.

#### Short-term storages

- Added properties:
Expand All @@ -25,12 +31,18 @@ The following properties were removed from **settings/generaldata.ini**.
- `penalize-variation-withdrawal` boolean, default false (file
input/st-storage/series/<area id>/list.ini)

- Added timeseries cost-injection.txt, cost-withdrawal.txt, cost-level.txt, cost-variation-injection.txt and
cost-variation-withdrawal.txt. These files are optional. If present, they must contain either no value (same behavior
as no file), or HOURS_PER_YEAR = 8760 coefficients in one column. Each of these timeseries is located in directory
input/st-storage/series/<area id>/<ST id>/, along existing series (rule-curves.txt, etc.).
- Added 5 optional timeseries for each STS in existing directory `input/st-storage/series/<area id>/<ST id>/`
- `cost-injection.txt`
- `cost-withdrawal.txt`
- `cost-level.txt`
- `cost-variation-injection.txt`
- `cost-variation-withdrawal.txt`

It is possible to provide only k of these time-series, for k=0..5. However, if present each file must contain either no value (same behavior as no file), or HOURS_PER_YEAR = 8760 coefficients in one column. These timeseries are located along existing series (rule-curves.txt, etc.).

Note that in order for time-series `cost-variation-injection.txt` and `cost-variation-withdrawal.txt` to be taken into account, the user needs to set `penalize-variation-injection = true` (resp. `penalize-variation-withdrawal = true`). If not, these files will be ignored.

#### Final levels / scenario-builder
#### Hydro final levels / scenario-builder

- Added optional key type "hfl" (hydro final level) in the scenario builder. The syntax is equivalent to existing
prefix "hl" (hydro initial level), that is
Expand All @@ -41,41 +53,13 @@ hl,area,<year> = <value>

By convention, `year` start at 0 and `value` must be in interval [0, 1].

#### Compatibility flag for hydro pmax coefficients

In file settings/generaldata.ini, in section `other preferences`, add property `hydro-pmax-format` with possible values
`daily` (default, legacy) and `hourly` (new).

Note: This flag allows to bypass the breaking change that took place in version 9.1 for hydro max powers. It is possible
to support only the `legacy` file format.

### (TS-generator only) TS generation for link capacities

In files input/links/<link1>/properties.ini, add the following properties

- unitcount (unsigned int, default 1)
- nominalcapacity (float, default 0)
- law.planned (string "uniform"/"geometric", default "uniform")
- law.forced (same)
- volatility.planned (double in [0,1], default 0)
- volatility.forced (same)
- force-no-generation (true/false, default true)

- "prepro" timeseries => input/links/<link 1>/prepro/<link 2>_{direct, indirect}.txt, 365x6 values, respectively "forced
outage duration", "planned outage duration", "forced outage rate", "planned outage rate", "minimum of groups in
maintenance", "maximum of groups in maintenance".
- "modulation" timeseries => input/links/<link 1>/prepro/<link 2>_mod_{direct, indirect}.txt, 8760x1 values each
in [0, 1]
- number of TS to generate => generaldata.ini/General/nbtimeserieslinks (unsigned int, default value 1)

### Input

#### Hydro Final Reservoir Level
#### Compatibility flag for hydro maximal power

In the existing file **settings/scenariobuilder.dat**, under **&lt;ruleset&gt;** section following properties added (if
final reservoir level specified, different from `init`):
In file settings/generaldata.ini, in new section `other preferences`, add new property `hydro-pmax` with possible values
- `daily` (default, legacy)
- `hourly` (new).

* **hfl,&lt;area&gt;,&lt;year&gt; = &lt;hfl-value&gt;**
Note: This flag allows to bypass the breaking change that was introduced in version 9.1 the representation of max hydro power (daily -> hourly, see below). If flag is not specified or given value `daily`, the 8.8 format will be used for hydro pmax time-series. For reference, this format consists of a single file with 4 columns and 365 rows located in `input/hydro/common/capacity/maxpower_<area id>.txt`.

### Output

Expand Down
Loading

0 comments on commit 1f66833

Please sign in to comment.