From 9ca5482f10fe3cf9733493db0c1637687c5227ce Mon Sep 17 00:00:00 2001 From: Szczepanski Nicolas Date: Tue, 10 Oct 2023 18:22:25 +0200 Subject: [PATCH] Update Installation procedure --- .gitignore | 179 +------- .gitmodules | 3 + LICENSE | 21 + MANIFEST.in | 18 + dev-requirements.txt | 1 + pyxai/.gitignore | 160 +++++++ Builder.py => pyxai/Builder.py | 0 Dockerfile => pyxai/Dockerfile | 0 Explainer.py => pyxai/Explainer.py | 0 LICENCE => pyxai/LICENCE | 0 Learning.py => pyxai/Learning.py | 0 README.md => pyxai/README.md | 0 Tools.py => pyxai/Tools.py | 0 __init__.py => pyxai/__init__.py | 0 clean.sh => pyxai/clean.sh | 0 convert.py => pyxai/convert.py | 0 .../.virtual_documents/Untitled.ipynb | 0 .../docker}/pyxai-experimental/Dockerfile | 0 .../docker}/pyxai-experimental/Untitled.ipynb | 0 .../examples}/BT/GUI-mnist38.py | 0 .../examples}/BT/builder-simple.py | 0 .../BT/regression/builder-regression.py | 0 .../BT/regression/simple-regression.py | 0 {examples => pyxai/examples}/BT/simple.py | 0 .../Converters/bad/converter-dorothea.py | 0 .../examples}/Converters/converter-adult.py | 0 .../Converters/converter-australian.py | 0 .../Converters/converter-balance-scale.py | 0 .../examples}/Converters/converter-bank.py | 0 .../Converters/converter-biodegradation.py | 0 .../Converters/converter-breast-tumor.py | 0 .../examples}/Converters/converter-bupa.py | 0 .../Converters/converter-christine.py | 0 .../examples}/Converters/converter-cifar.py | 0 .../Converters/converter-cleveland.py | 0 .../examples}/Converters/converter-cnae.py | 0 .../examples}/Converters/converter-compas.py | 0 .../Converters/converter-contraceptive.py | 0 .../Converters/converter-default-paiement.py | 0 .../examples}/Converters/converter-dexter.py | 0 .../examples}/Converters/converter-divorce.py | 0 .../examples}/Converters/converter-german.py | 0 .../examples}/Converters/converter-gisette.py | 0 .../examples}/Converters/converter-melb.py | 0 .../examples}/Converters/converter-mnist.py | 0 .../Converters/converter-regression.py | 0 .../Converters/converter-spambase.py | 0 {examples => pyxai/examples}/DT/GUI-cifar.py | 0 .../examples}/DT/GUI-mnist38-contrastives.py | 0 .../examples}/DT/GUI-mnist38.py | 0 .../examples}/DT/builder-loan.py | 0 .../examples}/DT/builder-orchid.py | 0 {examples => pyxai/examples}/DT/simple.py | 0 .../examples}/RF/GUI-australian.py | 0 .../examples}/RF/GUI-builder-loan.py | 0 .../examples}/RF/GUI-mnist49.py | 0 .../examples}/RF/builder-categorical-paper.py | 0 .../examples}/RF/builder-categorical.py | 0 .../examples}/RF/builder-cattleya.py | 0 .../examples}/RF/builder-loan-simple.py | 0 .../examples}/RF/builder-loan.py | 0 .../examples}/RF/builder-multiclasses.py | 0 {examples => pyxai/examples}/RF/simple.py | 0 .../examples}/RF/theories-majoritary.py | 0 .../examples}/RF/theories-types-dict.py | 0 .../examples}/RF/theories-types-file.py | 0 .../BT_builder_regression.explainer | Bin .../explanations}/BT_builder_simple.explainer | Bin .../explanations}/BT_iris.explainer | Bin ...BT_mnist38_tree_specific_class_3.explainer | Bin ...BT_mnist38_tree_specific_class_8.explainer | Bin .../BT_wine_regression.explainer | Bin .../explanations}/DT_dexter.explainer | Bin .../explanations}/DT_loan.explainer | Bin .../DT_mnist38_contrastives.explainer | Bin .../DT_mnist38_hot_map.explainer | Bin .../explanations}/DT_orchid.explainer | Bin .../explanations}/DT_wine.explainer | Bin .../RF_australian_majoritary.explainer | Bin .../RF_australian_theory.explainer | Bin .../explanations}/RF_biodegradation.explainer | Bin .../RF_breast_tumor_theory.explainer | Bin .../explanations}/RF_buba.explainer | Bin .../RF_cifar_cat_minimal_majoritary.explainer | Bin .../explanations}/RF_cnae.explainer | Bin .../RF_iris_majoritary_theory.explainer | Bin .../RF_mnist49_minimal_majoritary.explainer | Bin pyxai/setup.py | 19 + {sources => pyxai/sources}/__init__.py | 0 {sources => pyxai/sources}/core/__init__.py | 0 .../sources}/core/explainer/Explainer.py | 0 .../sources}/core/explainer/__init__.py | 0 .../sources}/core/explainer/explainerBT.py | 0 .../sources}/core/explainer/explainerDT.py | 0 .../sources}/core/explainer/explainerRF.py | 0 .../core/explainer/explainerRegressionBT.py | 0 .../sources}/core/structure/__init__.py | 0 .../sources}/core/structure/binaryMapping.py | 0 .../sources}/core/structure/boostedTrees.py | 0 .../sources}/core/structure/decisionNode.py | 0 .../sources}/core/structure/decisionTree.py | 0 .../sources}/core/structure/randomForest.py | 0 .../sources}/core/structure/treeEnsembles.py | 0 .../sources}/core/structure/type.py | 0 .../sources}/core/tools/GUIQT.py | 0 .../sources}/core/tools/__init__.py | 0 .../sources}/core/tools/encoding.py | 0 .../sources}/core/tools/option.py | 0 .../sources}/core/tools/utils.py | 0 .../sources}/core/tools/vizualisation.py | 0 .../sources}/learning/__init__.py | 0 .../sources}/learning/generic.py | 0 .../sources}/learning/learner.py | 0 .../sources}/learning/learner_information.py | 0 .../sources}/learning/lightgbm.py | 0 .../sources}/learning/preprocessor.py | 0 .../sources}/learning/scikitlearn.py | 0 .../sources}/learning/xgboost.py | 0 .../sources}/solvers/COMPILER/D4Solver.py | 0 .../sources}/solvers/COMPILER/d4_static | Bin .../solvers/CPLEX/SufficientRegressionBT.py | 0 .../sources}/solvers/CPLEX/__init__.py | 0 .../sources}/solvers/CSP/AbductiveV1.py | 0 .../sources}/solvers/CSP/AbductiveV2.py | 0 .../sources}/solvers/CSP/TSMinimalV1.py | 0 .../sources}/solvers/CSP/TSMinimalV2.py | 0 .../sources}/solvers/CSP/TSMinimalV3.py | 0 .../solvers/GRAPH/TreeDecomposition.py | 0 .../sources}/solvers/GREEDY/CMakeLists.txt | 0 .../sources}/solvers/GREEDY/src/Explainer.cc | 0 .../sources}/solvers/GREEDY/src/Explainer.h | 0 .../sources}/solvers/GREEDY/src/Node.cc | 0 .../sources}/solvers/GREEDY/src/Node.h | 0 .../sources}/solvers/GREEDY/src/Tree.cc | 0 .../sources}/solvers/GREEDY/src/Tree.h | 0 .../solvers/GREEDY/src/bcp/BufferRead.h | 0 .../solvers/GREEDY/src/bcp/FactoryException.h | 0 .../solvers/GREEDY/src/bcp/ParserDimacs.cc | 0 .../solvers/GREEDY/src/bcp/ParserDimacs.h | 0 .../solvers/GREEDY/src/bcp/Problem.cc | 0 .../sources}/solvers/GREEDY/src/bcp/Problem.h | 0 .../solvers/GREEDY/src/bcp/ProblemTypes.cc | 0 .../solvers/GREEDY/src/bcp/ProblemTypes.h | 0 .../solvers/GREEDY/src/bcp/Propagator.cc | 0 .../solvers/GREEDY/src/bcp/Propagator.h | 0 .../sources}/solvers/GREEDY/src/bt_wrapper.cc | 0 .../sources}/solvers/GREEDY/src/constants.h | 0 .../solvers/GREEDY/src/utils/TimerHelper.h | 0 .../sources}/solvers/MAXSAT/MAXSATSolver.py | 0 .../sources}/solvers/MAXSAT/OPENWBOSolver.py | 0 .../sources}/solvers/MAXSAT/RC2solver.py | 0 .../sources}/solvers/MAXSAT/__init__.py | 0 .../sources}/solvers/MAXSAT/openwbo-darwin | Bin .../sources}/solvers/MAXSAT/openwbo-linux | Bin .../sources}/solvers/MUS/MUSERSolver.py | 0 .../sources}/solvers/MUS/OPTUXSolver.py | 0 .../sources}/solvers/MUS/__init__.py | 0 .../sources}/solvers/MUS/muser_static | Bin .../sources}/solvers/SAT/glucoseSolver.py | 0 .../sources}/solvers/__init__.py | 0 {tests => pyxai/tests}/compas.csv | 0 {tests => pyxai/tests}/dermatology.csv | 0 {tests => pyxai/tests}/explaining/bt.py | 0 {tests => pyxai/tests}/explaining/dt.py | 0 {tests => pyxai/tests}/explaining/misc.py | 0 .../tests}/explaining/regressionbt.py | 0 .../tests}/explaining/rf-multiclasses.py | 0 {tests => pyxai/tests}/explaining/rf.py | 0 .../tests}/functionality/GetInstances.py | 0 .../tests}/functionality/ToFeatures.py | 0 {tests => pyxai/tests}/importing/LightGBM.py | 0 .../tests}/importing/ScikitLearn.py | 0 .../tests}/importing/SimpleScikitLearn.py | 0 {tests => pyxai/tests}/importing/XGBoost.py | 0 {tests => pyxai/tests}/iris.csv | 0 {tests => pyxai/tests}/learning/LightGBM.py | 0 .../tests}/learning/ScikitLearn.py | 0 {tests => pyxai/tests}/learning/XGBoost.py | 0 {tests => pyxai/tests}/saveload/LightGBM.py | 0 .../tests}/saveload/ScikitLearn.py | 0 {tests => pyxai/tests}/saveload/XGBoost.py | 0 {tests => pyxai/tests}/tests.py | 0 {tests => pyxai/tests}/winequality-red.csv | 0 version.txt => pyxai/version.txt | 0 setup.py | 52 ++- update_pypi_version-OSX.py | 32 ++ update_pypi_version.py | 32 ++ valgrind-python.supp | 391 ++++++++++++++++++ 188 files changed, 735 insertions(+), 173 deletions(-) create mode 100644 .gitmodules create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 dev-requirements.txt create mode 100644 pyxai/.gitignore rename Builder.py => pyxai/Builder.py (100%) rename Dockerfile => pyxai/Dockerfile (100%) rename Explainer.py => pyxai/Explainer.py (100%) rename LICENCE => pyxai/LICENCE (100%) rename Learning.py => pyxai/Learning.py (100%) rename README.md => pyxai/README.md (100%) rename Tools.py => pyxai/Tools.py (100%) rename __init__.py => pyxai/__init__.py (100%) rename clean.sh => pyxai/clean.sh (100%) rename convert.py => pyxai/convert.py (100%) rename {docker => pyxai/docker}/pyxai-experimental/.virtual_documents/Untitled.ipynb (100%) rename {docker => pyxai/docker}/pyxai-experimental/Dockerfile (100%) rename {docker => pyxai/docker}/pyxai-experimental/Untitled.ipynb (100%) rename {examples => pyxai/examples}/BT/GUI-mnist38.py (100%) rename {examples => pyxai/examples}/BT/builder-simple.py (100%) rename {examples => pyxai/examples}/BT/regression/builder-regression.py (100%) rename {examples => pyxai/examples}/BT/regression/simple-regression.py (100%) rename {examples => pyxai/examples}/BT/simple.py (100%) rename {examples => pyxai/examples}/Converters/bad/converter-dorothea.py (100%) rename {examples => pyxai/examples}/Converters/converter-adult.py (100%) rename {examples => pyxai/examples}/Converters/converter-australian.py (100%) rename {examples => pyxai/examples}/Converters/converter-balance-scale.py (100%) rename {examples => pyxai/examples}/Converters/converter-bank.py (100%) rename {examples => pyxai/examples}/Converters/converter-biodegradation.py (100%) rename {examples => pyxai/examples}/Converters/converter-breast-tumor.py (100%) rename {examples => pyxai/examples}/Converters/converter-bupa.py (100%) rename {examples => pyxai/examples}/Converters/converter-christine.py (100%) rename {examples => pyxai/examples}/Converters/converter-cifar.py (100%) rename {examples => pyxai/examples}/Converters/converter-cleveland.py (100%) rename {examples => pyxai/examples}/Converters/converter-cnae.py (100%) rename {examples => pyxai/examples}/Converters/converter-compas.py (100%) rename {examples => pyxai/examples}/Converters/converter-contraceptive.py (100%) rename {examples => pyxai/examples}/Converters/converter-default-paiement.py (100%) rename {examples => pyxai/examples}/Converters/converter-dexter.py (100%) rename {examples => pyxai/examples}/Converters/converter-divorce.py (100%) rename {examples => pyxai/examples}/Converters/converter-german.py (100%) rename {examples => pyxai/examples}/Converters/converter-gisette.py (100%) rename {examples => pyxai/examples}/Converters/converter-melb.py (100%) rename {examples => pyxai/examples}/Converters/converter-mnist.py (100%) rename {examples => pyxai/examples}/Converters/converter-regression.py (100%) rename {examples => pyxai/examples}/Converters/converter-spambase.py (100%) rename {examples => pyxai/examples}/DT/GUI-cifar.py (100%) rename {examples => pyxai/examples}/DT/GUI-mnist38-contrastives.py (100%) rename {examples => pyxai/examples}/DT/GUI-mnist38.py (100%) rename {examples => pyxai/examples}/DT/builder-loan.py (100%) rename {examples => pyxai/examples}/DT/builder-orchid.py (100%) rename {examples => pyxai/examples}/DT/simple.py (100%) rename {examples => pyxai/examples}/RF/GUI-australian.py (100%) rename {examples => pyxai/examples}/RF/GUI-builder-loan.py (100%) rename {examples => pyxai/examples}/RF/GUI-mnist49.py (100%) rename {examples => pyxai/examples}/RF/builder-categorical-paper.py (100%) rename {examples => pyxai/examples}/RF/builder-categorical.py (100%) rename {examples => pyxai/examples}/RF/builder-cattleya.py (100%) rename {examples => pyxai/examples}/RF/builder-loan-simple.py (100%) rename {examples => pyxai/examples}/RF/builder-loan.py (100%) rename {examples => pyxai/examples}/RF/builder-multiclasses.py (100%) rename {examples => pyxai/examples}/RF/simple.py (100%) rename {examples => pyxai/examples}/RF/theories-majoritary.py (100%) rename {examples => pyxai/examples}/RF/theories-types-dict.py (100%) rename {examples => pyxai/examples}/RF/theories-types-file.py (100%) rename {explanations => pyxai/explanations}/BT_builder_regression.explainer (100%) rename {explanations => pyxai/explanations}/BT_builder_simple.explainer (100%) rename {explanations => pyxai/explanations}/BT_iris.explainer (100%) rename {explanations => pyxai/explanations}/BT_mnist38_tree_specific_class_3.explainer (100%) rename {explanations => pyxai/explanations}/BT_mnist38_tree_specific_class_8.explainer (100%) rename {explanations => pyxai/explanations}/BT_wine_regression.explainer (100%) rename {explanations => pyxai/explanations}/DT_dexter.explainer (100%) rename {explanations => pyxai/explanations}/DT_loan.explainer (100%) rename {explanations => pyxai/explanations}/DT_mnist38_contrastives.explainer (100%) rename {explanations => pyxai/explanations}/DT_mnist38_hot_map.explainer (100%) rename {explanations => pyxai/explanations}/DT_orchid.explainer (100%) rename {explanations => pyxai/explanations}/DT_wine.explainer (100%) rename {explanations => pyxai/explanations}/RF_australian_majoritary.explainer (100%) rename {explanations => pyxai/explanations}/RF_australian_theory.explainer (100%) rename {explanations => pyxai/explanations}/RF_biodegradation.explainer (100%) rename {explanations => pyxai/explanations}/RF_breast_tumor_theory.explainer (100%) rename {explanations => pyxai/explanations}/RF_buba.explainer (100%) rename {explanations => pyxai/explanations}/RF_cifar_cat_minimal_majoritary.explainer (100%) rename {explanations => pyxai/explanations}/RF_cnae.explainer (100%) rename {explanations => pyxai/explanations}/RF_iris_majoritary_theory.explainer (100%) rename {explanations => pyxai/explanations}/RF_mnist49_minimal_majoritary.explainer (100%) create mode 100644 pyxai/setup.py rename {sources => pyxai/sources}/__init__.py (100%) rename {sources => pyxai/sources}/core/__init__.py (100%) rename {sources => pyxai/sources}/core/explainer/Explainer.py (100%) rename {sources => pyxai/sources}/core/explainer/__init__.py (100%) rename {sources => pyxai/sources}/core/explainer/explainerBT.py (100%) rename {sources => pyxai/sources}/core/explainer/explainerDT.py (100%) rename {sources => pyxai/sources}/core/explainer/explainerRF.py (100%) rename {sources => pyxai/sources}/core/explainer/explainerRegressionBT.py (100%) rename {sources => pyxai/sources}/core/structure/__init__.py (100%) rename {sources => pyxai/sources}/core/structure/binaryMapping.py (100%) rename {sources => pyxai/sources}/core/structure/boostedTrees.py (100%) rename {sources => pyxai/sources}/core/structure/decisionNode.py (100%) rename {sources => pyxai/sources}/core/structure/decisionTree.py (100%) rename {sources => pyxai/sources}/core/structure/randomForest.py (100%) rename {sources => pyxai/sources}/core/structure/treeEnsembles.py (100%) rename {sources => pyxai/sources}/core/structure/type.py (100%) rename {sources => pyxai/sources}/core/tools/GUIQT.py (100%) rename {sources => pyxai/sources}/core/tools/__init__.py (100%) rename {sources => pyxai/sources}/core/tools/encoding.py (100%) rename {sources => pyxai/sources}/core/tools/option.py (100%) rename {sources => pyxai/sources}/core/tools/utils.py (100%) rename {sources => pyxai/sources}/core/tools/vizualisation.py (100%) rename {sources => pyxai/sources}/learning/__init__.py (100%) rename {sources => pyxai/sources}/learning/generic.py (100%) rename {sources => pyxai/sources}/learning/learner.py (100%) rename {sources => pyxai/sources}/learning/learner_information.py (100%) rename {sources => pyxai/sources}/learning/lightgbm.py (100%) rename {sources => pyxai/sources}/learning/preprocessor.py (100%) rename {sources => pyxai/sources}/learning/scikitlearn.py (100%) rename {sources => pyxai/sources}/learning/xgboost.py (100%) rename {sources => pyxai/sources}/solvers/COMPILER/D4Solver.py (100%) rename {sources => pyxai/sources}/solvers/COMPILER/d4_static (100%) rename {sources => pyxai/sources}/solvers/CPLEX/SufficientRegressionBT.py (100%) rename {sources => pyxai/sources}/solvers/CPLEX/__init__.py (100%) rename {sources => pyxai/sources}/solvers/CSP/AbductiveV1.py (100%) rename {sources => pyxai/sources}/solvers/CSP/AbductiveV2.py (100%) rename {sources => pyxai/sources}/solvers/CSP/TSMinimalV1.py (100%) rename {sources => pyxai/sources}/solvers/CSP/TSMinimalV2.py (100%) rename {sources => pyxai/sources}/solvers/CSP/TSMinimalV3.py (100%) rename {sources => pyxai/sources}/solvers/GRAPH/TreeDecomposition.py (100%) rename {sources => pyxai/sources}/solvers/GREEDY/CMakeLists.txt (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/Explainer.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/Explainer.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/Node.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/Node.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/Tree.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/Tree.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/BufferRead.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/FactoryException.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/ParserDimacs.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/ParserDimacs.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/Problem.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/Problem.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/ProblemTypes.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/ProblemTypes.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/Propagator.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bcp/Propagator.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/bt_wrapper.cc (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/constants.h (100%) rename {sources => pyxai/sources}/solvers/GREEDY/src/utils/TimerHelper.h (100%) rename {sources => pyxai/sources}/solvers/MAXSAT/MAXSATSolver.py (100%) rename {sources => pyxai/sources}/solvers/MAXSAT/OPENWBOSolver.py (100%) rename {sources => pyxai/sources}/solvers/MAXSAT/RC2solver.py (100%) rename {sources => pyxai/sources}/solvers/MAXSAT/__init__.py (100%) rename {sources => pyxai/sources}/solvers/MAXSAT/openwbo-darwin (100%) rename {sources => pyxai/sources}/solvers/MAXSAT/openwbo-linux (100%) rename {sources => pyxai/sources}/solvers/MUS/MUSERSolver.py (100%) rename {sources => pyxai/sources}/solvers/MUS/OPTUXSolver.py (100%) rename {sources => pyxai/sources}/solvers/MUS/__init__.py (100%) rename {sources => pyxai/sources}/solvers/MUS/muser_static (100%) rename {sources => pyxai/sources}/solvers/SAT/glucoseSolver.py (100%) rename {sources => pyxai/sources}/solvers/__init__.py (100%) rename {tests => pyxai/tests}/compas.csv (100%) rename {tests => pyxai/tests}/dermatology.csv (100%) rename {tests => pyxai/tests}/explaining/bt.py (100%) rename {tests => pyxai/tests}/explaining/dt.py (100%) rename {tests => pyxai/tests}/explaining/misc.py (100%) rename {tests => pyxai/tests}/explaining/regressionbt.py (100%) rename {tests => pyxai/tests}/explaining/rf-multiclasses.py (100%) rename {tests => pyxai/tests}/explaining/rf.py (100%) rename {tests => pyxai/tests}/functionality/GetInstances.py (100%) rename {tests => pyxai/tests}/functionality/ToFeatures.py (100%) rename {tests => pyxai/tests}/importing/LightGBM.py (100%) rename {tests => pyxai/tests}/importing/ScikitLearn.py (100%) rename {tests => pyxai/tests}/importing/SimpleScikitLearn.py (100%) rename {tests => pyxai/tests}/importing/XGBoost.py (100%) rename {tests => pyxai/tests}/iris.csv (100%) rename {tests => pyxai/tests}/learning/LightGBM.py (100%) rename {tests => pyxai/tests}/learning/ScikitLearn.py (100%) rename {tests => pyxai/tests}/learning/XGBoost.py (100%) rename {tests => pyxai/tests}/saveload/LightGBM.py (100%) rename {tests => pyxai/tests}/saveload/ScikitLearn.py (100%) rename {tests => pyxai/tests}/saveload/XGBoost.py (100%) rename {tests => pyxai/tests}/tests.py (100%) rename {tests => pyxai/tests}/winequality-red.csv (100%) rename version.txt => pyxai/version.txt (100%) create mode 100644 update_pypi_version-OSX.py create mode 100644 update_pypi_version.py create mode 100644 valgrind-python.supp diff --git a/.gitignore b/.gitignore index 2ec719c..2690496 100644 --- a/.gitignore +++ b/.gitignore @@ -1,160 +1,25 @@ -#from https://github.com/github/gitignore/blob/main/Python.gitignore - -.idea -tmp_diagram.png .vscode/ -examples/datasets/ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class *.pyc -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: +*~ +*# +#* +.#* +.spyproject/* +.idea +*pycache* +*.*~ +*.*# +*.aux *.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - +*.nav +*.out +*.snm +*.toc +*.vrb +build +dist +requirements-download/ +*.xml +wheelhouse +pyxai.egg-info/ +pyxai_experimental.egg-info/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d7ab163 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pyxai"] + path = pyxai + url = https://gitlab.univ-artois.fr/pyxai/pyxai-experimental.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ef43ab5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 CRIL + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3c034e8 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,18 @@ + +include pyxai/version.txt + +recursive-include pyxai/sources/solvers/COMPILER/ * +recursive-include pyxai/sources/solvers/CPP_CODE/ * +recursive-include pyxai/sources/solvers/CSP/ * +recursive-include pyxai/sources/solvers/GRAPH/ * +recursive-include pyxai/sources/solvers/MAXSAT/ * +recursive-include pyxai/sources/solvers/MUS/ * +recursive-include pyxai/sources/solvers/SAT/ * + +recursive-include pyxai/examples/ * +recursive-include pyxai/explanations/ * + +global-exclude __pycache__ +global-exclude *.pyc +prune __pycache__ +prune *.pyc \ No newline at end of file diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..f3c7e8e --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1 @@ +nose diff --git a/pyxai/.gitignore b/pyxai/.gitignore new file mode 100644 index 0000000..2ec719c --- /dev/null +++ b/pyxai/.gitignore @@ -0,0 +1,160 @@ +#from https://github.com/github/gitignore/blob/main/Python.gitignore + +.idea +tmp_diagram.png +.vscode/ +examples/datasets/ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +*.pyc +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + diff --git a/Builder.py b/pyxai/Builder.py similarity index 100% rename from Builder.py rename to pyxai/Builder.py diff --git a/Dockerfile b/pyxai/Dockerfile similarity index 100% rename from Dockerfile rename to pyxai/Dockerfile diff --git a/Explainer.py b/pyxai/Explainer.py similarity index 100% rename from Explainer.py rename to pyxai/Explainer.py diff --git a/LICENCE b/pyxai/LICENCE similarity index 100% rename from LICENCE rename to pyxai/LICENCE diff --git a/Learning.py b/pyxai/Learning.py similarity index 100% rename from Learning.py rename to pyxai/Learning.py diff --git a/README.md b/pyxai/README.md similarity index 100% rename from README.md rename to pyxai/README.md diff --git a/Tools.py b/pyxai/Tools.py similarity index 100% rename from Tools.py rename to pyxai/Tools.py diff --git a/__init__.py b/pyxai/__init__.py similarity index 100% rename from __init__.py rename to pyxai/__init__.py diff --git a/clean.sh b/pyxai/clean.sh similarity index 100% rename from clean.sh rename to pyxai/clean.sh diff --git a/convert.py b/pyxai/convert.py similarity index 100% rename from convert.py rename to pyxai/convert.py diff --git a/docker/pyxai-experimental/.virtual_documents/Untitled.ipynb b/pyxai/docker/pyxai-experimental/.virtual_documents/Untitled.ipynb similarity index 100% rename from docker/pyxai-experimental/.virtual_documents/Untitled.ipynb rename to pyxai/docker/pyxai-experimental/.virtual_documents/Untitled.ipynb diff --git a/docker/pyxai-experimental/Dockerfile b/pyxai/docker/pyxai-experimental/Dockerfile similarity index 100% rename from docker/pyxai-experimental/Dockerfile rename to pyxai/docker/pyxai-experimental/Dockerfile diff --git a/docker/pyxai-experimental/Untitled.ipynb b/pyxai/docker/pyxai-experimental/Untitled.ipynb similarity index 100% rename from docker/pyxai-experimental/Untitled.ipynb rename to pyxai/docker/pyxai-experimental/Untitled.ipynb diff --git a/examples/BT/GUI-mnist38.py b/pyxai/examples/BT/GUI-mnist38.py similarity index 100% rename from examples/BT/GUI-mnist38.py rename to pyxai/examples/BT/GUI-mnist38.py diff --git a/examples/BT/builder-simple.py b/pyxai/examples/BT/builder-simple.py similarity index 100% rename from examples/BT/builder-simple.py rename to pyxai/examples/BT/builder-simple.py diff --git a/examples/BT/regression/builder-regression.py b/pyxai/examples/BT/regression/builder-regression.py similarity index 100% rename from examples/BT/regression/builder-regression.py rename to pyxai/examples/BT/regression/builder-regression.py diff --git a/examples/BT/regression/simple-regression.py b/pyxai/examples/BT/regression/simple-regression.py similarity index 100% rename from examples/BT/regression/simple-regression.py rename to pyxai/examples/BT/regression/simple-regression.py diff --git a/examples/BT/simple.py b/pyxai/examples/BT/simple.py similarity index 100% rename from examples/BT/simple.py rename to pyxai/examples/BT/simple.py diff --git a/examples/Converters/bad/converter-dorothea.py b/pyxai/examples/Converters/bad/converter-dorothea.py similarity index 100% rename from examples/Converters/bad/converter-dorothea.py rename to pyxai/examples/Converters/bad/converter-dorothea.py diff --git a/examples/Converters/converter-adult.py b/pyxai/examples/Converters/converter-adult.py similarity index 100% rename from examples/Converters/converter-adult.py rename to pyxai/examples/Converters/converter-adult.py diff --git a/examples/Converters/converter-australian.py b/pyxai/examples/Converters/converter-australian.py similarity index 100% rename from examples/Converters/converter-australian.py rename to pyxai/examples/Converters/converter-australian.py diff --git a/examples/Converters/converter-balance-scale.py b/pyxai/examples/Converters/converter-balance-scale.py similarity index 100% rename from examples/Converters/converter-balance-scale.py rename to pyxai/examples/Converters/converter-balance-scale.py diff --git a/examples/Converters/converter-bank.py b/pyxai/examples/Converters/converter-bank.py similarity index 100% rename from examples/Converters/converter-bank.py rename to pyxai/examples/Converters/converter-bank.py diff --git a/examples/Converters/converter-biodegradation.py b/pyxai/examples/Converters/converter-biodegradation.py similarity index 100% rename from examples/Converters/converter-biodegradation.py rename to pyxai/examples/Converters/converter-biodegradation.py diff --git a/examples/Converters/converter-breast-tumor.py b/pyxai/examples/Converters/converter-breast-tumor.py similarity index 100% rename from examples/Converters/converter-breast-tumor.py rename to pyxai/examples/Converters/converter-breast-tumor.py diff --git a/examples/Converters/converter-bupa.py b/pyxai/examples/Converters/converter-bupa.py similarity index 100% rename from examples/Converters/converter-bupa.py rename to pyxai/examples/Converters/converter-bupa.py diff --git a/examples/Converters/converter-christine.py b/pyxai/examples/Converters/converter-christine.py similarity index 100% rename from examples/Converters/converter-christine.py rename to pyxai/examples/Converters/converter-christine.py diff --git a/examples/Converters/converter-cifar.py b/pyxai/examples/Converters/converter-cifar.py similarity index 100% rename from examples/Converters/converter-cifar.py rename to pyxai/examples/Converters/converter-cifar.py diff --git a/examples/Converters/converter-cleveland.py b/pyxai/examples/Converters/converter-cleveland.py similarity index 100% rename from examples/Converters/converter-cleveland.py rename to pyxai/examples/Converters/converter-cleveland.py diff --git a/examples/Converters/converter-cnae.py b/pyxai/examples/Converters/converter-cnae.py similarity index 100% rename from examples/Converters/converter-cnae.py rename to pyxai/examples/Converters/converter-cnae.py diff --git a/examples/Converters/converter-compas.py b/pyxai/examples/Converters/converter-compas.py similarity index 100% rename from examples/Converters/converter-compas.py rename to pyxai/examples/Converters/converter-compas.py diff --git a/examples/Converters/converter-contraceptive.py b/pyxai/examples/Converters/converter-contraceptive.py similarity index 100% rename from examples/Converters/converter-contraceptive.py rename to pyxai/examples/Converters/converter-contraceptive.py diff --git a/examples/Converters/converter-default-paiement.py b/pyxai/examples/Converters/converter-default-paiement.py similarity index 100% rename from examples/Converters/converter-default-paiement.py rename to pyxai/examples/Converters/converter-default-paiement.py diff --git a/examples/Converters/converter-dexter.py b/pyxai/examples/Converters/converter-dexter.py similarity index 100% rename from examples/Converters/converter-dexter.py rename to pyxai/examples/Converters/converter-dexter.py diff --git a/examples/Converters/converter-divorce.py b/pyxai/examples/Converters/converter-divorce.py similarity index 100% rename from examples/Converters/converter-divorce.py rename to pyxai/examples/Converters/converter-divorce.py diff --git a/examples/Converters/converter-german.py b/pyxai/examples/Converters/converter-german.py similarity index 100% rename from examples/Converters/converter-german.py rename to pyxai/examples/Converters/converter-german.py diff --git a/examples/Converters/converter-gisette.py b/pyxai/examples/Converters/converter-gisette.py similarity index 100% rename from examples/Converters/converter-gisette.py rename to pyxai/examples/Converters/converter-gisette.py diff --git a/examples/Converters/converter-melb.py b/pyxai/examples/Converters/converter-melb.py similarity index 100% rename from examples/Converters/converter-melb.py rename to pyxai/examples/Converters/converter-melb.py diff --git a/examples/Converters/converter-mnist.py b/pyxai/examples/Converters/converter-mnist.py similarity index 100% rename from examples/Converters/converter-mnist.py rename to pyxai/examples/Converters/converter-mnist.py diff --git a/examples/Converters/converter-regression.py b/pyxai/examples/Converters/converter-regression.py similarity index 100% rename from examples/Converters/converter-regression.py rename to pyxai/examples/Converters/converter-regression.py diff --git a/examples/Converters/converter-spambase.py b/pyxai/examples/Converters/converter-spambase.py similarity index 100% rename from examples/Converters/converter-spambase.py rename to pyxai/examples/Converters/converter-spambase.py diff --git a/examples/DT/GUI-cifar.py b/pyxai/examples/DT/GUI-cifar.py similarity index 100% rename from examples/DT/GUI-cifar.py rename to pyxai/examples/DT/GUI-cifar.py diff --git a/examples/DT/GUI-mnist38-contrastives.py b/pyxai/examples/DT/GUI-mnist38-contrastives.py similarity index 100% rename from examples/DT/GUI-mnist38-contrastives.py rename to pyxai/examples/DT/GUI-mnist38-contrastives.py diff --git a/examples/DT/GUI-mnist38.py b/pyxai/examples/DT/GUI-mnist38.py similarity index 100% rename from examples/DT/GUI-mnist38.py rename to pyxai/examples/DT/GUI-mnist38.py diff --git a/examples/DT/builder-loan.py b/pyxai/examples/DT/builder-loan.py similarity index 100% rename from examples/DT/builder-loan.py rename to pyxai/examples/DT/builder-loan.py diff --git a/examples/DT/builder-orchid.py b/pyxai/examples/DT/builder-orchid.py similarity index 100% rename from examples/DT/builder-orchid.py rename to pyxai/examples/DT/builder-orchid.py diff --git a/examples/DT/simple.py b/pyxai/examples/DT/simple.py similarity index 100% rename from examples/DT/simple.py rename to pyxai/examples/DT/simple.py diff --git a/examples/RF/GUI-australian.py b/pyxai/examples/RF/GUI-australian.py similarity index 100% rename from examples/RF/GUI-australian.py rename to pyxai/examples/RF/GUI-australian.py diff --git a/examples/RF/GUI-builder-loan.py b/pyxai/examples/RF/GUI-builder-loan.py similarity index 100% rename from examples/RF/GUI-builder-loan.py rename to pyxai/examples/RF/GUI-builder-loan.py diff --git a/examples/RF/GUI-mnist49.py b/pyxai/examples/RF/GUI-mnist49.py similarity index 100% rename from examples/RF/GUI-mnist49.py rename to pyxai/examples/RF/GUI-mnist49.py diff --git a/examples/RF/builder-categorical-paper.py b/pyxai/examples/RF/builder-categorical-paper.py similarity index 100% rename from examples/RF/builder-categorical-paper.py rename to pyxai/examples/RF/builder-categorical-paper.py diff --git a/examples/RF/builder-categorical.py b/pyxai/examples/RF/builder-categorical.py similarity index 100% rename from examples/RF/builder-categorical.py rename to pyxai/examples/RF/builder-categorical.py diff --git a/examples/RF/builder-cattleya.py b/pyxai/examples/RF/builder-cattleya.py similarity index 100% rename from examples/RF/builder-cattleya.py rename to pyxai/examples/RF/builder-cattleya.py diff --git a/examples/RF/builder-loan-simple.py b/pyxai/examples/RF/builder-loan-simple.py similarity index 100% rename from examples/RF/builder-loan-simple.py rename to pyxai/examples/RF/builder-loan-simple.py diff --git a/examples/RF/builder-loan.py b/pyxai/examples/RF/builder-loan.py similarity index 100% rename from examples/RF/builder-loan.py rename to pyxai/examples/RF/builder-loan.py diff --git a/examples/RF/builder-multiclasses.py b/pyxai/examples/RF/builder-multiclasses.py similarity index 100% rename from examples/RF/builder-multiclasses.py rename to pyxai/examples/RF/builder-multiclasses.py diff --git a/examples/RF/simple.py b/pyxai/examples/RF/simple.py similarity index 100% rename from examples/RF/simple.py rename to pyxai/examples/RF/simple.py diff --git a/examples/RF/theories-majoritary.py b/pyxai/examples/RF/theories-majoritary.py similarity index 100% rename from examples/RF/theories-majoritary.py rename to pyxai/examples/RF/theories-majoritary.py diff --git a/examples/RF/theories-types-dict.py b/pyxai/examples/RF/theories-types-dict.py similarity index 100% rename from examples/RF/theories-types-dict.py rename to pyxai/examples/RF/theories-types-dict.py diff --git a/examples/RF/theories-types-file.py b/pyxai/examples/RF/theories-types-file.py similarity index 100% rename from examples/RF/theories-types-file.py rename to pyxai/examples/RF/theories-types-file.py diff --git a/explanations/BT_builder_regression.explainer b/pyxai/explanations/BT_builder_regression.explainer similarity index 100% rename from explanations/BT_builder_regression.explainer rename to pyxai/explanations/BT_builder_regression.explainer diff --git a/explanations/BT_builder_simple.explainer b/pyxai/explanations/BT_builder_simple.explainer similarity index 100% rename from explanations/BT_builder_simple.explainer rename to pyxai/explanations/BT_builder_simple.explainer diff --git a/explanations/BT_iris.explainer b/pyxai/explanations/BT_iris.explainer similarity index 100% rename from explanations/BT_iris.explainer rename to pyxai/explanations/BT_iris.explainer diff --git a/explanations/BT_mnist38_tree_specific_class_3.explainer b/pyxai/explanations/BT_mnist38_tree_specific_class_3.explainer similarity index 100% rename from explanations/BT_mnist38_tree_specific_class_3.explainer rename to pyxai/explanations/BT_mnist38_tree_specific_class_3.explainer diff --git a/explanations/BT_mnist38_tree_specific_class_8.explainer b/pyxai/explanations/BT_mnist38_tree_specific_class_8.explainer similarity index 100% rename from explanations/BT_mnist38_tree_specific_class_8.explainer rename to pyxai/explanations/BT_mnist38_tree_specific_class_8.explainer diff --git a/explanations/BT_wine_regression.explainer b/pyxai/explanations/BT_wine_regression.explainer similarity index 100% rename from explanations/BT_wine_regression.explainer rename to pyxai/explanations/BT_wine_regression.explainer diff --git a/explanations/DT_dexter.explainer b/pyxai/explanations/DT_dexter.explainer similarity index 100% rename from explanations/DT_dexter.explainer rename to pyxai/explanations/DT_dexter.explainer diff --git a/explanations/DT_loan.explainer b/pyxai/explanations/DT_loan.explainer similarity index 100% rename from explanations/DT_loan.explainer rename to pyxai/explanations/DT_loan.explainer diff --git a/explanations/DT_mnist38_contrastives.explainer b/pyxai/explanations/DT_mnist38_contrastives.explainer similarity index 100% rename from explanations/DT_mnist38_contrastives.explainer rename to pyxai/explanations/DT_mnist38_contrastives.explainer diff --git a/explanations/DT_mnist38_hot_map.explainer b/pyxai/explanations/DT_mnist38_hot_map.explainer similarity index 100% rename from explanations/DT_mnist38_hot_map.explainer rename to pyxai/explanations/DT_mnist38_hot_map.explainer diff --git a/explanations/DT_orchid.explainer b/pyxai/explanations/DT_orchid.explainer similarity index 100% rename from explanations/DT_orchid.explainer rename to pyxai/explanations/DT_orchid.explainer diff --git a/explanations/DT_wine.explainer b/pyxai/explanations/DT_wine.explainer similarity index 100% rename from explanations/DT_wine.explainer rename to pyxai/explanations/DT_wine.explainer diff --git a/explanations/RF_australian_majoritary.explainer b/pyxai/explanations/RF_australian_majoritary.explainer similarity index 100% rename from explanations/RF_australian_majoritary.explainer rename to pyxai/explanations/RF_australian_majoritary.explainer diff --git a/explanations/RF_australian_theory.explainer b/pyxai/explanations/RF_australian_theory.explainer similarity index 100% rename from explanations/RF_australian_theory.explainer rename to pyxai/explanations/RF_australian_theory.explainer diff --git a/explanations/RF_biodegradation.explainer b/pyxai/explanations/RF_biodegradation.explainer similarity index 100% rename from explanations/RF_biodegradation.explainer rename to pyxai/explanations/RF_biodegradation.explainer diff --git a/explanations/RF_breast_tumor_theory.explainer b/pyxai/explanations/RF_breast_tumor_theory.explainer similarity index 100% rename from explanations/RF_breast_tumor_theory.explainer rename to pyxai/explanations/RF_breast_tumor_theory.explainer diff --git a/explanations/RF_buba.explainer b/pyxai/explanations/RF_buba.explainer similarity index 100% rename from explanations/RF_buba.explainer rename to pyxai/explanations/RF_buba.explainer diff --git a/explanations/RF_cifar_cat_minimal_majoritary.explainer b/pyxai/explanations/RF_cifar_cat_minimal_majoritary.explainer similarity index 100% rename from explanations/RF_cifar_cat_minimal_majoritary.explainer rename to pyxai/explanations/RF_cifar_cat_minimal_majoritary.explainer diff --git a/explanations/RF_cnae.explainer b/pyxai/explanations/RF_cnae.explainer similarity index 100% rename from explanations/RF_cnae.explainer rename to pyxai/explanations/RF_cnae.explainer diff --git a/explanations/RF_iris_majoritary_theory.explainer b/pyxai/explanations/RF_iris_majoritary_theory.explainer similarity index 100% rename from explanations/RF_iris_majoritary_theory.explainer rename to pyxai/explanations/RF_iris_majoritary_theory.explainer diff --git a/explanations/RF_mnist49_minimal_majoritary.explainer b/pyxai/explanations/RF_mnist49_minimal_majoritary.explainer similarity index 100% rename from explanations/RF_mnist49_minimal_majoritary.explainer rename to pyxai/explanations/RF_mnist49_minimal_majoritary.explainer diff --git a/pyxai/setup.py b/pyxai/setup.py new file mode 100644 index 0000000..a5790e8 --- /dev/null +++ b/pyxai/setup.py @@ -0,0 +1,19 @@ +from distutils.core import setup, Extension + + +def main(): + setup(name="c_explainer", + version="1.0.0", + description="Python interface for the c_explainer C library function", + author="", + author_email="your_email@gmail.com", + ext_modules=[Extension( + "c_explainer", + ["sources/solvers/GREEDY/src/bt_wrapper.cc", "sources/solvers/GREEDY/src/Explainer.cc", "sources/solvers/GREEDY/src/Tree.cc", + "sources/solvers/GREEDY/src/Node.cc", "sources/solvers/GREEDY/src/bcp/ParserDimacs.cc", "sources/solvers/GREEDY/src/bcp/Problem.cc", + "sources/solvers/GREEDY/src/bcp/ProblemTypes.cc", "sources/solvers/GREEDY/src/bcp/Propagator.cc"], + language="c++")]) + + +if __name__ == "__main__": + main() diff --git a/sources/__init__.py b/pyxai/sources/__init__.py similarity index 100% rename from sources/__init__.py rename to pyxai/sources/__init__.py diff --git a/sources/core/__init__.py b/pyxai/sources/core/__init__.py similarity index 100% rename from sources/core/__init__.py rename to pyxai/sources/core/__init__.py diff --git a/sources/core/explainer/Explainer.py b/pyxai/sources/core/explainer/Explainer.py similarity index 100% rename from sources/core/explainer/Explainer.py rename to pyxai/sources/core/explainer/Explainer.py diff --git a/sources/core/explainer/__init__.py b/pyxai/sources/core/explainer/__init__.py similarity index 100% rename from sources/core/explainer/__init__.py rename to pyxai/sources/core/explainer/__init__.py diff --git a/sources/core/explainer/explainerBT.py b/pyxai/sources/core/explainer/explainerBT.py similarity index 100% rename from sources/core/explainer/explainerBT.py rename to pyxai/sources/core/explainer/explainerBT.py diff --git a/sources/core/explainer/explainerDT.py b/pyxai/sources/core/explainer/explainerDT.py similarity index 100% rename from sources/core/explainer/explainerDT.py rename to pyxai/sources/core/explainer/explainerDT.py diff --git a/sources/core/explainer/explainerRF.py b/pyxai/sources/core/explainer/explainerRF.py similarity index 100% rename from sources/core/explainer/explainerRF.py rename to pyxai/sources/core/explainer/explainerRF.py diff --git a/sources/core/explainer/explainerRegressionBT.py b/pyxai/sources/core/explainer/explainerRegressionBT.py similarity index 100% rename from sources/core/explainer/explainerRegressionBT.py rename to pyxai/sources/core/explainer/explainerRegressionBT.py diff --git a/sources/core/structure/__init__.py b/pyxai/sources/core/structure/__init__.py similarity index 100% rename from sources/core/structure/__init__.py rename to pyxai/sources/core/structure/__init__.py diff --git a/sources/core/structure/binaryMapping.py b/pyxai/sources/core/structure/binaryMapping.py similarity index 100% rename from sources/core/structure/binaryMapping.py rename to pyxai/sources/core/structure/binaryMapping.py diff --git a/sources/core/structure/boostedTrees.py b/pyxai/sources/core/structure/boostedTrees.py similarity index 100% rename from sources/core/structure/boostedTrees.py rename to pyxai/sources/core/structure/boostedTrees.py diff --git a/sources/core/structure/decisionNode.py b/pyxai/sources/core/structure/decisionNode.py similarity index 100% rename from sources/core/structure/decisionNode.py rename to pyxai/sources/core/structure/decisionNode.py diff --git a/sources/core/structure/decisionTree.py b/pyxai/sources/core/structure/decisionTree.py similarity index 100% rename from sources/core/structure/decisionTree.py rename to pyxai/sources/core/structure/decisionTree.py diff --git a/sources/core/structure/randomForest.py b/pyxai/sources/core/structure/randomForest.py similarity index 100% rename from sources/core/structure/randomForest.py rename to pyxai/sources/core/structure/randomForest.py diff --git a/sources/core/structure/treeEnsembles.py b/pyxai/sources/core/structure/treeEnsembles.py similarity index 100% rename from sources/core/structure/treeEnsembles.py rename to pyxai/sources/core/structure/treeEnsembles.py diff --git a/sources/core/structure/type.py b/pyxai/sources/core/structure/type.py similarity index 100% rename from sources/core/structure/type.py rename to pyxai/sources/core/structure/type.py diff --git a/sources/core/tools/GUIQT.py b/pyxai/sources/core/tools/GUIQT.py similarity index 100% rename from sources/core/tools/GUIQT.py rename to pyxai/sources/core/tools/GUIQT.py diff --git a/sources/core/tools/__init__.py b/pyxai/sources/core/tools/__init__.py similarity index 100% rename from sources/core/tools/__init__.py rename to pyxai/sources/core/tools/__init__.py diff --git a/sources/core/tools/encoding.py b/pyxai/sources/core/tools/encoding.py similarity index 100% rename from sources/core/tools/encoding.py rename to pyxai/sources/core/tools/encoding.py diff --git a/sources/core/tools/option.py b/pyxai/sources/core/tools/option.py similarity index 100% rename from sources/core/tools/option.py rename to pyxai/sources/core/tools/option.py diff --git a/sources/core/tools/utils.py b/pyxai/sources/core/tools/utils.py similarity index 100% rename from sources/core/tools/utils.py rename to pyxai/sources/core/tools/utils.py diff --git a/sources/core/tools/vizualisation.py b/pyxai/sources/core/tools/vizualisation.py similarity index 100% rename from sources/core/tools/vizualisation.py rename to pyxai/sources/core/tools/vizualisation.py diff --git a/sources/learning/__init__.py b/pyxai/sources/learning/__init__.py similarity index 100% rename from sources/learning/__init__.py rename to pyxai/sources/learning/__init__.py diff --git a/sources/learning/generic.py b/pyxai/sources/learning/generic.py similarity index 100% rename from sources/learning/generic.py rename to pyxai/sources/learning/generic.py diff --git a/sources/learning/learner.py b/pyxai/sources/learning/learner.py similarity index 100% rename from sources/learning/learner.py rename to pyxai/sources/learning/learner.py diff --git a/sources/learning/learner_information.py b/pyxai/sources/learning/learner_information.py similarity index 100% rename from sources/learning/learner_information.py rename to pyxai/sources/learning/learner_information.py diff --git a/sources/learning/lightgbm.py b/pyxai/sources/learning/lightgbm.py similarity index 100% rename from sources/learning/lightgbm.py rename to pyxai/sources/learning/lightgbm.py diff --git a/sources/learning/preprocessor.py b/pyxai/sources/learning/preprocessor.py similarity index 100% rename from sources/learning/preprocessor.py rename to pyxai/sources/learning/preprocessor.py diff --git a/sources/learning/scikitlearn.py b/pyxai/sources/learning/scikitlearn.py similarity index 100% rename from sources/learning/scikitlearn.py rename to pyxai/sources/learning/scikitlearn.py diff --git a/sources/learning/xgboost.py b/pyxai/sources/learning/xgboost.py similarity index 100% rename from sources/learning/xgboost.py rename to pyxai/sources/learning/xgboost.py diff --git a/sources/solvers/COMPILER/D4Solver.py b/pyxai/sources/solvers/COMPILER/D4Solver.py similarity index 100% rename from sources/solvers/COMPILER/D4Solver.py rename to pyxai/sources/solvers/COMPILER/D4Solver.py diff --git a/sources/solvers/COMPILER/d4_static b/pyxai/sources/solvers/COMPILER/d4_static similarity index 100% rename from sources/solvers/COMPILER/d4_static rename to pyxai/sources/solvers/COMPILER/d4_static diff --git a/sources/solvers/CPLEX/SufficientRegressionBT.py b/pyxai/sources/solvers/CPLEX/SufficientRegressionBT.py similarity index 100% rename from sources/solvers/CPLEX/SufficientRegressionBT.py rename to pyxai/sources/solvers/CPLEX/SufficientRegressionBT.py diff --git a/sources/solvers/CPLEX/__init__.py b/pyxai/sources/solvers/CPLEX/__init__.py similarity index 100% rename from sources/solvers/CPLEX/__init__.py rename to pyxai/sources/solvers/CPLEX/__init__.py diff --git a/sources/solvers/CSP/AbductiveV1.py b/pyxai/sources/solvers/CSP/AbductiveV1.py similarity index 100% rename from sources/solvers/CSP/AbductiveV1.py rename to pyxai/sources/solvers/CSP/AbductiveV1.py diff --git a/sources/solvers/CSP/AbductiveV2.py b/pyxai/sources/solvers/CSP/AbductiveV2.py similarity index 100% rename from sources/solvers/CSP/AbductiveV2.py rename to pyxai/sources/solvers/CSP/AbductiveV2.py diff --git a/sources/solvers/CSP/TSMinimalV1.py b/pyxai/sources/solvers/CSP/TSMinimalV1.py similarity index 100% rename from sources/solvers/CSP/TSMinimalV1.py rename to pyxai/sources/solvers/CSP/TSMinimalV1.py diff --git a/sources/solvers/CSP/TSMinimalV2.py b/pyxai/sources/solvers/CSP/TSMinimalV2.py similarity index 100% rename from sources/solvers/CSP/TSMinimalV2.py rename to pyxai/sources/solvers/CSP/TSMinimalV2.py diff --git a/sources/solvers/CSP/TSMinimalV3.py b/pyxai/sources/solvers/CSP/TSMinimalV3.py similarity index 100% rename from sources/solvers/CSP/TSMinimalV3.py rename to pyxai/sources/solvers/CSP/TSMinimalV3.py diff --git a/sources/solvers/GRAPH/TreeDecomposition.py b/pyxai/sources/solvers/GRAPH/TreeDecomposition.py similarity index 100% rename from sources/solvers/GRAPH/TreeDecomposition.py rename to pyxai/sources/solvers/GRAPH/TreeDecomposition.py diff --git a/sources/solvers/GREEDY/CMakeLists.txt b/pyxai/sources/solvers/GREEDY/CMakeLists.txt similarity index 100% rename from sources/solvers/GREEDY/CMakeLists.txt rename to pyxai/sources/solvers/GREEDY/CMakeLists.txt diff --git a/sources/solvers/GREEDY/src/Explainer.cc b/pyxai/sources/solvers/GREEDY/src/Explainer.cc similarity index 100% rename from sources/solvers/GREEDY/src/Explainer.cc rename to pyxai/sources/solvers/GREEDY/src/Explainer.cc diff --git a/sources/solvers/GREEDY/src/Explainer.h b/pyxai/sources/solvers/GREEDY/src/Explainer.h similarity index 100% rename from sources/solvers/GREEDY/src/Explainer.h rename to pyxai/sources/solvers/GREEDY/src/Explainer.h diff --git a/sources/solvers/GREEDY/src/Node.cc b/pyxai/sources/solvers/GREEDY/src/Node.cc similarity index 100% rename from sources/solvers/GREEDY/src/Node.cc rename to pyxai/sources/solvers/GREEDY/src/Node.cc diff --git a/sources/solvers/GREEDY/src/Node.h b/pyxai/sources/solvers/GREEDY/src/Node.h similarity index 100% rename from sources/solvers/GREEDY/src/Node.h rename to pyxai/sources/solvers/GREEDY/src/Node.h diff --git a/sources/solvers/GREEDY/src/Tree.cc b/pyxai/sources/solvers/GREEDY/src/Tree.cc similarity index 100% rename from sources/solvers/GREEDY/src/Tree.cc rename to pyxai/sources/solvers/GREEDY/src/Tree.cc diff --git a/sources/solvers/GREEDY/src/Tree.h b/pyxai/sources/solvers/GREEDY/src/Tree.h similarity index 100% rename from sources/solvers/GREEDY/src/Tree.h rename to pyxai/sources/solvers/GREEDY/src/Tree.h diff --git a/sources/solvers/GREEDY/src/bcp/BufferRead.h b/pyxai/sources/solvers/GREEDY/src/bcp/BufferRead.h similarity index 100% rename from sources/solvers/GREEDY/src/bcp/BufferRead.h rename to pyxai/sources/solvers/GREEDY/src/bcp/BufferRead.h diff --git a/sources/solvers/GREEDY/src/bcp/FactoryException.h b/pyxai/sources/solvers/GREEDY/src/bcp/FactoryException.h similarity index 100% rename from sources/solvers/GREEDY/src/bcp/FactoryException.h rename to pyxai/sources/solvers/GREEDY/src/bcp/FactoryException.h diff --git a/sources/solvers/GREEDY/src/bcp/ParserDimacs.cc b/pyxai/sources/solvers/GREEDY/src/bcp/ParserDimacs.cc similarity index 100% rename from sources/solvers/GREEDY/src/bcp/ParserDimacs.cc rename to pyxai/sources/solvers/GREEDY/src/bcp/ParserDimacs.cc diff --git a/sources/solvers/GREEDY/src/bcp/ParserDimacs.h b/pyxai/sources/solvers/GREEDY/src/bcp/ParserDimacs.h similarity index 100% rename from sources/solvers/GREEDY/src/bcp/ParserDimacs.h rename to pyxai/sources/solvers/GREEDY/src/bcp/ParserDimacs.h diff --git a/sources/solvers/GREEDY/src/bcp/Problem.cc b/pyxai/sources/solvers/GREEDY/src/bcp/Problem.cc similarity index 100% rename from sources/solvers/GREEDY/src/bcp/Problem.cc rename to pyxai/sources/solvers/GREEDY/src/bcp/Problem.cc diff --git a/sources/solvers/GREEDY/src/bcp/Problem.h b/pyxai/sources/solvers/GREEDY/src/bcp/Problem.h similarity index 100% rename from sources/solvers/GREEDY/src/bcp/Problem.h rename to pyxai/sources/solvers/GREEDY/src/bcp/Problem.h diff --git a/sources/solvers/GREEDY/src/bcp/ProblemTypes.cc b/pyxai/sources/solvers/GREEDY/src/bcp/ProblemTypes.cc similarity index 100% rename from sources/solvers/GREEDY/src/bcp/ProblemTypes.cc rename to pyxai/sources/solvers/GREEDY/src/bcp/ProblemTypes.cc diff --git a/sources/solvers/GREEDY/src/bcp/ProblemTypes.h b/pyxai/sources/solvers/GREEDY/src/bcp/ProblemTypes.h similarity index 100% rename from sources/solvers/GREEDY/src/bcp/ProblemTypes.h rename to pyxai/sources/solvers/GREEDY/src/bcp/ProblemTypes.h diff --git a/sources/solvers/GREEDY/src/bcp/Propagator.cc b/pyxai/sources/solvers/GREEDY/src/bcp/Propagator.cc similarity index 100% rename from sources/solvers/GREEDY/src/bcp/Propagator.cc rename to pyxai/sources/solvers/GREEDY/src/bcp/Propagator.cc diff --git a/sources/solvers/GREEDY/src/bcp/Propagator.h b/pyxai/sources/solvers/GREEDY/src/bcp/Propagator.h similarity index 100% rename from sources/solvers/GREEDY/src/bcp/Propagator.h rename to pyxai/sources/solvers/GREEDY/src/bcp/Propagator.h diff --git a/sources/solvers/GREEDY/src/bt_wrapper.cc b/pyxai/sources/solvers/GREEDY/src/bt_wrapper.cc similarity index 100% rename from sources/solvers/GREEDY/src/bt_wrapper.cc rename to pyxai/sources/solvers/GREEDY/src/bt_wrapper.cc diff --git a/sources/solvers/GREEDY/src/constants.h b/pyxai/sources/solvers/GREEDY/src/constants.h similarity index 100% rename from sources/solvers/GREEDY/src/constants.h rename to pyxai/sources/solvers/GREEDY/src/constants.h diff --git a/sources/solvers/GREEDY/src/utils/TimerHelper.h b/pyxai/sources/solvers/GREEDY/src/utils/TimerHelper.h similarity index 100% rename from sources/solvers/GREEDY/src/utils/TimerHelper.h rename to pyxai/sources/solvers/GREEDY/src/utils/TimerHelper.h diff --git a/sources/solvers/MAXSAT/MAXSATSolver.py b/pyxai/sources/solvers/MAXSAT/MAXSATSolver.py similarity index 100% rename from sources/solvers/MAXSAT/MAXSATSolver.py rename to pyxai/sources/solvers/MAXSAT/MAXSATSolver.py diff --git a/sources/solvers/MAXSAT/OPENWBOSolver.py b/pyxai/sources/solvers/MAXSAT/OPENWBOSolver.py similarity index 100% rename from sources/solvers/MAXSAT/OPENWBOSolver.py rename to pyxai/sources/solvers/MAXSAT/OPENWBOSolver.py diff --git a/sources/solvers/MAXSAT/RC2solver.py b/pyxai/sources/solvers/MAXSAT/RC2solver.py similarity index 100% rename from sources/solvers/MAXSAT/RC2solver.py rename to pyxai/sources/solvers/MAXSAT/RC2solver.py diff --git a/sources/solvers/MAXSAT/__init__.py b/pyxai/sources/solvers/MAXSAT/__init__.py similarity index 100% rename from sources/solvers/MAXSAT/__init__.py rename to pyxai/sources/solvers/MAXSAT/__init__.py diff --git a/sources/solvers/MAXSAT/openwbo-darwin b/pyxai/sources/solvers/MAXSAT/openwbo-darwin similarity index 100% rename from sources/solvers/MAXSAT/openwbo-darwin rename to pyxai/sources/solvers/MAXSAT/openwbo-darwin diff --git a/sources/solvers/MAXSAT/openwbo-linux b/pyxai/sources/solvers/MAXSAT/openwbo-linux similarity index 100% rename from sources/solvers/MAXSAT/openwbo-linux rename to pyxai/sources/solvers/MAXSAT/openwbo-linux diff --git a/sources/solvers/MUS/MUSERSolver.py b/pyxai/sources/solvers/MUS/MUSERSolver.py similarity index 100% rename from sources/solvers/MUS/MUSERSolver.py rename to pyxai/sources/solvers/MUS/MUSERSolver.py diff --git a/sources/solvers/MUS/OPTUXSolver.py b/pyxai/sources/solvers/MUS/OPTUXSolver.py similarity index 100% rename from sources/solvers/MUS/OPTUXSolver.py rename to pyxai/sources/solvers/MUS/OPTUXSolver.py diff --git a/sources/solvers/MUS/__init__.py b/pyxai/sources/solvers/MUS/__init__.py similarity index 100% rename from sources/solvers/MUS/__init__.py rename to pyxai/sources/solvers/MUS/__init__.py diff --git a/sources/solvers/MUS/muser_static b/pyxai/sources/solvers/MUS/muser_static similarity index 100% rename from sources/solvers/MUS/muser_static rename to pyxai/sources/solvers/MUS/muser_static diff --git a/sources/solvers/SAT/glucoseSolver.py b/pyxai/sources/solvers/SAT/glucoseSolver.py similarity index 100% rename from sources/solvers/SAT/glucoseSolver.py rename to pyxai/sources/solvers/SAT/glucoseSolver.py diff --git a/sources/solvers/__init__.py b/pyxai/sources/solvers/__init__.py similarity index 100% rename from sources/solvers/__init__.py rename to pyxai/sources/solvers/__init__.py diff --git a/tests/compas.csv b/pyxai/tests/compas.csv similarity index 100% rename from tests/compas.csv rename to pyxai/tests/compas.csv diff --git a/tests/dermatology.csv b/pyxai/tests/dermatology.csv similarity index 100% rename from tests/dermatology.csv rename to pyxai/tests/dermatology.csv diff --git a/tests/explaining/bt.py b/pyxai/tests/explaining/bt.py similarity index 100% rename from tests/explaining/bt.py rename to pyxai/tests/explaining/bt.py diff --git a/tests/explaining/dt.py b/pyxai/tests/explaining/dt.py similarity index 100% rename from tests/explaining/dt.py rename to pyxai/tests/explaining/dt.py diff --git a/tests/explaining/misc.py b/pyxai/tests/explaining/misc.py similarity index 100% rename from tests/explaining/misc.py rename to pyxai/tests/explaining/misc.py diff --git a/tests/explaining/regressionbt.py b/pyxai/tests/explaining/regressionbt.py similarity index 100% rename from tests/explaining/regressionbt.py rename to pyxai/tests/explaining/regressionbt.py diff --git a/tests/explaining/rf-multiclasses.py b/pyxai/tests/explaining/rf-multiclasses.py similarity index 100% rename from tests/explaining/rf-multiclasses.py rename to pyxai/tests/explaining/rf-multiclasses.py diff --git a/tests/explaining/rf.py b/pyxai/tests/explaining/rf.py similarity index 100% rename from tests/explaining/rf.py rename to pyxai/tests/explaining/rf.py diff --git a/tests/functionality/GetInstances.py b/pyxai/tests/functionality/GetInstances.py similarity index 100% rename from tests/functionality/GetInstances.py rename to pyxai/tests/functionality/GetInstances.py diff --git a/tests/functionality/ToFeatures.py b/pyxai/tests/functionality/ToFeatures.py similarity index 100% rename from tests/functionality/ToFeatures.py rename to pyxai/tests/functionality/ToFeatures.py diff --git a/tests/importing/LightGBM.py b/pyxai/tests/importing/LightGBM.py similarity index 100% rename from tests/importing/LightGBM.py rename to pyxai/tests/importing/LightGBM.py diff --git a/tests/importing/ScikitLearn.py b/pyxai/tests/importing/ScikitLearn.py similarity index 100% rename from tests/importing/ScikitLearn.py rename to pyxai/tests/importing/ScikitLearn.py diff --git a/tests/importing/SimpleScikitLearn.py b/pyxai/tests/importing/SimpleScikitLearn.py similarity index 100% rename from tests/importing/SimpleScikitLearn.py rename to pyxai/tests/importing/SimpleScikitLearn.py diff --git a/tests/importing/XGBoost.py b/pyxai/tests/importing/XGBoost.py similarity index 100% rename from tests/importing/XGBoost.py rename to pyxai/tests/importing/XGBoost.py diff --git a/tests/iris.csv b/pyxai/tests/iris.csv similarity index 100% rename from tests/iris.csv rename to pyxai/tests/iris.csv diff --git a/tests/learning/LightGBM.py b/pyxai/tests/learning/LightGBM.py similarity index 100% rename from tests/learning/LightGBM.py rename to pyxai/tests/learning/LightGBM.py diff --git a/tests/learning/ScikitLearn.py b/pyxai/tests/learning/ScikitLearn.py similarity index 100% rename from tests/learning/ScikitLearn.py rename to pyxai/tests/learning/ScikitLearn.py diff --git a/tests/learning/XGBoost.py b/pyxai/tests/learning/XGBoost.py similarity index 100% rename from tests/learning/XGBoost.py rename to pyxai/tests/learning/XGBoost.py diff --git a/tests/saveload/LightGBM.py b/pyxai/tests/saveload/LightGBM.py similarity index 100% rename from tests/saveload/LightGBM.py rename to pyxai/tests/saveload/LightGBM.py diff --git a/tests/saveload/ScikitLearn.py b/pyxai/tests/saveload/ScikitLearn.py similarity index 100% rename from tests/saveload/ScikitLearn.py rename to pyxai/tests/saveload/ScikitLearn.py diff --git a/tests/saveload/XGBoost.py b/pyxai/tests/saveload/XGBoost.py similarity index 100% rename from tests/saveload/XGBoost.py rename to pyxai/tests/saveload/XGBoost.py diff --git a/tests/tests.py b/pyxai/tests/tests.py similarity index 100% rename from tests/tests.py rename to pyxai/tests/tests.py diff --git a/tests/winequality-red.csv b/pyxai/tests/winequality-red.csv similarity index 100% rename from tests/winequality-red.csv rename to pyxai/tests/winequality-red.csv diff --git a/version.txt b/pyxai/version.txt similarity index 100% rename from version.txt rename to pyxai/version.txt diff --git a/setup.py b/setup.py index a5790e8..9e6424f 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,39 @@ -from distutils.core import setup, Extension +import os +from distutils.core import Extension +from setuptools import setup, find_packages +__version__ = open(os.path.join(os.path.dirname(__file__), 'pyxai/version.txt'), encoding='utf-8').read() -def main(): - setup(name="c_explainer", - version="1.0.0", - description="Python interface for the c_explainer C library function", - author="", - author_email="your_email@gmail.com", - ext_modules=[Extension( - "c_explainer", - ["sources/solvers/GREEDY/src/bt_wrapper.cc", "sources/solvers/GREEDY/src/Explainer.cc", "sources/solvers/GREEDY/src/Tree.cc", - "sources/solvers/GREEDY/src/Node.cc", "sources/solvers/GREEDY/src/bcp/ParserDimacs.cc", "sources/solvers/GREEDY/src/bcp/Problem.cc", - "sources/solvers/GREEDY/src/bcp/ProblemTypes.cc", "sources/solvers/GREEDY/src/bcp/Propagator.cc"], - language="c++")]) +print("setup version", __version__) - -if __name__ == "__main__": - main() +setup(name='pyxai', + version=__version__, + python_requires='>=3.6', + project_urls={ + 'Documentation': 'http://www.cril.univ-artois.fr/pyxai/', + 'Installation': 'http://www.cril.univ-artois.fr/pyxai/documentation/installation/', + 'Git': 'https://github.com/crillab/pyxai' + }, + author='Gilles Audemard, Steve Bellart, Louenas Bounia, Jean-Marie Lagniez, Pierre Marquis, Nicolas Szczepanski:', + author_email='audemard@cril.fr, bellart@cril.fr, bounia@cril.fr, lagniez@cril.fr, marquis@cril.fr, szczepanski@cril.fr', + maintainer='Gilles Audemard, Nicolas Szczepanski', + maintainer_email='audemard@cril.fr, szczepanski@cril.fr', + keywords='XAI AI XML ML explainable learning', + classifiers=['Topic :: Scientific/Engineering :: Artificial Intelligence', 'Topic :: Education'], + packages=find_packages(), # exclude=["problems/g7_todo/"]), + package_dir={'pyxai': 'pyxai'}, + install_requires=['lxml', 'numpy', 'wheel', 'pandas', 'termcolor', 'shap', 'wordfreq', 'python-sat[pblib,aiger]', 'xgboost', 'pycsp3', 'matplotlib', 'pyqt6', 'dill', 'lightgbm', 'docplex'], + include_package_data=True, + description='Explaining Machine Learning Classifiers in Python', + long_description=open(os.path.join(os.path.dirname(__file__), 'pyxai/README.md'), encoding='utf-8').read(), + long_description_content_type='text/markdown', + license='MIT', + ext_modules=[Extension( + "c_explainer", + ["pyxai/sources/solvers/GREEDY/src/bt_wrapper.cc", "pyxai/sources/solvers/GREEDY/src/Explainer.cc", + "pyxai/sources/solvers/GREEDY/src/Tree.cc", "pyxai/sources/solvers/GREEDY/src/Node.cc", + "pyxai/sources/solvers/GREEDY/src/bcp/ParserDimacs.cc", "pyxai/sources/solvers/GREEDY/src/bcp/Problem.cc", + "pyxai/sources/solvers/GREEDY/src/bcp/ProblemTypes.cc", "pyxai/sources/solvers/GREEDY/src/bcp/Propagator.cc" + ], + language="c++")], + platforms='LINUX') diff --git a/update_pypi_version-OSX.py b/update_pypi_version-OSX.py new file mode 100644 index 0000000..ff2f6a5 --- /dev/null +++ b/update_pypi_version-OSX.py @@ -0,0 +1,32 @@ +import os + +versionFile = os.getcwd() + os.sep + "pyxai" + os.sep + "version.txt" +__version__ = open(versionFile, encoding='utf-8').read() + +print("Type on the keyboard the new version number (current " + str(__version__) + ") ?") + +new_version = input() +if new_version != "": + print("Write the new version ...") + with open(versionFile, "r+") as f: + data = f.read() + f.seek(0) + f.write(new_version) + f.truncate() + +print("sudo rm -rf build/ dist/ wheelhouse/ rm -rf dist/ build/ pyxai-experimental.egg-info/") + +os.system("sudo rm -rf build/ dist/ wheelhouse/ rm -rf dist/ build/ pyxai-experimental.egg-info/") + +# print("Type Enter to execute python3 setup.py sdist bdist_wheel") +# input() +# os.system("python3 setup.py sdist bdist_wheel") + +print("Type Enter to execute the docker that build whells:") +input() + +os.system("sudo docker run --rm -e PLAT=manylinux2014_aarch64 -v `pwd`:/io quay.io/pypa/manylinux2014_aarch64 /io/travis/build-wheels.sh") + +print("Type Enter to execute the publish on pypi the wheels:") +input() +os.system("python3 -m twine upload --skip-existing wheelhouse/*") diff --git a/update_pypi_version.py b/update_pypi_version.py new file mode 100644 index 0000000..070f9a7 --- /dev/null +++ b/update_pypi_version.py @@ -0,0 +1,32 @@ +import os + +versionFile = os.getcwd() + os.sep + "pyxai" + os.sep + "version.txt" +__version__ = open(versionFile, encoding='utf-8').read() + +print("Type on the keyboard the new version number (current " + str(__version__) + ") ?") + +new_version = input() +if new_version != "": + print("Write the new version ...") + with open(versionFile, "r+") as f: + data = f.read() + f.seek(0) + f.write(new_version) + f.truncate() + +# print("sudo rm -rf build/ dist/ wheelhouse/ rm -rf dist/ build/ pyxai-experimental.egg-info/ pyxai.egg-info/") + +os.system("sudo rm -rf build/ dist/ wheelhouse/ rm -rf dist/ build/ pyxai-experimental.egg-info/ pyxai.egg-info/") + +# print("Type Enter to execute python3 setup.py sdist bdist_wheel") +# input() +# os.system("python3 setup.py sdist bdist_wheel") + +print("Type Enter to execute the docker that build whells:") +input() + +os.system("sudo docker run --rm -e PLAT=manylinux2014_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/travis/build-wheels.sh") + +print("Type Enter to execute the publish on pypi the wheels:") +input() +os.system("python3 -m twine upload --skip-existing wheelhouse/*.whl") diff --git a/valgrind-python.supp b/valgrind-python.supp new file mode 100644 index 0000000..15982cc --- /dev/null +++ b/valgrind-python.supp @@ -0,0 +1,391 @@ +# +# This is a valgrind suppression file that should be used when using valgrind. +# +# Here's an example of running valgrind: +# +# cd python/dist/src +# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ +# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network +# +# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER +# to use the preferred suppressions with Py_ADDRESS_IN_RANGE. +# +# If you do not want to recompile Python, you can uncomment +# suppressions for PyObject_Free and PyObject_Realloc. +# +# See Misc/README.valgrind for more information. + +# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64) + Memcheck:Value8 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:Py_ADDRESS_IN_RANGE +} + +# +# Leaks (including possible leaks) +# Hmmm, I wonder if this masks some real leaks. I think it does. +# Will need to fix that. +# + +{ + Suppress leaking the GIL. Happens once per process, see comment in ceval.c. + Memcheck:Leak + fun:malloc + fun:PyThread_allocate_lock + fun:PyEval_InitThreads +} + +{ + Suppress leaking the GIL after a fork. + Memcheck:Leak + fun:malloc + fun:PyThread_allocate_lock + fun:PyEval_ReInitThreads +} + +{ + Suppress leaking the autoTLSkey. This looks like it shouldn't leak though. + Memcheck:Leak + fun:malloc + fun:PyThread_create_key + fun:_PyGILState_Init + fun:Py_InitializeEx + fun:Py_Main +} + +{ + Hmmm, is this a real leak or like the GIL? + Memcheck:Leak + fun:malloc + fun:PyThread_ReInitTLS +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:realloc + fun:_PyObject_GC_Resize + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_New + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_NewVar + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +# +# Non-python specific leaks +# + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:memalign + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:PyObject_Realloc +} + +### +### All the suppressions below are for errors that occur within libraries +### that Python uses. The problems to not appear to be related to Python's +### use of the libraries. +### + +{ + Generic ubuntu ld problems + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + Generic gentoo ld problems + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so +} + +{ + DBM problems, see test_dbm + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_close +} + +{ + DBM problems, see test_dbm + Memcheck:Value8 + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + GDBM problems, see test_gdbm + Memcheck:Param + write(buf) + fun:write + fun:gdbm_open + +} + +{ + ZLIB problems, see test_gzip + Memcheck:Cond + obj:/lib/libz.so.1.2.3 + obj:/lib/libz.so.1.2.3 + fun:deflate +} + +{ + Avoid problems w/readline doing a putenv and leaking on exit + Memcheck:Leak + fun:malloc + fun:xmalloc + fun:sh_set_lines_and_columns + fun:_rl_get_screen_size + fun:_rl_init_terminal_io + obj:/lib/libreadline.so.4.3 + fun:rl_initialize +} + +### +### These occur from somewhere within the SSL, when running +### test_socket_sll. They are too general to leave on by default. +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:memset +###} +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:memset +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:MD5_Update +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:MD5_Update +###} + +# +# All of these problems come from using test_socket_ssl +# +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_bin2bn +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont +} + +{ + from test_socket_ssl + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libcrypto.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_set_key_unchecked +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_encrypt2 +} + +{ + from test_socket_ssl + Memcheck:Cond + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Value4 + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BUF_MEM_grow_clean +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:memcpy + fun:ssl3_read_bytes +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:SHA1_Update +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:SHA1_Update +} + +