Skip to content

Commit ff4f335

Browse files
committed
Adapt test client to handle reduction over axes
1 parent 1c2d841 commit ff4f335

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

scripts/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def get_args() -> argparse.Namespace:
3636
parser.add_argument("--offset", type=int)
3737
parser.add_argument("--size", type=int)
3838
parser.add_argument("--shape", type=str)
39+
parser.add_argument("--axis", type=int)
3940
parser.add_argument("--order", default="C") #, choices=["C", "F"]) allow invalid for testing
4041
parser.add_argument("--selection", type=str)
4142
parser.add_argument("--compression", type=str)
@@ -72,6 +73,8 @@ def build_request_data(args: argparse.Namespace) -> dict:
7273
request_data["byte_order"] = args.byte_order
7374
if args.shape:
7475
request_data["shape"] = json.loads(args.shape)
76+
if args.axis is not None:
77+
request_data["axis"] = args.axis
7578
if args.selection:
7679
request_data["selection"] = json.loads(args.selection)
7780
if args.compression:

scripts/parallel-client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def get_args() -> argparse.Namespace:
4848
parser.add_argument("--offset", type=int)
4949
parser.add_argument("--size", type=int)
5050
parser.add_argument("--shape", type=str)
51+
parser.add_argument("--axis", type=int)
5152
parser.add_argument("--order", default="C") #, choices=["C", "F"]) allow invalid for testing
5253
parser.add_argument("--selection", type=str)
5354
parser.add_argument("--compression", type=str)
@@ -90,6 +91,8 @@ def build_request_data(args: argparse.Namespace) -> dict:
9091
request_data["byte_order"] = args.byte_order
9192
if args.shape:
9293
request_data["shape"] = json.loads(args.shape)
94+
if args.axis is not None:
95+
request_data["axis"] = args.axis
9396
if args.selection:
9497
request_data["selection"] = json.loads(args.selection)
9598
if args.compression:

scripts/upload_sample_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
COMPRESSION_ALGS = [None, "gzip", "zlib"]
1212
FILTER_ALGS = [None, "shuffle"]
1313

14-
#Use enum which also subclasses string type so that
14+
# Use enum which also subclasses string type so that
1515
# auto-generated OpenAPI schema can determine allowed dtypes
1616
class AllowedDatatypes(str, Enum):
1717
""" Data types supported by active storage proxy """
@@ -31,7 +31,7 @@ def n_bytes(self):
3131
s3_fs = s3fs.S3FileSystem(key='minioadmin', secret='minioadmin', client_kwargs={'endpoint_url': S3_URL})
3232
bucket = pathlib.Path('sample-data')
3333

34-
#Make sure s3 bucket exists
34+
# Make sure s3 bucket exists
3535
try:
3636
s3_fs.mkdir(bucket)
3737
except FileExistsError:

0 commit comments

Comments
 (0)