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

deprecate exclude_structured_configs; introduce SCMode enum #548

Closed
Jasha10 opened this issue Feb 17, 2021 · 2 comments · Fixed by #552
Closed

deprecate exclude_structured_configs; introduce SCMode enum #548

Jasha10 opened this issue Feb 17, 2021 · 2 comments · Fixed by #552
Assignees
Milestone

Comments

@Jasha10
Copy link
Collaborator

Jasha10 commented Feb 17, 2021

exclude_structured_configs is new in 2.1 and we can still change it.
Looks like an enum can replace exclude_structured_configs and instantiate:

class SCMode(Enum):
  DICT = 1            # convert to plain dict
  DICT_CONFIG = 2     # Keep as OmegaConf DictConfig
  INSTANTIATE = 3     # instantiate underlying object.

Originally posted by @omry in #502 (comment)

Based on the above, it is planned to deprecate the exclude_structured_configs argument to the OmegaConf.to_container function. In it's place, it is proposed to add a structured_config_mode: SCMode argument to the to_container function's signature. This argument will determine what behavior occurs when to_container encounters a StructuredConfig.

To preserve the current default behavior, the default value will be structured_config_mode = SCMode.DICT.

@Jasha10
Copy link
Collaborator Author

Jasha10 commented Feb 17, 2021

The SCMode.INSTANTIATE mode is under development in PR #502

@Jasha10
Copy link
Collaborator Author

Jasha10 commented Feb 22, 2021

Closing as duplicate of #556

@Jasha10 Jasha10 closed this as completed Feb 22, 2021
Jasha10 added a commit to Jasha10/omegaconf that referenced this issue Feb 23, 2021
Jasha10 added a commit that referenced this issue Feb 25, 2021
* to_container: replace exclude_structured_configs with SCMode

Closes #548

Co-authored-by: Omry Yadan <omry@fb.com>

* Add note about `structured_config_mode` to docs

* revise documentation

* Update OmegaConf.to_container docstring

* add news/548.api_change
odelalleau pushed a commit to odelalleau/omegaconf that referenced this issue Mar 10, 2021
* to_container: replace exclude_structured_configs with SCMode

Closes omry#548

Co-authored-by: Omry Yadan <omry@fb.com>

* Add note about `structured_config_mode` to docs

* revise documentation

* Update OmegaConf.to_container docstring

* add news/548.api_change
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 a pull request may close this issue.

1 participant