-
Notifications
You must be signed in to change notification settings - Fork 0
First implementation for gridsuite-computation lib #1
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
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4a1c7dc
First implementation for gridsuite-computation lib
ghazwarhili 7e946ce
add dependencies version
ghazwarhili c30dd59
some fix
ghazwarhili 55a7807
CI fix
ghazwarhili 52b65be
sonar failure
ghazwarhili b47e501
fix README.md
ghazwarhili ddc6b37
code review Thang
ghazwarhili 0ede4d1
clean pom file
ghazwarhili 13ab75e
fix sonar issues
ghazwarhili e2dc317
update dependencies version
ghazwarhili File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
# computation | ||
# computation | ||
|
||
[](https://github.com/gridsuite/computation/actions) | ||
[](https://sonarcloud.io/component_measures?id=org.gridsuite%3Acomputation&metric=coverage) | ||
[](https://www.mozilla.org/en-US/MPL/2.0/) | ||
|
||
Common library for computation and result filtering. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.22.0</powsybl-ws-dependencies.version> | ||
<gridsuite-filter.version>1.5.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
23
src/main/java/org/gridsuite/computation/ComputationConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done