html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/4367#issuecomment-733989093,https://api.github.com/repos/pydata/xarray/issues/4367,733989093,MDEyOklzc3VlQ29tbWVudDczMzk4OTA5Mw==,14808389,2020-11-25T23:25:44Z,2020-11-25T23:25:44Z,MEMBER,"This seems to be resolved so I'll close this issue. Feel free to post / reopen if you disagree.
Just for reference, both `pytest` and the standard library doctest runner allow running setup code:
```python
@pytest.fixture(autouse=True)
def custom_function(doctest_namespace):
# the name of the function does not matter
# add setup code here
...
```
The official way to call the builtin doctest runner seems to be to add a `if __name__ == ""__main__""` with a call to `doctest.testmod()` and to then call the module using either `python .py` or `python -m `. All code before the call to `testmod` can be used to set up the environment of the doctest.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433
https://github.com/pydata/xarray/issues/4367#issuecomment-678738626,https://api.github.com/repos/pydata/xarray/issues/4367,678738626,MDEyOklzc3VlQ29tbWVudDY3ODczODYyNg==,14371165,2020-08-23T07:10:26Z,2020-08-23T07:10:26Z,MEMBER,"Pandas breaks PEP8 (80 > 79) too then and Numpy is PEP8 compliant to one indent level (75 + 4) which I think is fine.
I see no point in temporarily changing settings as it will not work with `doctest`. I will work around it by printing numpy arrays instead.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433
https://github.com/pydata/xarray/issues/4367#issuecomment-678722063,https://api.github.com/repos/pydata/xarray/issues/4367,678722063,MDEyOklzc3VlQ29tbWVudDY3ODcyMjA2Mw==,1217238,2020-08-23T02:54:04Z,2020-08-23T02:54:04Z,MEMBER,"Our default line width limit for text `repr()` is actually already 80 characters. This matches `display.width` from pandas, and is a little longer than what NumPy uses (75 characters).
You can definitely set a lower line width if you like for rendering `repr()` when copying and pasting into docstrings, using `xarray.set_options`.
I don't think we should change this overall, because copying and pasting into docstring is a relatively rare use of `repr()` compared to printing data in a console.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433
https://github.com/pydata/xarray/issues/4367#issuecomment-678703013,https://api.github.com/repos/pydata/xarray/issues/4367,678703013,MDEyOklzc3VlQ29tbWVudDY3ODcwMzAxMw==,10194086,2020-08-22T22:29:31Z,2020-08-22T22:29:31Z,MEMBER,"We ignore this error here:
https://github.com/pydata/xarray/blob/2bc8e33b319d54f9a6e89a88ac3161f4fb569fcf/setup.cfg#L109-L110
I think the argument is that a line lenght of 88 is much less likely to be too short: https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433
https://github.com/pydata/xarray/issues/4367#issuecomment-678700741,https://api.github.com/repos/pydata/xarray/issues/4367,678700741,MDEyOklzc3VlQ29tbWVudDY3ODcwMDc0MQ==,14371165,2020-08-22T22:06:26Z,2020-08-22T22:06:26Z,MEMBER,"> Black defaults to 88 characters per line, which happens to be 10% over 80. This number was found to produce significantly shorter files than sticking with 80 (the most popular), or even 79 (used by the standard library).
https://black.readthedocs.io/en/stable/the_black_code_style.html
I wonder why they don't reduce the indent size too if minimizing rows is of such importance.
The line width does make perfect sense if Black is the _new_ de facto standard. I don't think it's the path of least resistance though. If 88 is used it will trigger other code style analyzers (it did for me) because they default to 79.
PEP8 has been around for 19 years, black has a lot of work trying to persuade 19 years of people recommending following PEP8.
Have you updated the pep8speaks bot with this line length?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433
https://github.com/pydata/xarray/issues/4367#issuecomment-678677646,https://api.github.com/repos/pydata/xarray/issues/4367,678677646,MDEyOklzc3VlQ29tbWVudDY3ODY3NzY0Ng==,5635139,2020-08-22T18:50:04Z,2020-08-22T18:50:04Z,MEMBER,"Thanks for the issue and the example.
Because we use `black` — and `black`s increasing adoption in the python ecosystem — I think operation on its default 88 width is reasonable. Given the display width is currently 80, that gives us two tabs. I think that's probably OK. Are there cases where it doesn't work?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433
https://github.com/pydata/xarray/issues/4367#issuecomment-678619316,https://api.github.com/repos/pydata/xarray/issues/4367,678619316,MDEyOklzc3VlQ29tbWVudDY3ODYxOTMxNg==,14371165,2020-08-22T09:35:12Z,2020-08-22T09:39:14Z,MEMBER,"Seems the max width is defined in https://github.com/pydata/xarray/blob/43a2a4bdf3a492d89aae9f2c5b0867932ff51cef/xarray/core/options.py. Setting `OPTIONS[DISPLAY_WIDTH] = 71` does the trick. Not sure where else this option is used though.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,683954433