Skip to content

Commit ab5bf22

Browse files
committed
fixed up import locations in tutorials
1 parent dcc23f8 commit ab5bf22

File tree

7 files changed

+25
-24
lines changed

7 files changed

+25
-24
lines changed

docs/source/tutorial/1-getting-started.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
"metadata": {},
304304
"outputs": [],
305305
"source": [
306-
"from pydra.utils import default_run_cache_dir\n",
306+
"from pydra.utils.general import default_run_cache_dir\n",
307307
"\n",
308308
"my_cache_dir = Path(\"~/new-pydra-cache\").expanduser()\n",
309309
"my_cache_dir.mkdir(exist_ok=True)\n",

docs/source/tutorial/2-advanced-execution.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@
146146
"metadata": {},
147147
"outputs": [],
148148
"source": [
149-
"from pydra.engine.workers import ConcurrentFuturesWorker\n",
149+
"from pydra.workers import cf\n",
150150
"\n",
151151
"ten_to_the_power = TenToThePower().split(p=[6, 7, 8, 9, 10])\n",
152152
"\n",
153153
"# Run the 5 tasks in parallel split across 3 processes\n",
154-
"outputs = ten_to_the_power(worker=ConcurrentFuturesWorker(n_procs=3))\n",
154+
"outputs = ten_to_the_power(worker=cf.Worker(n_procs=3))\n",
155155
"\n",
156156
"p6, p7, p8, p9, p10 = outputs.out\n",
157157
"\n",
@@ -415,7 +415,7 @@
415415
],
416416
"metadata": {
417417
"kernelspec": {
418-
"display_name": "wf12",
418+
"display_name": "wf13",
419419
"language": "python",
420420
"name": "python3"
421421
},
@@ -429,7 +429,7 @@
429429
"name": "python",
430430
"nbconvert_exporter": "python",
431431
"pygments_lexer": "ipython3",
432-
"version": "3.12.5"
432+
"version": "3.13.1"
433433
}
434434
},
435435
"nbformat": 4,

docs/source/tutorial/3-troubleshooting.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"metadata": {},
153153
"outputs": [],
154154
"source": [
155-
"from pydra.utils import default_run_cache_dir\n",
155+
"from pydra.utils.general import default_run_cache_dir\n",
156156
"import cloudpickle as cp\n",
157157
"from pprint import pprint\n",
158158
"from pydra.tasks.testing import Divide\n",
@@ -241,7 +241,7 @@
241241
],
242242
"metadata": {
243243
"kernelspec": {
244-
"display_name": "wf12",
244+
"display_name": "wf13",
245245
"language": "python",
246246
"name": "python3"
247247
},
@@ -255,7 +255,7 @@
255255
"name": "python",
256256
"nbconvert_exporter": "python",
257257
"pygments_lexer": "ipython3",
258-
"version": "3.12.5"
258+
"version": "3.13.1"
259259
}
260260
},
261261
"nbformat": 4,

docs/source/tutorial/4-python.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
"outputs": [],
165165
"source": [
166166
"from pprint import pprint\n",
167-
"from pydra.engine.helpers import fields_dict\n",
167+
"from pydra.utils import fields_dict\n",
168168
"\n",
169169
"\n",
170170
"@python.define(outputs=[\"c\", \"d\"])\n",
@@ -242,7 +242,7 @@
242242
],
243243
"metadata": {
244244
"kernelspec": {
245-
"display_name": "wf12",
245+
"display_name": "wf13",
246246
"language": "python",
247247
"name": "python3"
248248
},
@@ -256,7 +256,7 @@
256256
"name": "python",
257257
"nbconvert_exporter": "python",
258258
"pygments_lexer": "ipython3",
259-
"version": "3.12.5"
259+
"version": "3.13.1"
260260
}
261261
},
262262
"nbformat": 4,

