and as Ilia mentioned in the discussion thread about this pull request: Iterative computations of confusion matrixfastai codebase doesn’t document function args in the docstings. I’ve used to more advanced docstrings like this(which does not mean it is better in general):
I haven’t found any discussions about it, so maybe I am missing some information, but where should I document parameters, especially if I add one like in this pull request?
The docstrings should take the minimum amount of space (one line is best) and explain in sentences what the function does, with the arguments between backquotes. That’s the format that will work best with our documentation framework. Note that the argument and the return should be type-annotated. Example:
def open_image(fn:PathOrStr)->Image:
"Return `Image` object created from image in file `fn`."
Jeremy,
that you for your reply. I am a bit struggling with adding example to fastai_docs/docs_src . On one hand, there is already a vision.learner.ipynb notebook where I could add my documentation/example. On another hand, it is not up to date and does not work with the latest fastai code. What would you suggest? add a new notebook even though I am adding just a relatively minor feature to the module?
This is what I get locally when trying to run vision.learner.ipynb:
I’ve checked the current code to be sure that my fastai_doc uses latest fastai version.
If you don’t have this function, it’s definitely because you don’t have the latest version. ImageClassificationDataset is an ImageDataset which is a LabelDataset which is a Datasetbase which has a set_item function