Skip to content

Commit

Permalink
chore: black reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
supersergiy committed Jan 28, 2025
1 parent 31939fa commit 2c30e1e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions tests/unit/layer/volumetric/cloudvol/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def test_cv_backend_write_scalar(clear_caches_reset_mocks, mocker):


def test_cv_backend_read_uint63(clear_caches_reset_mocks, mocker):
data_read = np.array([[[[2**63 - 1]]]], dtype=np.uint64)
expected = np.array([[[[2**63 - 1]]]], dtype=np.int64)
data_read = np.array([[[[2 ** 63 - 1]]]], dtype=np.uint64)
expected = np.array([[[[2 ** 63 - 1]]]], dtype=np.int64)
cv_m = mocker.MagicMock()
cv_m.__getitem__ = mocker.MagicMock(return_value=data_read)
mocker.patch("cloudvolume.CloudVolume.__new__", return_value=cv_m)
Expand All @@ -222,8 +222,8 @@ def test_cv_backend_write_scalar_uint63(clear_caches_reset_mocks, mocker):
cv_m.dtype = "uint64"
mocker.patch("cloudvolume.CloudVolume.__new__", return_value=cv_m)
cvb = CVBackend(path=LAYER_SCRATCH0_PATH, info_spec=info_spec, on_info_exists="overwrite")
value = np.array([2**63 - 1], dtype=np.int64)
expected_written = np.uint64(2**63 - 1)
value = np.array([2 ** 63 - 1], dtype=np.int64)
expected_written = np.uint64(2 ** 63 - 1)

index = VolumetricIndex(
bbox=BBox3D.from_slices((slice(0, 1), slice(0, 1), slice(0, 1))),
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/tensor_ops/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def test_get_field_from_matrix_exceptions(mat, size):
[[[[nan, nan], [0.0, nan]], [[nan, nan], [-1.0, nan]]]], dtype=torch.float32
),
],
# Two vectors, same target pixel -- should average
[
[
Expand All @@ -267,7 +266,6 @@ def test_get_field_from_matrix_exceptions(mat, size):
[[[[0.0, nan], [nan, nan]], [[0.0, nan], [nan, nan]]]], dtype=torch.float32
),
],
# Annotation outside ROI
[
[
Expand Down
6 changes: 3 additions & 3 deletions zetta_utils/geometry/bbox_strider.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def __attrs_post_init__(self) -> None:
object.__setattr__(self, "stride", superchunk_size)
object.__setattr__(self, "mode", "exact")
object.__setattr__(self, "max_superchunk_size", None)
object.__setattr__(self,
"stride_start_offset",
self.bbox_snapped.start / self.resolution)
object.__setattr__(
self, "stride_start_offset", self.bbox_snapped.start / self.resolution
)
object.__setattr__(self, "stride_start_offset_in_unit", self.bbox_snapped.start)
self.__attrs_post_init__()

Expand Down
2 changes: 1 addition & 1 deletion zetta_utils/layer/volumetric/cloudvol/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
_cv_cache: cachetools.LRUCache = cachetools.LRUCache(maxsize=16)
_cv_cached: Dict[str, set] = {}

IN_MEM_CACHE_NUM_BYTES_PER_CV = 128 * 1024**2
IN_MEM_CACHE_NUM_BYTES_PER_CV = 128 * 1024 ** 2

# To avoid reloading info file - note that an empty provenance is passed
# since otherwise the CloudVolume's __new__ will download the provenance
Expand Down

0 comments on commit 2c30e1e

Please sign in to comment.