Skip to content

Commit 9da0bb0

Browse files
authored
[ds-api] Dataset api properties refactoring (#374)
* WIP: starting to remove parallel properties structure * use cattrs to (de)serialize the properties * cleanup * remove redundant properties * reformat properties in testdata * fix linter/typecheck/format errors * don't export the properties after a dataset is opened * fix bug in get_view * fix upsampling test case * implement PR feedback * Discard magnifications from the properties which do not exist on disk * format code * replace get_bounding_box and set_bounding_box with the property 'bounding_box' * fix merge error
1 parent 9bf8037 commit 9da0bb0

File tree

17 files changed

+1028
-1245
lines changed

17 files changed

+1028
-1245
lines changed

Changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1010
[Commits](https://github.com/scalableminds/webknossos-cuber/compare/v0.8.12...HEAD)
1111

1212
### Breaking Changes in Config & CLI
13-
13+
- Replaced the old properties classes of the Dataset API with attr-classes.
14+
- The `Layer.rename()` function is now replaced with the setter of `Layer.name`.
15+
- The functions `Layer.get_view_configuration` and `Layer.set_view_conficuration` are replaced by the property `Layer.default_view_configuration`. (Same applies to `Dataset.get_view_configuration` and `Dataset.set_view_configuration`)
16+
- Moved `LayerViewConfiguration` and `DatasetViewConfiguration` into `properties.py`
17+
- Removed `Layer.set_bounding_box_offset` and `Layer.set_bounding_box_size`.
18+
- Renamed `Layer.get_bounding_box()` to the property `Layer.bounding_box`. The method `Layer.set_bounding_box` is replaced with the setter of the property `Layer.bounding_box`.
1419
### Added
1520
- The API documentation is now hosted on a publicwebpage. [#392](https://github.com/scalableminds/webknossos-cuber/pull/392)
1621

poetry.lock

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

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ scikit-learn = "^0.24.0"
2222
tifffile = "^2020.11.26"
2323
imagecodecs = "^2020.5.30"
2424
czifile = "^2019.7.2"
25+
attrs = "^21.1.0"
26+
cattrs = "1.7.1"
2527

2628
[tool.poetry.dev-dependencies]
2729
pylint = "^2.6.0"

testdata/simple_wk_dataset/datasource-properties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"team": ""
55
},
66
"scale": [
7-
1
7+
1, 1, 1
88
],
99
"defaultViewConfiguration": {
1010
"position": [
@@ -19,7 +19,7 @@
1919
"name": "color",
2020
"category": "color",
2121
"elementClass": "uint24",
22-
"num_channels": 3,
22+
"numChannels": 3,
2323
"boundingBox": {
2424
"topLeft": [
2525
0,

0 commit comments

Comments
 (0)