Repository navigation
Releases
v0.2.1
Image stdio smoke now shares the host-local storage-seal key across cold containers (VGI_ATTACH_SECRET_KEY_FILE on the state volume); the 0.2.0 image publish failed with StoragePayloadError ... MAC check failed. No worker code change. Speaks VGI protocol 3.4 (needs Haybarn 2.0.1+).
v0.2.0
- Speaks VGI protocol 3.4: require vgi-python
>=0.55.2,<0.56; uv.lock re-locked. This release
needs Haybarn 2.0.1 (or stock DuckDB 2.0 withINSTALL vgi FROM query_farm): Haybarn 2.0.0
loads a 3.3vgiextension that cannot attach it. - SQL tests run on haybarn-unittest 2.0.1rc3 (CI and Makefile).
- New
serveextra (vgi-python[http,oauth]); the Docker image installs it, so the image runs in
Orchard hosted mode (VGI_ORCHARD_HOSTED=1with VGI_JWT_ISSUER, VGI_JWT_AUDIENCE,
VGI_JWT_JWKS_URI and VGI_SIGNING_KEY). The Docker HEALTHCHECK usesHEAD /health, which
stays anonymous in hosted mode.
v0.1.2
v0.1.1
v0.1.0
First release of vgi-pysal, a VGI worker that brings PySAL (the Python Spatial Analysis Library) to DuckDB / Haybarn 2.0. It lets you build spatial weights, measure spatial autocorrelation (Moran's I, Geary's C, Getis-Ord, LISA), classify choropleth maps, compute inequality indices and fit spatial regressions, all from SQL. Speaks VGI protocol 3.3 (vgi-python 0.51.1).
Functions
| Function | Kind | Purpose |
|---|---|---|
columbus, baltim, sids, us_states, mexico, georgia |
table | Built-in example datasets |
weights / weights_summary |
table | Neighbour graph as an edge list / connectivity diagnostics |
moran, geary, getis_ord_g |
table | Global spatial autocorrelation |
local_moran, getis_ord_g_local |
table | Local autocorrelation and hot spots, one row per observation |
quantiles, equal_interval, natural_breaks, fisher_jenks, std_mean, box_plot, head_tail_breaks |
table | Choropleth classification |
gini, theil |
aggregate | Inequality indices |
spreg |
table | Spatial regression coefficient table |
fit / predict |
table | Fit and store a model, then score rows with it |
list_models, model_info, drop_model |
table | Model registry |
Composed examples
These ship in the catalog metadata (vgi.example_queries and the driving functions' example lists). All of them run on built-in data:
- Spatial lag of crime: join the queen
weightsedge list tocolumbusand average each neighbourhood's neighbours' crime. - LISA cluster profile: join
local_moranback tocolumbusand compare crime, income and house value per cluster type. - Crime by income quintile: classify income with
quantiles, then aggregate crime for each class.
The release also includes agent test tasks that graders check against fixed, seeded built-in data.
Quick start
The worker isn't on PyPI. uvx runs it from this tag:
INSTALL vgi FROM community;
LOAD vgi;
ATTACH 'pysal' AS pysal (TYPE vgi, LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-pysal@v0.1.0 vgi-pysal');
SELECT statistic AS morans_i, p_value
FROM pysal.moran((SELECT crime AS y, geom FROM pysal.columbus()), w_type => 'queen');Or use the signed multi-arch image: LOCATION 'docker://ghcr.io/query-farm/vgi-pysal:0.1.0'.
Known limits
- Choice arguments (
w_type,kernel_function,model) are case-sensitive at bind time. Use'queen', not'Queen'. - Stored models go to local disk (
PYSAL_MODELS_DIR, default./models) as plain JSON. The examples forlist_models/model_infodepend on a model thatfithas stored first. - The geopandas/scipy stack is heavy, so the first
uvxATTACH takes a while to build the environment. - This is a source-only release with no binary assets. The container image is
ghcr.io/query-farm/vgi-pysal:0.1.0.