Skip to content

Conversation

@rijobro
Copy link
Contributor

@rijobro rijobro commented Mar 2, 2021

Fixes #1662.

Description

Option to not raise exception if keys are missing during transform.

This is my current proposition. I've only done it for a few classes to get opinions before continuing with rest.

The generator in the base class to minimise code duplication.

Status

Work in progress

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh --codeformat --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

rijobro added 2 commits March 1, 2021 18:13
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro requested review from Nic-Ma and wyli March 2, 2021 10:45
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I think this a nice direction to go... @jansoe would be great to have your comments as well. I was also thinking of using a special key in keys such as None or * to represent the allow_missing_keys flag... but maybe that's more confusing APIs

Copy link

@jansoe jansoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, I think this will make pipelines much more flexible.

rijobro added 5 commits March 2, 2021 12:57
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro changed the title [1662] [WIP] Allow missing keys [1662] Allow missing keys Mar 2, 2021
@rijobro rijobro marked this pull request as ready for review March 2, 2021 15:47
rijobro added 2 commits March 2, 2021 17:57
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@wyli
Copy link
Contributor

wyli commented Mar 2, 2021

/black
/integration-test

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, it looks good to me

@rijobro rijobro merged commit 421c0a9 into Project-MONAI:master Mar 3, 2021
@rijobro rijobro deleted the missing_keys branch March 3, 2021 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option for transforms to skip missing keys instead of raising exception

3 participants