webknossos-libs
webknossos-libs copied to clipboard
Docs issue (Dataset): "cls" is never explained
I'm reading the APIs for Dataset and several methods take an argument called cls but the docs don't say what it is or what type(s) it is.
It'd be good to have this documented.
(I'm guessing cls is a kind of "catch-all do-it-to-this-thing" type argument based on some of your sample code, but this is just a guess; I see in at least one case it accepts a pathlib.PosixPath but is that all?)
I am assuming that cls typically stands for class which is a protected keyword in Python (and other languages) and therefore needs to be renamed/rephrased differently.
The most typical use case for that are static, class methods. E.g. Dataset.from_images(...). I don't believe there is ever a case where a user needs to provide that argument themselves.
As the API docs are directly generated from the code, these language specific "features" can not be easily omitted. If you have a question regarding a specific function call I am happy to assist.
We have updated how we generate the API documentation to make it more clear what class-methods, (instance/regular)-methods, attributes each class has. A color-coded label helps with the identification.
Also, class methods no longer carry the cls parameter in their signature.
Example: