-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Improve formatting of Python API reference #4156
Comments
I have some more suggestions:
It would be a huge win if we could define, document and test functions in a consistent way across the various interfaces (Expr, DataFrame, Series, stand-alone function). Some of this I have tried by making it easy to test for both Series and Expr the same function by adding some test utils, but it is hard to generalize unfortunately. Still, for Series <-> Expr there should always be an equivalent, and for these functions they should also apply column wise on DataFrame?
I am not sure I fully agree. Yes, sometimes it gets unwieldy, which is probably what you are thinking of, but I find this very useful: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.DataFrame.write_csv.html. It tells me all those input types for |
Fully agree. I will strikethrough my suggestion for removing type specs from function signatures. Having the information in the docstring is a lot of work and prone to errors / being outdated. We could probably be better at using type aliases though, to improve readability of our type hints. But that's a story for another time 😄 |
Done (99%) ... #5376 :) |
Amazing work @alexander-beedie ! |
Got most (annoyingly not all) of the type annotations under control now too... #5388 |
Really nice work, @alexander-beedie ! I will update this issue soon. |
I'm going to close this issue as we are miles ahead of where we were when I opened this issue. Many thanks for @alexander-beedie and others for the nice improvements. I realize we're not perfect yet. If you run into specific issues with the API reference formatting, please open a new issue. |
There are a few improvements I would like to see when it comes to the Python API reference page.
Exceptions
.polars.max
,polars.Expr.max
, andpolars.Expr/polars.Expr.max
.Remove type specifications from function signatures.Not desirable right now, see discussion below.I don't actually know how exactly the docs are built, but I wouldn't mind contributing to these improvements if you agree that this is the way to go.
The text was updated successfully, but these errors were encountered: