Skip to content

Commit ec84820

Browse files
committed
Aligned with the changes in v0.5.1 before rebase/merge
Signed-off-by: M Q <mingmelvinq@nvidia.com>
1 parent 422add1 commit ec84820

File tree

11 files changed

+42
-37
lines changed

11 files changed

+42
-37
lines changed

.readthedocs.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
# .readthedocs.yml
2-
# Read the Docs configuration file
1+
# Read the Docs configuration file for Sphinx projects
32
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
43

54
# Required
65
version: 2
76

8-
# Build documentation in the docs/ directory with Sphinx
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.8"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
17+
# Build documentation in the "docs/" directory with Sphinx
918
sphinx:
1019
configuration: docs/source/conf.py
11-
12-
# Build documentation with MkDocs
13-
#mkdocs:
14-
# configuration: mkdocs.yml
20+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
21+
# builder: "dirhtml"
22+
# Fail on all warnings to avoid broken references
23+
# fail_on_warning: true
1524

1625
# Optionally build your docs in additional formats such as PDF and ePub
17-
# formats: all
26+
# formats:
27+
# - pdf
28+
# - epub
1829

19-
# Optionally set the version of Python and requirements required to build your docs
30+
# Optional but recommended, declare the Python requirements required
31+
# to build your documentation
32+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
2033
python:
21-
version: 3.8
22-
install:
23-
- requirements: docs/requirements.txt
24-
# system_packages: true
25-
26-
27-
build:
28-
image: stable
34+
install:
35+
- requirements: docs/requirements.txt

examples/apps/mednist_classifier_monaideploy/mednist_classifier_monaideploy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def compute(self, op_input, op_output, context):
201201

202202

203203
# @md.resource(cpu=1, gpu=1, memory="1Gi")
204+
# @md.env(pip_packages=["pydicom >= 2.3.0", "highdicom>=0.18.2"]) # because of the use of DICOM writer operator
204205
class App(Application):
205206
"""Application class for the MedNIST classifier."""
206207

monai/deploy/operators/dicom_data_loader_operator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ def test():
358358
print(f" 'StudyInstanceUID': {ds.StudyInstanceUID if ds.StudyInstanceUID else ''}")
359359
print(f" 'SeriesDescription': {ds.SeriesDescription if ds.SeriesDescription else ''}")
360360
print(
361-
f" 'IssuerOfPatientID': {ds.get('IssuerOfPatientID', '').repval if ds.get('IssuerOfPatientID', '') else '' }"
361+
f" 'IssuerOfPatientID':"
362+
f" {ds.get('IssuerOfPatientID', '').repval if ds.get('IssuerOfPatientID', '') else '' }"
362363
)
363364
try:
364365
print(f" 'IssuerOfPatientID': {ds.IssuerOfPatientID if ds.IssuerOfPatientID else '' }")

monai/deploy/operators/dicom_series_selector_operator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,9 @@ def _select_all_series(self, dicom_study_list: List[DICOMStudy]) -> List[StudySe
177177
study_selected_series_list = []
178178
for study in dicom_study_list:
179179
logging.info(f"Working on study, instance UID: {study.StudyInstanceUID}")
180-
print((f"Working on study, instance UID: {study.StudyInstanceUID}"))
181180
study_selected_series = StudySelectedSeries(study)
182181
for series in study.get_all_series():
183182
logging.info(f"Working on series, instance UID: {str(series.SeriesInstanceUID)}")
184-
print(f"Working on series, instance UID: {str(series.SeriesInstanceUID)}")
185183
selected_series = SelectedSeries("", series, None) # No selection name or Image obj.
186184
study_selected_series.add_selected_series(selected_series)
187185
study_selected_series_list.append(study_selected_series)

monai/deploy/packager/util.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ def initialize_args(args: Namespace) -> Dict:
9393
dockerfile_type = verify_base_image(args.base)
9494
if not dockerfile_type:
9595
logger.error(
96-
"Provided base image '{}' is not supported \n \
97-
Please provide a ROCm or Cuda based Pytorch image from \n \
98-
https://hub.docker.com/r/rocm/pytorch or https://ngc.nvidia.com/ (nvcr.io/nvidia)".format(
99-
args.base
100-
)
96+
"Provided base image '{}' is not supported \n Please provide a ROCm or Cuda"
97+
" based Pytorch image from \n https://hub.docker.com/r/rocm/pytorch or"
98+
" https://ngc.nvidia.com/ (nvcr.io/nvidia)".format(args.base)
10199
)
102100

103101
sys.exit(1)

