Skip to content

Commit de276a0

Browse files
committed
Document custom overlays and overlay naming conventions
1 parent a966d35 commit de276a0

File tree

1 file changed

+52
-6
lines changed

1 file changed

+52
-6
lines changed

README.md

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GeoCompare
22

3-
GeoCompare is a program that allows users to easily view and organized and
4-
processed demographic data without the need to modify any data files.
3+
GeoCompare is a CLI for building and querying standardized local demographic
4+
data products from public datasets, without manual data-file editing.
55

66
See the [Wiki](https://github.com/iandorsey00/geocompare/wiki) for documentation.
77
Architecture details: [doc/architecture.md](doc/architecture.md).
@@ -49,6 +49,11 @@ python3 scripts/fetch_latest_acs.py --out-dir /path/to/data --archive-existing -
4949
and latest compatible gazetteer year (`<YEAR>_Gaz_*_national.txt`) in the input
5050
directory.
5151

52+
GeoCompare supports two overlay types:
53+
54+
- Built-in overlays: canonical crime and voter files.
55+
- Custom overlays: private/user-defined metrics (including submodule-fed data).
56+
5257
Optional overlays can be placed in the same data directory:
5358

5459
- `overlays/crime_data.csv`
@@ -65,8 +70,49 @@ python3 scripts/fetch_overlays.py \
6570
--voter-source /path/or/url/to/voter.csv
6671
```
6772

68-
Crime metrics appear under `CRIME`, voter metrics under `CIVICS`, and other
69-
private/custom metrics in `project_data.csv` appear under `PROJECT DATA`.
73+
Crime metrics appear under `CRIME`, voter metrics under `VOTER REGISTRATION`,
74+
and custom metrics in `project_data.csv` appear under `PROJECT DATA`.
75+
76+
### Custom Overlay Conventions
77+
78+
For custom overlays (for example, private submodule outputs):
79+
80+
- Keep one canonical CSV with `GEOID` and numeric metric columns.
81+
- Prefer `project_` prefixes for private/custom identifiers.
82+
- Use `_pct` suffix for percentages.
83+
84+
Example `project_data.csv`:
85+
86+
```csv
87+
GEOID,project_social_alignment_index,project_social_alignment_confidence_pct
88+
06037,63.2,91.5
89+
06073,58.8,88.1
90+
```
91+
92+
Recommended metadata file (`overlay_manifest.json`) in your overlay repo:
93+
94+
```json
95+
{
96+
"overlay": "social-alignment",
97+
"metrics": [
98+
{
99+
"key": "project_social_alignment_index",
100+
"label": "Social alignment index",
101+
"section": "PROJECT DATA",
102+
"type": "score"
103+
},
104+
{
105+
"key": "project_social_alignment_confidence_pct",
106+
"label": "Social alignment confidence",
107+
"section": "PROJECT DATA",
108+
"type": "pct"
109+
}
110+
]
111+
}
112+
```
113+
114+
`overlay_manifest.json` is optional today, but recommended for stable naming,
115+
labels, and section placement across overlay builds.
70116

71117
Query workflows:
72118

@@ -100,8 +146,8 @@ Run local quality checks:
100146

101147
```bash
102148
python3 -m pip install -e ".[dev]"
103-
ruff check tests geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py scripts/benchmark_queries.py
104-
black --check tests geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py scripts/benchmark_queries.py
149+
ruff check tests geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py scripts/fetch_overlays.py
150+
black --check tests geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py scripts/fetch_overlays.py
105151
mypy geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py
106152
pytest -q
107153
```

0 commit comments

Comments
 (0)