Skip to content

Commit 998065d

Browse files
author
Lee Newberg
committed
DOC: Use upstream/downstream instead of source/destination
For monai.deploy.core.Operator, instead of sometimes using "upstream" and "downstream" and sometimes using "source" and "destination", consistently use former. Signed-off-by: Lee Newberg <lee.newberg@kitware.com>
1 parent 0a8af47 commit 998065d

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

docs/source/developing_with_sdk/creating_application_class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ In `compose()` method, operators are instantiated and connected through <a href=
5454

5555
> add_flow(upstream_op, downstream_op, io_map=None)
5656
57-
`io_map` is a dictionary of mapping from the source operator's label to the destination operator's label(s) and its type is `Dict[str, str|Set[str]]`.
57+
`io_map` is a dictionary of mapping from the upstream operator's label to the downstream operator's label(s) and its type is `Dict[str, str|Set[str]]`.
5858

5959
We can skip specifying `io_map` if both the number of `upstream_op`'s outputs and the number of `downstream_op`'s inputs are one.
6060
For example, if Operators named `task1` and `task2` has only one input and output (with the label `image`), `self.add_flow(task1, task2)` is same with `self.add_flow(task1, task2, {"image": "image"})` or `self.add_flow(task1, task2, {"image": {"image"}})`.

examples/apps/ai_livertumor_seg_app/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def compose(self):
6868
# Add the publishing operator to save the input and seg images for Render Server.
6969
# Note the PublisherOperator has temp impl till a proper rendering module is created.
7070
self.add_flow(unetr_seg_op, publisher_op, {"saved_images_folder": "saved_images_folder"})
71-
# Note below the dicom_seg_writer requires two inputs, each coming from a upstream operator.
71+
# Note below the dicom_seg_writer requires two inputs, each coming from an upstream operator.
7272
self.add_flow(
7373
series_selector_op, dicom_seg_writer, {"study_selected_series_list": "study_selected_series_list"}
7474
)

examples/apps/ai_spleen_seg_app/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def compose(self):
7171
series_selector_op, series_to_vol_op, {"study_selected_series_list": "study_selected_series_list"}
7272
)
7373
self.add_flow(series_to_vol_op, bundle_spleen_seg_op, {"image": "image"})
74-
# Note below the dicom_seg_writer requires two inputs, each coming from a upstream operator.
74+
# Note below the dicom_seg_writer requires two inputs, each coming from an upstream operator.
7575
self.add_flow(
7676
series_selector_op, dicom_seg_writer, {"study_selected_series_list": "study_selected_series_list"}
7777
)

monai/deploy/core/application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ def add_flow(
192192
Args:
193193
upstream_op (Operator): An instance of the upstream operator of type Operator.
194194
downstream_op (Operator): An instance of the downstream operator of type Operator.
195-
io_map (Optional[Dict[str, Union[str, Set[str]]]]): A dictionary of mapping from the source operator's label
196-
to the destination operator's label(s).
195+
io_map (Optional[Dict[str, Union[str, Set[str]]]]): A dictionary of mapping from the upstream operator's label
196+
to the downstream operator's label(s).
197197
"""
198198

199199
# Ensure that the upstream and downstream operators are valid

monai/deploy/core/graphs/graph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ def add_flow(self, op_u: Operator, op_v: Operator, io_map: Dict[str, Set[str]]):
2828
"""Add an edge to the graph.
2929
3030
Args:
31-
op_u (Operator): A source operator.
32-
op_v (Operator): A destination operator.
33-
io_map (Dict[str, Set[str]]): A dictionary of mapping from the source operator's label to the destination
31+
op_u (Operator): An upstream operator.
32+
op_v (Operator): A downstream operator.
33+
io_map (Dict[str, Set[str]]): A dictionary of mapping from the upstream operator's label to the downstream
3434
operator's label(s).
3535
"""
3636
pass
3737

3838
@abstractmethod
3939
def get_io_map(self, op_u: Operator, op_v) -> Dict[str, Set[str]]:
40-
"""Get a mapping from the source operator's output label to the destination operator's input label.
40+
"""Get a mapping from the upstream operator's output label to the downstream operator's input label.
4141
Args:
42-
op_u (Operator): A source operator.
43-
op_v (Operator): A destination operator.
42+
op_u (Operator): An upstream operator.
43+
op_v (Operator): A downstream operator.
4444
Returns:
45-
A dictionary of mapping from the source operator's output label to the destination operator's
45+
A dictionary of mapping from the upstream operator's output label to the downstream operator's
4646
input label(s).
4747
"""
4848
pass

notebooks/tutorials/01_simple_app.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
"\n",
344344
"> add_flow(upstream_op, downstream_op, io_map=None)\n",
345345
"\n",
346-
"`io_map` is a dictionary of mapping from the source operator's label to the destination operator's label(s) and its type is `Dict[str, str|Set[str]]`. \n",
346+
"`io_map` is a dictionary of mapping from the upstream operator's label to the downstream operator's label(s) and its type is `Dict[str, str|Set[str]]`. \n",
347347
"\n",
348348
"We can skip specifying `io_map` if both the number of `upstream_op`'s outputs and the number of `downstream_op`'s inputs are one so `self.add_flow(sobel_op, median_op)` is same with `self.add_flow(sobel_op, median_op, {\"image\": \"image\"})` or `self.add_flow(sobel_op, median_op, {\"image\": {\"image\"}})`.\n"
349349
]

0 commit comments

Comments
 (0)