-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
first round of changes towards doctesting #1921
Conversation
@@ -161,91 +161,9 @@ def create_ohlc(open, high, low, close, dates=None, direction="both", **kwargs): | |||
>>> from plotly.figure_factory import create_ohlc | |||
>>> from datetime import datetime | |||
|
|||
>>> import pandas.io.data as web |
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.
here I removed all of them because the doc was broken and we have the trace anyway
@@ -468,8 +469,9 @@ def update(self, dict1=None, overwrite=False, **kwargs): | |||
>>> fig = go.Figure(layout={'xaxis': | |||
... {'color': 'green', | |||
... 'range': [0, 1]}}) | |||
>>> fig.update({'layout': {'xaxis': {'color': 'pink'}}}) | |||
>>> fig.to_plotly_json() | |||
>>> fig.update({'layout': {'xaxis': {'color': 'pink'}}}) #doctest: +ELLIPSIS |
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.
another approach would be fig = fig.update( ... )
?
Cool :) |
All seems pretty good to me! I notice that Sphinx grabs the first sentence or line of docstrings to make these "TOC" type pages: https://plot.ly/python-api-reference/plotly.figure_factory.html so we'll want to take a look at this page with these new docstrings to make sure we're happy with it. Maybe the deprecated ones all start with |
Looks good! Can we order them such that the non-deprecated ones are up top? |
Sure! But this needs to be done in |
Yehaah, I think this one is ready for review @nicolaskruchten ! |
Nice! So (how) does this test the docstrings for e.g. |
Ah, haha, there are no code examples in |
Exactly :-). Actually we don't have a lot of docstrings with code examples. You can see a list of the files with docstrings doctested in the corresponding CI job (python3.7-orca) |
@@ -36,7 +36,8 @@ def create_table( | |||
**kwargs | |||
): | |||
""" | |||
BETA function that creates data tables | |||
**deprecated**, use instead the plotly.graph_objects trace |
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 actually realize now that this isn't an older way of making tables, but it's a convenience method for making tables, because go.Table
is pretty hard to use. So maybe this one shouldn't be deprecated
after all.
💃 modulo table comment. Thanks for this cleanup and lock-down! |
Not a full doctest workflow yet, but some required changes.