From 5e250644d73fc69f58e7485317cd112090e827c5 Mon Sep 17 00:00:00 2001 From: Teagan King <55458851+tnking97@users.noreply.github.com> Date: Fri, 23 Apr 2021 17:40:29 -0400 Subject: [PATCH] a few other flake8 items --- .../common_monitors/bias_monitor.py | 7 +++--- jwql/jwql_monitors/generate_preview_images.py | 2 +- jwql/website/apps/jwql/bokeh_dashboard.py | 22 +++++++++---------- style_guide/typing_demo/typing_demo_1.py | 2 +- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/jwql/instrument_monitors/common_monitors/bias_monitor.py b/jwql/instrument_monitors/common_monitors/bias_monitor.py index c7bc509ca..c80a702fc 100755 --- a/jwql/instrument_monitors/common_monitors/bias_monitor.py +++ b/jwql/instrument_monitors/common_monitors/bias_monitor.py @@ -282,10 +282,9 @@ def most_recent_search(self): where the bias monitor was run. """ - sub_query = session.query( - self.query_table.aperture, - func.max(self.query_table.end_time_mjd).label('maxdate') - ).group_by(self.query_table.aperture).subquery('t2') + sub_query = session.query(self.query_table.aperture, + func.max(self.query_table.end_time_mjd).label('maxdate') + ).group_by(self.query_table.aperture).subquery('t2') # Note that "self.query_table.run_monitor == True" below is # intentional. Switching = to "is" results in an error in the query. diff --git a/jwql/jwql_monitors/generate_preview_images.py b/jwql/jwql_monitors/generate_preview_images.py index 6253ffb6d..34339640e 100755 --- a/jwql/jwql_monitors/generate_preview_images.py +++ b/jwql/jwql_monitors/generate_preview_images.py @@ -611,7 +611,7 @@ def group_filenames(filenames): subgroup.append(file_to_match) else: - # filename_dict['filename_type'] may be 'guider' or 'time_series', for instance. Treat individually. + # filename_dict['filename_type'] may be 'guider' or 'time_series', for instance. Treat individually. matched_names.append(filename) subgroup.append(filename) diff --git a/jwql/website/apps/jwql/bokeh_dashboard.py b/jwql/website/apps/jwql/bokeh_dashboard.py index 02c55acf6..bf028fb5b 100644 --- a/jwql/website/apps/jwql/bokeh_dashboard.py +++ b/jwql/website/apps/jwql/bokeh_dashboard.py @@ -171,20 +171,18 @@ def dashboard_files_per_day(self): p2.line(x='date', y='used', source=source, color='#355C7D', line_dash='dashed', line_width=3, legend='Used Storage') tab2 = Panel(child=p2, title='Storage') - p1.xaxis.formatter = DatetimeTickFormatter( - hours=["%d %B %Y"], - days=["%d %B %Y"], - months=["%d %B %Y"], - years=["%d %B %Y"], - ) + p1.xaxis.formatter = DatetimeTickFormatter(hours=["%d %B %Y"], + days=["%d %B %Y"], + months=["%d %B %Y"], + years=["%d %B %Y"], + ) p1.xaxis.major_label_orientation = pi / 4 - p2.xaxis.formatter = DatetimeTickFormatter( - hours=["%d %B %Y"], - days=["%d %B %Y"], - months=["%d %B %Y"], - years=["%d %B %Y"], - ) + p2.xaxis.formatter = DatetimeTickFormatter(hours=["%d %B %Y"], + days=["%d %B %Y"], + months=["%d %B %Y"], + years=["%d %B %Y"], + ) p2.xaxis.major_label_orientation = pi / 4 tabs = Tabs(tabs=[tab1, tab2]) diff --git a/style_guide/typing_demo/typing_demo_1.py b/style_guide/typing_demo/typing_demo_1.py index e62c34b98..33c11e397 100644 --- a/style_guide/typing_demo/typing_demo_1.py +++ b/style_guide/typing_demo/typing_demo_1.py @@ -30,7 +30,7 @@ # For heterogeneous non-tuples, use Union. a_heterogeneous_list: List[Union[int, bool, str]] = [1, True, "jwql"] -a_heterogeneous_dict: Dict[Union[str, int], Union[bool, int]] = {"jwql": True, 1:1} +a_heterogeneous_dict: Dict[Union[str, int], Union[bool, int]] = {"jwql": True, 1: 1} # If a value can be None, use Optional maybe_a_string: Optional[str] = "jwql" if not a_bool else None