Skip to content

Ensure the GUI's open dialog box always shows a human readable date, even when using MJD values from a FITS header#586

Merged
ortk95 merged 1 commit into
devfrom
585-show-nice-date-in-gui-open
Jul 22, 2026
Merged

Ensure the GUI's open dialog box always shows a human readable date, even when using MJD values from a FITS header#586
ortk95 merged 1 commit into
devfrom
585-show-nice-date-in-gui-open

Conversation

@ortk95

@ortk95 ortk95 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

When opening a FITS file with the GUI's open dialog, the target, date and observer fields are auto-populated (if possible) using information from the FITS header. Previously, this meant that if the header contained dates in MJD format, the date field would show the date as a numeric value. This worked completely fine, but made it difficult to double check or understand the auto-populated value.

Therefore, this update will automatically convert auto-populated MJD values (e.g. 61043.93858073495 to a human readable date (e.g. 2026-01-03T22:31:33.375500), making it much easier for the user to understand what the value means.

This has no functional effect, but just makes things easier to use.


This is implemented by re-using the same code that is used to convert a MJD to a SPICE-compatible date. The date standardisation code has been extracted from BodyBase.__init__ and now lives in the classmethod BodyBase._standardise_utc_to_string, where it can easily be re-used by other parts of the code as necesary. Extra unit tests have been added to ensure this conversion works as expected across different inputs, and provides a stable output.

Closes #585


Pull request checklist

  • Add a clear description of the change
  • Add any new tests needed
  • Run spell check on new text visible to user (documentation, GUI etc.)
  • Check any changes to requirements.txt are reflected in setup.py and conda-forge feedstock
  • Check code passes CI checks (run run_ci.sh or check GitHub Actions)

See CONTRIBUTING.md for more details.

When auto-populating the date field in the GUI's Open dialog, auto convert any MJD (float) values to a human readable %Y-%m-%dT%H:%M:%S.%f format.

As part of this, extract utc standardisation code from `BodyBase.__init__` to a new `BodyBase._standardise_utc_to_string` classmethod for ease of use elsewhere.

#585
@ortk95 ortk95 added polish Minor changes to improve quality gui Related to the graphical user interface labels Jul 22, 2026
@ortk95
ortk95 marked this pull request as ready for review July 22, 2026 12:44
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29920886187

Coverage remained the same at 99.61%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 13 of 13 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3470
Covered Lines: 3458
Line Coverage: 99.65%
Relevant Branches: 890
Covered Branches: 885
Branch Coverage: 99.44%
Branches in Coverage %: Yes
Coverage Strength: 14.88 hits per line

💛 - Coveralls

@ortk95
ortk95 merged commit e1ab3f5 into dev Jul 22, 2026
52 checks passed
@ortk95
ortk95 deleted the 585-show-nice-date-in-gui-open branch July 22, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gui Related to the graphical user interface polish Minor changes to improve quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants