Skip to content

Enhance expression logic of bundle config#4377

Merged
Nic-Ma merged 19 commits intoProject-MONAI:devfrom
Nic-Ma:update-lambda-config
May 30, 2022
Merged

Enhance expression logic of bundle config#4377
Nic-Ma merged 19 commits intoProject-MONAI:devfrom
Nic-Ma:update-lambda-config

Conversation

@Nic-Ma
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma commented May 28, 2022

Fixes Project-MONAI/model-zoo#25.

Description

This PR enhanced the expression logic of bundle config to support reference in lambda or other callables.
And added more unit tests and integration test to cover it.

Status

Ready

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 -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 28, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 28, 2022

/build

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 29, 2022

/black

Signed-off-by: Nic Ma <[email protected]>
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 29, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 29, 2022

I will update the test for the pickle issue of lambda in windows.

Thanks.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 30, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 30, 2022

/build

Copy link
Copy Markdown
Member

@ericspod ericspod left a comment

Choose a reason for hiding this comment

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

This change may not be needed if we use other techniques to avoid having global variables but it's much cleaner to do it this way. It's correct that an unbound value in a lambda is a global variable, the only concern is if changing the global dictionary would override an existing value, warning when this happens might be a good addition.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 30, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 30, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented May 30, 2022

/build

@Nic-Ma Nic-Ma enabled auto-merge (squash) May 30, 2022 16:02
@wyli
Copy link
Copy Markdown
Contributor

wyli commented May 30, 2022

/build

1 similar comment
@wyli
Copy link
Copy Markdown
Contributor

wyli commented May 30, 2022

/build

@Nic-Ma Nic-Ma merged commit 8cdd692 into Project-MONAI:dev May 30, 2022
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.

Local references fail in lambda functions

4 participants