Skip to content
Back to skills

Contribution And Testing

ASecurity

"Use for TorchGeo repository edits, style/type conventions, adding

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythongobashtestingapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill contribution-and-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Contribution And Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Contribution And Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-contribution-and-testing/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-contribution-and-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: contribution-and-testing
description: "Use for TorchGeo repository edits, style/type conventions, adding
  datasets/models/tasks/transforms, fake fixtures, docs updates, and targeted
  verification commands."
metadata:
  disco-role: operating
disable-model-invocation: true
license: MIT
---

# TorchGeo contribution and testing

Use this sub-skill when modifying the TorchGeo repository rather than only using the package.

## Required style conventions

- New Python files must start with:

```python
# Copyright (c) TorchGeo Contributors. All rights reserved.
# Licensed under the MIT License.
```

- Ruff style uses single quotes and isort ordering: stdlib, third-party, then local imports.
- All functions need type annotations. Prefer built-in collection types and `X | Y` unions.
- Use Google-style docstrings with `Args`, `Returns`, `Raises`, and `Warns` sections as needed.
- Avoid broad `Exception` catches. Use TorchGeo dataset errors such as `DatasetNotFoundError`, `RGBBandsMissingError`, or `DependencyNotFoundError` where applicable.

## New dataset checklist

1. Add `torchgeo/datasets/<dataset>.py` with the license header.
2. Import it in `torchgeo/datasets/__init__.py`.
3. Add generated/minimal fake data under `tests/data/<dataset>/`.
4. Add `tests/datasets/test_<dataset>.py` with enough coverage for initialization, `__getitem__`, plotting, missing data, checksum/download behavior, and split handling as applicable.
5. Update `docs/api/datasets.rst` and the relevant dataset CSV under `docs/api/datasets/`.
6. Add or update a datamodule and datamodule test if the dataset has a standard training workflow.

## Targeted commands

From the repository root:

```bash
ruff format && ruff check && ty check && prettier --write .
pytest --cov=torchgeo tests/
pytest --cov=torchgeo.datasets tests/datasets/test_<dataset>.py
pytest --cov=torchgeo.datasets tests/datasets/test_<dataset>.py::TestDataset::test_getitem
pytest -m "" --cov=torchgeo tests/  # includes slow tests, use only when approved
```

For docs, install docs dependencies and run:

```bash
cd docs && make clean && make html
```

## Testing practices

- Use fake data only; never commit real dataset samples.
- Mark downloads/network as `@pytest.mark.slow` and respect the default socket-disabled test settings.
- Use `pytest.importorskip` for optional dependencies.
- Close matplotlib figures in plot tests.
- Keep files reasonably small and separate logical changes.

## Read next

- [reference](references/contribution-and-testing.md) for review checklists and native test maps.

Files in this skill

  • SKILL.md2.5 KB
  • references/contribution-and-testing.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.