jhanley634 / dojo-blackboard

An HTMX webserver for the Dojo's Tuesday night python meetups.
MIT License
3 stars 1 forks source link

9 san mateo map #10

Closed jhanley634 closed 2 months ago

jhanley634 commented 2 months ago

Summary by Sourcery

Enhance the vehicle data querying and plotting functionality by supporting multiple transit agencies and improving map visualization. Refactor map plotting functions to return Basemap objects for more flexible usage. Add unit tests for helper functions and switch to the 'Agg' backend for matplotlib.

New Features:

Enhancements:

Tests:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request implements changes to improve the visualization of transit vehicles and the International Space Station (ISS) on maps. The main changes include adding support for multiple transit agencies, updating the map display for the Bay Area, and refactoring the ISS map generation.

File-Level Changes

Change Details Files
Added support for multiple transit agencies in vehicle plotting
  • Introduced a new function 'query_agency_vehicles' to plot vehicles for specific agencies
  • Modified 'query_vehicles' to iterate through multiple agencies (SC, SF, SM, CT)
  • Added color differentiation for different agencies (lime for CT, blue for others)
src/bboard/transit/vehicles.py
Updated Bay Area map visualization
  • Modified map boundaries and resolution for better detail
  • Changed map scale location
  • Added a marker for a specific location (dojo)
src/bboard/transit/vehicles.py
Refactored ISS map generation
  • Renamed '_get_base_map' to '_get_world_map'
  • Removed caching for map generation
  • Updated map clearing method from 'plt.gca().figure.clear()' to 'plt.clf()'
src/bboard/transit/iss.py
Added backend configuration for matplotlib
  • Set matplotlib backend to 'Agg' in both vehicles.py and iss.py
src/bboard/transit/vehicles.py
src/bboard/transit/iss.py
Enhanced test coverage
  • Added new test cases for formatting helpers in vehicles.py
  • Included tests for 'fmt_lat_lng' and '_fmt_msg' functions
tests/vehicles_test.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.