EarthView: read key from GOOGLE_MAPS_API_KEY to avoid clash with Gemini's GOOGLE_API_KEY
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- computer-vision
Hướng nghiên cứu
Review Sources.py and EarthView.__init__, then run the TestEarthViewKey tests in tests/test_image_sources.py. The issue says the change is already implemented on fix/earthview-maps-key-env; rebase on main if needed, open a PR, and check the RVC3 text and notebooks for instructions that still recommend GOOGLE_API_KEY. Done means the PR is opened and those instructions are updated where necessary.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
EarthView reads its Google Maps key only from the GOOGLE_API_KEY environment variable (Sources.py, EarthView.__init__). That is also the first name Google's Gemini libraries (google-genai) check, so anyone with both a Maps key and a Gemini key can only satisfy one of them: whichever key is in GOOGLE_API_KEY, the other tool gets the wrong one.
Proposed fix
Read GOOGLE_MAPS_API_KEY first, falling back to GOOGLE_API_KEY so existing setups keep working:
self.key = os.getenv("GOOGLE_MAPS_API_KEY") or os.getenv("GOOGLE_API_KEY")
and update the docstring to explain the lookup order, recommend GOOGLE_MAPS_API_KEY, and advise restricting the key to the Maps Static API with a daily quota (an unrestricted Maps key that leaks can run up charges).
Status
Implemented and tested on branch fix/earthview-maps-key-env (commit 4e12d1b), not yet opened as a PR:
EarthView.__init__lookup changed as above, docstring updated- 4 new tests in
tests/test_image_sources.py(TestEarthViewKey): Maps key preferred,GOOGLE_API_KEYfallback, explicitkey=wins, no key givesNone; no network access needed tests/test_image_sources.pypasses (13 passed, 20 skipped for optional extras) in a clean venv
Possible follow-up
With no key at all, self.key is None and the failure only shows up later as an HTTP error from Google. A clear error at construction time (or on first grab) naming both environment variables would be friendlier.
To finish
Open a PR from the branch (rebase on main first if it has moved), and update the RVC3 text/notebooks if they tell readers to set GOOGLE_API_KEY.
- Ngôn ngữ chính
- Python
- Star
- 223
- Fork
- 30
- Merge trung bình
- 1 giờ 4 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của petercorke/machinevision-toolbox-python
-
tech-debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
petercorke/machinevision-toolbox-python#122 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
petercorke/machinevision-toolbox-python#119 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
petercorke/machinevision-toolbox-python#117 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Remaining bare `except:` / swallowed exceptions in tests/ and src/ (Codacy + hidden failures)Đang mởtech-debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
petercorke/machinevision-toolbox-python#115 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
petercorke/machinevision-toolbox-python#113 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của petercorke/machinevision-toolbox-python
Issue tương tự
-
area/install reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
FluidNumerics/fluid-walk-blocker#191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
TransformerLensOrg/TransformerLens#1868 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
climate-analytics-lab/jax-gcm#1057 ·
Maintainer thường phản hồi trong vòng 1 ngày