-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpython.hpp
More file actions
62 lines (54 loc) · 1.99 KB
/
python.hpp
File metadata and controls
62 lines (54 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Copyright (c) 2019, Lawrence Livermore National Security, LLC.
*
* Produced at the Lawrence Livermore National Laboratory
*
* LLNL-CODE-746361
*
* All rights reserved. See COPYRIGHT for details.
*
* This file is part of the GEOSX Simulation Framework.
*
* GEOSX is a free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License (as published by the
* Free Software Foundation) version 2.1 dated February 1999.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/**
* @file python.hpp
* @brief Includes all the other python related headers.
*/
#pragma once
// source includes
#include "PyArray.hpp"
#include "PySortedArray.hpp"
#include "PyArrayOfArrays.hpp"
#include "PyArrayOfSets.hpp"
#include "PyCRSMatrix.hpp"
#include "PyFunc.hpp"
#include "../typeManipulation.hpp"
namespace LvArray
{
/**
* @brief Contains all the Python code.
*/
namespace python
{
/**
* @brief add the `pylvarray` module, which defines all of the `pylvarray` classes, to a module.
* @param module the Python module object to add `pylvarray` to as the attribute named "pylvarray".
* Equivalent to `import pylvarray; module.pylvarray = pylvarray`.
* @return true if the import and addition succeeded, false otherwise.
* @note It is recommended to invoke this function before using pylvarray's C++ API, e.g. in a
* module initialization function, since it ensures that all of the pylvarray types are defined.
* If the types are not defined but are attempted to be exported to python, it will trigger a segfault.
*/
bool addPyLvArrayModule( PyObject * module );
/**
* @brief Expands to a static constexpr template bool @code CanCreate< T > @endcode which is true iff
* @c T is a type which LvArray can export to Python.
*/
IS_VALID_EXPRESSION( CanCreate, T, LvArray::python::create( std::declval< T & >() ) );
} // namespace python
} // namespace LvArray