Skip to content

Commit

Permalink
Merge pull request #126 from alopezrivera/hybrid-module-definitive
Browse files Browse the repository at this point in the history
Proposal for a definitive hybrid C++/Python tudatpy package architecture
  • Loading branch information
DominicDirkx authored Nov 3, 2023
2 parents 73f63df + 98596b6 commit bb00d91
Show file tree
Hide file tree
Showing 57 changed files with 74 additions and 79 deletions.
41 changes: 18 additions & 23 deletions tudatpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,35 +158,30 @@ install(TARGETS kernel
LIBRARY DESTINATION ${TUDATPY_INSTALL_PATH}
)

# Install the Python files.
# Install Python files.
install(FILES ${TUDATPY_PYTHON_FILES} "${CMAKE_CURRENT_BINARY_DIR}/_version.py"
DESTINATION ${TUDATPY_INSTALL_PATH})

# Install the Python modules.
macro(INSTALL_PURE_PYTHON_MODULE_DIR module_dir_name)
# Install hybrid C++/Python modules
macro(INSTALL_HYBRID_CPP_PYTHON_MODULE module_dir_name)
install(DIRECTORY ${module_dir_name}/ DESTINATION "${TUDATPY_INSTALL_PATH}/${module_dir_name}")
file(COPY ${module_dir_name}/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${module_dir_name}/)
endmacro()
INSTALL_PURE_PYTHON_MODULE_DIR(apps)
INSTALL_PURE_PYTHON_MODULE_DIR(bodies)
INSTALL_PURE_PYTHON_MODULE_DIR(plotting)
INSTALL_PURE_PYTHON_MODULE_DIR(data)
INSTALL_PURE_PYTHON_MODULE_DIR(util)
INSTALL_PURE_PYTHON_MODULE_DIR(io)

# Create hybrid C++/Python modules
macro(CREATE_HYBRID_CPP_PYTHON_MODULE module_dir_name)
install(DIRECTORY kernel_hybrid/${module_dir_name}/ DESTINATION "${TUDATPY_INSTALL_PATH}/${module_dir_name}")
file(COPY kernel_hybrid/${module_dir_name}/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${module_dir_name}/)
endmacro()
# CREATE_HYBRID_CPP_PYTHON_MODULE(utils)
CREATE_HYBRID_CPP_PYTHON_MODULE(astro)
CREATE_HYBRID_CPP_PYTHON_MODULE(trajectory_design)
CREATE_HYBRID_CPP_PYTHON_MODULE(constants)
CREATE_HYBRID_CPP_PYTHON_MODULE(interface)
# CREATE_HYBRID_CPP_PYTHON_MODULE(io)
CREATE_HYBRID_CPP_PYTHON_MODULE(math)
CREATE_HYBRID_CPP_PYTHON_MODULE(numerical_simulation)

# Hybrid modules
INSTALL_HYBRID_CPP_PYTHON_MODULE(astro)
INSTALL_HYBRID_CPP_PYTHON_MODULE(trajectory_design)
INSTALL_HYBRID_CPP_PYTHON_MODULE(constants)
INSTALL_HYBRID_CPP_PYTHON_MODULE(interface)
INSTALL_HYBRID_CPP_PYTHON_MODULE(math)
INSTALL_HYBRID_CPP_PYTHON_MODULE(numerical_simulation)
# Pure Python modules
INSTALL_HYBRID_CPP_PYTHON_MODULE(apps)
INSTALL_HYBRID_CPP_PYTHON_MODULE(bodies)
INSTALL_HYBRID_CPP_PYTHON_MODULE(plotting)
INSTALL_HYBRID_CPP_PYTHON_MODULE(data)
INSTALL_HYBRID_CPP_PYTHON_MODULE(util)
INSTALL_HYBRID_CPP_PYTHON_MODULE(io)

# TODO: Automatic exposure of hybrid C++/Python modules
# This involves solving the dependencies which conda
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro`.
# its Python extensions defined in `tudatpy/astro`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.element_conversion` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/element_conversion`.
# its Python extensions defined in `tudatpy/astro/element_conversion`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.element_conversion` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.frame_conversion` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/frame_conversion`.
# its Python extensions defined in `tudatpy/astro/frame_conversion`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.frame_conversion` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.fundamentals` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/fundamentals`.
# its Python extensions defined in `tudatpy/astro/fundamentals`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.fundamentals` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.gravitation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/gravitation`.
# its Python extensions defined in `tudatpy/astro/gravitation`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.gravitation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.polyhedron_utilities` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/polyhedron_utilities`.
# its Python extensions defined in `tudatpy/astro/polyhedron_utilities`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.polyhedron_utilities` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.time_conversion` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/time_conversion`.
# its Python extensions defined in `tudatpy/astro/time_conversion`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.time_conversion` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.astro.two_body_dynamics` with
# its Python extensions defined in `tudatpy/kernel_hybrid/astro/two_body_dynamics`.
# its Python extensions defined in `tudatpy/astro/two_body_dynamics`.
#
# This allows the import of all the C++ and Python submodules of the
# `astro.two_body_dynamics` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.constants` with
# its Python extensions defined in `tudatpy/kernel_hybrid/constants`.
# its Python extensions defined in `tudatpy/constants`.
#
# This allows the import of all the C++ and Python submodules of the
# `constants` kernel module directly from tudatpy:
Expand Down
4 changes: 2 additions & 2 deletions tudatpy/data/horizons.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from typing import Union, List, Tuple
import datetime

