From f351df82ce470cb3d027c7ed7fad6f52e3d5fbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Fri, 22 Nov 2024 13:18:03 +0100 Subject: [PATCH] Remove include dirs variable --- .vscode/launch.json | 2 +- CHANGELOG.md | 14 ++++++++++++-- CMakeLists.txt | 9 +-------- README.md | 2 +- bayesnet/CMakeLists.txt | 3 +-- sample/CMakeLists.txt | 3 +-- tests/CMakeLists.txt | 3 +-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 40fbf2f..a736a24 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,7 +16,7 @@ "name": "test", "program": "${workspaceFolder}/build_Debug/tests/TestBayesNet", "args": [ - "[Network]" + "Test Node computeCPT" ], "cwd": "${workspaceFolder}/build_Debug/tests" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 2505b39..a0f3a4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Prevent existing edges to be added to the network in the `add_edge` method. +- Don't allow to add nodes or edges on already fiited networks. +- Number of threads spawned +- Network class tests + ### Added - Library logo generated with to README.md @@ -19,12 +26,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add tests to check the correct version of the mdlp, folding and json libraries. - Library documentation generated with Doxygen. - Link to documentation in the README.md. -- Three types of smoothing the Bayesian Network OLD_LAPLACE, LAPLACE and CESTNIK. +- Three types of smoothing the Bayesian Network ORIGINAL, LAPLACE and CESTNIK. ### Internal +- Fixed doxygen optional dependency +- Add env parallel variable to Makefile +- Add CountingSemaphore class to manage the number of threads spawned. - Ignore CUDA language in CMake CodeCoverage module. -- Remove mdlp library from submodules and add it as a dependency. +- Update mdlp library as a git submodule. - Create library ShuffleArffFile to limit the number of samples with a parameter and shuffle them. - Refactor catch2 library location to test/lib - Refactor loadDataset function in tests. diff --git a/CMakeLists.txt b/CMakeLists.txt index 32beaa9..396c590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,16 +65,9 @@ endif (ENABLE_CLANG_TIDY) # External libraries - dependencies of BayesNet # --------------------------------------------- -# find_library(FImdlp NAMES libfimdlp.a REQUIRED) -# find_path(FImdlp_INCLUDE_DIRS REQUIRED NAMES fimdlp) - -# message(STATUS "FImdlp=${FImdlp}") -# message(STATUS "FImdlp_INCLUDE_DIRS=${FImdlp_INCLUDE_DIRS}") - -add_git_submodule("lib/mdlp") - # include(FetchContent) add_git_submodule("lib/json") +add_git_submodule("lib/mdlp") # Subdirectories # -------------- diff --git a/README.md b/README.md index 7cad08d..7b8e34b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=rmontanana_BayesNet&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=rmontanana_BayesNet) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=rmontanana_BayesNet&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=rmontanana_BayesNet) ![Gitea Last Commit](https://img.shields.io/gitea/last-commit/rmontanana/bayesnet?gitea_url=https://gitea.rmontanana.es:3000&logo=gitea) -[![Coverage Badge](https://img.shields.io/badge/Coverage-97,1%25-green)](html/index.html) +[![Coverage Badge](https://img.shields.io/badge/Coverage-96,8%25-green)](html/index.html) Bayesian Network Classifiers using libtorch from scratch diff --git a/bayesnet/CMakeLists.txt b/bayesnet/CMakeLists.txt index 845c72c..73d0ef7 100644 --- a/bayesnet/CMakeLists.txt +++ b/bayesnet/CMakeLists.txt @@ -4,10 +4,9 @@ include_directories( ${BayesNet_SOURCE_DIR}/lib/json/include ${BayesNet_SOURCE_DIR} ${CMAKE_BINARY_DIR}/configured_files/include - ${FImdlp_INCLUDE_DIRS} ) file(GLOB_RECURSE Sources "*.cc") add_library(BayesNet ${Sources}) -target_link_libraries(BayesNet mdlp "${TORCH_LIBRARIES}") +target_link_libraries(BayesNet fimdlp "${TORCH_LIBRARIES}") diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 31981c4..3799e89 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -8,7 +8,6 @@ find_package(Torch REQUIRED) find_library(BayesNet NAMES libBayesNet BayesNet libBayesNet.a REQUIRED) find_path(Bayesnet_INCLUDE_DIRS REQUIRED NAMES bayesnet) find_library(FImdlp NAMES libfimdlp.a PATHS REQUIRED) -find_path(FImdlp_INCLUDE_DIRS REQUIRED NAMES fimdlp) message(STATUS "FImdlp=${FImdlp}") message(STATUS "FImdlp_INCLUDE_DIRS=${FImdlp_INCLUDE_DIRS}") @@ -23,4 +22,4 @@ include_directories( ) add_executable(bayesnet_sample sample.cc) -target_link_libraries(bayesnet_sample ${FImdlp} "${TORCH_LIBRARIES}" "${BayesNet}") \ No newline at end of file +target_link_libraries(bayesnet_sample fimdlp "${TORCH_LIBRARIES}" "${BayesNet}") \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7a431d9..d7bfa85 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,13 +6,12 @@ if(ENABLE_TESTING) ${BayesNet_SOURCE_DIR}/lib/json/include ${BayesNet_SOURCE_DIR} ${CMAKE_BINARY_DIR}/configured_files/include - ${FImdlp_INCLUDE_DIRS} ) file(GLOB_RECURSE BayesNet_SOURCES "${BayesNet_SOURCE_DIR}/bayesnet/*.cc") add_executable(TestBayesNet TestBayesNetwork.cc TestBayesNode.cc TestBayesClassifier.cc TestBayesModels.cc TestBayesMetrics.cc TestFeatureSelection.cc TestBoostAODE.cc TestA2DE.cc TestUtils.cc TestBayesEnsemble.cc TestModulesVersions.cc TestBoostA2DE.cc ${BayesNet_SOURCES}) - target_link_libraries(TestBayesNet PUBLIC "${TORCH_LIBRARIES}" mdlp PRIVATE Catch2::Catch2WithMain) + target_link_libraries(TestBayesNet PUBLIC "${TORCH_LIBRARIES}" fimdlp PRIVATE Catch2::Catch2WithMain) add_test(NAME BayesNetworkTest COMMAND TestBayesNet) add_test(NAME A2DE COMMAND TestBayesNet "[A2DE]") add_test(NAME BoostA2DE COMMAND TestBayesNet "[BoostA2DE]")