Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

ENH: Switch recommonmark to MyST-parser #787

Merged
merged 25 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
267d4e8
📝 Create basic for ML API
peterhessey Aug 5, 2022
806f261
📝 Add ML/configs base doc files
peterhessey Aug 5, 2022
0cbd7c7
📝 Finish ML/configs API
peterhessey Aug 8, 2022
f5c82cf
📝 Update augmentations
peterhessey Aug 8, 2022
ac0171a
📝 Add ML/dataset API docs
peterhessey Aug 8, 2022
e9fff6a
📝 Add rst skeleton for ML/models
peterhessey Aug 8, 2022
4fd8de4
📝 Fix docstring missing newlines
peterhessey Aug 8, 2022
6371548
Remove script
peterhessey Aug 8, 2022
27e7784
📝 Finish ML/models API docs
peterhessey Aug 8, 2022
6a1273f
📝 Start ML/SSL API. Fix some formatting issues
peterhessey Aug 9, 2022
562173b
📝 Correct whitespace issues in `:param`
peterhessey Aug 9, 2022
416e907
📝 Fix whitespace errors on `:return` statements
peterhessey Aug 9, 2022
a778dac
📝 Fix :return: statements
peterhessey Aug 9, 2022
33b557c
📝 Finish ML/SSL API
peterhessey Aug 9, 2022
7d4f466
📝 Add ML/utils API docs
peterhessey Aug 9, 2022
19ab5b2
📝 Add visualizer docs, fix `:raise` indents
peterhessey Aug 9, 2022
67169af
📝 Fix more issues with the `:raises:` formatting
peterhessey Aug 9, 2022
7619004
♻️ Restructuring folders
peterhessey Aug 9, 2022
bdc2a51
📝 Limit API `toctree` depth
peterhessey Aug 9, 2022
56c3a52
📝 Add primary InnerEye/ML files API to docs
peterhessey Aug 9, 2022
e9e5ee8
📝 Fix and add `InnerEye/ML/*.py` docs
peterhessey Aug 9, 2022
c1d84a8
⚰️ Remove weird `settings.json` change
peterhessey Aug 9, 2022
933bc7b
📌 Switch recommonmark to MyST-parser
peterhessey Aug 15, 2022
6e610b0
📌 Add myst-parser to `environment.yml`, lock env
peterhessey Aug 16, 2022
a9a5278
Fix conflicts merging main
peterhessey Aug 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
📝 Add visualizer docs, fix :raise indents
  • Loading branch information
peterhessey committed Aug 9, 2022
commit 19ab5b21def58efa377e200264043ef9e36a7eb8
2 changes: 1 addition & 1 deletion InnerEye/ML/model_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def segmentation_model_test_epoch(config: SegmentationModelBase,
:param execution_mode: Is the model evaluated on train, test, or validation set?
:param results_folder: The folder where to store the results.
:param epoch_and_split: A string that should uniquely identify the epoch and the data split (train/val/test).
:raises TypeError: If the arguments are of the wrong type.
:raises TypeError: If the arguments are of the wrong type.
:raises ValueError: When there are issues loading the model.
:return: A list with the mean dice score (across all structures apart from background) for each image.
"""
Expand Down
2 changes: 1 addition & 1 deletion InnerEye/ML/utils/io_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def load_nifti_image(path: PathOrString, image_type: Optional[Type] = float) ->
:return: A numpy array of the image and header data if applicable.

:param image_type: The type to load the image in, set to None to not cast, default is float
:raises ValueError: If the path is invalid or the image is not 3D.
:raises ValueError: If the path is invalid or the image is not 3D.
"""

def _is_valid_image_path(_path: Path) -> bool:
Expand Down
10 changes: 5 additions & 5 deletions InnerEye/ML/utils/ml_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def validate_dataset_paths(
Validates that the required dataset csv file exists in the given path.

:param dataset_path: The base path
:param custom_dataset_csv : The name of the dataset csv file
:raise ValueError if the dataset does not exist.
:param custom_dataset_csv: The name of the dataset csv file
:raise ValueError if the dataset does not exist.
"""
if not dataset_path.is_dir():
raise ValueError("The dataset_path argument should be the path to the base directory of the data "
Expand Down Expand Up @@ -117,7 +117,7 @@ def check_size_matches(arg1: Union[np.ndarray, torch.Tensor],

:param arg1_name: If provided, all error messages will use that string to instead of "arg1"
:param arg2_name: If provided, all error messages will use that string to instead of "arg2"
:raise ValueError if shapes don't match
:raise ValueError if shapes don't match
"""
if arg1 is None or arg2 is None:
raise Exception("arg1 and arg2 cannot be None.")
Expand All @@ -132,7 +132,7 @@ def check_dim(expected: int, actual_shape: Any, name: str) -> None:
:param expected: expected shape
:param actual_shape:
:param name: variable name
:raise ValueError if not the same shape
:raise ValueError if not the same shape
"""
if len(actual_shape) != expected:
raise ValueError("'{}' was expected to have ndim == {}, but is {}. Shape is {}"
Expand Down Expand Up @@ -176,7 +176,7 @@ def is_test_from_execution_mode(execution_mode: ModelExecutionMode) -> bool:
Returns a boolean by checking the execution type. The output is used to determine the properties
of the forward pass, e.g. model gradient updates or metric computation.
:return: True if execution mode is VAL or TEST, False if TRAIN
:raise ValueError if the execution mode is invalid
:raise ValueError if the execution mode is invalid
"""
if execution_mode == ModelExecutionMode.TRAIN:
return False
Expand Down
18 changes: 18 additions & 0 deletions docs/source/rst/api/ML/visualizers/index.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
Visualizers
===========

Below you will find all classes and functions related to the visualization of models and outputs.

.. automodule:: InnerEye.ML.visualizers.activation_maps

.. automodule:: InnerEye.ML.visualizers.metrics_scatterplot

.. automodule:: InnerEye.ML.visualizers.model_hooks

.. automodule:: InnerEye.ML.visualizers.model_summary

.. automodule:: InnerEye.ML.visualizers.patch_sampling

.. automodule:: InnerEye.ML.visualizers.plot_cross_validation

.. automodule:: InnerEye.ML.visualizers.regression_visualization

.. automodule:: InnerEye.ML.visualizers.reliability_curve