Migrate vista precinct script to open source dependencies#193
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the Vista precinct update/export tooling away from ArcPy/ODC-based workflows to an open-source, Conda-managed Python stack (GeoPandas + SQLAlchemy), with supporting docs and developer ergonomics.
Changes:
- Replaces legacy ArcPy precinct export/update scripts with a new
UpdatePrecinctID.pythat queries Oracle + PostGIS and performs a GeoPandas spatial join. - Adds a Conda environment definition, sidecar JSON config template, a “tracer bullet” connectivity script, and pytest coverage for key helpers/output formatting.
- Removes several ArcPy-based checker/update scripts and an exported CSV artifact; updates repo ignore rules and VS Code settings for the new workflow.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/vista_pallet.py | Adds a Forklift pallet definition for Vista data/services. |
| scripts/UpdatePrecinctIDByCounty.py | Removes legacy ArcPy + pyodbc county updater script. |
| scripts/UpdatePrecinctID.py | New open-source implementation for exporting precinct info via Oracle/PostGIS + GeoPandas join. |
| scripts/trace_update_precinct_id.py | Adds a connectivity/import “tracer bullet” script for the new environment. |
| scripts/test_update_precinct_id.py | Adds pytest coverage for parsing/config/output formatting helpers. |
| scripts/ResidenceXYChecker.py | Removes legacy ArcPy-based XY checker. |
| scripts/RESIDENCE_EXPORT.csv | Removes committed exported data artifact. |
| scripts/README.md | Documents Conda setup, config shape, tracer usage, and CLI for the new script. |
| scripts/PrecinctChecker.py | Removes legacy ArcPy precinct checker. |
| scripts/environment.yml | Adds a conda-forge environment spec for the geospatial stack. |
| scripts/DJScript.py | Removes legacy ArcPy/pyodbc script that updated precinct IDs and logged changes. |
| scripts/connections/update_precinct_id.config.example.json | Adds example JSON config template for DB URLs/table settings. |
| scripts/CheckPrecinctIDInResidences.py | Removes legacy ArcPy checker script. |
| scripts/CheckCountyIDInResidences.py | Removes legacy ArcPy checker script. |
| .vscode/settings.json | Adds pytest configuration + conda env manager setting; updates spellchecker words. |
| .vscode/launch.json | Adds a debug configuration for running UpdatePrecinctID.py with arguments. |
| .gitignore | Ignores scripts/connections/* (except the example) and expands ignore patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
acneville
left a comment
There was a problem hiding this comment.
I appreciate the effective documentation in the README. The try-catch around imports is also a good practice. New script additions and old script removals look good as the project is migrated. Approved.
234443a to
d4d230e
Compare
|
Visit the preview URL for this PR (updated for commit d9a17fd): |
|
Waiting on Max to test this within the vista environment. |
|
Max has tested this successfully from his end. |
This has not been fully tested on the vista servers yet so I don't want to merge this. But I did want a review.