From dc521d0c4bb9dde02d64efb79952bb0a4d2f3566 Mon Sep 17 00:00:00 2001 From: Elizabeth Adhiambo <100125026+Liz-Adhiambo@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:51:34 +0000 Subject: [PATCH] Reduce flake8 max-line-length to 146 (#3203) --- .flake8 | 2 +- parsl/addresses.py | 4 +++- parsl/dataflow/dflow.py | 3 ++- parsl/monitoring/db_manager.py | 6 ++++-- parsl/monitoring/monitoring.py | 3 ++- parsl/monitoring/visualization/views.py | 3 ++- parsl/tests/configs/user_opts.py | 3 ++- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.flake8 b/.flake8 index b78c9f5bf5..7ea92ca6ac 100644 --- a/.flake8 +++ b/.flake8 @@ -8,7 +8,7 @@ # W504: line break after binary operator # (Raised by flake8 even when it is followed) ignore = E126, E402, E129, W504 -max-line-length = 147 +max-line-length = 146 exclude = test_import_fail.py, parsl/executors/workqueue/parsl_coprocess.py # E741 disallows ambiguous single letter names which look like numbers diff --git a/parsl/addresses.py b/parsl/addresses.py index 424075006b..a75d69ddb8 100644 --- a/parsl/addresses.py +++ b/parsl/addresses.py @@ -81,7 +81,9 @@ def address_by_hostname() -> str: def address_by_interface(ifname: str) -> str: """Returns the IP address of the given interface name, e.g. 'eth0' - This is from a Stack Overflow answer: https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-of-eth0-in-python#24196955 + This is taken from a Stack Overflow answer: + https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-of-eth0-in-python#24196955 + Parameters ---------- diff --git a/parsl/dataflow/dflow.py b/parsl/dataflow/dflow.py index a22500e2c3..10942c0968 100644 --- a/parsl/dataflow/dflow.py +++ b/parsl/dataflow/dflow.py @@ -1171,7 +1171,8 @@ def wait_for_current_tasks(self) -> None: fut = task_record['app_fu'] if not fut.done(): fut.exception() - # now app future is done, poll until DFK state is final: a DFK state being final and the app future being done do not imply each other. + # now app future is done, poll until DFK state is final: a + # DFK state being final and the app future being done do not imply each other. while task_record['status'] not in FINAL_STATES: time.sleep(0.1) diff --git a/parsl/monitoring/db_manager.py b/parsl/monitoring/db_manager.py index eec2b4323a..ff794bf60d 100644 --- a/parsl/monitoring/db_manager.py +++ b/parsl/monitoring/db_manager.py @@ -633,7 +633,8 @@ def _update(self, table: str, columns: List[str], messages: List[MonitoringMessa # if retried - for example, the database being locked because someone else is readying # the tables we are trying to write to. If that assumption is wrong, then this loop # may go on forever. - logger.warning("Got a database OperationalError. Ignoring and retrying on the assumption that it is recoverable: {}".format(e)) + logger.warning("Got a database OperationalError. " + "Ignoring and retrying on the assumption that it is recoverable: {}".format(e)) self.db.rollback() time.sleep(1) # hard coded 1s wait - this should be configurable or exponential backoff or something @@ -660,7 +661,8 @@ def _insert(self, table: str, messages: List[MonitoringMessage]) -> None: done = True except sa.exc.OperationalError as e: # hoping that this is a database locked error during _update, not some other problem - logger.warning("Got a database OperationalError. Ignoring and retrying on the assumption that it is recoverable: {}".format(e)) + logger.warning("Got a database OperationalError. " + "Ignoring and retrying on the assumption that it is recoverable: {}".format(e)) self.db.rollback() time.sleep(1) # hard coded 1s wait - this should be configurable or exponential backoff or something except KeyboardInterrupt: diff --git a/parsl/monitoring/monitoring.py b/parsl/monitoring/monitoring.py index 0c17f460bd..2070727d27 100644 --- a/parsl/monitoring/monitoring.py +++ b/parsl/monitoring/monitoring.py @@ -449,7 +449,8 @@ def start(self, # but there is no verification that the message # received from ic_channel.recv_pyobj() is actually # of that type. - self.logger.error(f"Discarding message from interchange with unknown type {msg[0].value}") # type: ignore[unreachable] + self.logger.error("Discarding message " # type: ignore[unreachable] + f"from interchange with unknown type {msg[0].value}") except zmq.Again: pass except Exception: diff --git a/parsl/monitoring/visualization/views.py b/parsl/monitoring/visualization/views.py index 94ae4d2865..5489da2a03 100644 --- a/parsl/monitoring/visualization/views.py +++ b/parsl/monitoring/visualization/views.py @@ -8,7 +8,8 @@ from parsl.monitoring.visualization.plots.default.workflow_plots import task_gantt_plot, task_per_app_plot, workflow_dag_plot from parsl.monitoring.visualization.plots.default.task_plots import time_series_memory_per_task_plot -from parsl.monitoring.visualization.plots.default.workflow_resource_plots import resource_distribution_plot, resource_efficiency, worker_efficiency +from parsl.monitoring.visualization.plots.default.workflow_resource_plots import (resource_distribution_plot, + resource_efficiency, worker_efficiency) dummy = True diff --git a/parsl/tests/configs/user_opts.py b/parsl/tests/configs/user_opts.py index 979d834e49..ec39d4e7ab 100644 --- a/parsl/tests/configs/user_opts.py +++ b/parsl/tests/configs/user_opts.py @@ -60,7 +60,8 @@ # 'username': OSG_USERNAME, # 'script_dir': '/home/{}/parsl_scripts'.format(OSG_USERNAME), # 'scheduler_options': "", - # 'worker_init' : 'module load python/3.5.2; python3 -m venv parsl_env; source parsl_env/bin/activate; python3 -m pip install parsl==0.5.2' + # 'worker_init' : 'module load python/3.5.2; python3 -m venv parsl_env; + # source parsl_env/bin/activate; python3 -m pip install parsl==0.5.2' # }, # 'swan': { # 'username': SWAN_USERNAME,