Skip to content

Commit 28815f0

Browse files
committed
no fs-copy for memory
1 parent 1037059 commit 28815f0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

webknossos/webknossos/dataset/layer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,17 @@ def add_mag_as_copy(
900900
else:
901901
has_same_compression = compress == foreign_mag_view.info.compression_mode
902902

903-
if has_same_shapes and has_same_format and has_same_compression:
903+
uses_memory_store = (
904+
foreign_mag_view.path.protocol == "memory"
905+
or (self.path / foreign_mag_view.mag.to_layer_name()).protocol == "memory"
906+
)
907+
908+
if (
909+
has_same_shapes
910+
and has_same_format
911+
and has_same_compression
912+
and not uses_memory_store
913+
):
904914
logger.debug(
905915
f"Optimization: Copying files from {foreign_mag_view.path} to {self.path}/{foreign_mag_view.mag} directly without re-encoding."
906916
)

0 commit comments

Comments
 (0)