Skip to content

Commit 0093daf

Browse files
committed
clean up reductionist
1 parent ca8e46d commit 0093daf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

activestorage/reductionist.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import numpy as np
1212
import requests
1313

14-
REDUCTIONIST_AXIS_READY = True
1514

1615
DEBUG = 0
1716

@@ -25,6 +24,8 @@ def get_session(username: str, password: str,
2524
:returns: a client session object.
2625
"""
2726
session = requests.Session()
27+
if username is None and password is None:
28+
return session
2829
session.auth = (username, password)
2930
session.verify = cacert or False
3031
return session
@@ -83,7 +84,6 @@ def reduce_chunk(session,
8384
chunk_selection,
8485
axis,
8586
storage_type=storage_type)
86-
print(f"Reductionist request data dictionary: {request_data}")
8787
if DEBUG:
8888
print(f"Reductionist request data dictionary: {request_data}")
8989
api_operation = "sum" if operation == "mean" else operation or "select"
@@ -206,9 +206,9 @@ def build_request_data(url: str,
206206
if any(missing):
207207
request_data["missing"] = encode_missing(missing)
208208

209-
if REDUCTIONIST_AXIS_READY:
209+
if axis is not None:
210210
request_data['axis'] = axis
211-
elif axis is not None and len(axis) != len(shape):
211+
elif len(axis) != len(shape):
212212
raise ValueError(
213213
"Can't reduce over axis subset unitl reductionist is ready")
214214

0 commit comments

Comments
 (0)