Skip to content

Commit 9a044f3

Browse files
committed
updated developer docs to match new Pydra syntax
1 parent 4ced892 commit 9a044f3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/source/developer/extras.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ to do a generic conversion between all image types,
134134
from pathlib import Path
135135
import tempfile
136136
import pydra.mark
137-
import pydra.engine.specs
138137
from fileformats.core import converter
139138
from .raster import RasterImage, Bitmap, Gif, Jpeg, Png, Tiff
140139
@@ -144,9 +143,8 @@ to do a generic conversion between all image types,
144143
@converter(target_format=Jpeg, output_format=Jpeg)
145144
@converter(target_format=Png, output_format=Png)
146145
@converter(target_format=Tiff, output_format=Tiff)
147-
@pydra.mark.task
148-
@pydra.mark.annotate({"return": {"out_file": RasterImage}})
149-
def convert_image(in_file: RasterImage, output_format: type, out_dir: ty.Optional[Path] = None):
146+
@python.define(outputs=["out_file"])
147+
def convert_image(in_file: RasterImage, output_format: type, out_dir: Path | None = None) -> RasterImage:
150148
data_array = in_file.load()
151149
if out_dir is None:
152150
out_dir = Path(tempfile.mkdtemp())

0 commit comments

Comments
 (0)