Skip to content

Commit 8995b11

Browse files
committed
remove logging from TestZarr
1 parent ed93541 commit 8995b11

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/test/java/com/glencoesoftware/TestZarr.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
import java.util.Map;
3131
import java.util.OptionalInt;
3232

33-
import org.slf4j.Logger;
34-
import org.slf4j.LoggerFactory;
35-
3633
import com.bc.zarr.ArrayParams;
3734
import com.bc.zarr.DataType;
3835
import com.bc.zarr.DimensionSeparator;
@@ -46,8 +43,6 @@
4643
*/
4744
public class TestZarr {
4845

49-
private static final Logger logger = LoggerFactory.getLogger(TestZarr.class);
50-
5146
private int sizeX = 512;
5247
private int sizeY = 256;
5348
private int sizeZ = 5;
@@ -130,8 +125,7 @@ public TestZarr init() throws IOException {
130125
if (sizeT == 0) {
131126
this.order = order.replace("T", "");
132127
}
133-
logger.info("Initializing Zarr array with dimensions: x={} y={} z={} t={} c={} order={}", sizeX, sizeY, sizeZ, sizeT, sizeC, order);
134-
int[] shape = new int[order.length()];
128+
int[] shape = new int[order.length()];
135129
if (order.contains("C"))
136130
shape[order.indexOf("C")] = sizeC;
137131
if (order.contains("T"))
@@ -143,13 +137,11 @@ public TestZarr init() throws IOException {
143137

144138
if (Files.exists(path)) {
145139
if (overwrite) {
146-
logger.info("Overwriting existing path: {}", path);
147140
Files.walk(path)
148141
.sorted(Comparator.reverseOrder())
149142
.map(Path::toFile)
150143
.forEach(File::delete);
151144
} else {
152-
logger.error("Path already exists and overwrite is false: {}", path);
153145
throw new IOException("Path already exists");
154146
}
155147
}
@@ -159,14 +151,12 @@ public TestZarr init() throws IOException {
159151

160152
// Create parent directories if they don't exist
161153
Files.createDirectories(img_path.getParent());
162-
logger.debug("Created directories: {}", img_path.getParent());
163154

164155
array = ZarrArray.create(img_path, new ArrayParams()
165156
.shape(shape)
166157
.dataType(dataType)
167158
.dimensionSeparator(DimensionSeparator.SLASH)
168159
);
169-
logger.info("Created Zarr array at: {}", img_path);
170160
return this;
171161
}
172162

@@ -177,7 +167,6 @@ public TestZarr init() throws IOException {
177167
* @throws InvalidRangeException
178168
*/
179169
public TestZarr createImage() throws IOException, InvalidRangeException {
180-
logger.info("Creating image data");
181170
for (int i = 0; i <= sizeC; i++) {
182171
if (i == sizeC && sizeC > 0)
183172
break;
@@ -187,7 +176,6 @@ public TestZarr createImage() throws IOException, InvalidRangeException {
187176
for (int k = 0; k <= sizeZ; k++) {
188177
if (j == sizeZ && sizeZ > 0)
189178
break;
190-
logger.debug("Generating {}x{}px plane for C={}, T={}, Z={}", sizeX, sizeY, i, j, k);
191179
String txt = text.replace("<C>", String.valueOf(i)).replace("<T>", String.valueOf(j)).replace("<Z>", String.valueOf(k));
192180
byte[] plane = Utils.generateGreyscaleImageWithText(sizeX, sizeY, txt, textX, textY);
193181
int[] sh = new int[order.length()];
@@ -212,7 +200,6 @@ public TestZarr createImage() throws IOException, InvalidRangeException {
212200
}
213201
}
214202
}
215-
logger.info("Finished creating image data");
216203
return this;
217204
}
218205

@@ -222,7 +209,6 @@ public TestZarr createImage() throws IOException, InvalidRangeException {
222209
* @throws IOException
223210
*/
224211
public TestZarr createMetadata() throws IOException {
225-
logger.info("Saving image metadata");
226212
List<Map<String, String>> axes = new ArrayList<>();
227213
for (int i = 0; i < order.length(); i++) {
228214
Map<String, String> axisObj = new HashMap<>();
@@ -262,14 +248,12 @@ public TestZarr createMetadata() throws IOException {
262248

263249
// Create the series directory if it doesn't exist
264250
Files.createDirectories(series_path);
265-
logger.debug("Created series directory: {}", series_path);
266251

267252
// Create a new ZarrGroup instead of trying to open an existing one
268253
ZarrGroup z = ZarrGroup.create(series_path);
269254
Map<String,Object> attrs = new HashMap<String, Object>();
270255
attrs.put("multiscales", msArray);
271256
z.writeAttributes(attrs);
272-
logger.info("Saved image metadata to: {}", series_path);
273257

274258
return this;
275259
}

0 commit comments

Comments
 (0)