diff --git a/jwql/jwql_monitors/monitor_filesystem.py b/jwql/jwql_monitors/monitor_filesystem.py index 5fb99d628..a78711e5d 100755 --- a/jwql/jwql_monitors/monitor_filesystem.py +++ b/jwql/jwql_monitors/monitor_filesystem.py @@ -75,6 +75,7 @@ THUMBNAILS = SETTINGS['thumbnail_filesystem'] LOGS = SETTINGS['log_dir'] + def files_per_filter(): """Querying MAST (rather than looping through the filesystem), determine how many files use each filter for each instrument. Note that thiw function takes @@ -94,7 +95,7 @@ def files_per_filter(): for fname in FILTERS_PER_INSTRUMENT[instrument]: # note that this does not include pupil wheel-based filters obs = Observations.query_criteria(filters=fname, instrument_name=JWST_INSTRUMENT_NAMES_MIXEDCASE[instrument]) batch_size = 5 - batches = [obs[i:i+batch_size] for i in range(0, len(obs), batch_size)] + batches = [obs[i : i + batch_size] for i in range(0, len(obs), batch_size)] obs_table = [Observations.get_product_list(batch) for batch in batches] products = unique(vstack(obs_table), keys='productFilename') diff --git a/jwql/tests/test_utils.py b/jwql/tests/test_utils.py index 7effb4d0f..121a0dbec 100644 --- a/jwql/tests/test_utils.py +++ b/jwql/tests/test_utils.py @@ -512,32 +512,32 @@ def test_validate_config(): "host": "", "port": "" }, - "django_databases" : { + "django_databases": { "default": { - "ENGINE" : "", - "NAME" : "", - "USER" : "", - "PASSWORD" : "", - "HOST" : "", - "PORT" : "" + "ENGINE": "", + "NAME": "", + "USER": "", + "PASSWORD": "", + "HOST": "", + "PORT": "" }, "monitors": { - "ENGINE" : "", - "NAME" : "", - "USER" : "", - "PASSWORD" : "", - "HOST" : "", - "PORT" : "" + "ENGINE": "", + "NAME": "", + "USER": "", + "PASSWORD": "", + "HOST": "", + "PORT": "" } }, - "django_debug" : "", + "django_debug": "", "jwql_dir": "", "jwql_version": "", "server_type": "", "log_dir": "", "mast_token": "", "outputs": "", - "working" : "", + "working": "", "preview_image_filesystem": "", "filesystem": "", "setup_file": "", diff --git a/jwql/utils/utils.py b/jwql/utils/utils.py index b141f9ad0..d96388d9a 100644 --- a/jwql/utils/utils.py +++ b/jwql/utils/utils.py @@ -602,7 +602,7 @@ def filename_parser(filename): except AttributeError: filename_dict = {'recognized_filename': False} logging.exception((f'\nFile; {filename} was not recognized by filename_parser(). Update parser or ' - 'constants.py if it should be recognized.\n')) + 'constants.py if it should be recognized.\n')) return filename_dict