]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename the python modules. 2834/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Mon, 25 Jul 2016 22:15:43 +0000 (18:15 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 3 Aug 2016 20:34:02 +0000 (16:34 -0400)
contrib/python-bindings/source/__init__.py
contrib/python-bindings/source/cell_accessor_wrapper.cc
contrib/python-bindings/source/point_wrapper.cc
contrib/python-bindings/source/wrappers.cc
contrib/python-bindings/tests/cell_accessor_wrapper.py
contrib/python-bindings/tests/point_wrapper.py
contrib/python-bindings/tests/triangulation_wrapper.py

index dd99d5fdbd143c07097e00f61a935f9da44f406c..5e7a0469da019af4844c904b70bb402b31014f28 100644 (file)
@@ -13,7 +13,6 @@
 #
 # ---------------------------------------------------------------------
 
-from .PyDealII import *
-
-__all__ = ['PyDealII']
-__doc__ = PyDealII.__doc__
+__doc__ = 'PyDealII is just an empty shell. You need to either\n\
+           import PyDealII.Debug or PyDealII.Release. Do not\n\
+           import both of them.'
index 3aa3495b1b9793aba2c646ea62ada0c158eb6349..ce00a3b37971b34b9cee3d85ce808dd67a3822e6 100644 (file)
@@ -240,7 +240,7 @@ namespace python
     {
       const CellAccessor<dim,spacedim> *cell =
         static_cast<const CellAccessor<dim,spacedim>*>(cell_accessor);
-      cell->manifold_id();
+      return cell->manifold_id();
     }
   }
 
@@ -468,11 +468,11 @@ namespace python
   int CellAccessorWrapper::get_manifold_id() const
   {
     if ((dim == 2) && (spacedim == 2))
-      internal::get_manifold_id<2,2>(cell_accessor);
+      return internal::get_manifold_id<2,2>(cell_accessor);
     else if ((dim== 2) && (spacedim == 3))
-      internal::get_manifold_id<2,3>(cell_accessor);
+      return internal::get_manifold_id<2,3>(cell_accessor);
     else
-      internal::get_manifold_id<3,3>(cell_accessor);
+      return internal::get_manifold_id<3,3>(cell_accessor);
   }
 }
 
index 7d8e928498f4ca895737b5d62f6db9a426d33224..3fb1863090a84e3166b77cfbda4ea10a2bfd4abf 100644 (file)
@@ -119,6 +119,8 @@ namespace python
     else
       AssertThrow(false,
                   ExcMessage("The z coordinate is only available for three-dimensional points"));
+    // Silence a warning
+    return 0.;
   }
 
 
index e64fb1b7a9e2986c62847b976beeb1a9508a0b78..6d644bad54068fce7d4bf72c0090a2609de4b370 100644 (file)
@@ -34,10 +34,14 @@ char const *pydealii_docstring =
   "                                                             \n"
   "PyDealII                                                     \n"
   "========                                                     \n"
-  "Some interesting doc.                                        \n"
+  "This module contains the python bindings to deal.II.         \n"
+  "The Debug module uses deal.II compiled in Debug mode while   \n"
+  "the Release module uses deal.II compiled in Release mode.    \n"
   ;
 
-BOOST_PYTHON_MODULE(PyDealII)
+#ifdef DEBUG
+
+BOOST_PYTHON_MODULE(Debug)
 {
   boost::python::scope().attr("__doc__") = pydealii_docstring;
 
@@ -51,4 +55,22 @@ BOOST_PYTHON_MODULE(PyDealII)
   dealii::python::export_triangulation();
 }
 
+#else
+
+BOOST_PYTHON_MODULE(Release)
+{
+  boost::python::scope().attr("__doc__") = pydealii_docstring;
+
+  boost::python::docstring_options doc_options;
+  doc_options.enable_user_defined();
+  doc_options.enable_py_signatures();
+  doc_options.disable_cpp_signatures();
+
+  dealii::python::export_cell_accessor();
+  dealii::python::export_point();
+  dealii::python::export_triangulation();
+}
+
+#endif
+
 #endif
index 8f8308b885efecaff35fc1fe5b92d4921238b9d0..af18f1402004d9ac58b21c8963b822f3efabb722 100644 (file)
@@ -14,7 +14,7 @@
 # ---------------------------------------------------------------------
 
 import unittest
-from pydealii.PyDealII import *
+from PyDealII.Debug import *
 
 
 class TestCellAccessorWrapper(unittest.TestCase):
index c68482ca2c577f0a69b9446d3299f1a3eb8dd2c9..4fcbc309e306aff4a6b96ecb8aed7f8bc27d5cb5 100644 (file)
@@ -14,7 +14,7 @@
 # ---------------------------------------------------------------------
 
 import unittest
-from pydealii.PyDealII import *
+from PyDealII.Debug import *
 
 
 class TestPointWrapper(unittest.TestCase):
index 52ac71f7d7ed9471ee8c47200bc43c91aeefa1fa..fff385bf693e8fca3651bc9aa144cae43741e897 100644 (file)
@@ -14,7 +14,7 @@
 # ---------------------------------------------------------------------
 
 import unittest
-from pydealii.PyDealII import *
+from PyDealII.Debug import *
 
 
 class TestTriangulationWrapper(unittest.TestCase):

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.