Skip to content

46/cli no weather api - #95

Merged
Kamal-uva merged 2 commits into
mainfrom
46/cli-no-weather-api
Oct 22, 2026
Merged

Kamal-uva merged 2 commits into
mainfrom
46/cli-no-weather-api

Conversation

@pranavvadd

Copy link
Copy Markdown
Contributor

Summary

Adds a --no-api-weather CLI flag so the simulator can run offline with synthetic
weather. The flag is passed into all three run modes: the normal single run, --plan,
and --speed-sweep. Without the flag, behavior is unchanged: the Open-Meteo API is
tried first, with the existing fallback to synthetic data if it fails.

The offline commands are documented in README.md.

Changes

  • sim/main.py: new --no-api-weather argument. The four hardcoded
    use_api_weather=True calls now use not args.no_api_weather.
  • README.md: offline usage examples, plus a note in the Weather section.
  • tests/test_cli_offline.py: 11 new pytest tests.

Testing

Run python3 -m pytest tests/test_cli_offline.py. The tests cover:

  • argument parsing (default off, flag on, combined with --plan)
  • the flag reaching the single run, --plan and --speed-sweep, with and without the flag
  • a real one-speed sweep: offline mode never calls the weather API, and default mode
    tries the API and falls back to synthetic weather when the network fails

I also ran each command by hand: --no-api-weather for the single run, --plan and
--speed-sweep. With the network blocked, --plan --no-api-weather made no API calls.

Related Issue

Closes #46

Notes

  • This unblocks Add Deterministic Synthetic Weather For Tests #43 (deterministic synthetic weather for tests).
  • tests/test_config.py::test_invalid_track_config was already failing on main.
    The separate PR for the fix/test-invalid-track-config branch fixes it, so
    this branch can still show that one failure until that PR is merged.

pranavvadd and others added 2 commits October 17, 2026 23:53
Passes use_api_weather=not args.no_api_weather into single runs,
--plan, and --speed-sweep. Default behavior (try API first) unchanged.
Documents the offline commands in the README.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Kamal-uva

Copy link
Copy Markdown
Contributor

W gander, I'll approve ur other one too

@Kamal-uva
Kamal-uva merged commit 525ede0 into main Oct 22, 2026
1 check passed
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.

Add CLI Option To Run Simulator Without Weather API

2 participants