Chart: orientation indicator + flag NCP-up fallback when GPS isn't ready (#419)#444
Merged
Merged
Conversation
…dy (#419) The chart silently fell back to NCP up when the user picked Horizontal or EQ (Auto) but no GPS lock was available yet, then flipped to the "real" orientation once GPS arrived. With "horiz" as the shipped default (default_config.json:19), this is the normal first-run experience and was confusing. Changes: - python/PiFinder/ui/chart.py: - New ChartOrientation dataclass (rot_deg, up_label, is_fallback). - get_chart_rotation_angle now returns it. Resolution is unchanged for eq_north_up / eq_south_up, and for the GPS-locked branches of horiz / eq_auto. The lockless horiz and eq_auto branches now use location.lock (matching the canonical altaz_ready() test in state.py) and set is_fallback=True so the UI can flag the NCP-up default as transient. - UIChart.update draws a small bottom-right label after the chart paste: "Zenith up" / "NCP up" / "SCP up", prefixed with "!" and rendered at higher brightness when is_fallback=True. - python/PiFinder/ui/align.py: caller updated to unpack rot_deg from the new return type. - python/tests/test_chart.py: new file, 11 unit tests covering each coord-sys × GPS-present/absent case plus the None RA/Dec path. - .claude/skills/pifinder-remote/SKILL.md: document the two one-time worktree-setup steps the headless launcher needs but git worktrees don't inherit (Hipparcos catalog copy + tetra3 submodule contents copy), plus the venv activation requirement so the launcher's find_python picks up the main checkout's interpreter via sys.executable. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #419.
Summary
"horiz"is the shipped default (default_config.json:19), this is the normal first-run experience and was confusing.Zenith up,NCP up, orSCP up— so the user can always see the current orientation.!and rendered at higher brightness, flagging that the chart will reorient once GPS comes online.Changes
python/PiFinder/ui/chart.pyChartOrientationdataclass (rot_deg,up_label,is_fallback).get_chart_rotation_anglenow returns it. Resolution is unchanged foreq_north_up/eq_south_upand for the GPS-locked branches ofhoriz/eq_auto. The locklesshorizandeq_autobranches now uselocation.lock(matching the canonicalaltaz_ready()test instate.py) and setis_fallback=Trueso the UI can flag the NCP-up default as transient.UIChart.updatedraws the label after the chart paste.python/PiFinder/ui/align.py— caller updated to unpackrot_degfrom the new return type. No behavior change for the align screen itself.python/tests/test_chart.py— new file, 11 unit tests covering each coord-sys × GPS-present/absent case plus the None RA/Dec path..claude/skills/pifinder-remote/SKILL.md— documents the two one-time worktree-setup steps the headless launcher needs but git worktrees don't inherit (copy the Hipparcos catalog and thetetra3submodule contents in from the main checkout), plus the venv-activation requirement so the launcher'sfind_pythonpicks up the main checkout's interpreter viasys.executable.Test plan
pytest -m unit tests/test_chart.py— 11 new tests pass.pytest -m unitoverall — 159 tests pass (148 pre-existing + 11 new).ruff checkclean onchart.py,align.py,test_chart.py.Zenith uprendered at bottom-right alongside the optional RA/Dec line at bottom-left. (Headless--camera debugprovides a fake GPS lock, so the rendered case is the non-fallback path; the!NCP upfallback rendering goes through the same code with different text + brightness — both unit-tested.)chart_coord_sys = "horiz"), open Chart, confirm!NCP upshows immediately, thenZenith upafter GPS lock.🤖 Generated with Claude Code