Skip to content

Feature request: xr.set_option('display.max_data_vars', N) #4992

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

Closed
raybellwaves opened this issue Mar 4, 2021 · 4 comments
Closed

Feature request: xr.set_option('display.max_data_vars', N) #4992

raybellwaves opened this issue Mar 4, 2021 · 4 comments

Comments

@raybellwaves
Copy link
Contributor

idea discussed here: #4991

Copying here

the data_vars method provides a convenient ways to see the varaibles and the formatting (https://github.com/pydata/xarray/blob/master/xarray/core/dataset.py#L484) is nice. However, there are times I would look to see the full variables names not just a subset (12 is the default).

Ideally there would be a setting to toggle to specify the length of the formatter akin to https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html#overview

xr.set_option('display.max_data_vars', N)

@raybellwaves raybellwaves changed the title Feature requests: xr.set_option('display.max_data_vars', N) Feature request: xr.set_option('display.max_data_vars', N) Mar 4, 2021
@Illviljan
Copy link
Contributor

Problem is that xarray is very unresponsive when you're printing many variables, see #4736. But this should do what you want I believe xr.set_option("display_max_rows", N).

@raybellwaves
Copy link
Contributor Author

Thanks @Illviljan. I missed that issue. Is the syntax above off slightly? Is it in the docs as well?

Screen Shot 2021-03-04 at 10 03 05 AM

@Illviljan
Copy link
Contributor

Illviljan commented Mar 4, 2021

I might have missed adding it in docs. It's here though: https://github.com/pydata/xarray/blob/master/xarray/core/options.py

Ah, it should be xr.set_options(display_max_rows=20)

@raybellwaves
Copy link
Contributor Author

Thanks. Works great. Closing.

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

No branches or pull requests

2 participants