Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jzarr to 0.3.5 #148

Merged
merged 1 commit into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
implementation 'ome:formats-gpl:6.9.1'
implementation 'info.picocli:picocli:4.6.1'
implementation 'com.univocity:univocity-parsers:2.8.4'
implementation 'com.bc.zarr:jzarr:0.3.3-gs-SNAPSHOT'
implementation 'com.bc.zarr:jzarr:0.3.5'
// implementation 'org.carlspring.cloud.aws:s3fs-nio:1.0-SNAPSHOT'
// implementation 'io.nextflow:nxf-s3fs:1.1.0'
implementation 'org.lasersonlab:s3fs:2.2.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import com.bc.zarr.ArrayParams;
import com.bc.zarr.CompressorFactory;
import com.bc.zarr.DataType;
import com.bc.zarr.DimensionSeparator;
import com.bc.zarr.ZarrArray;
import com.bc.zarr.ZarrGroup;
import com.glencoesoftware.bioformats2raw.MiraxReader.TilePointer;
Expand Down Expand Up @@ -1217,7 +1218,7 @@ public void saveResolutions(int series)
.chunks(new int[] {1, 1, activeChunkDepth, activeTileHeight,
activeTileWidth})
.dataType(dataType)
.nested(nested)
.dimensionSeparator(getDimensionSeparator())
.compressor(CompressorFactory.create(
compressionType.toString(), compressionProperties));
ZarrArray.create(getRootPath().resolve(resolutionString), arrayParams);
Expand Down Expand Up @@ -1853,6 +1854,10 @@ public static DataType getZarrType(int type) {
}
}

private DimensionSeparator getDimensionSeparator() {
return nested ? DimensionSeparator.SLASH : DimensionSeparator.DOT;
}

private void checkOutputPaths() {
if (pyramidName != null || !scaleFormatString.equals("%d/%d")) {
LOGGER.info("Output will be incompatible with raw2ometiff " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ public void testDefaultLayoutIsSetAndIsNested() throws Exception {
Integer layout = (Integer)
z.getAttributes().get("bioformats2raw.layout");
ZarrArray series0 = ZarrGroup.open(output.resolve("0")).openArray("0");
assertTrue(series0.getNested());

// no getter for DimensionSeparator in ZarrArray
// check that the correct separator was used by checking
// that the expected first chunk file exists
assertTrue(output.resolve("0/0/0/0/0/0/0").toFile().exists());

// Also ensure we're using the latest .zarray metadata
ObjectMapper objectMapper = new ObjectMapper();
JsonNode root = objectMapper.readTree(
Expand Down Expand Up @@ -878,6 +883,12 @@ public void testDownsampleTypes(Downsampling type) throws IOException {
public void testNestedStorage(boolean nested) throws IOException {
input = fake();
assertTool(nested ? "--nested" : "--no-nested");
if (nested) {
assertTrue(output.resolve("0/0/0/0/0/0/0").toFile().exists());
}
else {
assertTrue(output.resolve("0/0/0.0.0.0.0").toFile().exists());
}
}

/**
Expand Down