Skip to content

Commit 7d1fe62

Browse files
feat(Lib): create lib to manage stochastic geometry.
1 parent 4c84184 commit 7d1fe62

20 files changed

Lines changed: 79 additions & 64 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,9 @@ option(OPENGEODE_STOCHASTIC_WITH_PYTHON "Compile Python bindings" OFF)
3131
# Get MyModule dependencies
3232
find_package(OpenGeode REQUIRED CONFIG)
3333

34-
#------------------------------------------------------------------------------------------------
35-
# Configure the MyModule libraries
36-
add_geode_library(
37-
NAME mylib
38-
FOLDER "mylib"
39-
SOURCES
40-
"common.cpp"
41-
"hello_world.cpp"
42-
PUBLIC_HEADERS
43-
"common.hpp"
44-
"hello_world.hpp"
45-
PRIVATE_DEPENDENCIES
46-
OpenGeode::basic
47-
)
34+
# ------------------------------------------------------------------------------------------------
35+
# Configure the OpenGeode-Stochastic libraries
36+
add_subdirectory(src/geode/stochastic)
4837

4938
#------------------------------------------------------------------------------------------------
5039
# Optional modules configuration

bindings/python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ add_geode_python_wheel(
2929
DESCRIPTION
3030
"A module of the OpenGeode framework for stochastic modeling, simulation and bayesian inference"
3131
MODULES
32-
"mylib.py"
32+
"geometry.py"
3333
LICENSE "MIT"
3434
)
3535

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
import opengeode
66

7-
from opengeode_stochastic_py_mylib import *
8-
StochasticMyLibLibrary.initialize()
7+
from opengeode_stochastic_py_geometry import *
8+
9+
StochasticGeometryLibrary.initialize()

bindings/python/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
add_subdirectory(mylib)
21+
add_subdirectory(geometry)

bindings/python/src/mylib/CMakeLists.txt renamed to bindings/python/src/geometry/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
# SOFTWARE.
2020

2121
add_geode_python_binding(
22-
NAME "py_mylib"
22+
NAME "py_geometry"
2323
SOURCES
24-
"mylib.cpp"
24+
"geometry.cpp"
2525
DEPENDENCIES
26-
${PROJECT_NAME}::mylib
26+
${PROJECT_NAME}::geometry
2727
)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424
#include <pybind11/pybind11.h>
2525

26-
#include <mylib/hello_world.hpp>
26+
#include <geode/stochastic/geometry/hello_world.hpp>
2727

28-
PYBIND11_MODULE( opengeode_stochastic_py_mylib, module )
28+
PYBIND11_MODULE( opengeode_stochastic_py_geometry, module )
2929
{
30-
module.doc() = "OpenGeode-Stochastic Python binding for mylib";
31-
pybind11::class_< stochastic::StochasticMyLibLibrary >(
32-
module, "StochasticMyLibLibrary" )
33-
.def( "initialize", &stochastic::StochasticMyLibLibrary::initialize );
34-
module.def( "hello_world", &stochastic::hello_world );
30+
module.doc() = "OpenGeode-Stochastic Python binding for geometry";
31+
pybind11::class_< geode::StochasticGeometryLibrary >(
32+
module, "StochasticGeometryLibrary" )
33+
.def( "initialize", &geode::StochasticGeometryLibrary::initialize );
34+
module.def( "hello_world", &geode::hello_world );
3535
}

bindings/python/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
add_subdirectory(mylib)
21+
add_subdirectory(geometry)

bindings/python/tests/mylib/CMakeLists.txt renamed to bindings/python/tests/geometry/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
add_geode_python_test(
2222
SOURCE "test-py-hello-world.py"
2323
DEPENDENCIES
24-
${PROJECT_NAME}::py_mylib
24+
${PROJECT_NAME}::py_geometry
2525
)

bindings/python/tests/mylib/test-py-hello-world.py renamed to bindings/python/tests/geometry/test-py-hello-world.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
os.add_dll_directory(path)
2929

3030
import opengeode
31-
import opengeode_stochastic_py_mylib as mylib
31+
import opengeode_stochastic_py_geometry as stochgeom
3232

3333
if __name__ == "__main__":
34-
mylib.hello_world()
34+
stochgeom.hello_world()

cmake/OpenGeode-StochasticConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ include(CMakeFindDependencyMacro)
2424
find_dependency(OpenGeode)
2525

2626
# Load information for each target
27-
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@_mylib_target.cmake)
27+
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@_geometry_target.cmake)

0 commit comments

Comments
 (0)