-
-
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
Makefile: modify docstrings to use temporarily graph_objs #2406
Conversation
lol for "massive So the output is the same as the current output? if you do a diff on the before and after trees it's reasonable? |
Hum how should I do the diff ? I cannot git diff with the version deployed on plotly.py-docs because we |
The change of this PR modifies only docstrings so not the structure of the generated html pages (but the lazy import PR might have modified this structure). |
Oh wow I just saw you can do |
So diffing the current API doc and the one generated on master results in a lot of changes. One reason for this is that the order of objects in the I can dig further but maybe @jonmmease you would know why the order has changed? |
Huh, no I don't think I had any good reason to change the sorting from alphabetical to reverse alphabetical. You could try sorting the classes and modules during code generation here: plotly.py/packages/python/plotly/codegen/__init__.py Lines 306 to 308 in 5b0e8d3
for path_parts in datatype_rel_class_imports:
rel_classes = sorted(datatype_rel_class_imports[path_parts])
rel_modules = sorted(datatype_rel_module_imports.get(path_parts, [])) and see if that helps |
Thanks for the tip for the codegen @jonmmease , now the imports are indeed in alphabetical order and the API doc looks good :-). I also corrected a bug (related to graph_objects <-> graph_objs) which I had previously overlooked. |
Reviewing commit by commit will be easier, the middle commit is only codegen. |
Awesome! So the diff between current prod and the output of this branch is basically nil, right? |
💃 |
This PR fixes the build of the API doc. The problem was that
graph_objs
objects have docstrings with intersphinx references like :class:plotly.graph_objects.scatter.Marker
but (from my understanding, which might be incorrect) graph_objects are lazily imported and not found by sphinx when generating html files from the docstrings, hence no links were generated.I solved the problem by temporarily changing the docstrings thanks to a massive sed, and reverting everything with git checkout after the sphinx build. A more robust long-term solution would be to have all the codegened code inside the
graph_objects
directory.I tested that the solution works both on master and on the branch of #2403.
@nicolaskruchten @jonmmease