Skip to content

Commit aa62dba

Browse files
Merge pull request #8 from tonkintaylor/develop
v0.1.0
2 parents 2a097d9 + 432ff7a commit aa62dba

32 files changed

Lines changed: 5201 additions & 1120 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ jobs:
7575
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434
7676

7777
- name: Create test reports directory
78-
if: matrix.pytest && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
78+
if: matrix.pytest && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && matrix.resolution == 'highest'
7979
run: mkdir -p ./test-reports
8080

8181
- name: Upload coverage reports
82-
if: matrix.pytest && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
82+
if: matrix.pytest && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && matrix.resolution == 'highest'
8383
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
8484
with:
8585
name: coverage-reports
@@ -126,7 +126,7 @@ jobs:
126126
cat > sonar-project.properties << EOF
127127
sonar.projectKey=${SONAR_PROJECT_KEY}
128128
sonar.language=py
129-
sonar.python.version=3.13
129+
sonar.python.version=3.10
130130
sonar.sources=./src
131131
sonar.tests=./tests
132132
sonar.python.coverage.reportPaths=./test-reports/coverage.xml

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12.11
1+
3.10.18

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<a href="https://github.com/tonkintaylor/geopins/"><img src="https://raw.githubusercontent.com/tonkintaylor/geopins/refs/heads/develop/docs/logo.svg" align="right" height="138" /></a>
2-
3-
<!-- -->
41
# geopins
2+
<a href="https://github.com/tonkintaylor/geopins/"><img src="https://raw.githubusercontent.com/tonkintaylor/geopins/refs/heads/develop/docs/logo.svg" align="right" height="138" /></a>
53

64
[![PyPI Version](https://img.shields.io/pypi/v/geopins.svg)](<https://pypi.python.org/pypi/geopins>)
75
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
86
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
97
[![usethis](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/usethis-python/usethis-python/main/assets/badge/v1.json)](https://github.com/usethis-python/usethis-python)
108

11-
Geospatial support for the [Python pins package](https://github.com/rstudio/pins-python).
9+
The geopins package provides geospatial support for the [Python pins package](https://github.com/rstudio/pins-python). The package publishes data, models, and other Python objects, making it easy to share them across projects and with your colleagues. With `geopins`, there is support for geospatial datatypes (e.g. `geopandas.GeoDatFrame`, and `rastr.Raster`) and filetypes (e.g. `GeoPackage`, and `GeoTIFF`), fully compatible with your existing pins boards.
10+
11+
The pins package provides drivers for standard Python tabular datatypes (e.g. `pandas.DataFrame`) and filetypes (e.g. CSV, Parquet, etc.). The geopins package brings the same experience to geospatial datatypes (e.g. `geopandas.GeoDatFrame`, and `rastr.Raster` and filetypes, fully compatible with your existing pins boards.
1212

1313
## Installation
1414

@@ -20,6 +20,36 @@ uv add geopins
2020
pip install geopins
2121
```
2222

23+
## Quick Start
24+
25+
```python
26+
from pins import board_local
27+
28+
# Patch pins to support geospatial data
29+
import geopins
30+
geopins.patch()
31+
32+
# Define any pins board as usual
33+
b = board_local()
34+
35+
# Save a GeoDataFrame
36+
import geopandas as gpd
37+
gdf = b.pin_write(
38+
gpd.GeoDataFrame({"x": [1, 2, 3]}, geometry=gpd.points_from_xy([1, 2, 3], [4, 5, 6])),
39+
"gdf_example",
40+
)
41+
42+
# Read it back
43+
gdf = b.pin_read("gdf_example")
44+
45+
# Save a raster
46+
from rastr.raster import Raster
47+
b.pin_write(Raster.example(), "raster_example")
48+
49+
# Read it back
50+
raster = b.pin_read("raster_example")
51+
```
52+
2353
## Contributing
2454

2555
See the

docs/logo.svg

Lines changed: 21 additions & 18 deletions
Loading

pyproject.toml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ classifiers = [
2929
]
3030
dynamic = [ "urls", "version" ]
3131
dependencies = [
32+
"geopandas>=1.1.1",
33+
"pins>=0.9.1",
34+
"pyarrow>=21.0.0",
35+
"rastr>=0.6.0",
3236
]
3337

3438
[dependency-groups]
@@ -56,6 +60,7 @@ dev = [
5660
test = [
5761
"coverage[toml]>=7.10.1",
5862
"detect-test-pollution>=1.2.0",
63+
"pandas>=2.3.3",
5964
"pytest>=8.4.1",
6065
"pytest-cov>=6.2.1",
6166
"pytest-emoji>=0.2.0",
@@ -170,16 +175,6 @@ lint.per-file-ignores."tests/**/*.py" = [
170175
]
171176
lint.allowed-confusables = [ "", "", "σ" ]
172177
lint.flake8-tidy-imports.banned-api."pytz".msg = "'zoneinfo' should be preferred to 'pytz' when using Python 3.9 and later, see https://tonkintaylor-sonarqube.azurewebsites.net/coding_rules?open=python%3AS6890&rule_key=python%3AS6890"
173-
lint.flake8-tidy-imports.banned-module-level-imports = [
174-
"branca",
175-
"folium",
176-
"geopandas",
177-
"matplotlib",
178-
"mpl_toolkits",
179-
"pandas",
180-
"scipy",
181-
"tqdm",
182-
]
183178

184179
lint.flake8-type-checking.quote-annotations = true
185180
lint.flake8-type-checking.runtime-evaluated-base-classes = [ "pydantic.BaseModel" ]
@@ -193,6 +188,8 @@ ignore-words-list = [ "..." ]
193188
[tool.deptry]
194189
extend_exclude = [ "src/notebooks", "src/scripts", "src/archive" ]
195190
experimental_namespace_package = true
191+
[tool.deptry.per_rule_ignores]
192+
DEP002 = [ "pyarrow" ]
196193

197194
[tool.pyproject-fmt]
198195
keep_full_version = true
@@ -249,7 +246,14 @@ root_packages = [ "geopins" ]
249246
[[tool.importlinter.contracts]]
250247
name = "geopins"
251248
type = "layers"
252-
layers = [ ]
249+
layers = [ "patch_", "boards", "drivers", "meta", "filetypes | interfaces" ]
253250
containers = [ "geopins" ]
254251
exhaustive = true
255252
exhaustive_ignores = [ "_version" ]
253+
254+
[[tool.importlinter.contracts]]
255+
name = "geopins.drivers"
256+
type = "layers"
257+
layers = [ "gdf | raster", "exceptions | infer" ]
258+
containers = [ "geopins.drivers" ]
259+
exhaustive = true

0 commit comments

Comments
 (0)