Skip to content
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

Adding API documentation made on sphinx #526

Merged
merged 72 commits into from
Dec 8, 2021

Conversation

TOsmanov
Copy link
Contributor

@TOsmanov TOsmanov commented Oct 25, 2021

Summary

API Documentation generated made on sphinx.
Generated with using sphinx-apidoc and sphinx-autodoc.
Used theme read the docs.
The color of the theme read the docs is partially changed to match the color of the main site.
Added nojekyll file for website correct work on the github pages (read more).

  • A button has been added to the documentation site to go to the site with API documentation
  • Visual compliance with the documentation site.
  • Footer contains the necessary information.
  • Update site/README.md.
  • |n and |s in the comments replace on \n and spaces before generation (using docstring preprocessing).
  • excluded members beginning with _ .

Preview: https://tosmanov.github.io/datumaro/api/

Current issues:

  1. Needs to update the workflows. I used the following commands:
      pip install Sphinx==4.2.0
      pip install sphinx-rtd-theme==1.0.0
      sphinx-build -a -n site\source site\static\api
    
  2. Have to fixed warnings arising during generation sphinx-autodoc
  3. Not added versioning with use sphinx-versioning
  4. Most modules have no documentation

List of the problems that require editing comments in source code:

datumaro.plugins.openvino_plugin.launcher and datumaro.plugins.accuracy_checker_plugin.* sections make without using autodoc, therefore not have bases and source links

Attributable with a space in the name are not displayed sphinx-autodoc. For example plugins/mot_format.py lines 24, 28, 29 (https://tosmanov.github.io/datumaro/api/api/datumaro.plugins.html#module-datumaro.plugins.mot_format)

https://tosmanov.github.io/datumaro/api/api/plugins/sampler/datumaro.plugins.sampler.sampler.html#datumaro.plugins.sampler.sampler.Sampler
Notes has no line break

https://tosmanov.github.io/datumaro/api/api/plugins/plugins/datumaro.plugins.splitter.html#datumaro.plugins.splitter.Split
Examples has no line break

https://tosmanov.github.io/datumaro/api/api/plugins/plugins/datumaro.plugins.splitter.html#datumaro.plugins.splitter._ClassificationSplit
Notes incorrect line wrapping
Examples has no line break

https://tosmanov.github.io/datumaro/api/api/plugins/plugins/datumaro.plugins.splitter.html#datumaro.plugins.splitter._InstanceSpecificSplit
Example incorrect line wrapping

https://tosmanov.github.io/datumaro/api/api/plugins/plugins/datumaro.plugins.transforms.html#datumaro.plugins.transforms.ProjectLabels
Examples has no line break

https://tosmanov.github.io/datumaro/api/api/plugins/plugins/datumaro.plugins.transforms.html#datumaro.plugins.transforms.Rename
Examples incorrect interpretation :

https://tosmanov.github.io/datumaro/api/api/util/util/datumaro.util.annotation_util.html#datumaro.util.annotation_util.make_label_id_mapping
Returns incorrect line wrapping

https://tosmanov.github.io/datumaro/api/api/util/util/datumaro.util.image.html#datumaro.util.image.load_image_meta_file
incorrect line wrapping

https://tosmanov.github.io/datumaro/api/api/util/util/datumaro.util.mask_tools.html#datumaro.util.mask_tools.paint_mask
incorrect line wrapping

https://tosmanov.github.io/datumaro/api/api/util/util/datumaro.util.mask_tools.html#datumaro.util.mask_tools.mask_to_polygons
Args: is displayed as Parameters:

https://tosmanov.github.io/datumaro/api/api/util/util/datumaro.util.mask_tools.html#datumaro.util.mask_tools.crop_covered_segments
Args: is displayed as Parameters:
[ has incorrect highlight

https://tosmanov.github.io/datumaro/api/api/util/util/datumaro.util.os_util.html#datumaro.util.os_util.generate_next_name
Inputs has no line break


How to test

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

Makefile Outdated Show resolved Hide resolved
.gitmodules Outdated Show resolved Hide resolved
@TOsmanov TOsmanov force-pushed the api-documentation-sphinx branch 5 times, most recently from 26647e7 to 8bc9023 Compare October 29, 2021 08:49
@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Nov 1, 2021

I see such fragments:

image

Can we do anything about the "The syntax is" part?

site/source/Makefile Outdated Show resolved Hide resolved
@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Nov 1, 2021

image

Can we move the sections below to the plugins? These are all plugins. The same is for algorithms and components

@zhiltsov-max
Copy link
Contributor

Can we add missing class definitions in modules?

There is no Dataset class, nor Project, but they're really important. The operations module is almost empty, but it has many useful functions and classes. Please, check for them.

@TOsmanov
Copy link
Contributor Author

TOsmanov commented Nov 30, 2021

Planned fixes:

  • in rise add apply
  • add fields for classes in annotation, datasetitem, errors and everything announced with the attrs decorator
  • remove _shape
  • add __init__ members
  • in convert add apply and convert
  • add undoc-members to all classes
  • add __iter__ to dataset
  • add to .environment. Environment property, make_*, load_plugins
  • in datumaro.components.extractor.Importer, datumaro.components.annotation and datumaro.components.project fix display parameters
  • in plugin return all files
  • plugins.accuracy_checker_plugin, datumaro.plugins.openvino_plugin.launcher fix display, but make without autodoc
  • remove private-members everywhere except for the list of included members

@zhiltsov-max
Copy link
Contributor

Ok, looks almost finished.

Please move
image
From "utilities" to "plugins"

@nmanovic
Copy link

nmanovic commented Dec 8, 2021

@TOsmanov , @zhiltsov-max , let's merge in the current status. If we find any problems, it will be possible to fix them in the future.

@nmanovic nmanovic merged commit 94bed0c into openvinotoolkit:develop Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants