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
📝 Fix more issues with the :raises: formatting
  • Loading branch information
peterhessey committed Aug 9, 2022
commit 67169af21c5161bd4416555965eb5f9aee3ae6f7
2 changes: 1 addition & 1 deletion InnerEye/ML/utils/io_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def store_binary_mask_as_nifti(image: np.ndarray, header: ImageHeader, file_name
:param header: The image header
:param file_name: The name of the file for this image.
:return: the path to the saved image
:raises: when image is not binary
:raises Exception: when image is not binary
"""
if not is_binary_array(image):
raise Exception("Array values must be binary.")
Expand Down
9 changes: 5 additions & 4 deletions InnerEye/ML/utils/ml_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def validate_dataset_paths(

: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.
:raises: 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
:raises: 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
:raises: 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 @@ -175,8 +175,9 @@ 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
:raises ValueError: if the execution mode is invalid
"""
if execution_mode == ModelExecutionMode.TRAIN:
return False
Expand Down