Skip to content

Commit

Permalink
Clean up flak8 messages
Browse files Browse the repository at this point in the history
With the addition of flak8-bugbear in hound these changes will make sure all the new rules are followed
  • Loading branch information
CKrawczyk committed Jan 8, 2020
1 parent f95c4b3 commit 3686570
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion panoptes_aggregation/csv_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def flatten_data(data, json_column='data'):

def unflatten_data(data, json_column='data', renest=True):
data_dict = {}
for name, value in data.iteritems():
for name, value in data.items():
if ('{0}.'.format(json_column) in name) and (pandas.notnull(value)):
key = name.split('{0}.'.format(json_column))[1]
try:
Expand Down
2 changes: 1 addition & 1 deletion panoptes_aggregation/extractors/point_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def point_extractor(classification, **kwargs):
extract = OrderedDict()
for annotation in classification['annotations']:
task_key = annotation['task']
for idx, value in enumerate(annotation['value']):
for _, value in enumerate(annotation['value']):
key = '{0}_tool{1}'.format(task_key, value['tool'])
if ('x' in value) and ('y' in value):
extract.setdefault('{0}_x'.format(key), []).append(value['x'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def point_extractor_by_frame(classification, **kwargs):
extract = OrderedDict()
for annotation in classification['annotations']:
task_key = annotation['task']
for idx, value in enumerate(annotation['value']):
for _, value in enumerate(annotation['value']):
frame = 'frame{0}'.format(value['frame'])
extract.setdefault(frame, {})
key = '{0}_tool{1}'.format(task_key, value['tool'])
Expand Down
2 changes: 1 addition & 1 deletion panoptes_aggregation/reducers/subtask_reducer_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def wrapper(data, **kwargs):
output[frame_key].setdefault(k, [])
if k in frame:
output[frame_key][k] += frame[k]
for frame_key, frame in output.items():
for frame_key, _frame in output.items():
for kd, kl, kc, df in zip(keys_details, keys_labels, keys_clusters, details_functions.keys()):
detail_array = np.array(output[frame_key][kd])
if kl in output[frame_key]:
Expand Down
2 changes: 1 addition & 1 deletion panoptes_aggregation/scripts/path_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, type='file'):
None: don't care
dash_ok: whether to allow "-" as stdin/stdout
'''
assert type in ('file', 'dir', 'symlink', None) or hasattr(type, '__call__')
assert type in ('file', 'dir', 'symlink', None) or callable(type)
self._type = type

def __call__(self, string):
Expand Down

0 comments on commit 3686570

Please sign in to comment.