Skip to content

Enhance expression logic of bundle config#4377

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

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

Conversation

@Nic-Ma

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

Copy link
Copy Markdown
Contributor

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

Nic-Ma commented May 28, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented May 28, 2022

Copy link
Copy Markdown
Contributor Author

/build

@Nic-Ma

Nic-Ma commented May 29, 2022

Copy link
Copy Markdown
Contributor Author

/black

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented May 29, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented May 29, 2022

Copy link
Copy Markdown
Contributor Author

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

Thanks.

Signed-off-by: Nic Ma <nma@nvidia.com>
Comment thread tests/test_config_parser.py
Nic-Ma and others added 2 commits May 30, 2022 11:13
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented May 30, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented May 30, 2022

Copy link
Copy Markdown
Contributor Author

/build

@ericspod ericspod left a comment

Copy link
Copy Markdown
Member

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

Nic-Ma commented May 30, 2022

Copy link
Copy Markdown
Contributor Author

/black

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented May 30, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented May 30, 2022

Copy link
Copy Markdown
Contributor Author

/build

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

wyli commented May 30, 2022

Copy link
Copy Markdown
Contributor

/build

1 similar comment
@wyli

wyli commented May 30, 2022

Copy link
Copy Markdown
Contributor

/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