Skip to content

Commit

Permalink
chore: set get_bounds bounds to be large for const backend
Browse files Browse the repository at this point in the history
  • Loading branch information
dodamih committed Jun 10, 2024
1 parent f7f9ebd commit 4c5f64b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zetta_utils/layer/volumetric/constant/backend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=missing-docstring
from __future__ import annotations

import sys
from typing import Literal, Union

import attrs
Expand All @@ -11,6 +12,8 @@

from .. import VolumetricBackend, VolumetricIndex

MAXSIZE_HALF = (sys.maxsize + 1) // 2


@attrs.mutable
class ConstantVolumetricBackend(VolumetricBackend): # pylint: disable=too-few-public-methods
Expand Down Expand Up @@ -106,7 +109,11 @@ def get_dataset_size(self, resolution: Vec3D) -> Vec3D[int]: # pragma: no cover
return Vec3D[int](0, 0, 0)

def get_bounds(self, resolution: Vec3D) -> VolumetricIndex: # pragma: no cover
return VolumetricIndex.from_coords((0, 0, 0), (0, 0, 0), Vec3D[int](1, 1, 1))
return VolumetricIndex.from_coords(
(-MAXSIZE_HALF, -MAXSIZE_HALF, -MAXSIZE_HALF),
(MAXSIZE_HALF, MAXSIZE_HALF, MAXSIZE_HALF),
Vec3D[int](1, 1, 1),
)

def get_chunk_aligned_index(
self, idx: VolumetricIndex, mode: Literal["expand", "shrink", "round"]
Expand Down

0 comments on commit 4c5f64b

Please sign in to comment.