home / github / commits

Menu
  • Search all tables
  • GraphQL API

commits: a78c1e0115d38cb4461fd1aba93334d440cff49c

This data as json

sha message author_date committer_date raw_author raw_committer repo author committer
a78c1e0115d38cb4461fd1aba93334d440cff49c dataset `__repr__` updates (#5580) * Delegate `max_rows` from dataset `__repr__` As discussed in https://github.com/pydata/xarray/issues/5545 the default setting of `display_max_rows` is sometimes less useful to inspect datasets for completeness, and changing the option is not backwards compatible. In addition, a concise and short output dataset seems to be preferred by most people. The compromise is to keep the dataset's `__repr__` short and tunable via `xr.set_options(display_max_rows=...)`, and at the same time to enable the output of all items by explicitly requesting `ds.coords`, `ds.data_vars`, and `ds.attrs`. These explicit `__repr__`s also restore backwards compatibility in these cases. Slightly changes the internal implementation of `_mapping_repr()`: Setting (leaving) `max_rows` to `None` means "no limits". * tests: Update dataset `__repr__` tests [1/2] Updates the dataset `__repr__` test to assure that the dataset output honours the `display_max_rows` setting, not the `data_vars` output. Discussed in https://github.com/pydata/xarray/issues/5545 * tests: Extend dataset `__repr__` tests [2/2] Extends the dataset `__repr__` test to ensure that the output of `ds.coords`, `ds.data_vars`, and `ds.attrs` is of full length as desired. Includes more dimensions and coordinates to cover more cases. Discussed in https://github.com/pydata/xarray/issues/5545 * doc: Add what's new entry for `__repr__` changes Sorted as a "breaking change" for 0.18.3 for now. * Revert "doc: Add what's new entry for `__repr__` changes" This reverts commit 3dd645b3141cdb97567cc245aa836b22fab2b3da. * doc: Add what's new entry for `__repr__` changes Sorted as a "breaking change", for 0.19.1 for now. * doc: Remove `attrs` from `__repr__` changes Address comment from @keewis: `.attrs` is a standard python dict, so there's no custom repr. * tests: Remove `ds.attrs` formatting test According to @keewis: I don't think we need to test this because `attrs_repr` will only ever be called by `dataset_repr` / `array_repr`: on its own, the standard python `dict`'s `repr` will be used. * tests: Fix no. of coordinates in formatting_repr The number of coordinates changed to be the same as the number of variables, which only incidentally was fixed to 40. Updates the to-be-tested format string to use the same number of variables instead of the hard-coded one, which might be subject to change. 2021-08-21T22:51:02Z 2021-08-21T22:51:02Z b87b8161def2ccc7bb2ae2db0a353c635685481d cd792325681cbad9f663f2879d8b69f1edbb678f 13221727 28786187 19864447
Powered by Datasette · Queries took 0.724ms · About: xarray-datasette