Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Development

SYZ edited this page May 21, 2025 · 9 revisions

Build

We use uv as a project manager:

  1. Install uv
  2. Run uv build to build .whl
  3. Run uv run python tests/test.py to test the package.

Project Structure

The project can be divided into three parts:

  1. a data fetcher
  2. a torch datasets
  3. some utils

Publish

uv doesn't support automatically bump version, see https://github.com/astral-sh/uv/issues/6298 .

An elegant workaround is using dunamai to calculate version number from git tag. And git tag should be the only source of version numbers.
So the best practice to release a stable version is:

  1. Create a release in GitHub, or (locally) run git tag v<x.y.z>
  2. Trigger the uv-publish.yml, or (locally) run etc/bump-version.bash to set the version in pyproject.toml automatically, and uv publish.

the best practice to release an unstable version is:

  1. Check if the previous stable version is correctly tagged
  2. Trigger the uv-publish.yml, or (locally) run etc/bump-version.bash to set the version in pyproject.toml automatically, and uv publish.

Branding

  1. PyPI pre-release version badge are not supported: https://github.com/badges/shields/issues/4692

etc

What to load, what not

We won't add any dataset that are available in other dataloaders, like torchgeo

Naming

"There are only two hard things in Computer Science: cache invalidation and naming things." (Phil Karlton). As a small project, we met both: The download cache and the API naming.

To avoid naming issue, we use this naming method in the future:

  1. The class and typing are PacalCase, the const value are ALL_UPPER_CASE, and everything else should be snake_case
  2. The package naming may be a huge problem, but let it go
  3. Use clear words: use channel instead of band, hsi instead of casi, lidar instead of dsm

off-by-1 errors

There's background and labels, the sparse matrix make 0 to be the background. So the label starts from 1 ...

Rasterio warnings

It won't affect the data:

WARNING:rasterio._env:CPLE_AppDefined in 2013_IEEE_GRSS_DF_Contest_CASI.tif: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.    
WARNING:rasterio._env:CPLE_AppDefined in TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.
Clone this wiki locally