@@ -142,20 +142,35 @@ class CastValue(ArrayArrayCodec):
142142 Value-converts array elements to a new data type during encoding,
143143 and back to the original data type during decoding.
144144
145- Requires the `` cast-value-rs` ` package for the actual casting logic.
145+ Requires the `cast-value-rs` package for the actual casting logic.
146146
147147 Parameters
148148 ----------
149- data_type : str
150- Target zarr v3 data type name (e.g. "uint8", "float32").
149+ data_type : str or ZDType
150+ Target zarr v3 data type. Strings are looked up by spec name
151+ (e.g. "uint8", "float32"); a `ZDType` instance is used as-is.
151152 rounding : RoundingMode
152- How to round when exact representation is impossible. Default is "nearest-even".
153+ How to round when exact representation is impossible. Default is
154+ "nearest-even".
153155 out_of_range : OutOfRangeMode or None
154- What to do when a value is outside the target's range.
155- None means error. "clamp" clips to range. "wrap" uses modular arithmetic
156- (only valid for integer types).
157- scalar_map : dict or None
158- Explicit mapping from input scalars to output scalars.
156+ What to do when a value is outside the target's range. `None` means
157+ error; "clamp" clips to range; "wrap" uses modular arithmetic
158+ (only valid for integer types). Default is `None`.
159+ scalar_map : ScalarMap, ScalarMapJSON, or None
160+ Explicit mapping from input scalars to output scalars. Default is
161+ `None`.
162+
163+ Attributes
164+ ----------
165+ dtype : ZDType
166+ Resolved target data type (a `ZDType` instance, regardless of
167+ whether the constructor received a string or a `ZDType`).
168+ rounding : RoundingMode
169+ The rounding mode, as supplied to the constructor.
170+ out_of_range : OutOfRangeMode or None
171+ The out-of-range behaviour, as supplied to the constructor.
172+ scalar_map : ScalarMap or None
173+ Parsed scalar map (always normalized to `ScalarMap` form).
159174
160175 References
161176 ----------
0 commit comments