monai/deploy/runner/runner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def fetch_map_manifest(map_name: str) -> Tuple[dict, dict, int]:
4141

4242
with tempfile.TemporaryDirectory() as info_dir:
4343
if sys.platform == "win32":
44-
cmd = f"docker run --rm -a STDOUT -a STDERR -v {info_dir!r}:/var/run/monai/export/config {map_name}"
44+
cmd = f'docker run --rm -a STDOUT -a STDERR -v " {info_dir}":/var/run/monai/export/config {map_name}'
4545
else:
4646
cmd = f"""docker_id=$(docker create {map_name})
4747
docker cp $docker_id:/etc/monai/app.json "{info_dir}/app.json"
@@ -103,8 +103,8 @@ def run_app(map_name: str, input_path: Path, output_path: Path, app_info: dict,
103103
if not posixpath.isabs(map_output):
104104
map_output = posixpath.join(app_info["working-directory"], map_output)
105105

106-
cmd += f" -e MONAI_INPUTPATH={map_input!r}"
107-
cmd += f" -e MONAI_OUTPUTPATH={map_output!r}"
106+
cmd += ' -e MONAI_INPUTPATH="{}"'.format(map_input)
107+
cmd += ' -e MONAI_OUTPUTPATH="{}"'.format(map_output)
108108
# TODO(bhatt-piyush): Handle model environment correctly (maybe solved by fixing 'monai-exec')
109109
cmd += " -e MONAI_MODELPATH=/opt/monai/models"
110110

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Sphinx==4.1.2
1919
recommonmark==0.6.0
2020
sphinx-autodoc-typehints==1.12.0
2121
sphinx-rtd-theme==0.5.2
22-
pytest==6.2.4
23-
pytest-cov==2.12.1
22+
pytest==7.4.0
23+
pytest-cov==4.1.0
2424
pytest-lazy-fixture==0.6.3
2525
cucim~=21.06; platform_system == "Linux"
2626
monai>=1.0.0

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ holoscan>=0.5.0
22
numpy>=1.21.6
33
networkx>=2.4
44
colorama>=0.4.1
5-
typeguard~=2.12.1
5+
typeguard>=3.0.0

run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ pytest_desc() { c_echo 'Run tests with pytest
818818
819819
It executes the following command:
820820
821-
' "${MONAI_PY_EXE}"' -m py.test --cache-clear -vv \
821+
' "${MONAI_PY_EXE}"' -m pytest --cache-clear -vv \
822822
--cov=monai \
823823
--junitxml="'"$TOP/junit-monai-deploy-app-sdk.xml"'" \
824824
--cov-config="'"$TOP/.coveragerc"'" \
@@ -837,7 +837,7 @@ pytest() {
837837
local result=0
838838

839839
pushd $TOP > /dev/null
840-
run_command ${MONAI_PY_EXE} -m py.test --cache-clear -vv \
840+
run_command ${MONAI_PY_EXE} -m pytest --cache-clear -vv \
841841
--cov=monai \
842842
--junitxml="$TOP/junit-monai-deploy-app-sdk.xml" \
843843
--cov-config="$TOP/.coveragerc" \

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = Apache License 2.0
1111
license_files =
1212
LICENSE
1313
project_urls =
14-
Documentation=https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/
14+
Documentation=https://docs.monai.io/projects/monai-deploy-app-sdk/en/stable/
1515
Bug Tracker=https://github.com/Project-MONAI/monai-deploy-app-sdk/issues
1616
Source Code=https://github.com/Project-MONAI/monai-deploy-app-sdk
1717

@@ -27,7 +27,7 @@ install_requires =
2727
networkx>=2.4
2828
holoscan>=0.5.0
2929
colorama>=0.4.1
30-
typeguard~=2.12.1
30+
typeguard>=3.0.0
3131

3232
[options.extras_require]
3333
all =

tests/unit/test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ def test_run_app_for_input_output_path_with_space(
168168
expected_container_output /= app_manifest["working-directory"]
169169

170170
returncode = runner.run_app(sample_map_name, input_path, output_path, app_manifest, faux_pkg_manifest, quiet)
171-
input_path_with_quotes = f"{input_path.absolute()!r}"
172-
output_path_with_quotes = f"{output_path.absolute()!r}"
171+
input_path_with_quotes = '"{}"'.format(input_path.absolute()) # To quiet flake8 complaint
172+
output_path_with_quotes = '"{}"'.format(output_path.absolute())
173173

174174
assert returncode == return_value
175175
mock_run_cmd.assert_called_once_with(ContainsString(sample_map_name))

0 commit comments

Comments
 (0)