-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a tutorial framework + more tutorials
- Loading branch information
1 parent
2d73c2b
commit 120da8d
Showing
8 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
/docs/build/ | ||
|
||
/test/ref.parquet/ | ||
/test/real_zarray.zarr/ | ||
/test/real_zarray.zarr/ | ||
|
||
*/.CondaPkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[deps] | ||
# netcdf4 = "" | ||
virtualizarr = "" | ||
xarray = "" | ||
zarr = "" | ||
certifi = "" | ||
s3fs = "" | ||
kerchunk = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#= | ||
# Creating Kerchunk catalogs | ||
Kerchunk.jl is only a Kerchunk reader, meaning that if you want to create Kerchunk catalogs, you need to use the Python `kerchunk` package. | ||
The easiest way to do this in Julia is to use the [CondaPkg.jl](https://github.com/JuliaPy/CondaPkg.jl) package to install the `kerchunk` package into a Conda environment and then use PythonCall.jl to call the `kerchunk` package. This ensures reproducibility, since you can pin the versions in the generated CondaPkg.toml as well, and package management via CondaPkg has a very similar interface to `Pkg.jl`. | ||
=# | ||
|
||
|
||
#= | ||
## Setting up the Conda environment | ||
```julia | ||
using CondaPkg | ||
CondaPkg.add("python") | ||
CondaPkg.add("kerchunk") | ||
``` | ||
=# | ||
|
||
#= | ||
## Creating a Kerchunk catalog | ||
=# | ||
|
||
using CondaPkg, PythonCall | ||
|
||
# There are two approaches to this - either call Python explicitly via the command line, or call Python via PythonCall.jl. | ||
# Calling Python via Julia is a nicer interface, but you will very quickly run into binary incompatibility issues. | ||
|
||
CondaPkg.withenv() do | ||
run(``` | ||
$(CondaPkg.which("python")) -e " | ||
import kerchunk | ||
import kerchunk.hdf5 as hdf | ||
# do something | ||
" | ||
```) | ||
end | ||
|
||
#= | ||
## Using PythonCall.jl | ||
```julia | ||
``` | ||
=# | ||
|
||
# Let's load this using Kerchunk.jl, and see what we get! | ||
|
||
using Zarr, Kerchunk | ||
z = Zarr.zopen("reference://catalog.json") | ||
|
||
using Rasters, ZarrDatasets | ||
r = Raster(z) |
Empty file.