-
Notifications
You must be signed in to change notification settings - Fork 795
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
WIP: Tab completion 2 #2770
WIP: Tab completion 2 #2770
Conversation
…etion parameter support
…er class docstring when not appropriate
… backported changes that we do not test on older versions
Different approach I see! Tab-completion works for the chained options👏: Almost there it seems! Or is this because of a limitation within ipython? See jupyterlab/jupyterlab#12570 (comment). |
When looking to the code change I notice the following: @overload
def aggregate(self, _: str, **kwds) -> 'Angle':
...
@overload
def aggregate(self, argmax=Undefined, **kwds) -> 'Angle':
...
@overload
def aggregate(self, argmin=Undefined, **kwds) -> 'Angle': It seems it defines somehow multiple identical named methods with different arguments combinations. |
Thanks @mattijn! I didn't know about this Notice that none of these lines you posted are defining anything; they're just indicating what types of arguments are valid. Does that make sense? I will think about the signature question (but it might be more a question related to @joelostblom's earlier commits). |
Thanks for the explanation @ChristopherDavisUCI! Will give these changes a few more trials, but nice👍. |
Yes, I think that is the issue and not something we can easily fix on the Altair side of things I believe =/ I'm really quite surprised that this isn't considered a more important issue as method chaining is used so often but maybe it is a really complex problems to solve? |
Thanks @joelostblom, are you aware of a GitHub issue raising this somewhere higher up, like in ipython? |
I'm not unfortunately. I wasn't sure what would be a good way to test it in Ipython since the shift+tab shortcut is for JupyterLab only and the tab completion works as expected in both jupyterlab and ipython |
@joelostblom I tested your example from the jupyterlab issue linked above with xeus-python. I get the same behavior with the |
Thanks @mattijn, yes, it should be very possible for me to work on this. At least the third one should be no problem, and I'll let you know if I get stuck on 1 or 2. |
Very exciting to see the progress here, thanks everyone involved! I like the idea of explaining the new syntax in a separate section in the docs but not modifying the rest of the docs and the examples just yet. What do you think about making this the actual As it's not a backwards-incompatible change, this would be fine following semantic versioning and it would allow us to already publish the new documentation (don't think we would update it for an rc version?). Furthermore, it would be great to get a proper |
Is "update from upstream/master" a good thing to do before working on the docs? Or is bringing in those 19(?) commits too messy? Should I instead work on the docs in a different branch off of the master branch? |
No is fine, you can update from master. But if you have to undo all commits from this PR regarding the changes to the examples, it might be easier to open a new PR in a new branch? |
@mattijn I thought your comment 3 about To me, at this point it doesn't seem worth rewriting this Does that seem reasonable? I should have some time today to think about your other comments 1 and 2. |
That is unfortunate. I agree with you that it is not worth too much effort at the moment. Just mention this limitation is enough for now! |
I've put all of the examples by @joelostblom using the new attribute syntax into a folder `attribute_syntax` and replaced them in the main `examples` folder with the current versions in the master branch.
👍 perfect |
Hi @mattijn and @joelostblom, I added some basic documentation in this last commit (briefly explaining the setter methods), and at the end mentioning that it does not work with @binste I don't have a great overview of the current layout of the docs, so feel free to move this to another location or make changes to make it more inline with what you have. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the placement in the docs and how it builds on the previously introduced example.
Co-authored-by: Stefan Binder <[email protected]>
I've modified the tests so the examples using the attribute syntax method are integrated within the tests. All are passing, so that is good. But what I don't like, which becomes much clear in this PR, is that all tests(-files) are included as part of the Altair package. A few test files are fine, but now, there are many. Maybe this is a good moment to extract the test-files from the Altair folder into a specific test folder? Maybe good to do this in a separate PR, but I'm not sure how interwoven the tests are with the Altair package. Opened a new issue for this: #2788 |
Hi @ChristopherDavisUCI! First, best wishes for 2023! |
Thanks @mattijn, Happy New Year to you too! Are you able to tell what file is causing the problem? I tried going to Github Desktop and "Update from upstream/master", and about 400 "conflicts" show up, but most of them seem to be related to the examples. I think you're right that @joelostblom's version of this PR did start before the parameter work. Worst case scenario I should be able to manually make the changes in this PR starting with the main branch. I'm very happy for any suggestions of what you think is the best way to proceed! |
Maybe we should create a new branch and One thing that I don't know of is the following: how will this upcoming PR: #2732 work with this commit: cc5ca7c? Would it still be necessary to get the docstring of the helper class? Or by setting up aliases the signature will be treated as general descriptors of these parameters? Probably not and is better to test in #2732 once we can merge this first. |
Thanks @mattijn, I'll take a look at this over the next few days and let you know if I get confused. |
Closing in favor of #2795. |
Branch off of #2592 by @jakevdp and @joelostblom. Adds type hints for the setter methods to help with tab completion.
@mattijn Can you please take another look and see if this new version addresses your concern from #2769 (comment)?
I've never used type hints before, so I'm very happy for any comments or corrections!