|
| 1 | +# GeoCompare Handoff |
| 2 | + |
| 3 | +## Snapshot |
| 4 | +- Project: `geocompare` |
| 5 | +- Handoff date: 2026-03-08 |
| 6 | +- Branch: `master` |
| 7 | +- Version: `0.6.2` |
| 8 | +- Last completed commit at handoff prep: `9d11bd7` (`Bump version to 0.6.2`) |
| 9 | + |
| 10 | +## Purpose |
| 11 | +GeoCompare builds and queries local demographic/geographic data products (Gazetteer + ACS-derived inputs) and supports ranking, distance, nearest geographies, and profile exports. |
| 12 | + |
| 13 | +## Environment |
| 14 | +- Python: 3.9+ |
| 15 | +- Package/deps: managed via `pyproject.toml` |
| 16 | +- Common setup: |
| 17 | + - `python3 -m pip install -e ".[dev]"` |
| 18 | + |
| 19 | +## Canonical CLI (Current) |
| 20 | +Use canonical commands and flags only. |
| 21 | + |
| 22 | +- Build data products: |
| 23 | + - `python3 -m geocompare.interfaces.cli build <data_path>` |
| 24 | +- Search: |
| 25 | + - `python3 -m geocompare.interfaces.cli query search "san francisco"` |
| 26 | +- Profile: |
| 27 | + - `python3 -m geocompare.interfaces.cli query profile "San Francisco city, California"` |
| 28 | +- Top/bottom with modern filter and scope: |
| 29 | + - `python3 -m geocompare.interfaces.cli query top median_year_structure_built --where 'population>=100000' --universe places --in-state ca` |
| 30 | + - `python3 -m geocompare.interfaces.cli query bottom median_household_income --where 'population>=50000' --scope places+ca` |
| 31 | +- Nearest: |
| 32 | + - `python3 -m geocompare.interfaces.cli query nearest "San Francisco city, California" --where 'population>=100000' --universe places --in-state ca -n 10` |
| 33 | +- Resolve: |
| 34 | + - `python3 -m geocompare.interfaces.cli resolve "San Francisco, CA" --state ca -n 5` |
| 35 | +- Export rows: |
| 36 | + - `python3 -m geocompare.interfaces.cli export rows ":population :income" --where 'population>=100000' --universe places --in-state ca` |
| 37 | + |
| 38 | +## Important Interface Decisions |
| 39 | +- Legacy CLI aliases were purged. |
| 40 | + - Removed command aliases like `hv`, `lv`, `cg`, `dist`, `dp`, etc. |
| 41 | + - Removed legacy flag names `--geofilter` and `--context`. |
| 42 | +- Canonical query flags are: |
| 43 | + - Filter: `--where` (short: `-w`) |
| 44 | + - Scope string: `--scope` (short: `-s`) |
| 45 | + - Explicit scope composition: `--universe`, plus one of `--in-state|--in-county|--in-zcta` |
| 46 | +- Legacy tool shims were removed. |
| 47 | + - Deleted: `CountyTools.py`, `StateTools.py`, `KeyTools.py`, `SummaryLevelTools.py` |
| 48 | + - Canonical modules: `county_lookup.py`, `state_lookup.py`, `county_key_index.py`, `summary_level_parser.py` |
| 49 | + |
| 50 | +## Shell Caveat |
| 51 | +- In `zsh`, quote or escape filter expressions that contain `>` or `<`. |
| 52 | + - Good: `--where 'population>=100000'` |
| 53 | + - Good: `--where population\>=100000` |
| 54 | + |
| 55 | +## Data Expectations |
| 56 | +- Build command expects source files under the provided `<data_path>`. |
| 57 | +- The project has support for recent ACS table-based inputs and latest Gazetteer-era ingestion logic integrated in prior updates. |
| 58 | +- If refreshing download logic, verify source year discovery against the files present in `<data_path>`. |
| 59 | + |
| 60 | +## Validation / Definition of Done |
| 61 | +Before ACP: |
| 62 | +1. `ruff check geocompare/interfaces/cli.py geocompare/engine.py geocompare/tools tests` |
| 63 | +2. `python3 -m pytest -q` |
| 64 | +3. Run at least one smoke query: |
| 65 | + - `python3 -m geocompare.interfaces.cli --version` |
| 66 | + - `python3 -m geocompare.interfaces.cli query search "san francisco" -n 3` |
| 67 | + - `python3 -m geocompare.interfaces.cli query top median_year_structure_built --where 'population>=100000' --universe places --in-state ca -n 5` |
| 68 | + |
| 69 | +## ACP Workflow |
| 70 | +- Stage only intended files. |
| 71 | +- Commit message should describe functional change precisely. |
| 72 | +- Push to `origin/master` unless directed otherwise. |
| 73 | + |
| 74 | +## Immediate Backlog Suggestions |
| 75 | +1. Add CLI integration tests that invoke argument parsing paths for `--where`, `--scope`, and explicit scope flags. |
| 76 | +2. Document canonical CLI examples in `README.md` and remove any remaining historical examples. |
| 77 | +3. Optionally add `--where` parser help examples for compound (`:c`/`:cc`) usage. |
0 commit comments