Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Sep 21, 2025

The solar module can accept datetime with a timezone offset with a syntax like -Td+d2010-01-01T00:00:00+z08:00, but currently Figure.solar doesn't support it.

This PR adds the support for timezone.

Internally, GMT's solar module uses the C atoi function to parse the timezone after +z, so "08:00" -> 8, "-05:00"->-5, and fractional offsets are cast to integers, e.g. "08:30"->8, "-05:30"->-5.

Preview: https://pygmt-dev--4112.org.readthedocs.build/en/4112/api/generated/pygmt.Figure.solar.html

Address #4110.

@seisman seisman added this to the 0.17.0 milestone Sep 21, 2025
@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Sep 21, 2025
@GenericMappingTools GenericMappingTools deleted a comment from github-actions bot Sep 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2025

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added pygmt/tests/baseline/test_solar_terminator_datetime_timezone.png

Image diff(s)

Added images

  • test_solar_terminator_datetime_timezone.png

Modified images

Path Old New

Report last updated at commit 813c952

@seisman seisman changed the title Figure.solar: Support datetime with timezone Figure.solar: Support terminator datetime with timezone Sep 22, 2025
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Sep 24, 2025
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Sep 25, 2025
@seisman seisman merged commit 8542760 into main Sep 25, 2025
22 of 28 checks passed
@seisman seisman deleted the solar/timezone branch September 25, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants