Skip to content

Commit

Permalink
fixing chunk size for single planes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Feb 16, 2024
1 parent fcd47a6 commit 667d203
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions python/neuroglancer/write_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,11 @@ def write(self, path: Union[str, pathlib.Path]):
sharding_spec = choose_output_spec(len(self.annotations), total_ann_bytes)

# calculate the number of chunks in each dimension
num_chunks = np.max(
np.full(self.upper_bound.shape, 1, dtype=int),
np.ceil((self.upper_bound - self.lower_bound) / self.chunk_size).astype(
int
),
)
num_chunks = np.ceil(
(self.upper_bound - self.lower_bound) / self.chunk_size
).astype(int)

np.maximum(num_chunks, np.full(num_chunks.shape, 1, dtype=int))

# make directories
os.makedirs(path, exist_ok=True)
Expand Down

0 comments on commit 667d203

Please sign in to comment.