Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/lean kernel exposure #154

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4b06b00
Corrected relative angular position docstring link
DominicDirkx May 7, 2024
8cc6ccc
Explicit kernel exposure undone
alopezrivera May 7, 2024
0cce9cc
Explicit kernel exposure undone - sure-fire
alopezrivera May 8, 2024
7c055da
[NOTE] Deleted script responsible for explicit kernel exposure
alopezrivera May 8, 2024
6de505b
Removed outdated kernel exposure explanatory comment
alopezrivera May 13, 2024
d325cb9
Install hybrid module only if it exists
alopezrivera May 13, 2024
5e3c3d5
Stub generation - Linux version with rsync
alopezrivera May 13, 2024
5888726
Stub generation - multiplatform, all modules
alopezrivera May 13, 2024
4cd2f4b
Modifications for extended time compatibility
DominicDirkx May 30, 2024
f361451
TODO's
alopezrivera Jun 3, 2024
97d550f
Merge pull request #152 from alopezrivera/lean-kernel-exposure
DominicDirkx Jun 19, 2024
8eeb6fe
Bumping version
DominicDirkx Jun 20, 2024
31f941d
Merge branch 'develop' into feature/lean_kernel_exposure
alopezrivera Jul 21, 2024
953a13b
Merged
DominicDirkx Jul 23, 2024
a07542d
Lean kernel exposure with explicit list of modules not to be exposed
alopezrivera Jul 23, 2024
09cce28
Kernel exposure without list of kernel modules not to be exposed
alopezrivera Jul 24, 2024
bf390da
Merge branch 'feature/lean_kernel_exposure' of https://github.com/tud…
alopezrivera Jul 24, 2024
65cb147
Add __init__.py to every Tudatpy Python subpackage
alopezrivera Aug 2, 2024
8f8173f
Kernel exposure using finder and loaders
alopezrivera Aug 2, 2024
91f8c9d
Refactor
alopezrivera Aug 2, 2024
34abbe0
Changed name of TudatpyModuleImporter to TudatpyModuleFinder
alopezrivera Aug 2, 2024
48fe01c
Removed explicit kernel exposure from gravity_field Python module __i…
alopezrivera Aug 2, 2024
6bc62b9
Merge branch 'develop' into feature/lean_kernel_exposure
alopezrivera Aug 5, 2024
f4c1bed
Cleanup
alopezrivera Aug 5, 2024
7595858
Make dependent variable dictionary available from tudatpy.numerical_s…
alopezrivera Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.8.0.dev7
current_version = 0.8.0.dev9
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
Expand Down
242 changes: 0 additions & 242 deletions expose_kernel_module.py

This file was deleted.

47 changes: 44 additions & 3 deletions tudatpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ install(TARGETS kernel
install(FILES ${TUDATPY_PYTHON_FILES} "${CMAKE_CURRENT_BINARY_DIR}/_version.py"
DESTINATION ${TUDATPY_INSTALL_PATH})

# 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}/)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${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}/)
else()
message(WARNING "Not installing hybrid C++/Python module ${module_dir_name} because it cannot be found in ${CMAKE_CURRENT_SOURCE_DIR}")
endif()
endmacro()

# Hybrid modules
Expand All @@ -183,6 +186,44 @@ INSTALL_HYBRID_CPP_PYTHON_MODULE(data)
INSTALL_HYBRID_CPP_PYTHON_MODULE(util)
INSTALL_HYBRID_CPP_PYTHON_MODULE(io)

#################################################
# Generate stubs to enable kernel autocompletions
#################################################

# Find stubgen executable
find_program(Stubgen_Executable NAMES stubgen)
if(NOT Stubgen_Executable)
message(FATAL_ERROR "Could not find stubgen. Please make sure it's installed in the active conda environment.")
endif()

# Generate stubs
add_custom_command(TARGET kernel POST_BUILD
COMMAND ${Stubgen_Executable} -p tudatpy.kernel -o . > /dev/null 2>&1
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../
COMMENT "Generating stubs..."
)

# Move stubs into tudatpy
# - TODO: replace by install directory just like tudatpy
# - TODO: turn into macro that can becalled to include stubs from particular kernel submodules, just like tudatpy python modules are selected for install
add_custom_command(TARGET kernel POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/kernel ${CMAKE_CURRENT_BINARY_DIR} > /dev/null 2>&1
COMMENT "Moving stubs to tudatpy..."
)

# Remove tudatpy/__init__.pyi
add_custom_command(TARGET kernel POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_CURRENT_BINARY_DIR}/__init__.pyi" > /dev/null 2>&1
COMMENT "Removing __init__.pyi file..."
)

# Remove directory (tudatpy/kernel) where stubgen generated the stubs
add_custom_command(TARGET kernel POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/kernel" > /dev/null 2>&1
COMMENT "Removing stub directory..."
)
#################################################

#install(FILES test.py "${CMAKE_CURRENT_BINARY_DIR}/_version.py")
file(COPY ../tests DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../)

Expand Down
Loading
Loading