Skip to content

Get last_updated supplement table without error#190

Merged
javierggt merged 7 commits intomasterfrom
last_updated
Sep 23, 2025
Merged

Get last_updated supplement table without error#190
javierggt merged 7 commits intomasterfrom
last_updated

Conversation

@javierggt
Copy link
Contributor

@javierggt javierggt commented Aug 28, 2024

Description

This PR fixes an exception that happens when one does agasc.get_supplement_table("last_updated") without specifying as_dict=True. Specifying as_dict=True is not intuitive and not expected, and anyway last_updated and agasc_versions are always better as dicts.

Interface impacts

Testing

Unit tests

Added a unit test for this and checked that it fails on master as expected.

  • No unit tests
  • Mac
  • Linux
  • Windows
# note that this is run on the commit before the ruff commit, which just adds whitespace
(ska3-flight) ~/SAO/git/agasc last_updated $ git rev-parse HEAD                                                     
fc21dc784584a757adbcd5e6e44ab678eba35dc8
(ska3-flight) ~/SAO/git/agasc last_updated $ pytest agasc
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/javierg/SAO/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 79 items                                                                                                                                           

agasc/tests/test_agasc_1.py .......                                                                                                                    [  8%]
agasc/tests/test_agasc_2.py ..........sssss..........ss....................                                                                            [ 68%]
agasc/tests/test_agasc_healpix.py .ssssssssss                                                                                                          [ 82%]
agasc/tests/test_obs_status.py ..............                                                                                                          [100%]

=============================================================== 62 passed, 17 skipped in 5.71s ===============================================================

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

You can quickly check this by running the following code. It should fail on master and succeed the branch:

import agasc
agasc.get_supplement_table("last_updated")

and

import agasc
agasc.get_supplement_table("agasc_versions")

@javierggt javierggt requested a review from taldcroft August 28, 2024 17:32
Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please always document your testing with the git rev-parse HEAD output and a copy/paste of the pytest results along with any custom setup. It's a slight hassle but otherwise there is no record of which version was tested.


def test_last_updated():
last_updated = agasc.get_supplement_table("last_updated")
assert CxoTime(last_updated["supplement"]).date.startswith("20")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that there is no other testing of these supplement tables. So while you are at it, it would be worth testing:

  • last_updated has the correct four keys
  • Each corresponding value is a string that is a valid ISO format date CxoTime(last_updated[key], format="iso").
  • agasc_versions has the same four keys.

The name of the test function does not quite match what it does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I addressed this comment in my last commit.

@taldcroft
Copy link
Member

@javierggt - is this PR overtaken by #203 or events?

@javierggt
Copy link
Contributor Author

@javierggt - is this PR overtaken by #203 or events?

No. It's still valid. I added some text to the functional test description so you can check.

My guess is that this PR stalled after you asked for further changes. I made those changes now, so this should be good.

@javierggt javierggt requested a review from taldcroft September 23, 2025 15:33
Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@javierggt javierggt merged commit ced0393 into master Sep 23, 2025
2 checks passed
@javierggt javierggt deleted the last_updated branch September 23, 2025 19:58
This was referenced Oct 29, 2025
@javierggt javierggt mentioned this pull request Nov 18, 2025
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