Overview#

This guide assumes you have looked at the repository and are familiar with the majority information found in the User Guide.

Environment Setup#

When developing Earth2Studio, using uv virtual environment is suggested and will be used in the documentation. To create a local development environment with a git repo and uv, follow the steps below. Clone the repo and use uv to create a Python 3.12 virtual enviroment and sync it with the dev dependency group:

# Replace with your fork
git clone https://github.com/NVIDIA/earth2studio.git --single-branch

cd earth2studio

uv venv --python=3.12
uv sync # This will install the base and developer dependencies

This should create a python virtual environment inside of the local Earth2Studio git repository. To install the base, developer, documentation dependencies, use:

uv sync --group={docs}

Note

When working with models, additional optional dependencies may be required. See the model dependencies section for details on the optional dependencies inside the package. Use the uv sync --extra <optional dep> command instead of the pip install. Take note of the difference between the optional dependency groups used here and the extra dependencies when using specific models.

Pre-commit#

For Earth2Studio development, pre-commit is required. This will not only help developers pass the CI pipeline, but also accelerate reviews. Contributions that have not used pre-commit will not be reviewed.

To install pre-commit run the following inside the Earth2Studio repository folder:

uv pip install pre-commit
uv run pre-commit install

>>> pre-commit installed at .git/hooks/pre-commit

Once the above commands are executed, the pre-commit hooks will be activated and all the commits will be checked for appropriate formatting, linting, etc.