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

Fix shard cli #10

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.*.swp
build
.gradle
.idea
52 changes: 47 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,53 @@
Usage
zarr2zarr
=====
This tool converts back and forth OME-zarr files from
[zarr-v2](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html)
to [zarr-v3](https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html).
standard.

Convert v2 (from e.g. bioformats2raw) to v3:

$ bin/zarr2zarr v2.zarr v3.zarr
## Installation
### zarr2zarr
1. Clone the repository
```dtd
git clone https://github.com/glencoesoftware/zarr2zarr.git
```

Convert v3 to v2:
2. Build the app and skip the tests
```dtd
gradle build -x test
```

$ bin/zarr2zarr v3.zarr v2-output.zarr --write-v2
3. Extract the content of the zip (or tar) file
``` dtd
/build/distributions/zarr2zarr-VERSION.zip`
```

### blosc
This application needs [blosc](https://github.com/Blosc/c-blosc) to run properly. If you don't have it installed,
you can [install it or download the pre-built dll](https://github.com/glencoesoftware/bioformats2raw?tab=readme-ov-file#requirements).

## Usage

- Open a terminal under the bin folder
````dtd
/build/distributions/zarr2zarr-VERSION/bin
````

- Write down the following command to convert a **zarr-v2 file to a zarr-v3 file**
```dtd
$ /zarr2zarr v2.zarr v3.zarr
```
where `v2.zarr` and `v3.zarr` are absolute path.

- Write down the following command to convert a **zarr-v3 file to a zarr-v2 file**
```dtd
$ /zarr2zarr v3.zarr v2-output.zarr --write-v2
```
where `v2-output.zarr` and `v3.zarr` are absolute path.

- Several parameters can be added as arguments (chunk, shard...). You can have a look to them by calling the help
```dtd
$ /zarr2zarr --help
```

2 changes: 1 addition & 1 deletion src/main/java/com/glencoesoftware/zarr/Convert.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void setChunk(String chunk) {
public void setSharding(String shard) {
if (shard != null && !shard.isEmpty()) {
try {
shardConfig = Enum.valueOf(ShardConfiguration.class, shard);
shardConfig = Enum.valueOf(ShardConfiguration.class, shard.toUpperCase());
}
catch (IllegalArgumentException e) {
shardConfig = ShardConfiguration.CUSTOM;
Expand Down