Skip to content

Commit

Permalink
Remove numpy header dependency and update changelog for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsgrogan committed Sep 24, 2017
1 parent 7218de8 commit b88705d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 288 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [Unreleased]
## [3.4.3] - PyBind11 Migration
- Cell generators no longer take cell lists as input and now return cell lists as output
- Moved from Boost Python to `PyBind11`, Boost Python is no longer a dependency
- Moved wrapper generation code from `Py++` to `cppwg`
Expand Down
42 changes: 0 additions & 42 deletions FindNumPy.cmake

This file was deleted.

54 changes: 0 additions & 54 deletions SConscript

This file was deleted.

81 changes: 0 additions & 81 deletions Summary.wiki

This file was deleted.

13 changes: 2 additions & 11 deletions WrapPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,12 @@ add_compile_options(-Wno-unused-local-typedefs)
# Add any cmake modules defined in this project
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)

# The Boost Python headers and shared library are needed, use CMake to find them.
#find_package(Boost COMPONENTS python REQUIRED)

# Python headers and shared library are also needed. The version needs to be the same
# as that of the Python interpreter used to run package. e.g. Python 2.7.x.
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

# These packages are needed for binding generation - Need script from M Moll
#find_python_module(pyplusplus 1.6.0)
#find_python_module(pygccxml 1.7.2)
#find_package(castxml)

# Numpy is needed for wrapping
find_package(NumPy)
# Used for binding generation
set(CASTXML_EXE_LOC "/usr/bin/castxml" CACHE FILEPATH "Path to the castxml executable.")

# Find the Chaste and third party dependency header files.
Expand All @@ -66,7 +57,7 @@ endif()

# Collect the header directories for this project
include(${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludes.cmake)
include_directories(${PYCHASTE_INCLUDE_DIRS} ${PYTHON_NUMPY_INCLUDE_DIR})
include_directories(${PYCHASTE_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/dynamic/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/dynamic/wrappers)

Expand Down
99 changes: 0 additions & 99 deletions src/PythonObjectConverters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <pybind11/pybind11.h>
#include "UblasIncludes.hpp"
#include "UblasVectorInclude.hpp"
//#include <vtkSmartPointer.h>
//#include <vtkRenderer.h>
//#include <vtkUnsignedCharArray.h>

namespace py = pybind11;

Expand Down Expand Up @@ -178,100 +175,4 @@ const_cast< VTK_OBJ *>(src.GetPointer())); \
}; \
}}


// **
// * Convert VTK pointers to Python VTK objects, templated over vtk object type
// * Source: http://www.vtk.org/Wiki/Example_from_and_to_python_converters
// */
//template<class T>
//struct VtkSmartPointerToPython
//{
// /**
// * Do the conversion
// * @param rVtkSmartPointerToObject a vtk smart pointer
// * @return A pointer to the Python object. Can be a None object if the smart pointer is empty.
// */
// static PyObject* convert(const vtkSmartPointer<T> &rVtkSmartPointer)
// {
// // Make sure something is being pointed to, otherwise return python None type
// if(rVtkSmartPointer.GetPointer() == NULL)
// {
// return incref(Py_None);
// }
//
// // Get the address string of the vtk object
// std::ostringstream oss;
// oss << (void*) rVtkSmartPointer.GetPointer();
// std::string address_str = oss.str();
//
// // Can get vtk object type from address string using vtk tricks
// boost::python::object obj = import("vtk").attr("vtkObjectBase")(address_str);
//
// // Important to increment object reference
// return incref(obj.ptr());
// }
//};
//
///**
// * Convert a Python VTK object to a pointer to the VTK object.
// * Care is needed in suitably casting the returned void pointer to the desired
// * vtk type. No checking is done here.
// * Source: http://www.vtk.org/Wiki/Example_from_and_to_python_converters
// * @param pPythonObject pointer to the python object
// * @return void pointer to the vtk object
// */
//void* ExtractVtkWrappedPointer(PyObject* pPythonObject)
//{
// //Get the __this__ attribute from the Python Object
// char thisStr[] = "__this__";
//
// // Several checks to make sure it is a valid vtk type, otherwise return a null pointer
// if (!PyObject_HasAttrString(pPythonObject, thisStr))
// {
// return NULL;
// }
//
// PyObject* thisAttr = PyObject_GetAttrString(pPythonObject, thisStr);
// if (thisAttr == NULL)
// {
// return NULL;
// }
//
// const char* str = PyString_AsString(thisAttr);
// if(str == 0 || strlen(str) < 1)
// {
// return NULL;
// }
//
// char hex_address[32], *pEnd;
// const char *_p_ = strstr(str, "_p_vtk");
// if(_p_ == NULL)
// {
// return NULL;
// }
//
// const char *class_name = strstr(_p_, "vtk");
// if(class_name == NULL)
// {
// return NULL;
//
// }
//
// // Create a generic vtk object pointer and assign the address of the python object to it
// strcpy(hex_address, str+1);
// hex_address[_p_-str-1] = '\0';
// long address = strtol(hex_address, &pEnd, 16);
//
// vtkObjectBase* vtk_object = (vtkObjectBase*)((void*)address);
// if(vtk_object->IsA(class_name))
// {
// vtk_object->Register(NULL);
// return vtk_object;
// }
//
// // Catch all in case something goes wrong
// return NULL;
//};


#endif /*PYTHONOBJECTCONVERTERS_HPP_*/

0 comments on commit b88705d

Please sign in to comment.