@@ -18,7 +18,8 @@ It is intended to be GitHub-renderable Markdown (no Sphinx/MyST directives).
1818 - [ DataFrame v0.2.0] ( #dataframe-v020 )
1919 - [ DataFrame v0.1.0 (legacy: anndata 0.7.x)] ( #dataframe-v010-legacy-anndata-07x )
2020 - [ Legacy categorical columns (Series-level)] ( #legacy-categorical-columns-series-level )
21- - [ Mappings / dict] ( #mappings--dict )
21+ - [ Mappings] ( #mappings )
22+ - [ Legacy mapping encoding (` dict ` v0.1.0)] ( #legacy-mapping-encoding-dict-v010 )
2223- [ Scalars] ( #scalars )
2324- [ Categorical arrays] ( #categorical-arrays )
2425- [ String arrays] ( #string-arrays )
@@ -154,26 +155,37 @@ In v0.1.0 DataFrames, a categorical column array (e.g. `obs/cell_type`) can be i
154155
155156(This differs from HDF5, which can store an object reference.)
156157
157- ## Mappings / dict
158+ ## Mappings
158159
159- ### ` encoding-type: dict ` , ` encoding-version: 0.1.0 `
160+ Mappings are stored as Zarr ** groups ** on disk.
160161
161- - A mapping ** MUST** be stored as a Zarr ** group** .
162- - Group attributes:
163- - ` encoding-type: "dict" `
164- - ` encoding-version: "0.1.0" `
165- - Each entry in the group is another element (recursively).
162+ - This includes standard AnnData mappings such as ` layers ` , ` obsm ` , ` varm ` , ` obsp ` , ` varp ` , and ` uns ` .
163+ - Mappings are distinct from DataFrames and sparse arrays and do not require special mapping-specific attributes.
164+ - Mapping semantics are recursive: entries in ` uns ` can themselves be groups containing additional encoded elements.
166165
167- > ** Legacy note**
166+ > ** Legacy compatibility note**
168167>
169- > In anndata 0.7.x, groups used as mappings often had ** no special attributes** .
168+ > In earlier conventions (commonly seen in older docs and some files), mappings could carry
169+ > ` encoding-type: "dict" ` and ` encoding-version: "0.1.0" ` .
170+ > Readers should still accept this legacy metadata when encountered.
171+
172+ ### Legacy mapping encoding (` dict ` v0.1.0)
173+
174+ For backward compatibility, older files may encode mappings with explicit mapping metadata:
175+
176+ - ` encoding-type: "dict" `
177+ - ` encoding-version: "0.1.0" `
178+
179+ This historical convention existed in earlier AnnData docs and files and should still be accepted by readers.
170180
171181## Scalars
172182
173183### ` encoding-version: 0.2.0 `
174184
175185Scalars are stored as ** 0-dimensional Zarr arrays** .
176186
187+ These should typically only occur inside ` uns ` and are commonly used for saved parameters.
188+
177189- Numeric scalars:
178190 - ` encoding-type: "numeric-scalar" `
179191 - ` encoding-version: "0.2.0" `
0 commit comments