Skip to content

replace 'or' shorthand with explicit 'is None' guards on numeric fields#106

Merged
wtgee merged 1 commit intomainfrom
refactor/fix-or-on-numeric-fields
May 6, 2026
Merged

replace 'or' shorthand with explicit 'is None' guards on numeric fields#106
wtgee merged 1 commit intomainfrom
refactor/fix-or-on-numeric-fields

Conversation

@wtgee
Copy link
Copy Markdown
Member

@wtgee wtgee commented May 6, 2026

In get_telescope_status and get_guide_objects, the pattern:

x = x or db_x

silently overwrites a caller-supplied 0.0 with the DB value because 0.0 is falsy. This affects inr, adc, m2_pos3, ra, dec, and inst_pa. Replace all six occurrences with explicit is None checks:

  if x is None:
      x = db_x

… fields

In get_telescope_status and get_guide_objects, the pattern:
  x = x or db_x
silently overwrites a caller-supplied 0.0 with the DB value because
0.0 is falsy. This affects inr, adc, m2_pos3, ra, dec, and inst_pa.
Replace all six occurrences with explicit is None checks:
  if x is None:
      x = db_x
Closes REFACTORING.md Issue 7 / AGENTS.md G4.
@wtgee wtgee changed the title fix: replace 'or' shorthand with explicit 'is None' guards on numeric… replace 'or' shorthand with explicit 'is None' guards on numeric fields May 6, 2026
@wtgee wtgee merged commit 0629a41 into main May 6, 2026
2 checks 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.

1 participant