Skip to content

Commit

Permalink
Reduce flake8 max-line-length to 146 (#3203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liz-Adhiambo authored Mar 18, 2024
1 parent 6e2e0dd commit dc521d0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion parsl/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
3 changes: 2 additions & 1 deletion parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 4 additions & 2 deletions parsl/monitoring/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion parsl/monitoring/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion parsl/monitoring/visualization/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion parsl/tests/configs/user_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dc521d0

Please sign in to comment.