Skip to content

Commit abf9699

Browse files
committed
Updated the setup post install action, local sdk version, and notebook examples
Signed-off-by: M Q <[email protected]>
1 parent b6fbb45 commit abf9699

File tree

8 files changed

+2430
-2749
lines changed

8 files changed

+2430
-2749
lines changed

monai/deploy/_version.py

Lines changed: 15 additions & 617 deletions
Large diffs are not rendered by default.

notebooks/tutorials/02_mednist_app-prebuilt.ipynb

Lines changed: 178 additions & 425 deletions
Large diffs are not rendered by default.

notebooks/tutorials/02_mednist_app.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
},
174174
{
175175
"cell_type": "code",
176-
"execution_count": 3,
176+
"execution_count": null,
177177
"metadata": {
178178
"tags": []
179179
},
@@ -191,7 +191,7 @@
191191
],
192192
"source": [
193193
"directory = os.environ.get(\"MONAI_DATA_DIRECTORY\")\n",
194-
"root_dir = os.path.curdir if directory is None else directory\n",
194+
"root_dir = os.path.curdir + \"MedNIST_DATA\" if directory is None else directory\n",
195195
"print(root_dir)\n",
196196
"\n",
197197
"resource = \"https://drive.google.com/uc?id=1QsnnkvZyJPcbRoV_ArW8SnE1OTuoVbKE\"\n",

notebooks/tutorials/03_segmentation_app.ipynb

Lines changed: 815 additions & 524 deletions
Large diffs are not rendered by default.

notebooks/tutorials/03_segmentation_viz_app.ipynb

Lines changed: 133 additions & 144 deletions
Large diffs are not rendered by default.

notebooks/tutorials/04_monai_bundle_app.ipynb

Lines changed: 771 additions & 618 deletions
Large diffs are not rendered by default.

notebooks/tutorials/05_multi_model_app.ipynb

Lines changed: 501 additions & 406 deletions
Large diffs are not rendered by default.

setup.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,43 @@ def patch_holoscan():
3939

4040
def needed_to_patch():
4141
from importlib.metadata import version
42-
needed = False
4342
try:
4443
version = version("holoscan")
4544
# This issue exists in the following versions
4645
if "2.7" in version or "2.8" in version:
4746
print("Need to patch holoscan v2.7 and 2.8.")
48-
needed = True
47+
return True
4948
except Exception:
5049
pass
5150

52-
return needed
51+
return False
5352

5453
if not needed_to_patch():
5554
return
5655

56+
print("Patching holoscan as needed...")
5757
spec = importlib.util.find_spec("holoscan")
5858
if spec:
5959
# holoscan core misses one class in its import in __init__.py
6060
module_to_add = " MultiMessageConditionInfo,"
61-
module_path = Path(str(spec.origin)).joinpath('core')
61+
module_path = Path(str(spec.origin)).parent.joinpath('core/__init__.py')
62+
print(f"Patching file {module_path}")
6263
if module_path.exists():
6364
lines_r = []
6465
existed = False
6566
with module_path.open("r") as f_to_patch:
66-
block_begin = False
67-
for line_r in f_to_patch.readline():
68-
if "from ._core import (" in line_r:
69-
block_begin = True
70-
elif block_begin and module_to_add.strip() in line_r:
67+
in_block = False
68+
for line_r in f_to_patch.readlines():
69+
if "from ._core import (\n" in line_r:
70+
in_block = True
71+
elif in_block and module_to_add.strip() in line_r:
7172
existed = True
7273
break
73-
elif block_begin and ")" in line_r:
74-
# Need to add the missing class.
75-
line_r = f"{module_to_add}\n{line_r}"
76-
print("Added missing module in holoscan.")
74+
elif in_block and ")\n" in line_r:
75+
# Need to add the missing class.
76+
line_r = f"{module_to_add}\n{line_r}"
77+
in_block = False
78+
print("Added missing module in holoscan.")
7779

7880
lines_r.append(line_r)
7981

0 commit comments

Comments
 (0)