The TU Delft Astrodynamics Toolbox in Python, or Tudatpy, is a library that primarily exposes a powerful set of C++ libraries aiming at accelerating the implementation of simulations, real-data processing and analysis, and quality education in the field of Astrodynamics.
See the documentation for more.
For nominal usage, the use of our distributed conda package is recommended. For more details on the project, please refer to the project website and the project’s Github page.
Structure of the Tudatpy Repository
The Tudatpy repository contains both the source code and the binding code, together with the respective documentation and examples folders.
The next steps outline how to get to a working version of Tudatpy. First we list some prerequisites, and then we show how to set it up.
All procedures, including the following prerequisite, assume the use of WSL. Power users who wish to do otherwise,
must do so at their own risk, with reduced support from the team.
Note that WSL is a, partially separated, Ubuntu terminal environment for Windows. Anaconda/Miniconda, Python and any other dependencies you require while executing code from the Tudatpy repository, must be installed in its Linux version via the Ubuntu terminal. This does not apply to PyCharm/CLion however, which can be configured to compile and/or run Python code through the WSL.
Note that, to access files and folders of WSL directly in Windows explorer, one can type \\wsl$ or Linux in the Windows explorer access bar, then press enter.
At the opposite, please follow this guide to access Windows file trough WSL.
Inside the Ubuntu terminal, install CMake by calling sudo apt install cmake.
Setup
Clone the repository and enter directory
git clone https://github.com/tudat-team/tudatpy
cd tudatpy
Clone the examples/tudatpy submodule:
git submodule update --init --recursive
Note Submodules “allow you to keep a Git repository as a subdirectory of
another Git repository” (from the Git guide). In particular,
This “sub-repository” has its own branches and functions separately from Tudatpy. This is why the previous step is needed.
Switch Tudatpy to a new or an already existing branch using:
git checkout develop
Note Although you could virtually choose any branch, we recommend working with the develop branch, as it receives frequent updates and are the ones used to build the Conda packages.
Install the contained environment.yaml file to satisfy dependencies, then activate it:
Note It is possible that the creation of the environment will ‘time out’. A likely reason for this is that the packages required cannot be found by the current channel, conda-forge. It is then advisable to add the channel anaconda to ensure a proper creation of the environment.
Build TudatPy
python build.py -h # Show help and available flags
python build.py -j <number-of-cores> # Compile Tudatpy
python build.py --tests # [optional] To verify with ctest (see below)
This script compiles Tudatpy. It will take some time to execute, but you can speed up the process by increasing the number of cores used with the -j flag. If you wish to verify your installation with ctest (see below), add the --tests flag.
Once the project is built, all the build output is dumped by default in a directory called build, which is not tracked by Git.
Install
python install.py -h # Show help and available flags
python install.py -e # Install in "editable mode"
Note This script installs Tudatpy in your active conda environment. If you install with the -e flag, you will not have to re-install every time you update the source code of the library.
And that’s it! The next step shows you what to do if you want to uninstall the libraries.
Uninstall
python uninstall.py -h # Show help and available flags
python uninstall.py # Uninstall Tudatpy
Note This script will remove Tudatpy from your Conda environment, but it will not delete the build directory.
Verify your build
Running tudatpy tests
Within the tudatpy directory, run pytest (packaged with CMake)
pytest
Desired result:
=========================================== 6 passed in 1.78s ============================================
Running tudat tests
Enter the tudatpy/build directory and run the tests using ctest
cd build
ctest
Desired result:
..
100% tests passed, 0 tests failed out of 224
Total Test time (real) = 490.77 sec
Note To speed up the tests, you can optionally use multiple cores as follows: ctest -j <number_of_cores>
关于
tudatpy 是代尔夫特理工大学 TU Delft 天体动力学平台 Tudat 的 Python 接口,支持高保真数值轨道传播、轨道估计与任务分析,在学术界应用广泛。镜像收录自 https://github.com/tudat-team/tudatpy,License:BSD-3-Clause
Tudatpy
The TU Delft Astrodynamics Toolbox in Python, or Tudatpy, is a library that primarily exposes a powerful set of C++
libraries aiming at accelerating the implementation of simulations, real-data processing and analysis, and quality education in the field of Astrodynamics. See the documentation for more.
For nominal usage, the use of our distributed conda package is recommended. For more details on the project, please refer to the project website and the project’s Github page.
Structure of the
TudatpyRepositoryThe
Tudatpyrepository contains both the source code and the binding code, together with the respective documentation and examples folders. The next steps outline how to get to a working version of Tudatpy. First we list some prerequisites, and then we show how to set it up.Prerequisites
Tudatpyrepository, must be installed in its Linux version via the Ubuntu terminal. This does not apply to PyCharm/CLion however, which can be configured to compile and/or run Python code through the WSL.\\wsl$orLinuxin the Windows explorer access bar, then press enter.sudo apt-get install build-essentialto install the necessary compilation toolssudo apt install cmake.Setup
examples/tudatpysubmodule:Tudatpyto a new or an already existing branch using:environment.yamlfile to satisfy dependencies, then activate it:This script compiles Tudatpy. It will take some time to execute, but you can speed up the process by increasing the number of cores used with the
-jflag. If you wish to verify your installation withctest(see below), add the--testsflag. Once the project is built, all the build output is dumped by default in a directory calledbuild, which is not tracked by Git.Verify your build
Running
tudatpyteststudatpydirectory, runpytest(packaged with CMake)Desired result:
Running
tudatteststudatpy/builddirectory and run the tests usingctestDesired result: