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

API: changing optional arguments to be keyword only #507

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Dec 15, 2023

This PR is to change optional arguments to be keyword only with the intention of making the API a bit cleaner and stricter over time.

This currently causes a lot of internal test failures (commit that fixes those is to come), but I wanted to get this out of the door asap so people can comment on whether this is a direction we should go.

Closes #408

@bsipocz bsipocz added this to the v1.5 milestone Dec 15, 2023
@tomdonaldson
Copy link
Contributor

I like these call signatures as they will make the method calls much more clear and explicit. However isn't this a rather significant API change? Like in the test failures, won't existing user code fail without the keyword specifications?

@bsipocz
Copy link
Member Author

bsipocz commented Dec 15, 2023

@tomdonaldson - I don't see any failures in astroquery, but will run the navo notebooks, too. And yes, it's a significant API change, but thus I would like to get them in sooner rather than later (assuming we decide we would want this).

@bsipocz bsipocz marked this pull request as ready for review December 15, 2023 22:47
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1c4f2fa) 80.28% compared to head (9fbcc6b) 80.28%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #507   +/-   ##
=======================================
  Coverage   80.28%   80.28%           
=======================================
  Files          52       52           
  Lines        6152     6152           
=======================================
  Hits         4939     4939           
  Misses       1213     1213           

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

@bsipocz
Copy link
Member Author

bsipocz commented Dec 15, 2023

@tomdonaldson - I don't see any errors due to this in the navo repo either (the is one timeout, but it should be unrelated, and hopefully there isn't anything lurking in the rest of that notebook)

@msdemlei
Copy link
Contributor

msdemlei commented Dec 18, 2023 via email

@bsipocz
Copy link
Member Author

bsipocz commented Dec 19, 2023

So @msdemlei, would you say hold this up and release v1.5 without this PR?

As you see, nothing in fact needed to be changed in our own documentation, nothing got caught up in astroquery, nor in the navo notebooks, so while this could indeed cause failures, in practice I would hope that people are sanely use the API rather than feeding it a lot of positional arguments.

(I'm also very much in favour of cleaning up or simplifying the API, but I also don't see that I will be able to assign significant resources for it. If I run into something bothersome, I'll try to clean it, but it all will be incremental).

@msdemlei
Copy link
Contributor

msdemlei commented Dec 19, 2023 via email

@bsipocz
Copy link
Member Author

bsipocz commented Dec 19, 2023

As long as our documentation and tests show the right patterns, I'd
say we've done enough for 1.5, and if we've had the whole run-up to
1.6 for people to notice that their code will break, at least we can
then say "you could have spoken up earlier".

OK. I'll run a through this to see whether any of these functions are brand new in 1.5, and if yes, than pull the updates for those, but leave the rest, that actually changes existing API alone. And then do the release.

@bsipocz
Copy link
Member Author

bsipocz commented Dec 19, 2023

I haven't noticed anything that could go in the release without changing the released API (compared to 1.4.2), so I'll separate out the test updates and merge that one, but leave the rest alone.

@bsipocz
Copy link
Member Author

bsipocz commented Dec 20, 2023

OK, so now that we're back in the dev cycle for 1.6, maybe this can go in as the first PR, so downstream will have all the time they can have to adjust 😄

@msdemlei
Copy link
Contributor

msdemlei commented Dec 21, 2023 via email

Copy link
Contributor

@tomdonaldson tomdonaldson left a comment

Choose a reason for hiding this comment

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

I agree that this is ready to go, and that it makes sense to get it out early in the v1.6 dev cycle. Thanks @bsipocz for pushing improvements to the API.

After the holidays, let's announce the change on IVOA channels and encourage testing with the dev version.

@bsipocz bsipocz merged commit 10e9dbd into astropy:main Dec 22, 2023
12 checks passed
@bsipocz bsipocz deleted the MAINT_kwarg_only branch April 17, 2024 15:45
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.

MAINT: making all optional arguments keyword only
3 participants