Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] Bump pydra to 0.23 #1106

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions clinica/pydra/engine_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from os import PathLike
from typing import Optional

Expand Down Expand Up @@ -50,7 +52,7 @@ def list_workflow_inputs(wf: Workflow) -> dict:
return inputs


def run(wf: Workflow, n_procs: Optional[int] = None) -> Result:
def run(wf: Workflow, n_procs: int | None = None) -> Result:
"""Execute a Pydra workflow.

If the execution of the workflow fails, the
Expand All @@ -62,19 +64,19 @@ def run(wf: Workflow, n_procs: Optional[int] = None) -> Result:
The workflow to be executed.

n_procs : int, optional
The number of CPU cores to be used to run the workflow.
If None, all available cores will be used.
The number of CPU cores used to run the workflow concurrently.
If None, the workflow is run sequentially.

Returns
-------
Result :
The result of running the Workflow

"""
import re

try:
with Submitter(plugin="cf", n_procs=n_procs) as submitter:
submitter_args = {"plugin": "cf", "n_procs": n_procs} if n_procs else {"plugin": "serial"}
with Submitter(**submitter_args) as submitter:
submitter(wf)
except Exception as e:
path = re.search(r"/.*\.pklz", str(e))
Expand Down
2 changes: 1 addition & 1 deletion clinica/pydra/pet_linear/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def build_core_workflow(name: str = "core", parameters: dict = {}) -> Workflow:
name="Input",
fields=[
("_graph_checksums", ty.Any),
("T1w", str, {"mandatory": True}),
("T1w", str, {"help_string": "T1w", "mandatory": True}),
("pet", dict, {"tracer": parameters["acq_label"]}, {"mandatory": True}),
("t1w_to_mni", dict, {}, {"mandatory": True}),
],
Expand Down
2 changes: 1 addition & 1 deletion clinica/pydra/t1_linear/t1_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def build_core_workflow(name: str = "core", parameters={}) -> Workflow:

input_spec = pydra.specs.SpecInfo(
name="Input",
fields=[("T1w", str, {"mandatory": True})],
fields=[("T1w", str, {"help_string": "T1w", "mandatory": True})],
bases=(pydra.specs.BaseSpec,),
)

Expand Down
64 changes: 49 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ click-option-group = "^0.5"
xlrd = "*"
openpyxl = "*"
fsspec = "*"
pydra-nipype1 = "^0.2"
pydra = "^0.22"
pydra-nipype1 = "^0.3"
pydra = "^0.23"
pybids = "^0.16"
joblib = "^1.2.0"
attrs = ">=20.1.0"
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/pydra/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def pipeline():
def core_workflow():
input_spec = pydra.specs.SpecInfo(
name="Input",
fields=[("T1w", str, {"mandatory": True})],
fields=[("T1w", str, {"help_string": "T1w", "mandatory": True})],
bases=(pydra.specs.BaseSpec,),
)
wf = Workflow("smoothing_t1w", input_spec=input_spec)
Expand Down
Loading