Skip to content

Commit

Permalink
feat: better scale inheritence
Browse files Browse the repository at this point in the history
  • Loading branch information
supersergiy committed Feb 4, 2025
1 parent 6646edf commit dad9455
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions zetta_utils/layer/precomputed.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ def get_info(path: str) -> dict[str, Any]:
PrecomputedAnnotationDType = Literal["POINT", "LINE", "AXIS_ALIGNED_BOUNDING_BOX", "ELLIPSOID"]
PrecomputedDType = Union[PrecomputedVolumeDType, PrecomputedAnnotationDType]

NON_INHERITABLE_SCALE_KEYS = [
"sharding",
"encoding",
"voxel_offset",
"size",
"chunk_sizes",
"resolution",
"key",
]


@attrs.mutable
class InfoSpecParams:
Expand Down Expand Up @@ -212,6 +222,15 @@ def from_reference(
encoding = reference_scale["encoding"]
if chunk_size is None:
chunk_size = reference_scale["chunk_sizes"][0]

if extra_scale_data is None:
extra_scale_data = {}
extra_scale_data = {
**{
k: v for k, v in reference_scale.items() if k not in NON_INHERITABLE_SCALE_KEYS
},
**extra_scale_data,
}
else:
missing_params = []
if type is None:
Expand Down

0 comments on commit dad9455

Please sign in to comment.