docs: Show correct accessors in the documentation#2563
docs: Show correct accessors in the documentation#2563
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2563 +/- ##
==========================================
- Coverage 93.47% 93.44% -0.03%
==========================================
Files 478 478
Lines 48257 48384 +127
==========================================
+ Hits 45106 45211 +105
- Misses 3151 3173 +22
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request updates the documentation by standardizing the docstring format for API methods across multiple modules, ensuring they end with a period. It also introduces a new Sphinx extension, sphinx-autosummary-accessors, to improve the documentation of accessors and updates the project configuration to support these documentation improvements.
|
There's a large amount of formatting changes in the same commit as the main change here, which makes this a lot harder to review than it needs to be. Please split that into a dedicated commit. The "autosummary and one page per method" setup did not work great the last time we tried it, but will click around a bit tomorrow to see what it's like. |
This PR has only one goal, and that is to remove the references to the internal classes in the documenation. All other changes are consequences of the way this is achieved. Let me elaborate on this:
What do you mean it did not work great the last time we tried? The major problem with the last attempt was that it had multiple goals, while thie PR only has one goal. I am afraid to not go for this solution, but also not have any clear other solution that solves this problem. I imagine it possible to dig into Sphinx and do more major modifications to achieve correct accessors, but I do not know how to do it, and I am afraid no one else will do it. |
|
@MortGron I'm still not entirely sold on this change - would you mind inviting to a quick 15 min meeting with myself + @erlendvollset and showcase some before and after; what gets better and what potentially gets worse? 😄 |
Sold in the sense that you do not want to change the way the accessors are displayed in the documentation, or in the sense that you do not like the side effects of this particular solution? |




Description
Currently the docs does not show how the users access all the methods of the SDK because it shows the methods as beloning to classes the useres do not directly interact with. With this PR the docs will show how the users actually can access the methods of the SDK.
Currently:
Future:
To achieve this, a few changes had to be applied:
AsyncCogniteClienthas to get the correct accessors. This is only done if a special envionrmental variable is set.How autosummary looks like:
Checklist:
If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.