Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f608090
Adding tetrad and junit 5 dependencies
JLaborda Jul 10, 2025
17d57dd
Cleaning and testing AlphaOrder
JLaborda Jul 10, 2025
04a1130
Cleaning and testing BetaToAlpha
JLaborda Jul 12, 2025
f12c247
Cleaning and testing TransformDags
JLaborda Jul 14, 2025
71e5cbe
Cleaning and testing ConsensusUnion and updating pom dependencies
JLaborda Jul 15, 2025
90688a8
Reformatring consensusBES and creating a new class for BES, consisten…
JLaborda Jul 16, 2025
d5f2f58
Cleaning and testing ConsensusBES
JLaborda Jul 16, 2025
48868e8
Cleaning applyBackwardEliminationWithDSeparation in BackwardEquivale…
JLaborda Jul 16, 2025
3d8b651
Cleaning and testing d-separation method and BESd algorithm
JLaborda Jul 17, 2025
6888065
Moving findNaXY to Utils as static and cleaning BESd
JLaborda Jul 18, 2025
f587377
Adding DSeparationKey for local map optimization
JLaborda Jul 18, 2025
ae6def1
Cleaned and tested BackwardEquivalenceSearchDSep
JLaborda Jul 18, 2025
6d08d80
Splitting UtilsTest into two
JLaborda Jul 18, 2025
9966f77
Cleaning and Testing PairWiseConsensusBES
JLaborda Jul 18, 2025
a5626e4
Improving coverage of BetaToAlpha
JLaborda Jul 18, 2025
1522069
Removing SubSet for HashSet
JLaborda Jul 21, 2025
8f8974b
Improving coverage of TransformDags
JLaborda Jul 21, 2025
7768c37
Cleaning and Testing PowerSet, ListFabric and deleting PowerSetFabric
JLaborda Jul 22, 2025
e38ed8f
Adding Javadoc to PowerSet
JLaborda Jul 22, 2025
df40b91
Deprecating RandomBN
JLaborda Jul 23, 2025
b2c59b9
Adding exception test cases for PairWiseConsensusBES
JLaborda Jul 23, 2025
e1249df
Cleaning and Testing HeuristicConsensus classes
JLaborda Jul 25, 2025
9120f8d
Cleanup ConsensusBES
JLaborda Jul 25, 2025
45f5cb3
Updating HeuristicConsensusBES with clean version
JLaborda Jul 25, 2025
d72eabf
Adding CI github action workflow and badge
JLaborda Jul 28, 2025
2cd719b
Solving javadoc issues
JLaborda Jul 29, 2025
3a6fdd7
Adding coverage check and bn_fusion.jpg
JLaborda Jul 29, 2025
ec20d5f
Adding basic tests for HierarchicalAgglomerativeClusterBNS
JLaborda Jul 29, 2025
53603f7
Adding Maven Central Repository and Github Packages workflow
JLaborda Jul 31, 2025
5cbb421
Adding gpg secrets
JLaborda Jul 31, 2025
c000ba7
Adding loopback in pinetry mode for gpg passphrase usage
JLaborda Jul 31, 2025
3c9df75
Adding passphare into command line
JLaborda Jul 31, 2025
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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI - Maven Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build, Test, and Check Coverage with Maven (80% coverage to pass)
run: mvn clean verify -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
46 changes: 46 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy
env:
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password

- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '17'
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Publish to Apache Maven Central
run: mvn deploy
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# consensusBN - Bayesian Network Fusion

[![CI](https://github.com/UCLM-SIMD/consensusBN/actions/workflows/ci.yml/badge.svg)](https://github.com/UCLM-SIMD/consensusBN/actions/workflows/ci.yml)
![Java](https://img.shields.io/badge/Java-8%2B-blue)
![Maven](https://img.shields.io/badge/Maven-3.6%2B-orange)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
Expand All @@ -8,7 +9,7 @@

`consensusBN` is a Java-based library for Bayesian Network Fusion. This project allows users to combine multiple Bayesian networks into a single consensus network, leveraging the power of consensus-based modeling techniques. The project is supported by a published paper [(link)](https://www.sciencedirect.com/science/article/abs/pii/S156625352030364X), titled "Efficient and accurate structural fusion of Bayesian networks."

![Bayesian Network Fusion](assets/bn_fusion.png)
![Bayesian Network Fusion](assets/bn_fusion.jpg)

## Features

Expand Down
Binary file added assets/bn_fusion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 124 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<!--Project Information-->
<groupId>org.albacete.simd</groupId>
<groupId>io.github.jlaborda</groupId>
<artifactId>consensusBN</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
Expand Down Expand Up @@ -55,19 +55,33 @@

<dependencies>
<!-- Tetrad Library -->
<dependency>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad-lib</artifactId>
<!--<version>7.1.2-2</version>-->
<version>7.6.4</version>
</dependency>
<dependency>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad-lib</artifactId>
<!--<version>7.1.2-2</version>-->
<version>7.6.4</version>
</dependency>

<!--<dependency>
<groupId>io.github.cmu-phil</groupId>
<artifactId>data-reader</artifactId>
<version>7.1.2-2</version>
</dependency>
-->
<!-- JUnit 5 (Jupiter) API and engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<!-- Apache Commons Math3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>

</dependencies>

<build>
Expand All @@ -92,17 +106,38 @@
</configuration>
</plugin>

<!--Maven-GPG-Plugin for signing artifacts-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>

<!-- Configure the Maven Source Plugin for source code packaging -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
<goal>jar</goal>
</goals>
</execution>
</executions>
Expand All @@ -112,7 +147,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -123,23 +158,99 @@
</executions>
</plugin>

<!-- Configure the Maven Surefire Plugin for running tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.1.2</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.0</version>
</dependency>
</dependencies>
</plugin>

<!--JaCoCo for checking coberture-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<configuration>
<excludes>
<exclude>**/RandomBN.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jacoco-report</outputDirectory>
</configuration>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>

<!--Maven Central Repository Publishing Plugin-->
<!--This looks for user token and pwd in settings.xml-->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>

</plugins>
</build>

<!-- Define the distribution management (for deployment) -->
<!--
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

-->


</project>
Loading