Skip to content

Commit 3f18d56

Browse files
jstriebelnormanrzvalentin-pinkau
authored
Remote Dataset (#723)
* update webknossos client, use floats for scale * WIP * add tests * add changelog entry * fix docs destination for branch builds * same for docker * use GITHUB_HEAD_REF with GITHUB_REF_NAME as a fallback * apply PR feedback * update changelog * update examples * update outdated cassettes * Update webknossos/webknossos/dataset/dataset.py Co-authored-by: Norman Rzepka <[email protected]> * make webknossos_context reentrant * Apply suggestions from code review Co-authored-by: Valentin Pinkau <[email protected]> * fix json body type of datasetUpdateTeam client method * call _ensure_writable where needed, re-order methods for docs * add read_only property to dataset and layer Co-authored-by: Norman Rzepka <[email protected]> Co-authored-by: Valentin Pinkau <[email protected]>
1 parent 97e6f3d commit 3f18d56

File tree

50 files changed

+28823
-3553
lines changed

Some content is hidden

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

50 files changed

+28823
-3553
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ jobs:
326326
- name: Push docker images (for branch)
327327
if: github.ref_type == 'branch'
328328
run: |
329-
CI_BRANCH=${GITHUB_REF##*/}
329+
CI_BRANCH=${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}
330330
NORMALIZED_CI_BRANCH=${CI_BRANCH//[\/-]/_}
331331
docker tag \
332332
scalableminds/webknossos-cuber:$GITHUB_SHA \
@@ -375,7 +375,7 @@ jobs:
375375
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
376376
AWS_DEFAULT_REGION: "eu-west-1"
377377
run: |
378-
CI_BRANCH=${GITHUB_REF##*/}
378+
CI_BRANCH=${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}
379379
NORMALIZED_CI_BRANCH=${CI_BRANCH//[\/-]/_}
380380
aws s3 sync --acl public-read docs/out s3://static.webknossos.org/docs/${NORMALIZED_CI_BRANCH}
381381

docs/overrides/main.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
font-style: normal;
4444
}
4545
:root {
46-
--md-text-font-family: "Titillium Web";
47-
--md-code-font-family: "Roboto Mono";
46+
--md-text-font: "Titillium Web";
47+
--md-code-font: "Roboto Mono";
4848
}
4949
.pdoc .attr {
50-
font-family: var(--md-code-font-family);
50+
font-family: var(--md-code-font);
5151
}
5252
</style>
5353
{% endblock styles %}

docs/pdoc_templates/with_mkdocs/frame.html.jinja2

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,36 @@ pdoc-toc:
5050
{% endif %}
5151
---
5252
<div>
53-
{% block body %}{% endblock %}
54-
{% block style %}{% endblock %}
53+
{% block body %}
54+
{% block content %}{% endblock %}
55+
{% if module and module.submodules %}
56+
<h2 id="submodules">Submodules</h2>
57+
<ul>
58+
{% for submodule in module.submodules %}
59+
<li>{{ submodule.taken_from | link }}</li>
60+
{% endfor %}
61+
</ul>
62+
{% endif %}
63+
{% endblock %}
64+
{% filter minify_css | indent %}
65+
{% block style %}
66+
{#
67+
Customizations:
68+
* removed include of resources/bootstrap-reboot.min.css
69+
* removed block style_layout with include of layout.css
70+
#}
71+
<style>/*! syntax-highlighting.css */{% include "syntax-highlighting.css" %}</style>
72+
{#
73+
The style_pdoc, style_theme, style_layout, and style_content Jinja2 blocks are deprecated and will be
74+
removed in a future release. Custom templates should either provide alternatives for the specific CSS files,
75+
or append their own styles by providing `custom.css` (see examples/custom-template/).
76+
#}
77+
{% block style_pdoc %}
78+
{% block style_theme %}<style>/*! theme.css */{% include "theme.css" %}</style>{% endblock %}
79+
{% block style_content %}<style>/*! content.css */{% include "content.css" %}</style>{% endblock %}
80+
{# Use this file in your custom template directory to add additional CSS styling: #}
81+
<style>/*! custom.css */{% include "custom.css" %}</style>
82+
{% endblock %}
83+
{% endblock %}
84+
{% endfilter %}
5585
</div>

docs/pdoc_templates/with_mkdocs/module.html.jinja2

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,3 @@
44

55
{% block nav %}
66
{% endblock %}
7-
8-
{% block style_layout %}{% endblock %}
9-
10-
## The member and module_contents blocks are just to add extra divs for classes,
11-
## so that classes have a correct anchor when using mkdocs
12-
{% defaultmacro member(doc,add_div) %}
13-
{% if add_div %}
14-
<div id="{{ doc.qualname or doc.name }}">
15-
{% endif %}
16-
{% if doc.type == "class" %}
17-
{{ class(doc) }}
18-
{% elif doc.type == "function" %}
19-
{{ function(doc) }}
20-
{% elif doc.type == "module" %}
21-
{{ submodule(doc) }}
22-
{% else %}
23-
{{ variable(doc) }}
24-
{% endif %}
25-
{% if doc.type != "variable" %}
26-
{{ view_source(doc) }}
27-
{% endif %}
28-
{% if add_div %}
29-
</div>
30-
{% endif %}
31-
{{ docstring(doc) }}
32-
{% enddefaultmacro %}
33-
34-
{% block module_contents %}
35-
{% for m in module.flattened_own_members if is_public(m) | trim %}
36-
<section>
37-
{{ member(m,true) }}
38-
{% if m.type == "class" %}
39-
{% for m in m.own_members if m.type != "class" and is_public(m) | trim %}
40-
<div id="{{ m.qualname }}" class="classattr">
41-
{{ member(m,false) }}
42-
</div>
43-
{% endfor %}
44-
{% set inherited_members = inherited(m) | trim %}
45-
{% if inherited_members %}
46-
<div class="inherited">
47-
<h5>Inherited Members</h5>
48-
<dl>
49-
{{ inherited_members }}
50-
</dl>
51-
</div>
52-
{% endif %}
53-
{% endif %}
54-
</section>
55-
{% endfor %}
56-
{% if module and module.submodules %}
57-
<h2 id="submodules">Submodules</h2>
58-
<ul>
59-
{% for submodule in module.submodules %}
60-
<li>{{ submodule.taken_from | link }}</li>
61-
{% endfor %}
62-
</ul>
63-
{% endif %}
64-
{% endblock %}

docs/poetry.lock

Lines changed: 35 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ python = "^3.7,>=3.7.1"
1010

1111
[tool.poetry.dev-dependencies]
1212
LinkChecker = "^10.0.1"
13-
mkdocs = "1.2.2"
14-
mkdocs-material = "^7.3.0"
13+
mkdocs = "^1.3.0"
14+
mkdocs-material = "^8.2.13"
1515
mkdocs-redirects = "^1.0.3"
16-
pdoc = { git = "https://github.com/mitmproxy/pdoc.git", rev = "1574222ab0568e072dc04e3569027d39aa124256"}
16+
pdoc = "^11.1.0"
1717
webknossos = { path = "../webknossos/", develop = true }
1818
wkcuber = { path = "../wkcuber/", develop = true }
1919

webknossos/Changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1313
[Commits](https://github.com/scalableminds/webknossos-libs/compare/v0.9.24...HEAD)
1414

1515
### Breaking Changes
16+
- `Dataset.upload()` now returns a `RemoteDataset` instead instead of the URL string. You can get the URL via `remote_ds.url`. [#723](https://github.com/scalableminds/webknossos-libs/pull/723)
17+
- `User.teams` now is a tuple instead of a list. [#723](https://github.com/scalableminds/webknossos-libs/pull/723)
18+
- The deprecated `download_dataset` function now requires the `organization_id` argument. [#723](https://github.com/scalableminds/webknossos-libs/pull/723)
1619

1720
### Added
21+
- Added `Dataset.open_remote()`, which returns an object of the new `RemoteDataset`. [#723](https://github.com/scalableminds/webknossos-libs/pull/723)
22+
This can
23+
* give the webknossos URL for the dataset as `remote_ds.url`,
24+
* read image data via the webknossos zarr interface, using the inherited `Dataset` methods, and
25+
* read and change the following dataset metadata as properties: `display_name`, `description`, `tags`, `is_public`, `sharing_token`, `allowed_teams`.
26+
- `Team` instances also contain the `organization_id`. [#723](https://github.com/scalableminds/webknossos-libs/pull/723)
1827

1928
### Changed
2029

0 commit comments

Comments
 (0)