Skip to content

Move cloud functions into Observations, fix for docs and test#3113

Merged
bsipocz merged 5 commits into
astropy:mainfrom
snbianco:ASB-28975-update-docs
Oct 17, 2024
Merged

Move cloud functions into Observations, fix for docs and test#3113
bsipocz merged 5 commits into
astropy:mainfrom
snbianco:ASB-28975-update-docs

Conversation

@snbianco

@snbianco snbianco commented Oct 2, 2024

Copy link
Copy Markdown
Contributor

Closes #3097

After talking with others at MAST, it looks like enable_cloud_dataset and disable_cloud_dataset are only applicable for Observations and no other classes (as of now). To minimize complexity, I decided to move the functions into Observations so as to not make them available to other classes that inherit from MastQueryWithLogin. This fixes the documentation issue as well.

There was also a problem with one of our tests that I fixed, so the test suite is passing now.

@codecov

codecov Bot commented Oct 2, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 67.49%. Comparing base (58f8692) to head (4e422d8).
Report is 110 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/mast/core.py 60.00% 2 Missing ⚠️
astroquery/mast/observations.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3113   +/-   ##
=======================================
  Coverage   67.49%   67.49%           
=======================================
  Files         233      233           
  Lines       18413    18420    +7     
=======================================
+ Hits        12428    12433    +5     
- Misses       5985     5987    +2     

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

@snbianco snbianco marked this pull request as ready for review October 2, 2024 15:10
@snbianco snbianco requested a review from bsipocz October 2, 2024 15:10
@snbianco

snbianco commented Oct 2, 2024

Copy link
Copy Markdown
Contributor Author

Do the code coverage checks only use the tests in test_mast.py? Is that why they're failing?

Comment thread astroquery/mast/core.py
self._auth_obj.logout()
self._authenticated = False

def enable_cloud_dataset(self, provider="AWS", profile=None, verbose=True):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would say these should be deprecated rather than starting to break user code without notice; while these have no effect, the code do run with non-cloud returns, right?

The deprecations would work nicely if you keep overriding the methods in the classes that these work and not get the deprecation.

What do you think @pllim?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I think these should be deprecated first. It sounds like people might be using these in the wild whether intentionally or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This makes sense! The latest version deprecates the functions in the base class.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Hmm you could also use @deprecated decorator from astropy.utils but I'll leave that to astroquery maintainers to decide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What's your preference @bsipocz? It looks like there are instances of both methods in the repo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we mostly use the decorator for methods/arguments/etc., most of the direct raise of the warnings are for cases when a parameter value or a full module is affected.

@snbianco snbianco Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made that change! I followed the convention of the other deprecated functions and left the original docstrings in, but let me know if something else would be preferable.

@bsipocz bsipocz added the mast label Oct 2, 2024
@bsipocz

bsipocz commented Oct 2, 2024

Copy link
Copy Markdown
Member

(minor note: could you also mast label these PRs at opening? Also, can add the next milestone, there should be only one open, for any of the PRs.
That would help with triaging.)

@bsipocz bsipocz added this to the v0.4.8 milestone Oct 2, 2024
@pep8speaks

pep8speaks commented Oct 3, 2024

Copy link
Copy Markdown

Hello @snbianco! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-10-17 21:44:46 UTC

@snbianco

snbianco commented Oct 3, 2024

Copy link
Copy Markdown
Contributor Author

(minor note: could you also mast label these PRs at opening? Also, can add the next milestone, there should be only one open, for any of the PRs. That would help with triaging.)

For sure, I'll remember this for future PRs!

@snbianco snbianco force-pushed the ASB-28975-update-docs branch 2 times, most recently from 0a2f14c to 6e49df3 Compare October 3, 2024 13:44
Comment thread CHANGES.rst Outdated
@snbianco snbianco force-pushed the ASB-28975-update-docs branch from 51447d9 to ea176a0 Compare October 15, 2024 02:27

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK, this looks good. I'll rebase for merging though (please update the PR with a rebase instead of a merge commit next time).

@bsipocz bsipocz force-pushed the ASB-28975-update-docs branch from ea176a0 to 4e422d8 Compare October 17, 2024 21:44
@bsipocz bsipocz merged commit 3e26521 into astropy:main Oct 17, 2024
@snbianco snbianco deleted the ASB-28975-update-docs branch January 31, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MAST: Tesscut doc needs updating, cloud API is no-op

4 participants