Skip to content

Commit 4e032df

Browse files
committed
Initial scaffold: app, stac helpers, CI, pixi, binder
1 parent 298e13f commit 4e032df

File tree

10 files changed

+669
-1
lines changed

10 files changed

+669
-1
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# .github/workflows/ci.yml
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [main, "refs/heads/*"]
7+
pull_request:
8+
branches: [main]
9+
workflow_dispatch:
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install mamba and conda-forge packages
23+
run: |
24+
python -m pip install -U pip
25+
python -m pip install mamba
26+
mamba install -y -c conda-forge python=3.11 ipywidgets ipyleaflet pytest ruff
27+
28+
- name: Install project (pip)
29+
run: |
30+
python -m pip install -e .
31+
32+
- name: Lint (ruff)
33+
run: |
34+
python -m ruff check .
35+
36+
- name: Run tests (pytest)
37+
run: |
38+
pytest -q
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# .github/workflows/integration-schedule.yml
2+
name: Integration - scheduled
3+
4+
on:
5+
schedule:
6+
- cron: "0 3 * * *"
7+
workflow_dispatch:
8+
9+
jobs:
10+
integration:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.11"
18+
- name: Install dependencies
19+
run: |
20+
pip install -U pip
21+
pip install -r requirements-dev.txt || true
22+
pip install -e .
23+
- name: Run integration tests (mocked)
24+
run: |
25+
pytest tests -q -k "not slow"

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/charliermarsh/ruff-pre-commit
3+
rev: v0.22.0
4+
hooks:
5+
- id: ruff
6+
args: [--fix]

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
# planetquery
1+
# PlanetQuery
2+
3+
Demo + scaffolding for STAC + ipyleaflet mapping.
4+
5+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Jack-Hayes/planetquery/HEAD?urlpath=voila%2Frender%2Fnotebooks%2Fapp.ipynb)
6+
7+
## Quickstart
8+
9+
Click the badge above to launch the demo (Binder + Voila). Session is ephemeral (~1–2 hours).
10+
11+
## Development
12+
13+
- Use `pixi` to create dev envs.
14+
- Lint with `ruff`.
15+
- Run tests with `pytest`.
16+
17+
## License
18+
19+
MIT

pixi.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[project]
2+
name = "planetquery"
3+
description = "PlanetQuery demo using STAC + ipyleaflet"
4+
5+
[env]
6+
python = "3.11.12"
7+
8+
[deps.conda]
9+
channels = ["conda-forge"]
10+
packages = [
11+
"python=3.11.12",
12+
"ipykernel",
13+
"jupyterlab",
14+
"voila",
15+
"notebook",
16+
"ipywidgets",
17+
"ipyleaflet",
18+
"matplotlib",
19+
"numpy",
20+
"pandas",
21+
"xarray",
22+
"geopandas",
23+
"rioxarray",
24+
"rasterio",
25+
"shapely",
26+
"gdal",
27+
"nodejs"
28+
]
29+
30+
[deps.pip]
31+
packages = [
32+
"pystac-client",
33+
"planetary-computer",
34+
"odc-stac",
35+
"localtileserver",
36+
"localtileserver-client",
37+
"matplotlib-inline"
38+
]

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[project]
2+
name = "planetquery"
3+
version = "0.0.1"
4+
description = "Interactive STAC + mapping demo (PlanetQuery)"
5+
readme = "README.md"
6+
requires-python = ">=3.11,<3.12"
7+
authors = [{name="Jack Hayes", email="[email protected]"}]
8+
license = {text = "MIT"}
9+
10+
[tool.ruff]
11+
line-length = 100
12+
select = ["E", "F", "I", "W", "C", "N", "Q"]
13+
extend-ignore = ["E203", "W503"]

0 commit comments

Comments
 (0)