Settings > Sources > Unmapped shows the place texts no place resolves, with their roles' countries and companies, and the host words no table maps, and copies both as text. Prep fingerprints places.seed(), so a town or spelling added to the code is seeded and every open role is mapped again at the next prep. app prep unlinked lists the places on the command line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 lines
3.7 KiB
Markdown
49 lines
3.7 KiB
Markdown
---
|
||
name: unmapped
|
||
description: Fix what prep could not place, from the owner's words ("Überlingen is a German town", "Home Based - Americas is remote", "DEU is Germany") or from the list copied off Settings › Sources › Unmapped. Use when the owner names an unlinked place text or an unmapped host word, pastes that list, or asks what is still unmapped.
|
||
---
|
||
|
||
# Unmapped places and host words
|
||
|
||
Prep never guesses. A place text the gazetteer does not know stays unlinked, and a host word no table maps stays empty. Both are listed on Settings › Sources › Unmapped and by the CLI:
|
||
|
||
```bash
|
||
uv run app prep unlinked
|
||
uv run app prep unmapped
|
||
```
|
||
|
||
`unlinked` prints roles, text, the countries prep gave those roles (`-` for none) and the companies that write it. Only open roles count. A text made only of no-place words (`places._PLACELESS`) is never listed.
|
||
|
||
Every fix is a line of code, not a database write, so a new database and the server get it too. Prep fingerprints the host tables and `places.seed()`. After an edit the next prep adds the new places and spellings to the database and maps every open role again, with no pull.
|
||
|
||
## Where each fix goes
|
||
|
||
| The owner says | Edit |
|
||
|---|---|
|
||
| A town is in a country ("Überlingen is German") | `_CITIES` in `app/models.py`: add the fold (`places.fold`, e.g. `uberlingen`) to that country's `dict.fromkeys(...)` tuple. |
|
||
| A town has another spelling ("Kbh is Copenhagen") | `_ALIAS_GROUPS` in `app/places.py`: add the spelling to the town's group. A new group lists the shown name first, and one of its folds also needs a `_CITIES` entry for its country. |
|
||
| A country is written another way ("DEU is Germany") | `_COUNTRY_NAMES` in `app/models.py`: append ` \| DEU` to the country's line. |
|
||
| A text names no place ("Fleet Place Office", "Solaris SE" is the company) | `_PLACELESS` in `app/places.py`, with only the words that never name a place. |
|
||
| A macro region outside Europe ("Americas", "APAC", "AMER") | Ask whether it should be a place. The default is to add the words to `_PLACELESS`, since the gazetteer has Europe as its only continent. |
|
||
| A text means remote or hybrid | `_REMOTE_WORDS` in `app/models.py` already reads "home based" and "remote". Add a phrase only when `remote_of` misses it. |
|
||
| A host word for level, contract or remote | That host's table in `app/prep/hosts/<host>.py` (`SENIORITY`, `EMPLOYMENT`, `REMOTE`), keyed by the lowercased word. A host with no module gets a new file. `""` means known but says nothing, which removes it from the list. |
|
||
| A country word from a host | `_COUNTRY_NAMES`, as above. |
|
||
| Two company names are one company | `Store.add_alias(key, name)`. This is data, not code, since companies are added by hand. |
|
||
|
||
Check a fold with `uv run python -c "from app import places; print(places.fold('Überlingen'))"`. A city whose country is unclear is a question for the owner, never a guess. When the owner gives a pattern ("all 1KOMMA5° towns are German"), go through the whole list for it and add each town.
|
||
|
||
## Steps
|
||
|
||
1. Read the list with the two commands above, or take the owner's words.
|
||
2. Make the edits. Keep each dictionary's order and wrapping.
|
||
3. Run the tests that hold the dictionaries:
|
||
```bash
|
||
uv run pytest -q tests/test_places.py tests/test_gazetteer.py tests/test_prep.py
|
||
```
|
||
For a host table, also run `tests/test_prep_hosts_<host>.py`.
|
||
4. Apply it now instead of waiting for the next pull. Then run `unlinked` or `unmapped` again and show the owner what left the list:
|
||
```bash
|
||
uv run app prep
|
||
```
|
||
5. Commit on main. When another hunk in the same file is uncommitted and not yours, commit only your hunk. Write it with `git diff` into a patch, cut the patch to your hunk, and apply it with `git apply --cached`.
|