-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bbf3ef
commit 9a20a88
Showing
7 changed files
with
164 additions
and
7 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 |
---|---|---|
|
@@ -30,3 +30,6 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# Generated header | ||
include/xtensor-zarr/xtensor_zarr_config_cling.hpp |
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
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,113 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "61829be3-6fab-4500-8d88-7c61ad7b8747", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#include \"xtensor/xio.hpp\"\n", | ||
"#include \"xtensor-io/xio_blosc.hpp\"\n", | ||
"#include \"xtensor-zarr/xzarr_hierarchy.hpp\"\n", | ||
"#include \"xtensor-zarr/xzarr_compressor.hpp\"\n", | ||
"#include \"xtensor-zarr/xzarr_gdal_store.hpp\"\n", | ||
"#include \"xtensor-zarr/xtensor_zarr_config_cling.hpp\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e2aac83c-691b-4bfb-a345-ac72708168fe", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"xt::xzarr_register_compressor<xt::xzarr_gdal_store, xt::xio_blosc_config>();\n", | ||
"std::vector<size_t> shape = {4, 4};\n", | ||
"std::vector<size_t> chunk_shape = {2, 2};\n", | ||
"nlohmann::json attrs = {{\"question\", \"life\"}, {\"answer\", 42}};\n", | ||
"std::size_t pool_size = 1;\n", | ||
"double fill_value = 6.6;\n", | ||
"std::string zarr_version = \"3\";\n", | ||
"xt::xzarr_gdal_store store(\"/vsimem/test.zr\" + zarr_version);\n", | ||
"auto h1 = xt::create_zarr_hierarchy(store, zarr_version);\n", | ||
"xt::xzarr_create_array_options<xt::xio_blosc_config> o;\n", | ||
"o.chunk_memory_layout = 'C';\n", | ||
"o.chunk_separator = '/';\n", | ||
"o.attrs = attrs;\n", | ||
"o.chunk_pool_size = pool_size;\n", | ||
"o.fill_value = fill_value;\n", | ||
"auto z1 = h1.create_array(\"/arthur/dent\", shape, chunk_shape, \"<f8\", o);" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "cffbab84-ec62-4641-a644-ee85f545a345", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"xt::xarray<double> a1 = xt::arange(0, 16).reshape({4, 4});" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4fc286dd-3809-4c19-88ef-62541fbedb8b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"noalias(z1) = a1;" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "63f4c900-6b55-4f6e-884e-8e0aa57e6145", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"auto a2 = z1.get_array<double>();\n", | ||
"a2" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "9386a0ed-4a3d-4626-856d-e60f3d5c32ad", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"auto h2 = xt::get_zarr_hierarchy(store);\n", | ||
"auto z2 = h2.get_array(\"/arthur/dent\");" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "935f7a10-6fab-4ac3-bd3a-15e0b28a3c08", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"auto a3 = z2.get_array<double>();\n", | ||
"a3" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "C++14", | ||
"language": "C++14", | ||
"name": "xcpp14" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": "text/x-c++src", | ||
"file_extension": ".cpp", | ||
"mimetype": "text/x-c++src", | ||
"name": "c++", | ||
"version": "14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
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,18 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2017, Sylvain Corlay and Johan Mabille * | ||
* * | ||
* Distributed under the terms of the BSD 3-Clause License. * | ||
* * | ||
* The full license is in the file LICENSE, distributed with this software. * | ||
****************************************************************************/ | ||
|
||
#ifndef XTENSOR_ZARR_CONFIG_CLING_HPP | ||
#define XTENSOR_ZARR_CONFIG_CLING_HPP | ||
|
||
#pragma cling add_include_path("@XTENSOR_ZARR_INCLUDE_DIR@") | ||
#pragma cling add_library_path(@XTENSOR_ZARR_INSTALL_LIBRARY_DIR@) | ||
#pragma cling load("libxtensor-zarr-gdal") | ||
#pragma cling load("libgdal") | ||
#pragma cling load("libblosc") | ||
|
||
#endif |
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