Skip to content

Commit

Permalink
Fix retcode and properly test shape
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmoore committed Apr 27, 2021
1 parent 6d02348 commit 7883082
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- zlib
- blosc
- nodejs
- z5py >= 2.0.10
- z5py
- python == 3.7.9
- scikit-image
- pytest
Expand All @@ -20,5 +20,4 @@ dependencies:
- pandas
- tabulate
- pip:
- pyn5
- git+https://github.com/grlee77/zarrita.git@codec_update
14 changes: 11 additions & 3 deletions generate_data/jzarr/generate_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
# https://stackoverflow.com/a/6393573/2700168
cd "${0%/*}"

set -e
set -u
set -x

mvn clean package
java -cp target/jzarr-1.0.0.jar zarr_implementations.jzarr.App "$@"
java -cp target/jzarr-1.0.0.jar zarr_implementations.jzarr.App "$@" && {
# Workaround for: https://github.com/bcdev/jzarr/issues/25
find ../../data/jzarr* -name .zarray -exec sed -ibak 's/>u1/|u1/' {} \;
} || {
echo jzarr failed
exit 2
}

# Workaround for: https://github.com/bcdev/jzarr/issues/25
find ../../data/jzarr* -name .zarray -exec sed -ibak 's/>u1/|u1/' {} \;
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public static void main(String args[]) throws Exception {
String dsname = args[2];
ZarrArray verification = ZarrGroup.open(fpath).openArray(dsname);
int[] shape = verification.getShape();
if (!Arrays.equals(new int[]{}, shape)) {
if (!Arrays.equals(SHAPE, shape)) {
throw new RuntimeException(String.format(
"shape-mismatch expected:{} found:{}",
SHAPE, shape
"shape-mismatch expected:%s found:%s",
Arrays.toString(SHAPE), Arrays.toString(shape)
));
}
return; // EARLY EXIT
Expand Down

0 comments on commit 7883082

Please sign in to comment.