Commit 29c18971 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Begin overhaul of the python interface

Reorginization of functions into useful modules, current structure is bad
parent fae78253
......@@ -25,7 +25,7 @@
#include <boost/serialization/array.hpp>
#ifdef PY_BINDINGS
#include <python/conversion_utils.hpp>
#include <python/py_binding_cpp_def/conversion_utils.hpp>
namespace py = boost::python;
namespace np = boost::python::numpy;
#endif
......@@ -514,4 +514,4 @@ bool operator>(Domain b, double a);
*/
bool operator>=(Domain b, double a);
#endif
\ No newline at end of file
#endif
......@@ -55,12 +55,12 @@ if(BUILD_PYTHON)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/TransferDocStrings.cmake)
set(CMAKE_INSTALL_RPATH ${PYTHON_PREFIX}/lib/;${Boost_LIBRARY_DIRS};${LAPACK_DIR};${MPI_DIR};${COIN_CLP_LIBRARY_DIRS};${NLOPT_LIBRARY_DIRS};${COIN_UTILS_LIBRARY_DIRS};${CMAKE_CURRENT_LIST_DIR}/../lib/;${PYTHON_INSTDIR}/sissopp/;${FMT_LIBRARY_DIRS})
transfer_doc_string(${CMAKE_CURRENT_LIST_DIR}/python/bindings_docstring_keyed.cpp ${CMAKE_CURRENT_LIST_DIR}/python/bindings.cpp)
transfer_doc_string(${CMAKE_CURRENT_LIST_DIR}/python/bindings_docstring_keyed.hpp ${CMAKE_CURRENT_LIST_DIR}/python/bindings.hpp)
transfer_doc_string(${CMAKE_CURRENT_LIST_DIR}/python/py_binding_cpp_def/bindings_docstring_keyed.cpp ${CMAKE_CURRENT_LIST_DIR}/python/py_binding_cpp_def/bindings.cpp)
transfer_doc_string(${CMAKE_CURRENT_LIST_DIR}/python/py_binding_cpp_def/bindings_docstring_keyed.hpp ${CMAKE_CURRENT_LIST_DIR}/python/py_binding_cpp_def/bindings.hpp)
file(GLOB_RECURSE SISSOLIB_SOURCES ${CMAKE_CURRENT_LIST_DIR}/python/*cpp)
list(REMOVE_ITEM SISSOLIB_SOURCES ${CMAKE_CURRENT_LIST_DIR}/main.cpp)
list(REMOVE_ITEM SISSOLIB_SOURCES ${CMAKE_CURRENT_LIST_DIR}/python/bindings_docstring_keyed.cpp)
list(REMOVE_ITEM SISSOLIB_SOURCES ${CMAKE_CURRENT_LIST_DIR}/python/py_binding_cpp_def/bindings_docstring_keyed.cpp)
if(NOT BUILD_PARAMS)
file(GLOB_RECURSE NOT_SISSOLIB_SOURCES */parameterize*.cpp)
list(REMOVE_ITEM SISSOLIB_SOURCES ${NOT_SISSOLIB_SOURCES})
......
......@@ -26,8 +26,6 @@
#endif
#ifdef PY_BINDINGS
#include "python/conversion_utils.hpp"
namespace py = boost::python;
namespace np = boost::python::numpy;
#endif
......
......@@ -22,7 +22,7 @@
#include"utils/enum.hpp"
#ifdef PY_BINDINGS
#include "python/conversion_utils.hpp"
#include "python/py_binding_cpp_def/conversion_utils.hpp"
namespace np = boost::python::numpy;
namespace py = boost::python;
#endif
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ def update_model_svm(model, c=1.0, max_iter=-1, tol=0.0001, filename=None):
"""Generate a new model with an updated SVM from sckitlearn
Args:
model (list of str, str or ModelClassifier): The model to be updated
model (list of str, str, or ModelClassifier): The model to be updated
c (float): The new c value to use
max_iter(int): The maximum number of iterations to use
tol(float): Maximum allowable error
......@@ -75,6 +75,7 @@ def update_model_svm(model, c=1.0, max_iter=-1, tol=0.0001, filename=None):
start_train += ts_train
start_test += ts_test
print("The updated coefficient for the decision boundaries:")
print(updated_coefs)
new_model = ModelClassifier(
......
This diff is collapsed.
#include <python/bindings.hpp>
#include <boost/python/suite/indexing/map_indexing_suite.hpp>
#include <boost/python/numpy.hpp>
#include <mpi_interface/MPI_Interface.hpp>
#include <Python.h>
#include "mpi_interface/MPI_Interface.hpp"
#include "python/py_binding_cpp_def/bindings.hpp"
static void finalize();
BOOST_PYTHON_MODULE(_sisso)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment