Skip to content

Commit 664d23c

Browse files
author
Tara Drwenski
committed
Add zarr test catalog and tests
1 parent f749525 commit 664d23c

File tree

384 files changed

+223
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+223
-0
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package thredds.tds;
2+
3+
import static com.google.common.truth.Truth.assertThat;
4+
5+
import java.nio.charset.StandardCharsets;
6+
import javax.servlet.http.HttpServletResponse;
7+
import org.junit.Ignore;
8+
import org.junit.Test;
9+
import thredds.test.util.TestOnLocalServer;
10+
11+
public class TestZarr {
12+
final private static String ZARR_DIR_PATH = "localContent/zarr/zarr_test_data.zarr";
13+
final private static String ZARR_ZIP_PATH = "localContent/zarr/zarr_test_data.zip";
14+
final private static String ZARR_S3_PATH = "s3-zarr/zarr_test_data.zarr";
15+
16+
@Test
17+
public void shouldOpenZarrDirectory() {
18+
checkWithOpendap(ZARR_DIR_PATH);
19+
}
20+
21+
@Test
22+
public void shouldOpenZarrZip() {
23+
checkWithOpendap(ZARR_ZIP_PATH);
24+
}
25+
26+
@Ignore("Still working on S3 Zarr")
27+
@Test
28+
public void shouldOpenObjectStoreZarrFile() {
29+
checkWithOpendap(ZARR_S3_PATH);
30+
}
31+
32+
private static void checkWithOpendap(String path) {
33+
final String endpoint = TestOnLocalServer.withHttpPath("dodsC/" + path + ".dds");
34+
final byte[] content = TestOnLocalServer.getContent(endpoint, HttpServletResponse.SC_OK);
35+
final String stringContent = new String(content, StandardCharsets.UTF_8);
36+
37+
assertThat(stringContent).contains("Int32 /group_with_attrs/F_order_array[dim0 = 20][dim1 = 20];");
38+
}
39+
}

Diff for: tds/src/test/content/thredds/catalog.xml

+1
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@
302302
<catalogRef xlink:title="ESGF" xlink:href="testEsgfProblems.xml" name=""/>
303303
<catalogRef xlink:title="RDA" xlink:href="testRdaProblems.xml" name=""/>
304304
<catalogRef xlink:title="TDS S3" xlink:href="tds-s3.xml" name=""/>
305+
<catalogRef xlink:title="TDS Zarr" xlink:href="tds-zarr.xml" name=""/>
305306
<catalogRef xlink:title="Test nested aggregation" xlink:href="catalogNestedAgg.xml" name=""/>
306307

307308
<catalogScan location="catalogs5" path="catalogs5" name="catalog scan with version 5 features"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"zarr_format": 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"group_attr": "foo"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"zarr_format": 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"chunks": [
3+
4,
4+
5
5+
],
6+
"compressor": null,
7+
"dtype": "<i4",
8+
"fill_value": 0,
9+
"filters": null,
10+
"order": "F",
11+
"shape": [
12+
20,
13+
20
14+
],
15+
"zarr_format": 2
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"bar": "apples",
3+
"baz": [
4+
1,
5+
2,
6+
3,
7+
4
8+
],
9+
"foo": 42
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"chunks": [
3+
10,
4+
10
5+
],
6+
"compressor": null,
7+
"dtype": "<i2",
8+
"fill_value": 0,
9+
"filters": null,
10+
"order": "C",
11+
"shape": [
12+
20,
13+
20
14+
],
15+
"zarr_format": 2,
16+
"dimension_separator": "/"
17+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"chunks": [
3+
10,
4+
10
5+
],
6+
"compressor": null,
7+
"dtype": "<f4",
8+
"fill_value": 999.0,
9+
"filters": null,
10+
"order": "C",
11+
"shape": [
12+
20,
13+
20
14+
],
15+
"zarr_format": 2
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"chunks": [
3+
10,
4+
10
5+
],
6+
"compressor": null,
7+
"dtype": "<f4",
8+
"fill_value": 999.0,
9+
"filters": null,
10+
"order": "C",
11+
"shape": [
12+
20,
13+
20
14+
],
15+
"zarr_format": 2
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"chunks": [
3+
10,
4+
10
5+
],
6+
"compressor": null,
7+
"dtype": "<f4",
8+
"fill_value": 999.0,
9+
"filters": null,
10+
"order": "C",
11+
"shape": [
12+
20,
13+
20
14+
],
15+
"zarr_format": 2
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"zarr_format": 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"chunks": [
3+
5
4+
],
5+
"compressor": null,
6+
"dtype": "<i4",
7+
"fill_value": 0,
8+
"filters": null,
9+
"order": "C",
10+
"shape": [
11+
20
12+
],
13+
"zarr_format": 2
14+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"chunks": [
3+
5,
4+
5
5+
],
6+
"compressor": null,
7+
"dtype": "<i4",
8+
"fill_value": 0,
9+
"filters": null,
10+
"order": "C",
11+
"shape": [
12+
20,
13+
20
14+
],
15+
"zarr_format": 2
16+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"chunks": [
3+
5,
4+
5,
5+
5
6+
],
7+
"compressor": null,
8+
"dtype": "<i4",
9+
"fill_value": 0,
10+
"filters": null,
11+
"order": "C",
12+
"shape": [
13+
20,
14+
20,
15+
20
16+
],
17+
"zarr_format": 2
18+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"chunks": [
3+
5,
4+
5,
5+
5,
6+
5
7+
],
8+
"compressor": null,
9+
"dtype": "<i4",
10+
"fill_value": 0,
11+
"filters": null,
12+
"order": "C",
13+
"shape": [
14+
20,
15+
20,
16+
20,
17+
20
18+
],
19+
"zarr_format": 2
20+
}

0 commit comments

Comments
 (0)