docs/source/tutorial/5-shell.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"outputs": [],
136136
"source": [
137137
"from pprint import pprint\n",
138-
"from pydra.engine.helpers import fields_dict\n",
138+
"from pydra.utils import fields_dict\n",
139139
"\n",
140140
"Cp = shell.define(\n",
141141
" \"cp <in_fs_objects:fs-object+> <out|out_dir:directory> \"\n",
@@ -390,7 +390,7 @@
390390
"outputs": [],
391391
"source": [
392392
"from fileformats.generic import File\n",
393-
"from pydra.engine.helpers import list_fields\n",
393+
"from pydra.utils import task_fields\n",
394394
"\n",
395395
"ACommand = shell.define(\n",
396396
" \"a-command\",\n",
@@ -408,8 +408,8 @@
408408
")\n",
409409
"\n",
410410
"\n",
411-
"print(f\"ACommand input fields: {list_fields(ACommand)}\")\n",
412-
"print(f\"ACommand input fields: {list_fields(ACommand.Outputs)}\")"
411+
"print(f\"ACommand input fields: {task_fields(ACommand)}\")\n",
412+
"print(f\"ACommand input fields: {task_fields(ACommand.Outputs)}\")"
413413
]
414414
},
415415
{
@@ -420,7 +420,7 @@
420420
],
421421
"metadata": {
422422
"kernelspec": {
423-
"display_name": "wf12",
423+
"display_name": "wf13",
424424
"language": "python",
425425
"name": "python3"
426426
},
@@ -434,7 +434,7 @@
434434
"name": "python",
435435
"nbconvert_exporter": "python",
436436
"pygments_lexer": "ipython3",
437-
"version": "3.12.5"
437+
"version": "3.13.1"
438438
}
439439
},
440440
"nbformat": 4,

docs/source/tutorial/6-workflow.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446
"import numpy as np\n",
447447
"from fileformats.medimage import Nifti1\n",
448448
"import fileformats.medimage_mrtrix3 as mrtrix3\n",
449-
"from pydra.engine.environments import Docker\n",
449+
"from pydra.environments import docker\n",
450450
"from pydra.compose import workflow, python\n",
451451
"from pydra.tasks.mrtrix3.v3_0 import MrConvert, MrThreshold\n",
452452
"\n",
@@ -483,7 +483,7 @@
483483
" input_conversion = workflow.add(\n",
484484
" MrConvert(in_file=in_image, out_file=\"out_file.mih\"),\n",
485485
" name=\"input_conversion\",\n",
486-
" environment=Docker(\"mrtrix3/mrtrix3\", tag=\"latest\"),\n",
486+
" environment=docker.Environment(\"mrtrix3/mrtrix3\", tag=\"latest\"),\n",
487487
" )\n",
488488
"\n",
489489
" @python.define\n",
@@ -502,13 +502,13 @@
502502
"\n",
503503
" threshold = workflow.add(\n",
504504
" MrThreshold(in_file=in_image, out_file=\"binary.mif\", abs=median.out),\n",
505-
" environment=Docker(\"mrtrix3/mrtrix3\", tag=\"latest\"),\n",
505+
" environment=docker.Environment(\"mrtrix3/mrtrix3\", tag=\"latest\"),\n",
506506
" )\n",
507507
"\n",
508508
" output_conversion = workflow.add(\n",
509509
" MrConvert(in_file=threshold.out_file, out_file=\"out_image.mif\"),\n",
510510
" name=\"output_conversion\",\n",
511-
" environment=Docker(\"mrtrix3/mrtrix3\", tag=\"latest\"),\n",
511+
" environment=docker.Environment(\"mrtrix3/mrtrix3\", tag=\"latest\"),\n",
512512
" )\n",
513513
"\n",
514514
" return output_conversion.out_file\n",
@@ -541,7 +541,7 @@
541541
],
542542
"metadata": {
543543
"kernelspec": {
544-
"display_name": "wf12",
544+
"display_name": "wf13",
545545
"language": "python",
546546
"name": "python3"
547547
},
@@ -555,7 +555,7 @@
555555
"name": "python",
556556
"nbconvert_exporter": "python",
557557
"pygments_lexer": "ipython3",
558-
"version": "3.12.5"
558+
"version": "3.13.1"
559559
}
560560
},
561561
"nbformat": 4,

pydra/utils/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from .general import (
22
task_fields,
3+
fields_dict,
34
plot_workflow,
45
print_help,
56
)
67
from ._version import __version__
78

8-
__all__ = ["__version__", "task_fields", "plot_workflow", "print_help"]
9+
__all__ = ["__version__", "task_fields", "plot_workflow", "print_help", "fields_dict"]

0 commit comments

Comments
 (0)