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

Better magic_underscore explanation in docstrings #1925

Open
nicolaskruchten opened this issue Nov 25, 2019 · 2 comments
Open

Better magic_underscore explanation in docstrings #1925

nicolaskruchten opened this issue Nov 25, 2019 · 2 comments
Assignees
Labels
documentation written for humans feature something new P3 backlog
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

I'd love to have a better answer for this kind of thing: https://stackoverflow.com/questions/58990657/python-how-do-i-find-inspect-what-kind-of-arguments-a-function-accepts

Some thoughts:

  • The constructors of all the graph_objects that accept **kwargs should include an entry for this in the docstring.
  • Wherever we accept another graph_object (e.g. marker in go.Scatter) the docstring could mention that you can also to marker_whatever?
  • Wherever we accept **kwargs, the docstring for that item should contain some self-contained explanation of what magic-underscores are and a link to the relevant docs. Minimally something like "for any other arguement x in this function which accepts a graph_object, you may use x_y where y is a valid property of the corresponding graph_object."
  • For generic methods like update/add etc we should mention the name of the relevant graph_object whose properties are accepted, so that they show up in the Sphinx doc and provide a trail that users can follow. E.g. in https://plot.ly/python-api-reference/generated/plotly.graph_objects.Figure.html#plotly.graph_objects.Figure.update_xaxes we should mention in patch and kwargs that the relevant attributes are to be found in plotly.graph_objects.layout.Xaxis etc.

@emmanuelle thoughts?

@emmanuelle
Copy link
Contributor

You mean document the fact that for example in go.Scatter we can pass marker= but alos marker_color=?

@nicolaskruchten
Copy link
Contributor Author

Yep!

@nicolaskruchten nicolaskruchten added this to the v4.3.1 milestone Nov 28, 2019
@jonmmease jonmmease modified the milestones: v4.3.1, v4.5.0 Dec 10, 2019
@nicolaskruchten nicolaskruchten modified the milestones: v4.5.0, v4.5.1 Jan 21, 2020
@nicolaskruchten nicolaskruchten modified the milestones: v4.5.1, v4.6.0 Feb 19, 2020
@nicolaskruchten nicolaskruchten modified the milestones: v4.6.0, v4.x Mar 31, 2020
@gvwilson gvwilson added P3 backlog feature something new documentation written for humans labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation written for humans feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

5 participants