You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: webknossos/Changelog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
19
19
### Added
20
20
21
21
### Changed
22
+
-`Layer.add_mag_as_copy` now automatically uses file-based copy, if possible. Therefore, `Dataset.fs_copy_dataset`, `Dataset.add_fs_copy_layer` and `Layer.add_fs_copy_mag` are deprecated. [#1362](https://github.com/scalableminds/webknossos-libs/pull/1362)
22
23
- The API methods now use `v10` API version of Webknossos. Datasets are now referenced by ID instead of dataset name or directory name. [#1363](https://github.com/scalableminds/webknossos-libs/pull/1363)
f"Cannot use file-based copy, because the foreign data format {foreign_mag_view.info.data_format} does not match the layer's data format {self.data_format}."
1092
+
)
1093
+
1053
1094
mag_path=self.path/str(foreign_mag_view.mag)
1095
+
ifnotexists_okandmag_path.exists():
1096
+
raiseFileExistsError(
1097
+
f"Cannot copy {foreign_mag_view.path} to {mag_path} because it already exists."
1098
+
)
1054
1099
copytree(
1055
1100
foreign_mag_view.path,
1056
1101
mag_path,
@@ -1067,6 +1112,30 @@ def add_fs_copy_mag(
1067
1112
1068
1113
returnmag
1069
1114
1115
+
defadd_fs_copy_mag(
1116
+
self,
1117
+
foreign_mag_view_or_path: PathLike|str|MagView,
1118
+
*,
1119
+
extend_layer_bounding_box: bool=True,
1120
+
exists_ok: bool=False,
1121
+
) ->MagView:
1122
+
"""Deprecated. File-copy is automatically selected when using `Layer.add_mag_as_copy`.
1123
+
1124
+
Copies the data at `foreign_mag_view_or_path` which belongs to another dataset to the current dataset via the filesystem.
1125
+
Additionally, the relevant information from the `datasource-properties.json` of the other dataset are copied, too.
1126
+
"""
1127
+
caller=getframeinfo(stack()[2][0])
1128
+
warnings.warn(
1129
+
f"[DEPRECATION] Direct use of `Layer.add_fs_copy_mag` is deprecated, please use `Layer.add_mag_as_copy` instead (see {caller.filename}:{caller.lineno}), which automatically uses file-based copy if available.",
0 commit comments