Skip to content

fix(cli): use correct default grid filename in find_sun#36

Open
steps-re wants to merge 1 commit into
bellingcat:mainfrom
steps-re:fix-find-sun-grid-cache-default
Open

fix(cli): use correct default grid filename in find_sun#36
steps-re wants to merge 1 commit into
bellingcat:mainfrom
steps-re:fix-find-sun-grid-cache-default

Conversation

@steps-re

@steps-re steps-re commented Jul 7, 2026

Copy link
Copy Markdown

What

The find_sun command defaults its --grid argument to timezene_grid.json (misspelled), while find and generate_timezone_grid both use timezone_grid.json.

Why it matters

Because timezene_grid.json never exists, quick_find always hits its FileNotFoundError fallback and regenerates the entire global timezone grid on every find_sun run. This silently defeats the CLI grid caching added in #21find benefits from the cached grid, but find_sun never does.

Changes

  • One-character fix to the find_sun default in cli.py so all three commands share the same grid filename.
  • Add tests/test_cli.py covering the grid defaults across find, find_sun, and generate_timezone_grid. The CLI previously had no direct tests; the new test fails on the old default and passes on the fix.

Verified locally: full test suite passes (7 passed) and black reports no changes.

The `find_sun` command defaulted its `grid` argument to
"timezene_grid.json" (misspelled), while `find` and
`generate_timezone_grid` use "timezone_grid.json". Because the
misspelled file is never found, `quick_find` falls back to
regenerating the entire timezone grid on every `find_sun` run,
silently defeating the grid caching added in bellingcat#21.

Also add tests for the CLI's grid defaults, which were previously
untested, to guard against this class of regression.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant