Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed Sep 29, 2023
1 parent 55a1ea9 commit 5710b12
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion covalent/_shared_files/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self) -> None:
self.generate_default_config()

try:
with open(self.config_file, "r") as f:
with open(self.config_file, "r"):
pass

self.update_config()
Expand Down
2 changes: 1 addition & 1 deletion covalent/_workflow/depsbash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

def apply_bash_commands(commands):
for cmd in commands:
proc = subprocess.run(
subprocess.run(
cmd, stdin=subprocess.DEVNULL, shell=True, capture_output=True, check=True, text=True
)

Expand Down
12 changes: 6 additions & 6 deletions covalent/executor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ def execute(
output: The result of the function execution.
"""

dispatch_info = DispatchInfo(dispatch_id)
fn_version = function.args[0].python_version
DispatchInfo(dispatch_id)
function.args[0].python_version
self._task_stdout = io.StringIO()
self._task_stderr = io.StringIO()

Expand All @@ -396,10 +396,10 @@ def execute(
self.setup(task_metadata=task_metadata)
result = self.run(function, args, kwargs, task_metadata)
job_status = RESULT_STATUS.COMPLETED
except TaskRuntimeError as err:
except TaskRuntimeError:
job_status = RESULT_STATUS.FAILED
result = None
except TaskCancelledError as err:
except TaskCancelledError:
job_status = RESULT_STATUS.CANCELLED
result = None
finally:
Expand Down Expand Up @@ -655,10 +655,10 @@ async def execute(
await self.setup(task_metadata=task_metadata)
result = await self.run(function, args, kwargs, task_metadata)
job_status = RESULT_STATUS.COMPLETED
except TaskCancelledError as err:
except TaskCancelledError:
job_status = RESULT_STATUS.CANCELLED
result = None
except TaskRuntimeError as err:
except TaskRuntimeError:
job_status = RESULT_STATUS.FAILED
result = None
finally:
Expand Down
2 changes: 1 addition & 1 deletion covalent/executor/executor_plugins/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(
if not scheduler_address:
try:
scheduler_address = get_config("dask.scheduler_address")
except KeyError as ex:
except KeyError:
app_log.debug(
"No dask scheduler address found in config. Address must be set manually."
)
Expand Down
4 changes: 2 additions & 2 deletions covalent_dispatcher/_cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _graceful_start(
try:
requests.get(dispatcher_addr, timeout=1)
up = True
except requests.exceptions.ConnectionError as err:
except requests.exceptions.ConnectionError:
time.sleep(1)

Path(get_config("dispatcher.cache_dir")).mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -649,7 +649,7 @@ def status() -> None:
try:
response = requests.get(f"http://localhost:{port}/api/triggers/status", timeout=1)
trigger_status = response.json()["status"]
except requests.exceptions.ConnectionError as err:
except requests.exceptions.ConnectionError:
trigger_status = "stopped"

if trigger_status == "running":
Expand Down
1 change: 0 additions & 1 deletion covalent_ui/api/v1/data_layer/summary_dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def get_summary(
Return:
List of top most Lattices and count
"""
result = None

status_filters = self.get_filters(status_filter)

Expand Down
2 changes: 1 addition & 1 deletion tests/covalent_dispatcher_tests/_cli/groups/db_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_migration_success(mocker):
runner = CliRunner()
db_mock = Mock()
mocker.patch.object(DataStore, "factory", lambda: db_mock)
res = runner.invoke(migrate, catch_exceptions=False)
runner.invoke(migrate, catch_exceptions=False)
db_mock.run_migrations.assert_called_once()


Expand Down

0 comments on commit 5710b12

Please sign in to comment.