Skip to content

Commit

Permalink
Merge pull request #17 from OPERA-Cal-Val/dev
Browse files Browse the repository at this point in the history
v0.0.4
  • Loading branch information
cmarshak authored Jan 11, 2024
2 parents 6292b5f + 332a94a commit 11531b2
Show file tree
Hide file tree
Showing 27 changed files with 77 additions and 76 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "bumpless"
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
call-flake8-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
local_package_names: tile_stitcher
local_package_names: tile_mate

call-secrets-analysis-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
Expand Down
29 changes: 7 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,10 @@ on:
- dev

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v2

- uses: mamba-org/provision-with-micromamba@main
with:
environment-name: tile-stitcher
environment-file: environment.yml
extra-specs: |
python=${{ matrix.python-version }}
- name: Pytest in conda environment
shell: bash -l {0}
run: |
python -m pip install .
pytest . tests
call-pytest-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
local_package_name: tile_mate
python_versions: >-
["3.10", "3.11", "3.12"]
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ __pycache__/
/dist/

# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info
**/*.egg-info

# Environments
.env
Expand Down Expand Up @@ -82,4 +82,7 @@ __pycache__/
*.pdf

# Ignore json
*.json
*.json

# Coverage
*.coverage
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.4]
* `tile-mate` is new name of the project - old name `tile-stitcher` was too similar to existing projects on PyPI
* Uses `src` layout per: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
* Hopefully on PyPI

## [0.0.3]
* Fixes PyPI workflow by removing unrecognized `License :: OSI Approved :: Apache 2.0' is not a valid classifier.`
* Fixes dependencies in pyproject.toml
* Updates readme installation instruction.
* On PyPI
* Still not on PyPI due to similarity of the name

## [0.0.2]
* Fixes automated workflows
Expand All @@ -19,7 +24,7 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.0.1]
(not on PyPI)

* First release of `tile_stitcher` with following datasets (See readme for links):
* First release of `tile_mate` with following datasets (See readme for links):
- ESA 10m worldcover 2020 and 2021;
- Pekel 30m water occurence 2021;
- S1 coherence from 2020;
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# tile-stitcher
# tile-mate

This tool provides a tool to create continuous rasters of global publicly available tiles such as Pekel Occurence and ESA 10 m land cover. This is a simpler cousin of [`dem-stitcher`](https://github.com/ACCESS-Cloud-Based-InSAR/dem-stitcher) without the need for basic post-processing (e.g. fractional pixel translation and vertical datum transformations).


The API can be summarized as
```
from tile_stitcher import get_raster_from_tiles
from tile_mate import get_raster_from_tiles
bounds = [-120.55, 34.85, -120.25, 35.15]
X, p = get_raster_from_tiles(bounds, tile_shortname='esa_world_cover_2021')
Expand All @@ -30,8 +30,8 @@ via [Anaconda/Miniconda](https://docs.conda.io/projects/conda/en/latest/user-gui
or [Python virtual environments](https://docs.python.org/3/tutorial/venv.html).

1. Install the environment in this repository with `mamba env update -f environment.yml`
2. Activate the environment `conda activate tile-stitcher`
3. Install the library with `pip` via `pip install tile-stitcher`
2. Activate the environment `conda activate tile-mate`
3. Install the library with `pip` via `pip install tile-mate`

For development, clone the repository and navigate to it in the terminal.

Expand All @@ -53,7 +53,7 @@ We have notebooks to demonstrate common usage:
The datasets supported are:

```
In [1]: from tile_stitcher.stitcher import DATASET_SHORTNAMES
In [1]: from tile_mate.stitcher import DATASET_SHORTNAMES
In [2]: DATASET_SHORTNAMES
Out[2]: ['peckel_water_occ_2021',
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tile-stitcher
name: tile-mate
channels:
- conda-forge
dependencies:
Expand Down
10 changes: 5 additions & 5 deletions notebooks/Basic_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"metadata": {},
"outputs": [],
"source": [
"from tile_stitcher import get_raster_from_tiles\n",
"from tile_stitcher.stitcher import DATASET_SHORTNAMES\n",
"from tile_mate import get_raster_from_tiles\n",
"from tile_mate.stitcher import DATASET_SHORTNAMES\n",
"from rasterio.plot import show\n",
"from matplotlib.colors import ListedColormap\n",
"import numpy as np\n",
"from tile_stitcher.stitcher import HANSEN_MOSAIC_YEARS"
"from tile_mate.stitcher import HANSEN_MOSAIC_YEARS"
]
},
{
Expand Down Expand Up @@ -563,9 +563,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
6 changes: 3 additions & 3 deletions notebooks/ESA_World_Cover_Plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"metadata": {},
"outputs": [],
"source": [
"from tile_stitcher import get_raster_from_tiles\n",
"from tile_mate import get_raster_from_tiles\n",
"from rasterio.plot import show\n",
"from matplotlib.colors import ListedColormap\n",
"import numpy as np\n",
Expand Down Expand Up @@ -213,9 +213,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
10 changes: 5 additions & 5 deletions notebooks/tile_creation/0_Organize_Hansen_Landsat_Mosaics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"from rasterio.crs import CRS\n",
"import geopandas as gpd\n",
"from shapely.geometry import box\n",
"from tile_stitcher.tile_model import TILE_SCHEMA\n",
"from tile_stitcher.stitcher import DATA_DIR\n",
"from tile_mate.tile_model import TILE_SCHEMA\n",
"from tile_mate.stitcher import DATA_DIR\n",
"import pandera as pa\n",
"from dem_stitcher.geojson_io import to_geojson_gzip"
]
Expand Down Expand Up @@ -352,7 +352,7 @@
{
"data": {
"text/plain": [
"'/Users/cmarshak/bekaert-team/tile-stitcher/tile_stitcher/data/hansen_landsat_mosaic_2022.geojson.zip'"
"'/Users/cmarshak/bekaert-team/tile-mate/tile_mate/data/hansen_landsat_mosaic_2022.geojson.zip'"
]
},
"execution_count": 37,
Expand All @@ -375,9 +375,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
12 changes: 6 additions & 6 deletions notebooks/tile_creation/1_ESA_World_Cover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"Source: https://esa-worldcover.org/en/data-access (see AWS section). Wasn't able to find grid for 2021 so copied the grid from 2020 and made necessary adjustments.\n",
"\n",
"Must have `tile-stitcher` installed in editable mode. Also, uses `dem_stitcher` for serialization (available via conda-forge)"
"Must have `tile-mate` installed in editable mode. Also, uses `dem_stitcher` for serialization (available via conda-forge)"
]
},
{
Expand All @@ -18,8 +18,8 @@
"outputs": [],
"source": [
"import geopandas as gpd\n",
"from tile_stitcher.tile_model import TILE_SCHEMA\n",
"from tile_stitcher.stitcher import DATA_DIR\n",
"from tile_mate.tile_model import TILE_SCHEMA\n",
"from tile_mate.stitcher import DATA_DIR\n",
"import pandera as pa\n",
"from dem_stitcher.geojson_io import to_geojson_gzip"
]
Expand Down Expand Up @@ -209,7 +209,7 @@
{
"data": {
"text/plain": [
"'/Users/cmarshak/bekaert-team/tile-stitcher/tile_stitcher/data/esa_world_cover_2020.geojson.zip'"
"'/Users/cmarshak/bekaert-team/tile-mate/tile_mate/data/esa_world_cover_2020.geojson.zip'"
]
},
"execution_count": 37,
Expand All @@ -225,9 +225,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
10 changes: 5 additions & 5 deletions notebooks/tile_creation/2_Peckel_Water_Mask.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"from shapely.geometry import box\n",
"import matplotlib.pyplot as plt\n",
"from dem_stitcher.geojson_io import to_geojson_gzip\n",
"from tile_stitcher.tile_model import TILE_SCHEMA\n",
"from tile_stitcher.stitcher import DATA_DIR\n",
"from tile_mate.tile_model import TILE_SCHEMA\n",
"from tile_mate.stitcher import DATA_DIR\n",
"import rasterio"
]
},
Expand Down Expand Up @@ -301,7 +301,7 @@
{
"data": {
"text/plain": [
"'/Users/cmarshak/bekaert-team/tile-stitcher/tile_stitcher/data/pekel_water_occurrence_2021.geojson.zip'"
"'/Users/cmarshak/bekaert-team/tile-mate/tile_mate/data/pekel_water_occurrence_2021.geojson.zip'"
]
},
"execution_count": 8,
Expand All @@ -316,9 +316,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
10 changes: 5 additions & 5 deletions notebooks/tile_creation/3_s1_2020_vv_coherence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"import matplotlib.pyplot as plt\n",
"from rasterio.plot import show\n",
"from shapely.geometry import Polygon\n",
"from tile_stitcher.tile_model import TILE_SCHEMA\n",
"from tile_stitcher.stitcher import DATA_DIR\n",
"from tile_mate.tile_model import TILE_SCHEMA\n",
"from tile_mate.stitcher import DATA_DIR\n",
"from dem_stitcher.geojson_io import to_geojson_gzip"
]
},
Expand Down Expand Up @@ -650,7 +650,7 @@
{
"data": {
"text/plain": [
"'/Users/cmarshak/bekaert-team/tile-stitcher/tile_stitcher/data/s1_coherence_2020.geojson.zip'"
"'/Users/cmarshak/bekaert-team/tile-mate/tile_mate/data/s1_coherence_2020.geojson.zip'"
]
},
"execution_count": 25,
Expand Down Expand Up @@ -708,9 +708,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
10 changes: 5 additions & 5 deletions notebooks/tile_creation/4_100m_Copernicus_landcover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"import matplotlib.pyplot as plt\n",
"from rasterio.plot import show\n",
"from shapely.geometry import Polygon\n",
"from tile_stitcher.tile_model import TILE_SCHEMA\n",
"from tile_stitcher.stitcher import DATA_DIR\n",
"from tile_mate.tile_model import TILE_SCHEMA\n",
"from tile_mate.stitcher import DATA_DIR\n",
"from dem_stitcher.geojson_io import to_geojson_gzip\n",
"from tqdm import tqdm"
]
Expand Down Expand Up @@ -682,7 +682,7 @@
{
"data": {
"text/plain": [
"'/Users/cmarshak/bekaert-team/tile-stitcher/tile_stitcher/data/cop_100m_lulc_discrete_classes.geojson.zip'"
"'/Users/cmarshak/bekaert-team/tile-mate/tile_mate/data/cop_100m_lulc_discrete_classes.geojson.zip'"
]
},
"execution_count": 25,
Expand All @@ -697,9 +697,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "tile-stitcher",
"display_name": "tile-mate",
"language": "python",
"name": "tile-stitcher"
"name": "tile-mate"
},
"language_info": {
"codemirror_mode": {
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ requires = ['setuptools>=60', 'setuptools-scm>=8.0']
build-backend = 'setuptools.build_meta'

[project]
name = 'tile-stitcher'
name = 'tile-mate'
requires-python = '>=3.10'
authors = [
{ name = 'Alexander Handwerger, Charlie Marshak, and OPERA Project Science Team' },
]
description = 'Create rasters from global tiles'
license = {text = 'Apache-2.0'}
license = { text = 'Apache-2.0' }
classifiers = [
'Intended Audience :: Science/Research',
'Natural Language :: English',
Expand Down Expand Up @@ -45,16 +45,16 @@ develop = [
]

[project.urls]
Homepage = "https://github.com/OPERA-Cal-Val/tile-stitcher"
"Bug Tracker" = "https://github.com/OPERA-Cal-Val/tile-stitcher/issues"
Homepage = "https://github.com/OPERA-Cal-Val/tile-mate"
"Bug Tracker" = "https://github.com/OPERA-Cal-Val/tile-mate/issues"

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.packages.find]
include = ['tile_stitcher']
exclude = ['notebooks*', 'tests*']
where = ["src"]
exclude = ["notebooks*", "tests*"]

[tool.setuptools.dynamic]
readme = { file = ['README.md'], content-type = 'text/markdown' }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 11531b2

Please sign in to comment.