Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3482 Add support for relative IDs in the config content #3974

Merged
merged 13 commits into from
Mar 23, 2022

Conversation

Nic-Ma
Copy link
Contributor

@Nic-Ma Nic-Ma commented Mar 22, 2022

Task step 12 of #3482 .

Description

According to the task plan, this PR added support for relative reference ID, like: "test": "@###data#1".

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 changed the title 3482 Add support for relative ids in the config content 3482 Add support for relative IDs in the config content Mar 22, 2022
@Nic-Ma Nic-Ma mentioned this pull request Mar 22, 2022
17 tasks
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

/build

1 similar comment
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

/build

@wyli
Copy link
Contributor

wyli commented Mar 22, 2022

I think this makes it difficult to distinguish the empty id "" and the parent reference?

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

I think this makes it difficult to distinguish the empty id "" and the parent reference?

Hi @wyli ,

The regex in this PR is re.compile(rf"{ref}{sep}+"), which only match the relative IDs at beginning of the string.

Thanks.

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

/build

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 22, 2022

/build

@Nic-Ma Nic-Ma requested review from wyli, ericspod and rijobro March 22, 2022 15:19
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 23, 2022

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 23, 2022

/build

@Nic-Ma Nic-Ma requested a review from ericspod March 23, 2022 00:32
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Mar 23, 2022

Hi @wyli @ericspod ,

Thanks for your review and suggestions.
I revisited the feature, actually, the relative id conversion is kind of "macro replacement" and we need to support it for both the macro token %XXX case and reference @XXX case. So I changed the logic to ConfigParser and no need to call it twice now.
Could you please help review it again?

Thanks in advance.

@wyli wyli merged commit fbd09a1 into Project-MONAI:dev Mar 23, 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.

3 participants