Auto format python, make sure it passes lint checks (#1401)

This commit is contained in:
Matt Weiden
2020-04-16 08:07:10 -07:00
committed by GitHub
parent 7e7ed74b92
commit 58e4c2489b
12 changed files with 66 additions and 78 deletions
+3 -5
View File
@@ -446,9 +446,7 @@ class AppConfig(object):
cpu_multiplier = self.diffexp__alg_cxg__cpu_multiplier
cpu_count = os.cpu_count()
max_workers = min(max_workers, cpu_multiplier * cpu_count)
diffexp_tiledb.set_config(
max_workers,
self.diffexp__alg_cxg__target_workunit)
diffexp_tiledb.set_config(max_workers, self.diffexp__alg_cxg__target_workunit)
def handle_adaptor(self, context):
# cxg
@@ -537,8 +535,8 @@ class AppConfig(object):
config["links"] = links
config["parameters"] = parameters
config["limits"] = {
'column_request_max': self.limits__column_request_max,
'diffexp_cellcount_max': self.limits__diffexp_cellcount_max,
"column_request_max": self.limits__column_request_max,
"diffexp_cellcount_max": self.limits__diffexp_cellcount_max,
}
return c
+1 -3
View File
@@ -43,9 +43,7 @@ class DataLocator:
# fsspec.filesystem will throw RuntimeError if the protocol is unsupported
if self.protocol == "s3" and region_name:
self.fs = fsspec.filesystem(
self.protocol, config_kwargs={"region_name": region_name}
)
self.fs = fsspec.filesystem(self.protocol, config_kwargs={"region_name": region_name})
else:
self.fs = fsspec.filesystem(self.protocol)
+5 -5
View File
@@ -27,23 +27,23 @@ class ImmutableKVCache(MutableMapping):
return self.cache[key]
if key not in self.factory_calls:
creation_thr = True
self.factory_calls[key] = {'cv': threading.Condition(), 'is_done': False, 'error': None}
self.factory_calls[key] = {"cv": threading.Condition(), "is_done": False, "error": None}
factory_calls = self.factory_calls[key]
# with the CV, create the value (or wait for it to be created)
cv = factory_calls['cv']
cv = factory_calls["cv"]
with cv:
if creation_thr:
try:
self.cache[key] = self.factory(key)
except Exception as e:
factory_calls['error'] = e
factory_calls["error"] = e
factory_calls['is_done'] = True
factory_calls["is_done"] = True
cv.notify_all()
else:
""" wait for the value to be available """
while not factory_calls['is_done']:
while not factory_calls["is_done"]:
cv.wait()
with self.lock:
+5 -7
View File
@@ -53,15 +53,15 @@ def _query_parameter_to_filter(args):
# on name and value.
try:
for key, value in args.items(multi=True):
axis, name = key.split(':')
axis, name = key.split(":")
if axis not in ("obs", "var"):
raise FilterError("unknown filter axis")
name = url_unquote(name)
current = filters[axis].setdefault(name, {"name": name})
val_split = value.split(',')
val_split = value.split(",")
if len(val_split) == 1:
if 'min' in current or 'max' in current:
if "min" in current or "max" in current:
raise FilterError("do not mix range and value filters")
value = url_unquote(value)
values = current.setdefault("values", [])
@@ -72,7 +72,7 @@ def _query_parameter_to_filter(args):
raise FilterError("duplicate range specification")
min = url_unquote(val_split[0])
max = url_unquote(val_split[1])
if min != '*':
if min != "*":
current["min"] = float(min)
if max != "*":
current["max"] = float(max)
@@ -89,9 +89,7 @@ def _query_parameter_to_filter(args):
for axis in ("obs", "var"):
axis_filter = filters[axis]
if len(axis_filter) > 0:
result[axis] = {
"annotation_value": [val for val in axis_filter.values()]
}
result[axis] = {"annotation_value": [val for val in axis_filter.values()]}
return result