Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on:
push:
branches:
- 'main'
pull_request:

jobs:
build:
uses: powsybl/github-ci/.github/workflows/build-backend-lib-generic.yml@39565de6fd7d394ed76fa09e5197ffb1350ff1e6
with:
eventType: computation_updated
secrets:
sonar-token: ${{ secrets.SONAR_TOKEN }}
repo-token: ${{ secrets.REPO_ACCESS_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Patch

on:
workflow_dispatch:
inputs:
branchRef:
description: 'Patch branch (format: release-vX.Y.Z)'
required: true
type: string

jobs:
run-patch:
uses: powsybl/github-ci/.github/workflows/patch-backend-lib-generic.yml@39565de6fd7d394ed76fa09e5197ffb1350ff1e6
with:
githubappId: ${{ vars.GRIDSUITE_ACTIONS_APPID }}
branchRef: ${{ github.event.inputs.branchRef }}
secrets:
VERSIONBUMP_GHAPP_PRIVATE_KEY: ${{ secrets.VERSIONBUMP_GHAPP_PRIVATE_KEY }}
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release

on:
workflow_dispatch:
inputs:
versionType:
description: 'Version type increment (major | minor)'
required: true
type: choice
options:
- major
- minor

jobs:
run-release:
uses: powsybl/github-ci/.github/workflows/release-backend-lib-generic.yml@39565de6fd7d394ed76fa09e5197ffb1350ff1e6
with:
githubappId: ${{ vars.GRIDSUITE_ACTIONS_APPID }}
versionType: ${{ github.event.inputs.versionType }}
secrets:
VERSIONBUMP_GHAPP_PRIVATE_KEY: ${{ secrets.VERSIONBUMP_GHAPP_PRIVATE_KEY }}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# VSCode
/.vscode
/.settings
.classpath
.factorypath
.project

target/

# IntelliJ
/.idea
*.iml
Empty file added .mvn/lombok-config-copy.marker
Empty file.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# computation
# computation

[![Actions Status](https://github.com/gridsuite/computation/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/gridsuite/computation/actions)
[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=org.gridsuite%3Acomputation&metric=coverage)](https://sonarcloud.io/component_measures?id=org.gridsuite%3Acomputation&metric=coverage)
[![MPL-2.0 License](https://img.shields.io/badge/license-MPL_2.0-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/)

Common library for computation and result filtering.
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import target/configs/powsybl-build-tools.jar!powsybl-build-tools/lombok.config
228 changes: 228 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2025, RTE (http://www.rte-france.com)
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-parent</artifactId>
<version>23</version>
<relativePath/>
</parent>

<groupId>org.gridsuite</groupId>
<artifactId>gridsuite-computation</artifactId>
<version>1.0.0-SNAPSHOT</version>

<packaging>jar</packaging>
<name>Computation library</name>
<description>Common library for common computation and result filtering.</description>
<url>http://www.gridsuite.org/</url>

<scm>
<connection>scm:git:https://github.com/gridsuite/computation.git</connection>
<developerConnection>scm:git:https://github.com/gridsuite/computation.git</developerConnection>
<url>https://github.com/gridsuite/computation</url>
</scm>

<developers>
<developer>
<name>Rehili Ghazwa</name>
<email>[email protected]</email>
<organization>RTE</organization>
<organizationUrl>http://www.rte-france.com</organizationUrl>
</developer>
</developers>

<properties>
<powsybl-ws-dependencies.version>2.23.0</powsybl-ws-dependencies.version>
<gridsuite-filter.version>1.6.0</gridsuite-filter.version>

<org-apache-commons.version>4.4</org-apache-commons.version>
<org.hamcrest.version>2.2</org.hamcrest.version>

<sonar.organization>gridsuite</sonar.organization>
<sonar.projectKey>org.gridsuite:computation</sonar.projectKey>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencyManagement>
<dependencies>
<!-- Import -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-ws-dependencies</artifactId>
<version>${powsybl-ws-dependencies.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- ============================================= -->
<!-- COMPILATION DEPENDENCIES -->
<!-- ============================================= -->
<!-- Apache Commons -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>

<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- Jakarta APIs -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>

<!-- Spring Framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>

<!-- Spring Data -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>

<!-- Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
</dependency>

<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<optional>true</optional>
</dependency>

<!-- Micrometer -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<optional>true</optional>
</dependency>

<!-- Powsybl -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-client</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-security-analysis-api</artifactId>
<optional>true</optional>
</dependency>

<!-- GridSuite -->
<dependency>
<groupId>org.gridsuite</groupId>
<artifactId>gridsuite-filter</artifactId>
<version>${gridsuite-filter.version}</version>
</dependency>

<!-- ============================================= -->
<!-- PROVIDED DEPENDENCIES -->
<!-- ============================================= -->

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>

<!-- ============================================= -->
<!-- TEST DEPENDENCIES -->
<!-- ============================================= -->

<!-- JUnit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<!-- Mockito -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<!-- AssertJ -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<!-- Hamcrest -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${org.hamcrest.version}</version>
<scope>test</scope>
</dependency>

<!-- JSON Assert -->
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<scope>test</scope>
</dependency>

<!-- Spring Boot Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
23 changes: 23 additions & 0 deletions src/main/java/org/gridsuite/computation/ComputationConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright (c) 2025, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.gridsuite.computation;

import com.fasterxml.jackson.databind.InjectableValues;
import com.powsybl.commons.report.ReportNodeDeserializer;
import com.powsybl.commons.report.ReportNodeJsonModule;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ComputationConfig {
@Bean
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
return builder -> builder.modulesToInstall(new ReportNodeJsonModule())
.postConfigurer(objMapper -> objMapper.setInjectableValues(new InjectableValues.Std().addValue(ReportNodeDeserializer.DICTIONARY_VALUE_ID, null)));
}
}
Loading