Skip to content

Commit

Permalink
PEP8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Aug 20, 2024
1 parent 002d107 commit ab1855c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions jwql/jwql_monitors/generate_preview_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def check_existence(file_list, outdir):
# If filename_parser() does not recognize the filename, return False
if not file_parts['recognized_filename']:
logging.warning((f'While running checking_existence() for a preview image for {file_list[0]}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
return False

if file_parts['detector'].upper() in NIRCAM_SHORTWAVE_DETECTORS:
Expand Down Expand Up @@ -266,7 +266,7 @@ def create_dummy_filename(filelist):
else:
# If filename_parser() does not recognize the file, skip it
logging.warning((f'While using {infile} to create a dummy filename in create_dummy_filename(), the '
'filename parser failed.'))
'filename parser failed.'))
continue
det_string_list.append(det_string)
modules.append(det_string[3].upper())
Expand Down Expand Up @@ -327,7 +327,7 @@ def create_mosaic(filenames):
else:
# If filename_parser() does not recognize the file, skip it.
logging.warning((f'While running create_mosaic() using {file_list[0]}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
pass
data_lower_left.append((image.xstart, image.ystart))

Expand Down Expand Up @@ -674,7 +674,7 @@ def group_filenames(filenames):
filename_dict = filename_parser(os.path.basename(filename))
if not filename_dict['recognized_filename']:
logging.warning((f'While running generate_preview_images.group_filenames() on {filename}, the '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
break

# If the filename was already involved in a match, then skip
Expand Down Expand Up @@ -760,7 +760,7 @@ def process_program(program, overwrite):
filtered_filenames.append(filename)
else:
logging.warning((f'While running generate_preview_images.process_program() on {filename}, the '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
filenames = filtered_filenames

logging.info('Found {} filenames'.format(len(filenames)))
Expand All @@ -782,7 +782,7 @@ def process_program(program, overwrite):
# In this case, the filename_parser failed to recognize the filename
identifier = os.path.basename(filename).split('.fits')[0]
logging.warning((f'While running generate_preview_images.process_program() on filtered filename {filename}, the '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
preview_output_directory = os.path.join(SETTINGS['preview_image_filesystem'], identifier)
thumbnail_output_directory = os.path.join(SETTINGS['thumbnail_filesystem'], identifier)

Expand Down
2 changes: 1 addition & 1 deletion jwql/website/apps/jwql/archive_database_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_updates(update_database):
rootnames.append(rootname)
else:
logging.warning((f'While running get_updates() to update the RootfileInfo tables, {rootname}, '
'was not recognized by the filename_parser().'))
'was not recognized by the filename_parser().'))
pass

if len(filenames) > 0:
Expand Down
12 changes: 6 additions & 6 deletions jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ def get_image_info(file_root):
else:
# If the filename parser does not recognize the file, skip it
logging.warning((f'While running get_image_info() on {filename}, the '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
continue

# For crf or crfints suffixes, we need to also include the association value
Expand Down Expand Up @@ -1724,7 +1724,7 @@ def get_proposal_info(filepaths):
obsnums.append(obs)
else:
logging.warning((f'While running get_proposal_info() for a program {proposal}, {fname} '
'was not recognized by the filename_parser().'))
'was not recognized by the filename_parser().'))

obsnums = sorted(obsnums)
observations.extend(obsnums)
Expand Down Expand Up @@ -2166,7 +2166,7 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
all_obs.append(file_info['observation'])
else:
logging.warning((f'While running thumbnails_ajax() on root {root}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))

obs_list = sorted(list(set(all_obs)))

Expand Down Expand Up @@ -2205,7 +2205,7 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
'visit_group': rootname[14:16],
'group_root': rootname[:26]}
logging.warning((f'While running thumbnails_ajax() on rootname {rootname}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))

# Get list of available filenames and exposure start times. All files with a given
# rootname will have the same exposure start time, so just keep the first.
Expand Down Expand Up @@ -2353,7 +2353,7 @@ def thumbnails_query_ajax(rootnames):
exp_groups.add(filename_dict['group_root'])
else:
logging.warning((f'While running thumbnails_query_ajax() on rootname {rootname}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
continue

try:
Expand Down Expand Up @@ -2390,7 +2390,7 @@ def thumbnails_query_ajax(rootnames):
data_dict['file_data'][rootname]['suffixes'].append(suffix)
else:
logging.warning((f'While running thumbnails_query_ajax() on filename {filename}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
continue

data_dict['file_data'][rootname]['thumbnail'] = get_thumbnail_by_rootname(rootname)
Expand Down
2 changes: 1 addition & 1 deletion jwql/website/apps/jwql/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def clean_search(self):
else:
# If the filename is not recognized by filename_parser(), skip it.
logging.warning((f'While running FileSearchForm.clean_search() on {file}, '
'filename_parser() failed to recognize the file pattern.'))
'filename_parser() failed to recognize the file pattern.'))
continue

# sort lists so first observation is available when link is clicked.
Expand Down

0 comments on commit ab1855c

Please sign in to comment.