Practical info for developers
Installation guide
The Python implementation of DePSI is under development. At present you can only install it from the GitHub repository.
We strongly recommend using uv to handle the Python environment during development process. Please refer to the uv documentation for installation instructions of uv
Before you start, make sure you have access to the correct DePSI repository. You can contribute to the pubilic DePSI repository by forking it to your own GitHub account. If you are a member of the TUDelftGeodesy organization, you can also contribute to the group DePSI repository.
Clone this GitHub repository, then cd into the cloned repository.
Then you can create a development environment simply by synchronizing:
To activate the environment created by uv, run under DePSI directory:
To add a new package during development, you can use uv add <package-name> command.
In the end, install the pre-commit hooks, which will run the checks before each commit:
Linting and formatting
We use ruff for linting and formatting. If the pre-commit hooks are installed, the checks will be run automatically before each commit.
To manually run the checks, use the following command in the root directory of the repository:
Testing
We use pytest for testing. All tests are located in the tests directory.
To run the tests, use the following command in the root directory of the repository:
The GitHub Actions will run the tests automatically for each push and pull-request
on the main branch.
Documentation
We use mkdocs for documentation.
To check the documentation at local, use the following command in the root directory of the repository:
This will build and render the documentation at a local server. Follow the link provided in the terminal to view the documentation in the browser.
Parallelization
We use dask in many functions for delayed computation and parallelization. Since DePSI operates with Xarray, in most cases, we us Xarray's interface with Dask Arrays, such as xarray.apply_gufunc or xarray.map_blocks to perform parallel computation. Please refer to the Xarray Tutorial of Parallelizing Custom Functions as the best practices for implementing parallelization in DePSI.