Skip to content

Commit 0f909cb

Browse files
[pre-commit.ci] pre-commit autoupdate (#618)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a9a116d commit 0f909cb

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: check-yaml
1010
- id: check-added-large-files
1111
- repo: https://github.com/psf/black
12-
rev: 22.12.0
12+
rev: 23.1.0
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/codespell-project/codespell

pydra/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424

2525
def check_latest_version():
26-
2726
import etelemetry
2827

2928
return etelemetry.check_available_version("nipype/pydra", __version__, lgr=logger)

pydra/engine/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ def done(self):
696696

697697
def _combined_output(self, return_inputs=False):
698698
combined_results = []
699-
for (gr, ind_l) in self.state.final_combined_ind_mapping.items():
699+
for gr, ind_l in self.state.final_combined_ind_mapping.items():
700700
combined_results_gr = []
701701
for ind in ind_l:
702702
result = load_result(self.checksum_states(ind), self.cache_locations)
@@ -1253,7 +1253,7 @@ def create_dotfile(self, type="simple", export=None, name=None, output_dir=None)
12531253
for task in self.graph.nodes:
12541254
self.create_connections(task, detailed=True)
12551255
# adding wf outputs
1256-
for (wf_out, lf) in self._connections:
1256+
for wf_out, lf in self._connections:
12571257
self.graph.add_edges_description((self.name, wf_out, lf.name, lf.field))
12581258
dotfile = self.graph.create_dotfile_detailed(outdir=outdir, name=name)
12591259
else:

pydra/engine/graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def edges(self, edges):
8585
"""Add edges to the graph (nodes should be already set)."""
8686
if edges:
8787
edges = ensure_list(edges)
88-
for (nd_out, nd_in) in edges:
88+
for nd_out, nd_in in edges:
8989
if nd_out not in self.nodes or nd_in not in self.nodes:
9090
raise Exception(
9191
f"edge {(nd_out, nd_in)} can't be added to the graph"
@@ -131,7 +131,7 @@ def _create_connections(self):
131131
self.predecessors[nd.name] = []
132132
self.successors[nd.name] = []
133133

134-
for (nd_out, nd_in) in self.edges:
134+
for nd_out, nd_in in self.edges:
135135
self.predecessors[nd_in.name].append(nd_out)
136136
self.successors[nd_out.name].append(nd_in)
137137

@@ -148,7 +148,7 @@ def add_nodes(self, new_nodes):
148148
def add_edges(self, new_edges):
149149
"""Add new edges and sort the new graph."""
150150
self.edges = self._edges + ensure_list(new_edges)
151-
for (nd_out, nd_in) in ensure_list(new_edges):
151+
for nd_out, nd_in in ensure_list(new_edges):
152152
self.predecessors[nd_in.name].append(nd_out)
153153
self.successors[nd_out.name].append(nd_in)
154154
if self._sorted_nodes is not None:

pydra/engine/helpers_state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def remove_inp_from_splitter_rpn(splitter_rpn, inputs_to_remove):
237237
stack_inp = []
238238
stack_sgn = []
239239
from_last_sign = []
240-
for (ii, el) in enumerate(splitter_rpn_copy):
240+
for ii, el in enumerate(splitter_rpn_copy):
241241
# element is a sign
242242
if el == "." or el == "*":
243243
stack_sgn.append((ii, el))
@@ -589,7 +589,7 @@ def combine_final_groups(combiner, groups, groups_stack, keys):
589589
gr_final = list(gr_final)
590590
map_gr_nr = {nr: i for (i, nr) in enumerate(sorted(gr_final))}
591591
groups_final_map = {}
592-
for (inp, gr) in groups_final.items():
592+
for inp, gr in groups_final.items():
593593
if isinstance(gr, int):
594594
groups_final_map[inp] = map_gr_nr[gr]
595595
elif isinstance(gr, list):

pydra/engine/task.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ def _check_inputs(self):
654654
or "pydra.engine.specs.File" in str(fld.type)
655655
or "pydra.engine.specs.Directory" in str(fld.type)
656656
):
657-
658657
if fld.name == "image":
659658
continue
660659
file = Path(getattr(self.inputs, fld.name))

pydra/engine/tests/test_shelltask.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3251,6 +3251,7 @@ def test_shell_cmd_outputspec_8d(tmpdir, plugin, results_function):
32513251
"""
32523252
customised output_spec, adding Directory to the output named by input spec
32533253
"""
3254+
32543255
# For /tmp/some_dict/test this function returns "/test"
32553256
def get_lowest_directory(directory_path):
32563257
return str(directory_path).replace(str(Path(directory_path).parents[0]), "")
@@ -4395,7 +4396,8 @@ def test_shell_cmd_non_existing_outputs_1(tmpdir):
43954396

43964397
def test_shell_cmd_non_existing_outputs_2(tmpdir):
43974398
"""Checking that non existing output files do not return a phantom path,
4398-
but return NOTHING instead. This test has one existing and one non existing output file."""
4399+
but return NOTHING instead. This test has one existing and one non existing output file.
4400+
"""
43994401
input_spec = SpecInfo(
44004402
name="Input",
44014403
fields=[
@@ -4460,7 +4462,8 @@ def test_shell_cmd_non_existing_outputs_2(tmpdir):
44604462

44614463
def test_shell_cmd_non_existing_outputs_3(tmpdir):
44624464
"""Checking that non existing output files do not return a phantom path,
4463-
but return NOTHING instead. This test has an existing mandatory output and another non existing output file."""
4465+
but return NOTHING instead. This test has an existing mandatory output and another non existing output file.
4466+
"""
44644467
input_spec = SpecInfo(
44654468
name="Input",
44664469
fields=[
@@ -4886,7 +4889,6 @@ def formatter_1(in1, in2):
48864889

48874890
@no_win
48884891
def test_shellcommand_error_msg(tmpdir):
4889-
48904892
script_path = Path(tmpdir) / "script.sh"
48914893

48924894
with open(script_path, "w") as f:

pydra/engine/workers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,6 @@ async def submit_array_job(self, sargs, tasks_to_run, error_file):
758758
self.output_by_jobid[jobid] = (rc, stdout, stderr)
759759

760760
for task_pkl, ind, rerun in tasks_to_run:
761-
762761
self.jobid_by_task_uid[Path(task_pkl).parent.name] = jobid
763762

764763
if error_file:
@@ -813,7 +812,6 @@ async def _submit_job(
813812
await asyncio.sleep(self.poll_delay)
814813

815814
async def _poll_job(self, jobid, cache_dir):
816-
817815
cmd = (f"qstat", "-j", jobid)
818816
logger.debug(f"Polling job {jobid}")
819817
rc, stdout, stderr = await read_and_display_async(*cmd, hide_display=True)

0 commit comments

Comments
 (0)