-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace chunk_memory_layout with transpose codec
- Loading branch information
Showing
2 changed files
with
111 additions
and
110 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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
.. _transpose-codec-v1: | ||
|
||
============================ | ||
Transpose codec (version 1.0) | ||
============================ | ||
|
||
**Editor's draft 26 July 2019** | ||
|
||
Specification URI: | ||
https://purl.org/zarr/spec/codecs/endian/1.0 | ||
Corresponding ZEP: | ||
`ZEP 1 — Zarr specification version 3 <https://zarr.dev/zeps/draft/ZEP0001.html>`_ | ||
Issue tracking: | ||
`GitHub issues <https://github.com/zarr-developers/zarr-specs/labels/codec>`_ | ||
Suggest an edit for this spec: | ||
`GitHub editor <https://github.com/zarr-developers/zarr-specs/blob/main/docs/codecs/transpose/v1.0.rst>`_ | ||
|
||
Copyright 2020 `Zarr core development team | ||
<https://github.com/orgs/zarr-developers/teams/core-devs>`_. This work | ||
is licensed under a `Creative Commons Attribution 3.0 Unported License | ||
<https://creativecommons.org/licenses/by/3.0/>`_. | ||
|
||
---- | ||
|
||
|
||
Abstract | ||
======== | ||
|
||
Defines a codec that permutes the dimensions of the chunk array. | ||
|
||
|
||
Status of this document | ||
======================= | ||
|
||
.. warning:: | ||
This document is a draft for review and subject to changes. | ||
It will become final when the `Zarr Enhancement Proposal (ZEP) 1 <https://zarr.dev/zeps/draft/ZEP0001.html>`_ | ||
is approved via the `ZEP process <https://zarr.dev/zeps/active/ZEP0000.html>`_. | ||
|
||
|
||
Document conventions | ||
==================== | ||
|
||
Conformance requirements are expressed with a combination of | ||
descriptive assertions and [RFC2119]_ terminology. The key words | ||
"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", | ||
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative | ||
parts of this document are to be interpreted as described in | ||
[RFC2119]_. However, for readability, these words do not appear in all | ||
uppercase letters in this specification. | ||
|
||
All of the text of this specification is normative except sections | ||
explicitly marked as non-normative, examples, and notes. Examples in | ||
this specification are introduced with the words "for example". | ||
|
||
|
||
Configuration parameters | ||
======================== | ||
|
||
order: | ||
Required. Must be one of: | ||
|
||
- An array of integers specifying a permutation of ``0``, ``1``, ..., | ||
``n-1``, where ``n`` is the number of dimensions in the decoded chunk | ||
representation provided as input to this codec. | ||
- The string ``"C"``, equivalent to specifying the identity permutation | ||
``0``, ``1``, ..., ``n-1``. This makes the codec a no-op. | ||
- The string ``"F"``, equivalent to specifying the permutation ``n-1``, ..., | ||
``1``, ``0``. | ||
|
||
Format and algorithm | ||
==================== | ||
|
||
The decoded chunk representation to which this codec is applied must be an | ||
array. Implementations must fail if this codec is specified immediately after | ||
another codec that produces a byte string as its encoded representation. | ||
|
||
Given a chunk array ``A`` with shape ``A_shape`` as the decoded representation, | ||
the encoded representation is an array ``B`` with the same data type as ``A`` | ||
and shape ``B_shape``, where: | ||
|
||
- ``B_shape[i] = A_shape[order[i]]`` for all dimension indices ``i``, and | ||
- ``B[B_pos] = A[A_pos]``, where ``B_pos[i] = A_pos[order[i]]``, for all chunk | ||
positions ``A_pos`` and dimension indices ``i``. | ||
|
||
.. note:: | ||
|
||
Implementations of this codec may simply construct a virtual view that | ||
represents the transposed result, and avoid physically transposing the | ||
in-memory representation when possible. | ||
|
||
References | ||
========== | ||
|
||
.. [RFC2119] S. Bradner. Key words for use in RFCs to Indicate | ||
Requirement Levels. March 1997. Best Current Practice. URL: | ||
https://tools.ietf.org/html/rfc2119 | ||
Change log | ||
========== | ||
|
||
No changes yet. |
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