Refactor project structure

This commit is contained in:
2022-12-13 10:15:31 +01:00
parent e18d44133a
commit f6fdc96c6d
30 changed files with 9 additions and 11 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "fimdlp/cppmdlp"] [submodule "fimdlp/cppmdlp"]
path = fimdlp/cppmdlp path = src/cppfimdlp
url = https://github.com/rmontanana/mdlp url = https://github.com/rmontanana/mdlp

View File

@@ -1 +0,0 @@
include fimdlp/cppmdlp/CPPFImdlp.h

View File

@@ -26,10 +26,9 @@ build: ## Build package
make clean make clean
python -m build --wheel python -m build --wheel
buildext: ## Build extension install: ## Build extension
make clean make clean
python setup.py build_ext pip install -e .
echo "Build extension success"
audit: ## Audit pip audit: ## Audit pip
pip-audit pip-audit

View File

@@ -2,7 +2,7 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <iomanip> #include <iomanip>
#include "../src/fimdlp/cppmdlp/CPPFImdlp.h" #include "../src/cppmdlp/CPPFImdlp.h"
using namespace std; using namespace std;
@@ -10,7 +10,7 @@ int main(int argc, char** argv)
{ {
ArffFiles file; ArffFiles file;
vector<string> lines; vector<string> lines;
string path = "../../src/fimdlp/cppmdlp/tests/datasets/"; string path = "../../src/cppmdlp/tests/datasets/";
map<string, bool > datasets = { map<string, bool > datasets = {
{"mfeat-factors", true}, {"mfeat-factors", true},
{"iris", true}, {"iris", true},

View File

@@ -20,7 +20,7 @@ ap.add_argument("dataset", type=str, choices=datasets.keys())
args = ap.parse_args() args = ap.parse_args()
relative = "" if os.path.isdir("src") else ".." relative = "" if os.path.isdir("src") else ".."
file_name = os.path.join( file_name = os.path.join(
relative, "src", "fimdlp", "cppmdlp", "tests", "datasets", args.dataset relative, "src", "cppmdlp", "tests", "datasets", args.dataset
) )
data = arff.loadarff(file_name + ".arff") data = arff.loadarff(file_name + ".arff")
df = pd.DataFrame(data[0]) df = pd.DataFrame(data[0])

View File

@@ -12,8 +12,8 @@ setup(
name="fimdlp.cppfimdlp", name="fimdlp.cppfimdlp",
sources=[ sources=[
"src/fimdlp/cfimdlp.pyx", "src/fimdlp/cfimdlp.pyx",
"src/fimdlp/cppmdlp/CPPFImdlp.cpp", "src/cppmdlp/CPPFImdlp.cpp",
"src/fimdlp/cppmdlp/Metrics.cpp", "src/cppmdlp/Metrics.cpp",
], ],
language="c++", language="c++",
include_dirs=["fimdlp"], include_dirs=["fimdlp"],

View File

@@ -3,7 +3,7 @@
from libcpp.vector cimport vector from libcpp.vector cimport vector
from libcpp cimport bool from libcpp cimport bool
cdef extern from "cppmdlp/CPPFImdlp.h" namespace "mdlp": cdef extern from "../cppmdlp/CPPFImdlp.h" namespace "mdlp":
ctypedef float precision_t ctypedef float precision_t
cdef cppclass CPPFImdlp: cdef cppclass CPPFImdlp:
CPPFImdlp(bool) except + CPPFImdlp(bool) except +