issues
3 rows where user = 9513634 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date), closed_at (date)
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1437481995 | I_kwDOAMm_X85VrjwL | 7259 | 🐛 NetCDF4 RuntimeWarning if xarray is imported before netCDF4 | s-weigand 9513634 | open | 0 | 18 | 2022-11-06T17:38:35Z | 2024-04-28T20:11:35Z | CONTRIBUTOR | What happened?Yesterday we got a dependabot update PR to upgrade After a lot of head-scratching and confusion, we found that it is an import order problem that can be solved by importing netCDF4 before importing xarray (we didn't import netCDF4 at all in our code). What did you expect to happen?No RuntimeWarning from Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?The problem can be reproduced by running
which throws the error
When importing netCDF4 first all runs as expected
A git bisect shows that the first commit with this problem was https://github.com/pydata/xarray/commit/f32d354e295c05fb5c5ece7862f77f19d82d5894
```console
$ git bisect start
status: waiting for both good and bad commits
(xarray) /d/git/xarray (main|BISECTING)
$ git bisect good v2022.10.0
status: waiting for bad commit, 1 good commit known
(xarray) /d/git/xarray (main|BISECTING)
$ git bisect bad v2022.11.0
Bisecting: 23 revisions left to test after this (roughly 5 steps)
[4944b9eb1483c1fbd0e86fd12f3fb894b325fb8d] Fix binning when labels are provided. (#7205)
(xarray) /d/git/xarray ((4944b9eb...)|BISECTING)
$ git bisect run python -c "import xarray;import warnings;warnings.filterwarnings('error');import netCDF4"
running 'python' '-c' 'import xarray;import warnings;warnings.filterwarnings('\''error'\'');import netCDF4'
Bisecting: 11 revisions left to test after this (roughly 4 steps)
[f32d354e295c05fb5c5ece7862f77f19d82d5894] Lazy Imports (#7179)
running 'python' '-c' 'import xarray;import warnings;warnings.filterwarnings('\''error'\'');import netCDF4'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Anaconda3\envs\xarray\lib\site-packages\netCDF4\__init__.py", line 3, in <module>
from ._netCDF4 import *
File "src\netCDF4\_netCDF4.pyx", line 1, in init netCDF4._netCDF4
RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[b9aedd0155548ed0f34506ecc255b1688f07ffaa] set_coords docs: see also Dataset.assign_coords (#7230)
running 'python' '-c' 'import xarray;import warnings;warnings.filterwarnings('\''error'\'');import netCDF4'
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[65bfa4d10a529f00a9f9b145d1cea402bdae83d0] Actually make the fast code path return early for Aligner.align (#7222)
running 'python' '-c' 'import xarray;import warnings;warnings.filterwarnings('\''error'\'');import netCDF4'
Bisecting: 0 revisions left to test after this (roughly 1 step)
[fc9026b59d38146a21769cc2d3026a12d58af059] Avoid loading any data for reprs (#7203)
running 'python' '-c' 'import xarray;import warnings;warnings.filterwarnings('\''error'\'');import netCDF4'
f32d354e295c05fb5c5ece7862f77f19d82d5894 is the first bad commit
commit f32d354e295c05fb5c5ece7862f77f19d82d5894
Author: Mick <mick.niklas@gmail.com>
Date: Fri Oct 28 18:25:39 2022 +0200
Lazy Imports (#7179)
* fix typing of BackendEntrypoint
* make backends lazy
* make matplotlib lazy and add tests for lazy modules
* make flox lazy
* fix generated docs on windows...
* try fixing test
* make pycompat lazy
* make dask.array lazy
* add import xarray without numpy or pandas benchmark
* improve error reporting in test
* fix import benchmark
* add lazy import to whats-new
* fix lazy import test
* fix typos
* fix windows stuff again
asv_bench/benchmarks/import.py | 12 +-
doc/whats-new.rst | 2 +
xarray/backends/cfgrib_.py | 27 ++--
xarray/backends/common.py | 15 ++-
xarray/backends/h5netcdf_.py | 19 ++-
xarray/backends/netCDF4_.py | 16 +--
xarray/backends/pseudonetcdf_.py | 13 +-
xarray/backends/pydap_.py | 24 ++--
xarray/backends/pynio_.py | 13 +-
xarray/backends/scipy_.py | 12 +-
xarray/backends/zarr.py | 15 +--
xarray/convert.py | 3 +-
xarray/core/_aggregations.py | 247 ++++++++++++++++++++++++++++-------
xarray/core/dataset.py | 3 +-
xarray/core/duck_array_ops.py | 31 +++--
xarray/core/formatting.py | 36 ++---
xarray/core/indexing.py | 6 +-
xarray/core/missing.py | 4 +-
xarray/core/parallel.py | 20 +--
xarray/core/pycompat.py | 20 ++-
xarray/core/utils.py | 19 +++
xarray/core/variable.py | 15 +--
xarray/plot/utils.py | 9 +-
xarray/tests/test_backends.py | 4 +-
xarray/tests/test_computation.py | 4 +-
xarray/tests/test_dask.py | 3 +-
xarray/tests/test_dataset.py | 4 +-
xarray/tests/test_duck_array_ops.py | 4 +-
xarray/tests/test_missing.py | 4 +-
xarray/tests/test_plugins.py | 61 ++++++++-
xarray/tests/test_sparse.py | 4 +-
xarray/tests/test_variable.py | 4 +-
xarray/util/generate_aggregations.py | 13 +-
33 files changed, 445 insertions(+), 241 deletions(-)
bisect found first bad commit
```
Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.10.6 | packaged by conda-forge | (main, Oct 7 2022, 20:14:50) [MSC v.1916 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD
byteorder: little
LC_ALL: None
LANG: de_DE.UTF-8
LOCALE: ('de_DE', 'cp1252')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 2022.11.0
pandas: 1.5.1
numpy: 1.23.4
scipy: 1.9.3
netCDF4: 1.6.1
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.6.1
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 59.8.0
pip: 22.2.2
conda: None
pytest: 7.1.3
IPython: 8.5.0
sphinx: 5.2.3
None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7259/reactions", "total_count": 12, "+1": 8, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 4 } |
xarray 13221727 | issue | ||||||||
1118113789 | PR_kwDOAMm_X84xxbjr | 6207 | Fix missing dependecy definition of 'packaging' | s-weigand 9513634 | closed | 0 | 19 | 2022-01-29T08:19:09Z | 2022-02-01T18:29:04Z | 2022-01-31T23:51:59Z | CONTRIBUTOR | 0 | pydata/xarray/pulls/6207 | Hi there, we just wanted to upgrade
```console $ johnnydep xarray 2022-01-29 08:28:38 [info ] init johnnydist [johnnydep.lib] dist=xarray parent=None 2022-01-29 08:28:40 [info ] init johnnydist [johnnydep.lib] dist=numpy>=1.18 parent=xarray 2022-01-29 08:28:44 [info ] init johnnydist [johnnydep.lib] dist=pandas>=1.1 parent=xarray 2022-01-29 08:28:47 [info ] init johnnydist [johnnydep.lib] dist=numpy>=1.18.5 parent=pandas>=1.1 2022-01-29 08:28:51 [info ] init johnnydist [johnnydep.lib] dist=python-dateutil>=2.8.1 parent=pandas>=1.1 2022-01-29 08:28:53 [info ] init johnnydist [johnnydep.lib] dist=pytz>=2020.1 parent=pandas>=1.1 2022-01-29 08:28:56 [info ] init johnnydist [johnnydep.lib] dist=six>=1.5 parent=python-dateutil>=2.8.1 name summary xarray N-D labeled arrays and datasets in Python ├── numpy>=1.18 NumPy is the fundamental package for array computing with Python. └── pandas>=1.1 Powerful data structures for data analysis, time series, and statistics ├── numpy>=1.18.5 NumPy is the fundamental package for array computing with Python. ├── python-dateutil>=2.8.1 Extensions to the standard Python datetime module │ └── six>=1.5 Python 2 and 3 compatibility utilities └── pytz>=2020.1 World timezone definitions, modern and historical ``` The problem why your tests didn't catch this is that pytest pytest: simple powerful testing with Python ├── atomicwrites>=1.0 Atomic file writes. ├── attrs>=19.2.0 Classes Without Boilerplate ├── colorama Cross-platform colored terminal text. ├── iniconfig iniconfig: brain-dead simple config-ini parsing ├── packaging Core utilities for Python packages │ └── pyparsing!=3.0.5,>=2.0.2 Python parsing module ├── pluggy<2.0,>=0.12 plugin and hook calling mechanisms for python ├── py>=1.8.2 library with cross-python path, ini-parsing, io, code, log facilities └── toml Python Library for Tom's Obvious, Minimal Language ``` We also only saw our ASV workflow fail since ASV only installs the package and all direct runtime dependencies in the venv it runs the benchmark with. I prepared a dummy PR on my fork to demonstrate that this fixes the issue. Since the release is only 10h old maybe just do a quick post-release so most users won't even notice.
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6207/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | pull | |||||
1046614317 | PR_kwDOAMm_X84uL503 | 5948 | Fix plot.line crash for data of shape (1, N) in _title_for_slice on format_item | s-weigand 9513634 | closed | 0 | 2 | 2021-11-06T22:56:59Z | 2021-11-08T18:40:08Z | 2021-11-08T17:27:45Z | CONTRIBUTOR | 0 | pydata/xarray/pulls/5948 | Affected When dependabot recently made a PR to update We use The crash is caused because the following line allows arrays of shape But Before the check was https://github.com/pydata/xarray/blob/a78c1e0115d38cb4461fd1aba93334d440cff49c/xarray/core/formatting.py#L145-L146 Which didn't allow any arrays and caused the float formatting issue. Code showing the differences```python In [1]: import numpy as np In [2]: x = np.array(0.1) In [3]: x.shape Out[3]: () In [4]: np.issubdtype(type(x), np.floating) Out[4]: False In [5]: hasattr(x, "dtype") and np.issubdtype(x.dtype, np.floating) Out[5]: True In [6]: f"{x:.4}" Out[6]: '0.1' In [7]: f"{x.item():.4}" Out[7]: '0.1' In [8]: x = np.array([0.1]) In [9]: x.shape Out[9]: (1,) In [10]: np.issubdtype(type(x), np.floating) Out[10]: False In [11]: hasattr(x, "dtype") and np.issubdtype(x.dtype, np.floating) Out[11]: True In [12]: f"{x:.4}" --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_32644/2490801713.py in <module> ----> 1 f"{x:.4}" TypeError: unsupported format string passed to numpy.ndarray.__format__ In [13]: f"{x.item():.4}" Out[13]: '0.1' ```I hope
PS: Thanks for the awesome package ❤️ |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5948/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 } |
xarray 13221727 | pull |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issues] ( [id] INTEGER PRIMARY KEY, [node_id] TEXT, [number] INTEGER, [title] TEXT, [user] INTEGER REFERENCES [users]([id]), [state] TEXT, [locked] INTEGER, [assignee] INTEGER REFERENCES [users]([id]), [milestone] INTEGER REFERENCES [milestones]([id]), [comments] INTEGER, [created_at] TEXT, [updated_at] TEXT, [closed_at] TEXT, [author_association] TEXT, [active_lock_reason] TEXT, [draft] INTEGER, [pull_request] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [state_reason] TEXT, [repo] INTEGER REFERENCES [repos]([id]), [type] TEXT ); CREATE INDEX [idx_issues_repo] ON [issues] ([repo]); CREATE INDEX [idx_issues_milestone] ON [issues] ([milestone]); CREATE INDEX [idx_issues_assignee] ON [issues] ([assignee]); CREATE INDEX [idx_issues_user] ON [issues] ([user]);