Update CMakeLists and conanfile

This commit is contained in:
2025-07-03 19:13:32 +02:00
parent 004528be8c
commit bedd2b5722
15 changed files with 227 additions and 899 deletions

View File

@@ -3,12 +3,15 @@ if(ENABLE_TESTING)
include_directories(
${PyClassifiers_SOURCE_DIR}
${Python3_INCLUDE_DIRS}
${TORCH_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/configured_files/include
/usr/local/include
)
file(GLOB_RECURSE PyClassifiers_SOURCES "${PyClassifiers_SOURCE_DIR}/pyclfs/*.cc")
set(TEST_SOURCES_PYCLASSIFIERS TestPythonClassifiers.cc TestUtils.cc ${PyClassifiers_SOURCES})
add_executable(${TEST_PYCLASSIFIERS} ${TEST_SOURCES_PYCLASSIFIERS})
target_link_libraries(${TEST_PYCLASSIFIERS} PUBLIC "${TORCH_LIBRARIES}" ${Python3_LIBRARIES} ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy fimdlp Catch2::Catch2WithMain)
endif(ENABLE_TESTING)
target_link_libraries(${TEST_PYCLASSIFIERS} PUBLIC
torch::torch ${Python3_LIBRARIES} ${LIBTORCH_PYTHON}
Boost::boost Boost::python Boost::numpy fimdlp::fimdlp
Catch2::Catch2WithMain nlohmann_json::nlohmann_json
bayesnet::bayesnet
)
endif(ENABLE_TESTING)

View File

@@ -1,11 +1,11 @@
#include "TestUtils.h"
#include "bayesnet/config.h"
#include "SourceData.h"
class Paths {
public:
static std::string datasets()
{
return { data_path.begin(), data_path.end() };
return pywrap::SourceData("Test").getPath();
}
};

View File

@@ -5,7 +5,7 @@
#include <vector>
#include <map>
#include <tuple>
#include "ArffFiles/ArffFiles.hpp"
#include "ArffFiles.hpp"
#include "fimdlp/CPPFImdlp.h"
bool file_exists(const std::string& name);
@@ -40,4 +40,4 @@ public:
double epsilon = 1e-5;
};
#endif //TEST_UTILS_H
#endif //TEST_UTILS_H

View File

@@ -0,0 +1,38 @@
#ifndef SOURCEDATA_H
#define SOURCEDATA_H
namespace pywrap {
enum fileType_t { CSV, ARFF, RDATA };
class SourceData {
public:
SourceData(std::string source)
{
if (source == "Surcov") {
path = "datasets/";
fileType = CSV;
} else if (source == "Arff") {
path = "datasets/";
fileType = ARFF;
} else if (source == "Tanveer") {
path = "data/";
fileType = RDATA;
} else if (source == "Test") {
path = "@TEST_DATA_PATH@/";
fileType = ARFF;
} else {
throw std::invalid_argument("Unknown source.");
}
}
std::string getPath()
{
return path;
}
fileType_t getFileType()
{
return fileType;
}
private:
std::string path;
fileType_t fileType;
};
}
#endif