Skip to content

Commit f640c2c

Browse files
authored
Updates docs for release (openvinotoolkit#936)
<!-- Contributing guide: https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md --> ### Summary * Added docs workflow for stable release * Updated some docstrings * Fixed some docs build errors <!-- Resolves openvinotoolkit#111 and openvinotoolkit#222. Depends on openvinotoolkit#1000 (for series of dependent commits). This PR introduces this capability to make the project better in this and that. - Added this feature - Removed that feature - Fixed the problem openvinotoolkit#1234 --> ### How to test <!-- Describe the testing procedure for reviewers, if changes are not fully covered by unit tests or manual testing can be complicated. --> ### Checklist <!-- Put an 'x' in all the boxes that apply --> - [ ] I have added unit tests to cover my changes.​ - [ ] I have added integration tests to cover my changes.​ - [ ] I have added the description of my changes into [CHANGELOG](https://github.com/openvinotoolkit/datumaro/blob/develop/CHANGELOG.md).​ - [ ] I have updated the [documentation](https://github.com/openvinotoolkit/datumaro/tree/develop/docs) accordingly ### License - [ ] I submit _my code changes_ under the same [MIT License](https://github.com/openvinotoolkit/datumaro/blob/develop/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). ```python # Copyright (C) 2023 Intel Corporation # # SPDX-License-Identifier: MIT ```
1 parent a2325b1 commit f640c2c

File tree

17 files changed

+93
-64
lines changed

17 files changed

+93
-64
lines changed

.github/workflows/docs_stable.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build Docs for releases
2+
3+
on:
4+
workflow_dispatch: # run on request (no need for PR)
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
Build-Docs:
10+
runs-on: ubuntu-20.04
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.10"
22+
- name: Install dependencies
23+
run: python -m pip install tox
24+
- name: Build-Docs
25+
run: |
26+
echo RELEASE_VERSION=${GITHUB_REF#refs/*/} >> $GITHUB_ENV
27+
tox -e build-doc
28+
# - name: Deploy
29+
# uses: peaceiris/actions-gh-pages@v3
30+
# with:
31+
# github_token: ${{ secrets.GITHUB_TOKEN }}
32+
# publish_dir: ./public
33+
# destination_dir: ${{ env.RELEASE_VERSION }}
34+
# force_orphan: true
File renamed without changes.

datumaro/cli/util/project.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def split_local_revpath(revpath: str) -> Tuple[Revision, str]:
153153
154154
A local revpath is a path to a revision withing the current project.
155155
The syntax is:
156-
- [ <revision> : ] [ <target> ]
156+
- [ <revision> : ] [ <target> ]
157157
At least one part must be present.
158158
159159
Returns: (revision, build target)

datumaro/plugins/data_formats/common_semantic_segmentation.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,19 @@ def find_sources(cls, path):
165165
class CommonSemanticSegmentationWithSubsetDirsImporter(CommonSemanticSegmentationImporter):
166166
"""It supports the following subset sub-directory structure for CommonSemanticSegmentation.
167167
168-
```
169-
Dataset/
170-
└─ <split: train,val, ...>
171-
├── dataset_meta.json # a list of labels
172-
├── images/
173-
│ ├── <img1>.png
174-
│ ├── <img2>.png
175-
│ └── ...
176-
└── masks/
177-
├── <img1>.png
178-
├── <img2>.png
179-
└── ...
168+
.. code-block::
169+
170+
Dataset/
171+
└─ <split: train,val, ...>
172+
├── dataset_meta.json # a list of labels
173+
├── images/
174+
│ ├── <img1>.png
175+
│ ├── <img2>.png
176+
│ └── ...
177+
└── masks/
178+
├── <img1>.png
179+
├── <img2>.png
180+
└── ...
180181
181182
Then, the imported dataset will have train, val, ... CommonSemanticSegmentation subsets.
182-
```
183183
"""

datumaro/plugins/data_formats/datumaro_binary/mapper/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ruff: noqa: F405
66

77
from .annotation import *
8-
from .common import *
8+
from .common import DictMapper, FloatListMapper, IntListMapper, Mapper, StringMapper
99
from .dataset_item import *
1010
from .media import *
1111

datumaro/plugins/data_formats/imagenet.py

+30-25
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,15 @@ class ImagenetImporter(Importer):
6666
"""TorchVision's ImageFolder style importer.
6767
For example, it imports the following directory structure.
6868
69-
root
70-
├── label_0
71-
│ ├── label_0_1.jpg
72-
│ └── label_0_2.jpg
73-
└── label_1
74-
└── label_1_1.jpg
69+
.. code-block:: text
70+
71+
root
72+
├── label_0
73+
│ ├── label_0_1.jpg
74+
│ └── label_0_2.jpg
75+
└── label_1
76+
└── label_1_1.jpg
77+
7578
"""
7679

7780
@classmethod
@@ -106,25 +109,27 @@ class ImagenetWithSubsetDirsImporter(ImagenetImporter):
106109
"""TorchVision ImageFolder style importer.
107110
For example, it imports the following directory structure.
108111
109-
root
110-
├── train
111-
│ ├── label_0
112-
│ │ ├── label_0_1.jpg
113-
│ │ └── label_0_2.jpg
114-
│ └── label_1
115-
│ └── label_1_1.jpg
116-
├── val
117-
│ ├── label_0
118-
│ │ ├── label_0_1.jpg
119-
│ │ └── label_0_2.jpg
120-
│ └── label_1
121-
│ └── label_1_1.jpg
122-
└── test
123-
├── label_0
124-
│ ├── label_0_1.jpg
125-
│ └── label_0_2.jpg
126-
└── label_1
127-
└── label_1_1.jpg
112+
.. code-block::
113+
114+
root
115+
├── train
116+
│ ├── label_0
117+
│ │ ├── label_0_1.jpg
118+
│ │ └── label_0_2.jpg
119+
│ └── label_1
120+
│ └── label_1_1.jpg
121+
├── val
122+
│ ├── label_0
123+
│ │ ├── label_0_1.jpg
124+
│ │ └── label_0_2.jpg
125+
│ └── label_1
126+
│ └── label_1_1.jpg
127+
└── test
128+
├── label_0
129+
│ ├── label_0_1.jpg
130+
│ └── label_0_2.jpg
131+
└── label_1
132+
└── label_1_1.jpg
128133
129134
Then, it will have three subsets: train, val, and test and they have label_0 and label_1 labels.
130135
"""

datumaro/plugins/sampler/random_sampler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class RandomSampler(Transform, CliPlugin):
18-
"""
18+
r"""
1919
Sampler that keeps no more than required number of items in the dataset.|n
2020
|n
2121
Notes:|n

docs/source/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363

6464
suppress_warnings = [
6565
# "myst.xref_missing",
66-
"myst.iref_ambiguous"
66+
"myst.iref_ambiguous",
67+
"autosectionlabel.*",
6768
]
6869

6970
autosummary_generate = True # Turn on sphinx.ext.autosummary

docs/source/docs/level-up/advanced_skills/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Advanced Skills
2-
###########
2+
###############
33

44
.. panels::
55

docs/source/docs/level-up/basic_skills/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Basic Skills
2-
###########
2+
############
33

44
.. panels::
55

docs/source/docs/level-up/intermediate_skills/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Intermediate Skills
2-
###########
2+
###################
33

44
.. panels::
55

docs/source/docs/reference/plugins/sampler/algorithm/datumaro.plugins.sampler.algorithm.entropy.rst

+3-10
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ Entropy module
22
--------------
33

44
.. automodule:: datumaro.plugins.sampler.algorithm.entropy
5-
6-
.. autoclass:: SampleEntropy
7-
8-
.. automethod:: __init__
9-
10-
.. automethod:: get_sample
11-
12-
.. automethod:: _get_sample_mixed
13-
14-
.. automethod:: _rank_images
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/docs/reference/plugins/sampler/algorithm/datumaro.plugins.sampler.algorithm.rst

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ Algorithm module
55
:members:
66
:undoc-members:
77
:show-inheritance:
8-
:private-members:

docs/source/docs/user-manual/extending.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Extending
22

33
There are few ways to extend and customize Datumaro behavior, which is
4-
supported by plugins. Check [our contribution guide](/docs/contributing) for
5-
details on plugin implementation. In general, a plugin is a Python module.
4+
supported by plugins. Check [our contribution guide](https://github.com/openvinotoolkit/datumaro/blob/develop/contributing.md)
5+
for details on plugin implementation. In general, a plugin is a Python module.
66
It must be put into a plugin directory:
77
- `<project_dir>/.datumaro/plugins` for project-specific plugins
88
- `<datumaro_dir>/plugins` for global plugins

notebooks/09_encrypt_dataset.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
"cell_type": "markdown",
316316
"metadata": {},
317317
"source": [
318-
"# Re-export again to any dataset format with no encryption\n",
318+
"## Re-export again to any dataset format with no encryption\n",
319319
"\n",
320320
"Because the `DatumaroBinary` format is encrypted, it cannot be easily used for your purposes. In this time, we re-export it to any dataset format for the future usage. For example, COCO format is used for the export."
321321
]

requirements.txt

-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,3 @@
22
-r requirements-default.txt
33

44
opencv-python-headless>=4.1.0.25
5-
6-
# docs
7-
markupsafe>=2.0.1
8-
nbconvert>=7.2.3
9-
ipython>=8.4.0

tox.ini

+2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
isolated_build = true
33
skip_missing_interpreters = true
44

5+
56
[testenv]
67
deps =
78
-r{toxinidir}/requirements.txt
89

10+
911
[testenv:pre-commit]
1012
basepython = python3
1113
deps =

0 commit comments

Comments
 (0)