Skip to content

BUG: Restore UTC fallback without timezonefinder - #1143

Merged
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/bug-environment-analysis-utc-fallback
Aug 13, 2026
Merged

BUG: Restore UTC fallback without timezonefinder#1143
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/bug-environment-analysis-utc-fallback

Conversation

@ting-hong-shieh

Copy link
Copy Markdown

Pull request type

  • Code changes (bugfix)
  • Code maintenance (tests)

Checklist

  • A regression test covers the missing optional dependency
  • Docs were reviewed; no update is needed because the intended UTC fallback is unchanged
  • Ruff formatting and lint checks pass
  • Pylint reports 10.00/10 for the changed files
  • CHANGELOG.md — no action needed; an LLM workflow auto-updates it after merge

Current behavior

When EnvironmentAnalysis receives no explicit timezone, it uses the optional
timezonefinder dependency to select one from the launch coordinates. If that
dependency is unavailable, the fallback handler calls warnings.warning, which
does not exist. Construction stops with AttributeError before UTC can be
selected.

New behavior

The fallback now calls warnings.warn, emits the existing message, selects UTC,
and localizes naive input dates. The regression test exercises the public
constructor while forcing the optional import to fail.

Breaking change

  • No

Verification

  • pytest tests/unit/environment/test_environment_analysis.py::test_missing_timezonefinder_defaults_to_utc -q — 1 passed
  • pytest tests/unit/environment -m "not slow" -q — 159 passed, 6 deselected
  • ruff check rocketpy/environment/environment_analysis.py tests/unit/environment/test_environment_analysis.py
  • ruff format --check rocketpy/environment/environment_analysis.py tests/unit/environment/test_environment_analysis.py
  • pylint rocketpy/environment/environment_analysis.py tests/unit/environment/test_environment_analysis.py — 10.00/10

@ting-hong-shieh
ting-hong-shieh marked this pull request as ready for review August 13, 2026 05:03
@ting-hong-shieh
ting-hong-shieh requested a review from a team as a code owner August 13, 2026 05:03
@Gui-FernandesBR

Copy link
Copy Markdown
Member

If it passes on CI, we can merge it!

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.16%. Comparing base (e0ff281) to head (78f55a5).
⚠️ Report is 49 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1143      +/-   ##
===========================================
+ Coverage    82.18%   83.16%   +0.97%     
===========================================
  Files          122      129       +7     
  Lines        16355    16901     +546     
===========================================
+ Hits         13441    14055     +614     
+ Misses        2914     2846      -68     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gui-FernandesBR
Gui-FernandesBR merged commit 364214b into RocketPy-Team:develop Aug 13, 2026
19 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.

2 participants