Contributing#
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
If you have a suggestion for improvements, please fork the repo and create a pull request. You can also simply open an issue. Don’t forget to star and rate the project! Thanks again!
Fork the Project
Create your Feature Branch (git checkout -b feature/AmazingFeature)
Commit your Changes (git commit -m ‘Add some AmazingFeature’)
Push to the Branch (git push origin feature/AmazingFeature)
Open a Pull Request
Here is how to set up the project locally for development:
Initial setup#
You only need two tools, Poetry and Copier.
Poetry is used as a package manager. Copier is used for the project structure (scaffolding).
Install with pip:
python3 -m pip install --user pipx
pipx install poetry
pipx install copier copier-templates-extensions
Or create a new environment with conda/mamba:
conda env create -f environment.yaml -p ./.venv
If you have a conda environment and want to use the Makefile, use following command:
make initiate-dev
A conda environment.yaml
is provided inside this repo.
In order to create an external docker network to connect your containers to, run:
docker network create dev
Installing dependencies#
Install the projects code and all dependencies with:
poetry install
you can add packages with:
poetry add PACKAGE-NAME
You can remove packages by using:
poetry remove PACKAGE-NAME
Packages can be updated with:
poetry update PACKAGE-NAME
In order to run an example modelserver, git submodule is used and needs to be initiated:
git submodule init
git submodule update --recursive
In this folder you can find build instructions to build a container with OGC API Processes compliant example processes based on pygeoapi. Those can be utilized as example processes for the Urban Model Platform. For it to run, cd moduleserver_example
and run:
cp .env.example .env
and setIMAGE_TAG
tomain
docker compose -f docker-compose-build.yaml build
Updating the Documentation#
Install the optional docs depdendencies with:
poetry install --only=docs
Run the build process with:
make build-docs
To view the docs copy the content of the docs/_build folder to a webserver or use VSCode and the Live server extension.
Start Flask App#
To start the Flask app, run:
flask -A src/ump/main.py --debug run
Data Storage#
The Urban Model Platform uses Docker containers to run the PostGIS and Geoserver components. The data is stored in the following folders:
postgresql_data
-> contains the postgres db filesgeoserver_data
-> contains the Geoserver data dir
If you are in development and want to reset all PostGis and Geoserver data, you can delete the postgresql_data
and the geoserver_data
folders.
DB-Migrations#
The Urban Model Platform uses Alembic for database migrations. The migration scripts are located in the src/ump/migrations
folder. To run the migrations, use the following command:
alembic upgrade head
This will apply all pending migrations to the database.