2025 Permit Ratification
What it does
Section titled “What it does”Geospatial + fiscal-compliance analysis in support of a G500 fuel-station permit ratification. Two threads of work live side by side in this project:
- SAT CFDI v4.0 modeling —
src/2025_permit_ratification/models/cfdv40.pyandcat_cfdi.pymodel Mexican SAT invoicing (Comprobante Fiscal Digital por Internet) catalogs/schemas usingxsdata-pydantic, generating typed Pydantic classes from the CFDI v4.0 XSD. - Geospatial influence-zone analysis — the
notebooks/(map.ipynb,mexico_contour.ipynb,tesselation.ipynb) parse a gas-stations XML dataset (vialxml), build Mexico’s national contour, and compute Voronoi tessellation areas of influence around G500 stations to estimate market/geographic coverage.
Pipeline / notebooks
Section titled “Pipeline / notebooks”| Notebook | Purpose |
|---|---|
map.ipynb |
Loads and visualizes Mexico GeoJSON boundaries |
mexico_contour.ipynb |
Builds the national contour polygon (geopandas + dask_geopandas) |
tesselation.ipynb |
Parses gas_stations.xml and computes Voronoi tessellation for influence zones |
Data & outputs
Section titled “Data & outputs”DVC-tracked under data/{raw,preprocessed,out}. Notable out/ artifacts (.dvc pointers): g500_gas_stations.parquet, g500_areas_coverage.geojson, g500_stations_with_areas.geojson, gas_stations_areas_of_influence.parquet, gas_stations_voronoi_tessellation.parquet, mexico_contour.parquet, plus rendered PNG maps. Raw assets (assets.dvc) total ~8GB / 55 files.
geopandas, dask-geopandas, dask-cudf-cu13 / cuda-python (GPU-accelerated geo processing), datashader, holoviews/geoviews/hvplot for large-scale rendering, shapely, lxml, xsdata-pydantic[cli,lxml] for CFDI modeling, plotly. Excluded from the root uv workspace (see pyproject.toml [tool.uv.workspace] exclude); has its own requirements.txt and uv.lock.
Status
Section titled “Status”Notebook-driven exploratory analysis with a fair amount of production-shaped output (parquet/geojson artifacts), but no dvc.yaml pipeline — stages are run manually from the notebooks rather than orchestrated.