Skip to content

Commit

Permalink
Merge pull request #3 from scalableminds/publishing-preparation
Browse files Browse the repository at this point in the history
Publishing preparation
  • Loading branch information
joshmoore authored Jul 4, 2024
2 parents d5f6af5 + e4bff36 commit bdb1bb8
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 13 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '22'
java-version: '11'
distribution: 'temurin'
cache: maven

Expand All @@ -38,11 +38,6 @@ jobs:
python -m venv venv_zarrita
if [ "${{ runner.os }}" = "Windows" ]; then venv_zarrita/Scripts/pip install zarrita; else venv_zarrita/bin/pip install zarrita; fi
- name: Download blosc jar
run: |
mkdir -p ../blosc-java/target
curl https://static.webknossos.org/misc/blosc-java-0.1-1.21.4-SNAPSHOT.jar -o ../blosc-java/target/blosc-java-0.1-1.21.4-SNAPSHOT.jar
- name: Download testdata
run: |
mkdir testoutput
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,29 @@ jobs:
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
# Begin copy from ci.yml. Refactor?

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install zarrita
run: |
python -m venv venv_zarrita
if [ "${{ runner.os }}" = "Windows" ]; then venv_zarrita/Scripts/pip install zarrita; else venv_zarrita/bin/pip install zarrita; fi
- name: Download testdata
run: |
mkdir testoutput
curl https://static.webknossos.org/data/zarr_v3/l4_sample.zip -o testdata/l4_sample.zip
cd testdata
unzip l4_sample.zip
# End copy from ci.yml

- name: Publish package
run: mvn --batch-mode deploy
run: mvn --batch-mode deploy -DargLine="-Xmx6g"
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
52 changes: 49 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>dev.zarr</groupId>
<artifactId>zarr-java</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>

<name>zarr-java</name>

Expand Down Expand Up @@ -42,8 +42,7 @@
</developers>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.14.2</jackson.version>
<aws.version>1.12.477</aws.version>
Expand Down Expand Up @@ -147,6 +146,53 @@
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>${maven.compiler.release}</release>
<encoding>UTF-8</encoding>
<excludes>
<exclude>.gitignore</exclude>
<exclude>temp/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<excludes>
<exclude>temp.**</exclude>
</excludes>
</configuration>
</execution>
</executions>
<configuration>
<excludeResources>true</excludeResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down
12 changes: 9 additions & 3 deletions src/test/java/dev/zarr/zarrjava/ZarrTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import dev.zarr.zarrjava.v3.*;
import dev.zarr.zarrjava.v3.codec.CodecBuilder;
import dev.zarr.zarrjava.v3.codec.core.TransposeCodec;
import jdk.jshell.spi.ExecutionControl;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Expand All @@ -30,6 +29,7 @@
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

Expand Down Expand Up @@ -150,13 +150,16 @@ public void testWriteReadWithZarrita(String codec, String codecParam) throws Exc
int[] testData = new int[16 * 16 * 16];
Arrays.setAll(testData, p -> p);

Map<String, Object> attributes = new HashMap<>();
attributes.put("test_key", "test_value");

StoreHandle storeHandle = new FilesystemStore(TESTOUTPUT).resolve("write_to_zarrita", codec, codecParam);
ArrayMetadataBuilder builder = Array.metadataBuilder()
.withShape(16, 16, 16)
.withDataType(DataType.UINT32)
.withChunkShape(2, 4, 8)
.withFillValue(0)
.withAttributes(Map.of("test_key", "test_value"));
.withAttributes(attributes);

switch (codec) {
case "blosc":
Expand Down Expand Up @@ -425,8 +428,11 @@ public void testV3FillValue() throws ZarrException {
public void testV3Group() throws IOException, ZarrException {
FilesystemStore fsStore = new FilesystemStore(TESTOUTPUT);

Map<String, Object> attributes = new HashMap<>();
attributes.put("hello", "world");

Group group = Group.create(fsStore.resolve("testgroup"));
Group group2 = group.createGroup("test2", Map.of("hello", "world"));
Group group2 = group.createGroup("test2", attributes);
Array array = group2.createArray("array", b ->
b.withShape(10, 10)
.withDataType(DataType.UINT8)
Expand Down

0 comments on commit bdb1bb8

Please sign in to comment.