Skip to content

Commit

Permalink
style(black): format with black v24 (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonadoni committed Jan 29, 2024
1 parent 2c34634 commit 311e157
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
6 changes: 3 additions & 3 deletions reana/reana_benchmark/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def _clean_results(df: pd.DataFrame) -> pd.DataFrame:
df.loc[df["status"] == "created", "started"] = None
df.loc[df["status"] == "created", "ended"] = None
df["asked_to_start_date"] = df.apply(
lambda row: None
if pd.isna(row["asked_to_start_date"])
else row["asked_to_start_date"],
lambda row: (
None if pd.isna(row["asked_to_start_date"]) else row["asked_to_start_date"]
),
axis=1,
)

Expand Down
26 changes: 15 additions & 11 deletions reana/reana_dev/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,22 @@ def python_unit_tests(
" pip install . --upgrade".format(cmd_activate_venv),
"git clean -d -ff -x",
# Fix installation of r-w-e-snakemake test dependencies for macOS/brew
'{} && GRAPHVIZ_DIR="$(brew --prefix graphviz)" pip install pygraphviz==1.7 --global-option=build_ext --global-option="-I$GRAPHVIZ_DIR/include" --global-option="-L$GRAPHVIZ_DIR/lib"'.format(
cmd_activate_venv
)
if component == "reana-workflow-engine-snakemake"
and platform.system() == "Darwin"
else "",
(
'{} && GRAPHVIZ_DIR="$(brew --prefix graphviz)" pip install pygraphviz==1.7 --global-option=build_ext --global-option="-I$GRAPHVIZ_DIR/include" --global-option="-L$GRAPHVIZ_DIR/lib"'.format(
cmd_activate_venv
)
if component == "reana-workflow-engine-snakemake"
and platform.system() == "Darwin"
else ""
),
# Fix installation of r-commons test dependencies
'{} && pip install ".[cwl,snakemake,yadage]" --upgrade'.format(
cmd_activate_venv
)
if component == "reana-commons"
else "",
(
'{} && pip install ".[cwl,snakemake,yadage]" --upgrade'.format(
cmd_activate_venv
)
if component == "reana-commons"
else ""
),
# Now we can call installing regular test dependencies
'{} && pip install ".[tests]" --upgrade'.format(cmd_activate_venv),
"{} && {} ./run-tests.sh --check-pytest".format(
Expand Down
12 changes: 6 additions & 6 deletions reana/reana_dev/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ def get_example_reana_yaml_file_path(example, workflow_engine, compute_backend):
)
if not reana_yaml_filename:
reana_yaml_filename = "reana{workflow_engine}{compute_backend}.yaml".format(
workflow_engine=""
if workflow_engine == "serial"
else "-{}".format(workflow_engine),
compute_backend=""
if compute_backend == "kubernetes"
else "-{}".format(compute_backend),
workflow_engine=(
"" if workflow_engine == "serial" else "-{}".format(workflow_engine)
),
compute_backend=(
"" if compute_backend == "kubernetes" else "-{}".format(compute_backend)
),
)
reana_yaml_filename_path = get_srcdir(example) + os.sep + reana_yaml_filename
try:
Expand Down
6 changes: 3 additions & 3 deletions reana/reana_dev/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ def execute_parallel(
total=len(fn_calls),
done=len(done),
failed=len(failed),
remaining=len(submitted) + len(pending)
if not failed
else len(submitted),
remaining=(
len(submitted) + len(pending) if not failed else len(submitted)
),
cancelled=0 if not failed else len(pending),
)
progress_callback(status)
Expand Down

0 comments on commit 311e157

Please sign in to comment.