from ..kernel import constants
from ..kernel.numerical_simulation import environment_setup
from tudatpy import constants
from tudatpy.numerical_simulation import environment_setup

import re

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.interface` with
# its Python extensions defined in `tudatpy/kernel_hybrid/interface`.
# its Python extensions defined in `tudatpy/interface`.
#
# This allows the import of all the C++ and Python submodules of the
# `interface` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.interface.spice` with
# its Python extensions defined in `tudatpy/kernel_hybrid/interface/spice`.
# its Python extensions defined in `tudatpy/interface/spice`.
#
# This allows the import of all the C++ and Python submodules of the
# `interface.spice` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.math` with
# its Python extensions defined in `tudatpy/kernel_hybrid/math`.
# its Python extensions defined in `tudatpy/math`.
#
# This allows the import of all the C++ and Python submodules of the
# `math` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.math.geometry` with
# its Python extensions defined in `tudatpy/kernel_hybrid/math/geometry`.
# its Python extensions defined in `tudatpy/math/geometry`.
#
# This allows the import of all the C++ and Python submodules of the
# `math.geometry` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.math.interpolators` with
# its Python extensions defined in `tudatpy/kernel_hybrid/math/interpolators`.
# its Python extensions defined in `tudatpy/math/interpolators`.
#
# This allows the import of all the C++ and Python submodules of the
# `math.interpolators` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.math.numerical_integrators` with
# its Python extensions defined in `tudatpy/kernel_hybrid/math/numerical_integrators`.
# its Python extensions defined in `tudatpy/math/numerical_integrators`.
#
# This allows the import of all the C++ and Python submodules of the
# `math.numerical_integrators` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.math.root_finders` with
# its Python extensions defined in `tudatpy/kernel_hybrid/math/root_finders`.
# its Python extensions defined in `tudatpy/math/root_finders`.
#
# This allows the import of all the C++ and Python submodules of the
# `math.root_finders` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation`.
# its Python extensions defined in `tudatpy/numerical_simulation`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.aerodynamic_coefficients` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/aerodynamic_coefficients`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/aerodynamic_coefficients`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.aerodynamic_coefficients` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.atmosphere` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/atmosphere`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/atmosphere`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.atmosphere` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.ephemeris` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/ephemeris`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/ephemeris`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.ephemeris` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.gravity_field` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/gravity_field`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/gravity_field`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.gravity_field` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.gravity_field_variation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/gravity_field_variation`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/gravity_field_variation`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.gravity_field_variation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.ground_station` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/ground_station`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/ground_station`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.ground_station` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.radiation_pressure` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/radiation_pressure`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/radiation_pressure`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.radiation_pressure` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.rigid_body` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/rigid_body`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/rigid_body`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.rigid_body` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.rotation_model` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/rotation_model`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/rotation_model`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.rotation_model` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.shape` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/shape`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/shape`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.shape` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.environment_setup.shape_deformation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/environment_setup/shape_deformation`.
# its Python extensions defined in `tudatpy/numerical_simulation/environment_setup/shape_deformation`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.environment_setup.shape_deformation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.estimation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/estimation`.
# its Python extensions defined in `tudatpy/numerical_simulation/estimation`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.estimation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.estimation_setup` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/estimation_setup`.
# its Python extensions defined in `tudatpy/numerical_simulation/estimation_setup`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.estimation_setup` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.estimation_setup.observation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/estimation_setup/observation`.
# its Python extensions defined in `tudatpy/numerical_simulation/estimation_setup/observation`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.estimation_setup.observation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.estimation_setup.parameter` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/estimation_setup/parameter`.
# its Python extensions defined in `tudatpy/numerical_simulation/estimation_setup/parameter`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.estimation_setup.parameter` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.propagation` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/propagation`.
# its Python extensions defined in `tudatpy/numerical_simulation/propagation`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.propagation` kernel module directly from tudatpy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file, by virtue of the import statement below, merges
# the Tudat kernel module `tudatpy.kernel.numerical_simulation.propagation_setup` with
# its Python extensions defined in `tudatpy/kernel_hybrid/numerical_simulation/propagation_setup`.
# its Python extensions defined in `tudatpy/numerical_simulation/propagation_setup`.
#
# This allows the import of all the C++ and Python submodules of the
# `numerical_simulation.propagation_setup` kernel module directly from tudatpy:
Expand Down
Loading

0 comments on commit bb00d91

Please sign in to comment.