-
Notifications
You must be signed in to change notification settings - Fork 15
Converter for MDIO dataset spec to Xarray Dataset and serialize it to Zarr #571
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
Open
dmitriyrepin
wants to merge
31
commits into
TGSAI:v1
Choose a base branch
from
dmitriyrepin:v1
base: v1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9dd9fbc
schema_v1-dataset_builder-add_dimension
dmitriyrepin f88531e
Merge remote-tracking branch 'upstream/v1' into v1
dmitriyrepin 1358f95
First take on add_dimension(), add_coordinate(), add_variable()
dmitriyrepin e5261cb
Finished add_dimension, add_coordinate, add_variable
dmitriyrepin 95c01d8
Work on build
dmitriyrepin 46f82f0
Generalize _to_dictionary()
dmitriyrepin 0dc7cc8
build
dmitriyrepin 79863ac
Dataset Build - pass one
dmitriyrepin ec480f1
Merge the latest TGSAI/mdio-python:v1 branch
dmitriyrepin fa81ea2
Merge branch 'v1' into v1
tasansal 4b2b163
Revert .container changes
dmitriyrepin c532c3b
PR review: remove DEVELOPER_NOTES.md
dmitriyrepin 08798cd
PR Review: add_coordinate() should accept only data_type: ScalarType
dmitriyrepin e8febe4
PR review: add_variable() data_type remove default
dmitriyrepin 0a4be3f
RE review: do not add dimension variable
dmitriyrepin 7b25d6b
PR Review: get api version from the package version
dmitriyrepin 7ca3ed8
PR Review: remove add_dimension_coordinate
dmitriyrepin 4d1ec9c
PR Review: add_coordinate() remove data_type default value
dmitriyrepin 99fcf43
PR Review: improve unit tests by extracting common functionality in v…
dmitriyrepin 0778fdd
Remove the Dockerfile changes. They are not supposed to be a part of …
dmitriyrepin 7e74567
PR Review: run ruff
dmitriyrepin 0aaa5f6
PR Review: fix pre-commit errors
dmitriyrepin 1904dee
remove some noqa overrides
tasansal 4c7c833
Writing XArray / Zarr
dmitriyrepin 4b39ffa
gitignore
dmitriyrepin e772a4f
Merge remote-tracking branch 'upstream/v1' into v1
dmitriyrepin cea7308
to_zarr() fix compression
dmitriyrepin 850135e
Fix precommit issues
dmitriyrepin 82f1960
Use only make_campos_3d_acceptance_dataset
dmitriyrepin b5ee31e
PR Review: address the review comments
dmitriyrepin 7b3ba70
Update _get_fill_value for StructuredType
dmitriyrepin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -153,3 +153,5 @@ mdio1/* | |
pytest-of-* | ||
tmp | ||
debugging/* | ||
|
||
test-data/* |
dmitriyrepin marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,16 @@ | ||
# Wring empty XArray / Zarr to a local storage | ||
|
||
src/mdio/schemas/v1/dataset_serializer.py | ||
|
||
## Issues encountered | ||
|
||
1. FIXED: Non-zero size of the serialized data files | ||
2. FIXED: Not clear how to properly set `compressor`, `dimension_separator`, and `fill_value` | ||
3. FIXED: For image_inline chunks[2] are somehow different? | ||
|
||
4. `fill_value` for StructuredType is set to null, but "AAAAAAAAAAAAAAAA" is expected | ||
|
||
## TO DO: | ||
|
||
- Add more unit tests for internal functions | ||
- Add a trest comparing expected and actual .zmetadata for the serialized dataset |
dmitriyrepin marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,195 @@ | ||
{ | ||
"metadata": { | ||
".zattrs": { | ||
"apiVersion": "1.0.0", | ||
"attributes": { | ||
"foo": "bar", | ||
"textHeader": [ | ||
"C01 .......................... ", | ||
"C02 .......................... ", | ||
"C03 .......................... " | ||
] | ||
}, | ||
"createdOn": "2023-12-12T15:02:06.413469-06:00", | ||
"name": "campos_3d" | ||
}, | ||
".zgroup": { | ||
"zarr_format": 2 | ||
}, | ||
"cdp-x/.zarray": { | ||
"chunks": [256, 512], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": "<f4", | ||
"fill_value": "NaN", | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256, 512], | ||
"zarr_format": 2 | ||
}, | ||
"cdp-x/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline", "crossline"], | ||
"unitsV1": { | ||
"length": "m" | ||
} | ||
}, | ||
"cdp-y/.zarray": { | ||
"chunks": [256, 512], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": "<f4", | ||
"fill_value": "NaN", | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256, 512], | ||
"zarr_format": 2 | ||
}, | ||
"cdp-y/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline", "crossline"], | ||
"unitsV1": { | ||
"length": "m" | ||
} | ||
}, | ||
"crossline/.zarray": { | ||
"chunks": [512], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": "<u4", | ||
"fill_value": null, | ||
"filters": null, | ||
"order": "C", | ||
"shape": [512], | ||
"zarr_format": 2 | ||
}, | ||
"crossline/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["crossline"] | ||
}, | ||
"depth/.zarray": { | ||
"chunks": [384], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": "<u4", | ||
"fill_value": null, | ||
"filters": null, | ||
"order": "C", | ||
"shape": [384], | ||
"zarr_format": 2 | ||
}, | ||
"depth/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["depth"], | ||
"unitsV1": { | ||
"length": "m" | ||
} | ||
}, | ||
"image/.zarray": { | ||
"chunks": [128, 128, 128], | ||
"compressor": { | ||
"blocksize": 0, | ||
"clevel": 5, | ||
"cname": "zstd", | ||
"id": "blosc", | ||
"shuffle": 1 | ||
}, | ||
"dimension_separator": "/", | ||
"dtype": "<f4", | ||
"fill_value": "NaN", | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256, 512, 384], | ||
"zarr_format": 2 | ||
}, | ||
"image/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline", "crossline", "depth"], | ||
"attributes": { | ||
"fizz": "buzz" | ||
}, | ||
"coordinates": "cdp-x cdp-y", | ||
"statsV1": { | ||
"count": 100, | ||
"histogram": { | ||
"binCenters": [1, 2], | ||
"counts": [10, 15] | ||
}, | ||
"max": 10.84, | ||
"min": 5.61, | ||
"sum": 1215.1, | ||
"sumSquares": 125.12 | ||
} | ||
}, | ||
"image_headers/.zarray": { | ||
"chunks": [128, 128], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": [ | ||
["cdp-x", "<i4"], | ||
["cdp-y", "<i4"], | ||
["elevation", "<f2"], | ||
["some_scalar", "<f2"] | ||
], | ||
"fill_value": "AAAAAAAAAAAAAAAA", | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256, 512], | ||
"zarr_format": 2 | ||
}, | ||
"image_headers/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline", "crossline"], | ||
"coordinates": "cdp-x cdp-y" | ||
}, | ||
"image_inline/.zarray": { | ||
"chunks": [4, 512, 512], | ||
"compressor": { | ||
"blocksize": 0, | ||
"clevel": 5, | ||
"cname": "zstd", | ||
"id": "blosc", | ||
"shuffle": 1 | ||
}, | ||
"dimension_separator": "/", | ||
"dtype": "<f4", | ||
"fill_value": "NaN", | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256, 512, 384], | ||
"zarr_format": 2 | ||
}, | ||
"image_inline/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline", "crossline", "depth"], | ||
"coordinates": "cdp-x cdp-y", | ||
"long_name": "inline optimized version of 3d_stack" | ||
}, | ||
"inline/.zarray": { | ||
"chunks": [256], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": "<u4", | ||
"fill_value": null, | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256], | ||
"zarr_format": 2 | ||
}, | ||
"inline/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline"] | ||
}, | ||
"velocity/.zarray": { | ||
"chunks": [128, 128, 128], | ||
"compressor": null, | ||
"dimension_separator": "/", | ||
"dtype": "<f2", | ||
"fill_value": "NaN", | ||
"filters": null, | ||
"order": "C", | ||
"shape": [256, 512, 384], | ||
"zarr_format": 2 | ||
}, | ||
"velocity/.zattrs": { | ||
"_ARRAY_DIMENSIONS": ["inline", "crossline", "depth"], | ||
"coordinates": "cdp-x cdp-y", | ||
"unitsV1": { | ||
"speed": "m/s" | ||
} | ||
} | ||
}, | ||
"zarr_consolidated_format": 1 | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.