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

Make flow style of yaml dump configurable #1075

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdraw
Copy link

@mdraw mdraw commented May 4, 2023

Dumping yaml with the currently hardcoded default_flow_style=False setting results in sometimes less than optimal string representations. Example output of OmegaConf.to_yaml(cfg):

nhood:
- - -1
  - 0
  - 0
- - 0
  - -1
  - 0
- - 0
  - 0
  - -1

After the proposed change you can use OmegaConf.to_yaml(cfg, default_flow_style=None) to get this output instead:

nhood:
- [-1, 0, 0]
- [0, -1, 0]
- [0, 0, -1]

@omry
Copy link
Owner

omry commented Jun 22, 2023

Hi @mdraw,
This is nice. Can you add a some basic testing and make sure everything passes (you may need to rebase).

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.

None yet

2 participants