Skip to content

Commit bd766eb

Browse files
Updates to readme & docs (#451)
* updated README wip * updated readmes * spell check * update to reamde * update readme on metadata * Update README.md * Update README.md * Merge remote-tracking branch 'origin/master' into readme2 * improve docs, move dataset examples into example folder, add more api reference links * Merge remote-tracking branch 'origin/master' into readme2 * fix import * add missing init * use import webknossos as wk in examples * add examples and annotation API from client PR to docs * Merge remote-tracking branch 'origin/master' into readme2 * update requirements * Merge branch 'master' into readme2 * Update docs/src/webknossos-py/examples/learned_segmenter.md Co-authored-by: Philipp Otto <[email protected]> * Apply suggestions from code review Co-authored-by: Philipp Otto <[email protected]> * PR feedback * guard against errors in pdoc leading to missing api docs
1 parent 26da565 commit bd766eb

38 files changed

+715
-442
lines changed

.gitignore

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,119 @@
1+
*.sublime-project
2+
*.sublime-workspace
3+
.vagrant
4+
.history
5+
wk_data
6+
17
.idea
8+
*.iml
9+
.vscode
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
env/
22+
build/
23+
develop-eggs/
24+
dist/
25+
downloads/
26+
eggs/
27+
.eggs/
28+
lib/
29+
lib64/
30+
parts/
31+
sdist/
32+
var/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
wheels/
37+
MANIFEST
38+
39+
# PyInstaller
40+
# Usually these files are written by a python script from a template
41+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# Unit test / coverage reports
50+
test_coverage_html/
51+
.tox/
52+
.coverage
53+
.coverage.*
54+
.cache
55+
nosetests.xml
56+
coverage.xml
57+
*,cover
58+
.hypothesis/
59+
*.cover
60+
.pytest_cache/
61+
62+
# Sphinx documentation
63+
docs/_build/
64+
65+
# PyBuilder
66+
target/
67+
68+
# IPython Notebook
69+
.ipynb_checkpoints
70+
71+
# pyenv
72+
.python-version
73+
74+
# celery beat schedule file
75+
celerybeat-schedule
76+
77+
# dotenv
78+
.env
79+
80+
# virtualenv
81+
venv/
82+
ENV/
83+
84+
# Spyder project settings
85+
.spyderproject
86+
# SageMath parsed files
87+
*.sage.py
88+
89+
# Environments
90+
.env
91+
.venv
92+
env/
93+
venv/
94+
ENV/
95+
env.bak/
96+
venv.bak/
97+
98+
# Spyder project settings
99+
.spyderproject
100+
.spyproject
101+
102+
# Rope project settings
103+
.ropeproject
104+
105+
.history
106+
107+
/.cfut
108+
/models
109+
.hash
110+
111+
# mkdocs documentation
112+
/site
113+
114+
# mypy
115+
.mypy_cache/
116+
.DS_Store
117+
.docker_credentials
118+
*.simg
119+
slurm-*.out

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
# webKnossos-libs
2+
[![PyPI version](https://img.shields.io/pypi/v/webknossos)](https://pypi.python.org/pypi/webknossos)
3+
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/webknossos.svg)](https://pypi.python.org/pypi/webknossos)
4+
[![Build Status](https://img.shields.io/github/workflow/status/scalableminds/webknossos-libs/CI/master)](https://github.com/scalableminds/webknossos-libs/actions?query=workflow%3A%22CI%22)
5+
[![Documentation](https://img.shields.io/badge/docs-passing-brightgreen.svg)](https://docs.webknossos.org/webknossos-py/index.html)
6+
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
7+
28
<img align="right" src="https://static.webknossos.org/images/oxalis.svg" alt="webKnossos Logo" />
39

410
## [webKnossos Python API](webknossos)
5-
Python API to work with webKnossos datasets, annotations and for webKnossos server interaction.
11+
Python API for working with [webKnossos](https://webknossos.org) datasets, annotations, and for webKnossos server interaction.
12+
13+
Use this for:
14+
- reading/writing/manipulating raw 2D/3D image data and volume annotations/segmentation in webKnossos wrap (*.wkw) format
15+
- handling/manipulation of webKnossos datasets
16+
- reading/writing/manipulating webKnossos skeleton annotations (*.nml)
17+
- up- & downloading annotations and datasets from your webKnossos instance
18+
- executing any of the wkcuber operations from below from your code
619

7-
Currently under construction :construction:
820

921
## [webKnossos cuber (wkcuber) CLI](wkcuber)
10-
CLI tool to creating and manipulate [webKnossos](https://webknossos.org) [WKW](https://github.com/scalableminds/webknossos-wrap) datasets. WKW is a container format for efficiently storing large-scale 3D images as found in microscopy data.
22+
CLI tool for creating and manipulating [webKnossos](https://webknossos.org) [WKW](https://github.com/scalableminds/webknossos-wrap) datasets. WKW is a container format for efficiently storing large-scale 3D images as found in microscopy data.
23+
24+
Use this for:
25+
- converting Tiff-stacks and other data formats for volume image data to webKnossos-compatible *.wkw files from the CLI
26+
- up/downsampling of *.wkw files to different magnification levels (image pyramid) from the CLI
27+
- compressing your *.wkw files to save disk space from the CLI

docs/generate.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ else
2222
poetry run pdoc ../webknossos/webknossos ../wkcuber/wkcuber -t pdoc_templates -o src/api
2323
# rename .html files to .md
2424
find src/api -iname "*.html" -exec sh -c 'mv "$0" "${0%.html}.md"' {} \;
25+
# assert that API docs are written
26+
webknossos_files="$(find src/api/webknossos -type f -name "*.md" | wc -l)"
27+
wkcuber_files="$(find src/api/wkcuber -type f -name "*.md" | wc -l)"
28+
if ! [ "$webknossos_files" -gt "50" ]; then
29+
echo "Error: There are too few ($webknossos_files, expected > 80) files in src/api/webknossos,"
30+
echo "probably there was an error with pdoc before!"
31+
exit 1
32+
fi
33+
if ! [ "$wkcuber_files" -gt "25" ]; then
34+
echo "There are too few ($wkcuber_files, expected > 25) files in src/api/wkcuber,"
35+
echo "probably there was an error with pdoc before!"
36+
exit 1
37+
fi
2538
if [ $# -eq 1 ] && [ "$1" = "--persist" ]; then
2639
PYTHONPATH=$PYTHONPATH:. poetry run mkdocs build
2740
else

docs/mkdocs.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ theme:
2929
features:
3030
- navigation.instant
3131
- navigation.tabs
32+
- navigation.tabs.sticky
3233
- navigation.sections
3334
- navigation.top
3435

3536
nav:
3637
- webKnossos:
37-
- Summary:
38-
- webknossos/index.md
39-
- webknossos/getting_started.md
38+
- webknossos/index.md
39+
- webknossos/getting_started.md
4040
- Guides:
4141
- webknossos/dashboard.md
4242
- webknossos/skeleton_annotation.md
@@ -63,8 +63,29 @@ nav:
6363
- Email Support: mailto:[email protected]
6464
- Commercial Support: https://scalableminds.com" target="_blank
6565
- Python Library:
66-
- Intro: webknossos-py/index.md
67-
- Dataset API: api/webknossos/dataset.md
66+
- webknossos-py/index.md
67+
- webknossos-py/installation.md
68+
- Usage Examples:
69+
- webknossos-py/examples/dataset_usage.md
70+
- webknossos-py/examples/upload_image_data.md
71+
- webknossos-py/examples/learned_segmenter.md
72+
- webknossos-py/examples/skeleton_synapse_candidates.md
73+
- API Reference:
74+
- Geometry:
75+
- BoundingBox: api/webknossos/geometry/bounding_box.md
76+
- Mag: api/webknossos/geometry/mag.md
77+
- Vec3Int: api/webknossos/geometry/vec3_int.md
78+
- Dataset:
79+
- Dataset: api/webknossos/dataset/dataset.md
80+
- Layer: api/webknossos/dataset/layer.md
81+
- MagView: api/webknossos/dataset/mag_view.md
82+
- View: api/webknossos/dataset/view.md
83+
- Skeleton:
84+
- Skeleton: api/webknossos/skeleton/skeleton.md
85+
- Group: api/webknossos/skeleton/group.md
86+
- Graph: api/webknossos/skeleton/graph.md
87+
- Node: api/webknossos/skeleton/node.md
88+
- Annotation: api/webknossos/annotation/annotation.md
6889
- wkcuber CLI: wkcuber/index.md
6990

7091
plugins:
@@ -76,9 +97,16 @@ plugins:
7697
markdown_extensions:
7798
- admonition
7899
- attr_list
100+
- md_in_html
79101
- md_extensions.pdoc_toc_extension
80102
- md_extensions.video_embed_extension
81103
- md_extensions.mdlightbox
104+
- pymdownx.highlight
105+
- pymdownx.inlinehilite
106+
- pymdownx.superfences
107+
- pymdownx.snippets:
108+
base_path: ".."
109+
check_paths: true
82110
- pymdownx.emoji:
83111
emoji_index: !!python/name:materialx.emoji.twemoji
84112
emoji_generator: !!python/name:materialx.emoji.to_svg

docs/overrides/css/image_gallery.css

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* 2 items */
55
article a:first-child:nth-last-child(2) > img,
6-
article a:first-child:nth-last-child(2) ~ a > img{
6+
article a:first-child:nth-last-child(2) ~ a > img {
77
max-width: calc(100%/2 - 1em);
88
}
99

@@ -15,42 +15,52 @@ article a:first-child:nth-last-child(3) ~ a > img {
1515

1616
/* 4 items */
1717
article a:first-child:nth-last-child(4) > img,
18-
article a:first-child:nth-last-child(4) ~ a > img{
18+
article a:first-child:nth-last-child(4) ~ a > img {
1919
max-width: calc(100%/4 - 1em);
2020
}
2121

2222
/* 5 items */
2323
article a:first-child:nth-last-child(5) > img,
24-
article a:first-child:nth-last-child(5) ~ a > img{
24+
article a:first-child:nth-last-child(5) ~ a > img {
2525
max-width: calc(100%/5 - 1em);
2626
}
2727

2828
/* 6 items */
2929
article a:first-child:nth-last-child(6) > img,
30-
article a:first-child:nth-last-child(6) ~ a > img{
30+
article a:first-child:nth-last-child(6) ~ a > img {
3131
max-width: calc(100%/6 - 1em);
3232
}
3333

3434
/* 7 items */
3535
article a:first-child:nth-last-child(7) > img,
36-
article a:first-child:nth-last-child(7) ~ a > img{
36+
article a:first-child:nth-last-child(7) ~ a > img {
3737
max-width: calc(100%/7 - 1em);
3838
}
3939

4040
/* 8 items */
4141
article a:first-child:nth-last-child(8) > img,
42-
article a:first-child:nth-last-child(8) ~ a > img{
42+
article a:first-child:nth-last-child(8) ~ a > img {
4343
max-width: calc(100%/8 - 1em);
4444
}
4545

4646
/* 9 items */
4747
article a:first-child:nth-last-child(9) > img,
48-
article a:first-child:nth-last-child(9) ~ a > img{
48+
article a:first-child:nth-last-child(9) ~ a > img {
4949
max-width: calc(100%/9 - 1em);
5050
}
5151

5252
/* 10 items */
5353
article a:first-child:nth-last-child(10) > img,
54-
article a:first-child:nth-last-child(10) ~ a > img{
54+
article a:first-child:nth-last-child(10) ~ a > img {
5555
max-width: calc(100%/10 - 1em);
5656
}
57+
58+
/*************/
59+
/* FIGURES */
60+
/*************/
61+
62+
/* Always set to 2 items */
63+
article figure {
64+
max-width: calc(100%/2 - 1em) !important;
65+
display: inline-grid !important;
66+
}

docs/pdoc_templates/frame.html.jinja2

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
- id: {{ m.qualname }}
55
name: class {{ m.qualname }}
66
level: {{ level }}
7-
children: {% if not m.own_members %}[]
8-
{% else %}
9-
7+
children:
108
{{ toc_members(m.own_members, level+1) | indent(2) }}
11-
{% endif %}
129
{% elif m.type == "module" %}
1310
- id: {{ m.name }}
1411
name: module {{ m.name }}
@@ -35,6 +32,7 @@
3532
level: {{ level }}
3633
children: []
3734
{% endif %}
35+
{% else %}{% if level > 2 %} []{% endif %}
3836
{% endfor %}
3937
{% enddefaultmacro %}
4038
---

0 commit comments

Comments
 (0)