id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type
638947370,MDU6SXNzdWU2Mzg5NDczNzA=,4156,writing sparse to netCDF,2448579,open,0,,,7,2020-06-15T15:33:23Z,2024-01-09T10:14:00Z,,MEMBER,,,,"I haven't looked at this too closely but it appears that this is a way to save MultiIndexed datasets to netCDF. So we may be able to do `sparse -> multiindex -> netCDF`
http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#compression-by-gathering
cc @fujiisoup ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4156/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue
1916012703,I_kwDOAMm_X85yNAif,8239,Address repo-review suggestions,2448579,open,0,,,7,2023-09-27T17:18:40Z,2023-10-02T20:24:34Z,,MEMBER,,,,"### What is your issue?
Here's the output from the Scientific Python [Repo Review](https://repo-review.readthedocs.io/) tool.
There's an online version [here](https://learn.scientific-python.org/development/guides/repo-review/?repo=pydata%2Fxarray&branch=main).
On mac I run
```
pipx run 'sp-repo-review[cli]' --format html --show err gh:pydata/xarray@main | pbcopy
```
A lot of these seem fairly easy to fix. I'll note that there's a large number of `mypy` config suggestions.
General
- Detected build backend:
setuptools.build_meta
- Detected license(s): Apache Software License
PyProject
See https://github.com/pydata/xarray/issues/8239#issuecomment-1739363809
? | Name | Description |
❌ |
PP305 |
Specifies xfail_strict
xfail_strict should be set. You can manually specify if a check
should be strict when setting each xfail.
[tool.pytest.ini_options]
xfail_strict = true
|
❌ |
PP308 |
Specifies useful pytest summary
-ra should be in addopts = [...] (print summary of all fails/errors).
[tool.pytest.ini_options]
addops = ["-ra", "--strict-config", "--strict-markers"]
|
Pre-commit
? | Name | Description |
❌ |
PC110 |
Uses black
Use https://github.com/psf/black-pre-commit-mirror instead of https://github.com/psf/black in .pre-commit-config.yaml
|
❌ |
PC160 |
Uses codespell
Must have https://github.com/codespell-project/codespell repo in .pre-commit-config.yaml
|
❌ |
PC170 |
Uses PyGrep hooks (only needed if RST present)
Must have https://github.com/pre-commit/pygrep-hooks repo in .pre-commit-config.yaml
|
❌ |
PC180 |
Uses prettier
Must have https://github.com/pre-commit/mirrors-prettier repo in .pre-commit-config.yaml
|
❌ |
PC191 |
Ruff show fixes if fixes enabled
If --fix is present, --show-fixes must be too.
|
❌ |
PC901 |
Custom pre-commit CI message
Should have something like this in .pre-commit-config.yaml :
ci:
autoupdate_commit_msg: 'chore: update pre-commit hooks'
|
MyPy
? | Name | Description |
❌ |
MY101 |
MyPy strict mode
Must have strict in the mypy config. MyPy is best with strict or
nearly strict configuration. If you are happy with the strictness of
your settings already, ignore this check or set strict = false
explicitly.
[tool.mypy]
strict = true
|
❌ |
MY103 |
MyPy warn unreachable
Must have warn_unreachable = true to pass this check. There are
occasionally false positives (often due to platform or Python version
static checks), so it's okay to ignore this check. But try it first - it
can catch real bugs too.
[tool.mypy]
warn_unreachable = true
|
❌ |
MY104 |
MyPy enables ignore-without-code
Must have "ignore-without-code" in enable_error_code = [...] . This
will force all skips in your project to include the error code, which
makes them more readable, and avoids skipping something unintended.
[tool.mypy]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
|
❌ |
MY105 |
MyPy enables redundant-expr
Must have "redundant-expr" in enable_error_code = [...] . This helps
catch useless lines of code, like checking the same condition twice.
[tool.mypy]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
|
❌ |
MY106 |
MyPy enables truthy-bool
Must have "truthy-bool" in enable_error_code = [] . This catches
mistakes in using a value as truthy if it cannot be falsey.
[tool.mypy]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
|
Ruff
? | Name | Description |
❌ |
RF101 |
Bugbear must be selected
Must select the flake8-bugbear B checks. Recommended:
[tool.ruff]
select = [
"B", # flake8-bugbear
]
|
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8239/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue
540451721,MDExOlB1bGxSZXF1ZXN0MzU1MjU4NjMy,3646,[WIP] GroupBy plotting,2448579,open,0,,,7,2019-12-19T17:26:39Z,2022-06-09T14:50:17Z,,MEMBER,,1,pydata/xarray/pulls/3646,"
- [x] Tests added
- [x] Passes `black . && mypy . && flake8`
- [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API
This adds plotting methods to GroupBy objects so that it's easy to plot each group as a facet. I'm finding this super helpful in my current research project.
It's pretty self-contained, mostly just adding `map_groupby*` methods to `FacetGrid`. But that's because I make `GroupBy` mimic the underlying `DataArray` by adding `coords`, `attrs` and `__getitem__`.
This still needs more tests but I would like feedback on the feature and the implementation.
## Example
``` python
import numpy as np
import xarray as xr
time = np.arange(80)
da = xr.DataArray(5 * np.sin(2*np.pi*time/10), coords={""time"": time}, dims=""time"")
da[""period""] = da.time.where((time % 10) == 0).ffill(""time"")/10
da.plot()
```

``` python
da.groupby(""period"").plot(col=""period"", col_wrap=4)
```

``` python
da = da.expand_dims(y=10)
da.groupby(""period"").plot(col=""period"", col_wrap=4, sharex=False, sharey=True, robust=True)
```

","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3646/reactions"", ""total_count"": 3, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 1, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull