Generate doc tables for transplanted methods, continued#2418
Generate doc tables for transplanted methods, continued#2418lilyminium wants to merge 12 commits intoMDAnalysis:developfrom
Conversation
The `transplant_stub.py` script introspects the groups and topology
attributes to write files in `documentation_pages/core` that contain the
documentation for the transplanted methods.
For the stubs to be picked up by sphinx, the docstring of the class to
document must contain
.. include:: XXX.txt
where "XXX" is the name of the class.
A stub contains a table of the methods, their short descriptions, and
what topology attribute they require.
Fixes MDAnalysis#1845
The syntax is not supported in python 3.5
Locally, sphinx complains about citation duplicates. Though, travis complains about missing citations refering about the same citation.
|
Looks like the screenshot below or have a look at these built docs. I felt a little blurb was needed to explain the sudden table. |
Codecov Report
@@ Coverage Diff @@
## develop #2418 +/- ##
========================================
Coverage 90.12% 90.12%
========================================
Files 177 177
Lines 22511 22511
Branches 2913 2913
========================================
Hits 20288 20288
Misses 1620 1620
Partials 603 603
Continue to review full report at Codecov.
|
|
I’m ok with moving methods into the base class. I think the whole transplanted methods thing went a little too far. |
|
To add to @lilyminium argument, having the transplanted method also means that the methods are less discoverable, that they are clearly not IDE friendly, and that error messages are unhelpful when switching topology format. |
I gave a go at the move in #2425. I am not done with it, but it feels already like a massive regression. The reasons @richardjgowers gave to justify the transplanted methods stand and become more obvious when undoing the change. From #601:
|

Fixes #1845
Continues #2176
Changes made in this Pull Request:
grouporself.I haven't addressed the duplicate citation issue. Links just go to the original
MDAnalysis.core.topologyattrs.Attrname.Methoddocstring citation.To be honest, IMO the best solution would be to just move the methods to the core classes and fail gracefully when the required topology attribute isn't there. This approach has many downsides, including:
.. include:: XXX_methods_table.txtand.. include:: XXX_methods_docs.txtto each docstring every time you add a new transplant target__init__method and will show up inhelp(Universe)PR Checklist