Print number of variables in repr#4762
Conversation
|
Ouch, forgot about the doctests... Going through them by hand is not happening. Is there any automatic way to do that? |
Workaround to avoid having to redo every single doctest... It is really only necessary when the data rows are limited. But I find it a bit difficult to count the rows quickly past like 7.
|
unfortunately, I can't find a tool that does that. I guess either someone will have to write that tool or you will have to go through all the files and update by hand. For the latter, I would recommend to wait until the |
|
I worked around it by only showing it when the repr is limited. That's the most important case anyway I think. |
No need to limit max_rows now because the if condition handles that.
|
I've used An aside — I tried to make a similar tool that worked for inline results — https://github.com/max-sixty/pytest-accept. Unfortunately it's not possible to make it work with bare |
| if len(mapping) > max_rows: | ||
| len_mapping = len(mapping) | ||
| if len_mapping > max_rows: | ||
| summary = [f"{summary[0]} ({max_rows}/{len_mapping})"] |
There was a problem hiding this comment.
Does this no longer get the title though?
There was a problem hiding this comment.
It gets the title via summary[0] in the f-string. I did this because I want the number to be displayed on the same row as title, Attributes: (12/25). If we do += the numbers would be shown on a new line.
|
LGTM, any final comments before we merge? |
|
Thanks @Illviljan ! |
* upstream/master: (342 commits) fix decode for scale/ offset list (pydata#4802) Expand user dir paths (~) in open_mfdataset and to_zarr. (pydata#4795) add a version info step to the upstream-dev CI (pydata#4815) fix the ci trigger action (pydata#4805) scatter plot by order of the first appearance of hue (pydata#4723) don't skip the scheduled CI (pydata#4806) coords: retain str dtype (pydata#4759) Fix interval labels with units (pydata#4794) Always force dask arrays to float in missing.interp_func (pydata#4771) Print number of variables in repr (pydata#4762) install conda as a library in the minimum dependency check CI (pydata#4792) Migrate CI from azure pipelines to GitHub Actions (pydata#4730) use conda.api instead of parallel calls to the conda binary (pydata#4775) Speed up missing._get_interpolator (pydata#4776) Remove special case in guess_engines (pydata#4777) improve typing of OrderedSet (pydata#4774) CI: ignore some warnings (pydata#4773) DOC: update hyperlink for xskillscore (pydata#4778) drop support for python 3.6 (pydata#4720) Trigger upstream CI on cron schedule (by default) (pydata#4729) ...
Show the printed and total number of variables in the repr.
isort . && black . && mypy . && flake8