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

Make utils and utis/tap kwargs keyword only #2690

Merged
merged 7 commits into from
Apr 4, 2023

Conversation

nkphysics
Copy link
Member

This PR is to address #1746 by making kwargs keyword only for utils and utils/tap.

As I expected, there are many packages that use some of these kwargs in a positional manner. So these changes have broken many packages. I started working though the packages to make the necessary changes so everything not listed in #2634 works again.

Like PRs I've done before here, I'm doing this pretty modularly so I figured I'd create the PR to get some input from yall on whether or not you want me to squash all the fixes to the different packages since in some cases its a 1-3 line change.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@770949e). Click here to learn what that means.
The diff coverage is 88.98%.

@@           Coverage Diff           @@
##             main    #2690   +/-   ##
=======================================
  Coverage        ?   65.73%           
=======================================
  Files           ?      233           
  Lines           ?    17841           
  Branches        ?        0           
=======================================
  Hits            ?    11728           
  Misses          ?     6113           
  Partials        ?        0           
Impacted Files Coverage Δ
astroquery/utils/tap/conn/tapconn.py 47.25% <73.91%> (ø)
astroquery/esa/hubble/core.py 83.69% <80.00%> (ø)
astroquery/utils/tap/core.py 44.52% <89.28%> (ø)
astroquery/esa/jwst/core.py 75.87% <100.00%> (ø)
astroquery/gaia/core.py 70.77% <100.00%> (ø)
astroquery/utils/commons.py 75.62% <100.00%> (ø)
astroquery/utils/docstr_chompers.py 85.18% <100.00%> (ø)
astroquery/utils/mocks.py 84.61% <100.00%> (ø)
astroquery/utils/process_asyncs.py 100.00% <100.00%> (ø)
astroquery/utils/progressbar.py 20.45% <100.00%> (ø)
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nkphysics nkphysics marked this pull request as ready for review March 21, 2023 15:25
@@ -12,7 +12,7 @@ class MockResponse:
A mocked/non-remote version of `astroquery.query.AstroResponse`
"""

def __init__(self, content=None, url=None, headers={}, content_type=None,
def __init__(self, content=None, *, url=None, headers={}, content_type=None,
Copy link
Member Author

Choose a reason for hiding this comment

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

This content kwarg is the only kwarg that I've had to leave to be positional since the majority of the packages' testing uses it positionally. Otherwise most of the packages' testing would need to be refactored.

@nkphysics
Copy link
Member Author

I can't seem to figure out where these 2 additional misses in utils/tap/ are that codecov is reporting.

@bsipocz bsipocz added this to the v0.4.7 milestone Mar 29, 2023
@bsipocz bsipocz mentioned this pull request Mar 29, 2023
62 tasks
@nkphysics
Copy link
Member Author

Ok, I figured out why codecov was mad... Should be ok now.

@nkphysics
Copy link
Member Author

This should be ready for review.

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.

One minor comment, and that this should be also added to the changelog.

>>> esahubble.get_postcard(observation_id="j6fl25s4q", calibration_level="RAW", resolution=256, filename="raw_postcard_for_j6fl25s4q.jpg") # doctest: +IGNORE_OUTPUT
>>> esahubble.get_postcard("j6fl25s4q", calibration_level="RAW", resolution=256, filename="raw_postcard_for_j6fl25s4q.jpg") # doctest: +IGNORE_OUTPUT
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 keep this one as is.

@bsipocz
Copy link
Member

bsipocz commented Apr 4, 2023

Thanks @nkphysics!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants