Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Oct 17, 2024

Conversation

snbianco
Copy link
Contributor

@snbianco snbianco commented Oct 2, 2024

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.

Copy link

codecov bot commented Oct 2, 2024

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 24 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
Copy link
Contributor Author

snbianco commented Oct 2, 2024

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

@@ -82,31 +81,6 @@ def logout(self):
self._auth_obj.logout()
self._authenticated = False

def enable_cloud_dataset(self, provider="AWS", profile=None, verbose=True):
Copy link
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
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
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
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
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
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.

Copy link
Contributor Author

@snbianco snbianco Oct 15, 2024

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
Copy link
Member

bsipocz commented Oct 2, 2024

(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
Copy link

pep8speaks commented Oct 3, 2024

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
Copy link
Contributor Author

snbianco commented Oct 3, 2024

(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
CHANGES.rst Outdated Show resolved Hide resolved
Copy link
Member

@bsipocz bsipocz left a comment

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 merged commit 3e26521 into astropy:main Oct 17, 2024
10 of 11 checks passed
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