diff --git a/.gitignore b/.gitignore index c6aea2258b..7c81bfaf87 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ instance/ # Sphinx documentation docs/build/ docs/source/_gen +docs/source/*_properties.csv _build/ # PyBuilder diff --git a/docs/Makefile b/docs/Makefile index 5dcb45d6df..57b69ce273 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -26,3 +26,4 @@ help: clean: rm -rf build/ rm -rf source/_gen + rm -rf source/*_properties.csv diff --git a/docs/requirements.txt b/docs/requirements.txt index 701b7998a9..c4bd50ec2b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -33,7 +33,7 @@ jsonschema pynrrd pydicom h5py -nni +nni; platform_system == "Linux" optuna opencv-python-headless onnx>=1.13.0 diff --git a/docs/source/bundle_intro.rst b/docs/source/bundle_intro.rst index c43093db96..b4a185ba25 100644 --- a/docs/source/bundle_intro.rst +++ b/docs/source/bundle_intro.rst @@ -8,6 +8,7 @@ Bundle mb_specification config_syntax.md + mb_properties Detailed bundle examples and get started tutorial: https://github.com/Project-MONAI/tutorials/tree/main/bundle diff --git a/docs/source/conf.py b/docs/source/conf.py index d04ff6acac..86131c565c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,7 +55,18 @@ def generate_apidocs(*args): """Generate API docs automatically by trawling the available modules""" - module_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "monai")) + + import pandas as pd + from monai.bundle.properties import TrainProperties, InferProperties, MetaProperties + + csv_file = os.path.join(os.path.dirname(__file__), "train_properties.csv") # used in mb_properties.rst + pd.DataFrame.from_dict(TrainProperties, orient="index").iloc[:, :3].to_csv(csv_file) + csv_file = os.path.join(os.path.dirname(__file__), "infer_properties.csv") + pd.DataFrame.from_dict(InferProperties, orient="index").iloc[:, :3].to_csv(csv_file) + csv_file = os.path.join(os.path.dirname(__file__), "meta_properties.csv") + pd.DataFrame.from_dict(MetaProperties, orient="index").iloc[:, :3].to_csv(csv_file) + + module_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "monai")) output_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "apidocs")) apidoc_command_path = "sphinx-apidoc" if hasattr(sys, "real_prefix"): # called from a virtualenv diff --git a/docs/source/mb_properties.rst b/docs/source/mb_properties.rst new file mode 100644 index 0000000000..f261480f55 --- /dev/null +++ b/docs/source/mb_properties.rst @@ -0,0 +1,30 @@ +MONAI Bundle Properties +======================= + + +Train properties +---------------- + +.. csv-table:: + :header-rows: 1 + :file: train_properties.csv + :class: longtable + :widths: 10, 55, 5, 30 + +Infer properties +---------------- + +.. csv-table:: + :header-rows: 1 + :file: infer_properties.csv + :class: longtable + :widths: 10, 55, 5, 30 + +Meta properties +--------------- + +.. csv-table:: + :header-rows: 1 + :file: meta_properties.csv + :class: longtable + :widths: 10, 55, 5, 30