Skip to content

Commit

Permalink
Respond to PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aliddell committed Dec 17, 2024
1 parent 16e9b61 commit 6d877d8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 26 deletions.
14 changes: 8 additions & 6 deletions examples/python/zarrv2-compressed-s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
)


def make_sample_data():
return np.random.randint(
0, 65535,
(32, 3, 48, 64), # Shape matches chunk sizes
dtype=np.int32
)

def main():
settings = StreamSettings()

Expand Down Expand Up @@ -66,12 +73,7 @@ def main():

# Create and write sample data
for i in range(10):
data = np.random.randint(
0, 65535,
(32, 3, 48, 64), # Shape matches chunk sizes
dtype=np.int32
)
stream.append(data)
stream.append(make_sample_data())


if __name__ == "__main__":
Expand Down
14 changes: 8 additions & 6 deletions examples/python/zarrv2-raw-filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
)


def make_sample_data():
return np.random.randint(
0, 65535,
(32, 48, 64), # Shape matches chunk size for time dimension
dtype=np.int32
)

def main():
# Configure stream settings
settings = StreamSettings()
Expand Down Expand Up @@ -43,12 +50,7 @@ def main():

# Create and write sample data
for i in range(10):
data = np.random.randint(
0, 65535,
(32, 48, 64), # Shape matches chunk size for time dimension
dtype=np.int32
)
stream.append(data)
stream.append(make_sample_data())


if __name__ == "__main__":
Expand Down
16 changes: 9 additions & 7 deletions examples/python/zarrv3-compressed-filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
)


def make_sample_data():
return np.random.randint(
0, 65535,
(5, 4, 2, 48, 64), # Shape matches chunk sizes
dtype=np.uint16
)

def main():
settings = StreamSettings()

Expand Down Expand Up @@ -63,13 +70,8 @@ def main():
# Create stream
stream = ZarrStream(settings)

# Create and write sample data
data = np.random.randint(
0, 65535,
(5, 4, 2, 48, 64), # Shape matches chunk sizes
dtype=np.uint16
)
stream.append(data)
# Write sample data
stream.append(make_sample_data())


if __name__ == "__main__":
Expand Down
16 changes: 9 additions & 7 deletions examples/python/zarrv3-raw-s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
)


def make_sample_data():
return np.random.randint(
0, 65535,
(5, 2, 48, 64), # Shape matches chunk sizes
dtype=np.uint16
)

def main():
settings = StreamSettings()

Expand Down Expand Up @@ -56,13 +63,8 @@ def main():
# Create stream
stream = ZarrStream(settings)

# Create and write sample data
data = np.random.randint(
0, 65535,
(5, 2, 48, 64), # Shape matches chunk sizes
dtype=np.uint16
)
stream.append(data)
# Write sample data
stream.append(make_sample_data())


if __name__ == "__main__":
Expand Down

0 comments on commit 6d877d8

Please sign in to comment.