instance_id stringlengths 10 57 | file_changes listlengths 1 15 | repo stringlengths 7 53 | base_commit stringlengths 40 40 | problem_statement stringlengths 11 52.5k | patch stringlengths 251 7.06M |
|---|---|---|---|---|---|
dask__dask-11707 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:arange"
],
"edited_modules": [
"dask/array/creation.py:arange"
]
},
"file": "dask/array/creation.py"
},
{
"changes": {
"added_entit... | dask/dask | c5524337c7abf5f9c5436736cbc8c081c193e8ab | arange crashes for parameters near 2**63
python 3.11
numpy 2.2.2
dask 2025.1.0
```python
>>> start, stop, step = 0., -9_131_138_316_486_228_481, -92_233_720_368_547_759
>>> da.arange(start, stop, step)
NotImplementedError: An error occurred while calling the arange method registered to the numpy backend.
Original Mes... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index ec7e96f8e..0f69d165c 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -436,7 +436,7 @@ def arange(
meta = meta_from_array(like) if like is not None else None
if dtype is None:
- dtype = np.arange(start, stop, step *... |
dask__dask-11723 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/slicing.py:setitem"
],
"edited_modules": [
"dask/array/slicing.py:setitem"
]
},
"file": "dask/array/slicing.py"
}
] | dask/dask | c5524337c7abf5f9c5436736cbc8c081c193e8ab | `da.Array.__setitem__` blindly assumes that the chunks are writeable
If one calls `da.Array.__getitem__(idx).__setitem__(())` where idx selects a scalar, all seems fine but crashes on `compute()`.
The object returned by `__getitem__` is another da.Array, which is writeable, but internally the chunk contains a `np.gener... | diff --git a/dask/array/slicing.py b/dask/array/slicing.py
index 473c42646..aebbfbf0f 100644
--- a/dask/array/slicing.py
+++ b/dask/array/slicing.py
@@ -2020,9 +2020,9 @@ def setitem(x, v, indices):
Parameters
----------
- x : numpy array
+ x : numpy/cupy/etc. array
The array to be assigned t... |
dask__dask-11725 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:arange"
],
"edited_modules": [
"dask/array/creation.py:arange"
]
},
"file": "dask/array/creation.py"
},
{
"changes": {
"added_entit... | dask/dask | c5524337c7abf5f9c5436736cbc8c081c193e8ab | `DataFrame.persist()`: persisting a specific partition fails ("IndexError: tuple index out of range")
**Describe the issue**:
Given the following conditions:
* `distributed.LocalCluster` with 2 workers
* Dask DataFrame with 2 equal-size partitions
Trying to `.persist()` a specific partition to a specific worker resu... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index ec7e96f8e..0f69d165c 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -436,7 +436,7 @@ def arange(
meta = meta_from_array(like) if like is not None else None
if dtype is None:
- dtype = np.arange(start, stop, step *... |
dask__dask-11727 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/dask_expr/_concat.py:Concat._simplify_up"
],
"edited_modules": [
"dask/dataframe/dask_expr/_concat.py:Concat"
]
},
"file": "dask/dataframe/dask_expr/_con... | dask/dask | d3ff1b66e154788e4551d008a77939232eadf370 | `dask.dataframe`: `concat()` fails when dropping a column and `columns` contains a mix of types
**Describe the issue**:
Given the following conditions:
* 2 Dask DataFrames with identical column names
* column names are a mix of strings and integers
This sequence of operations:
1. concatenate with `dask.dataframe.co... | diff --git a/dask/dataframe/dask_expr/_concat.py b/dask/dataframe/dask_expr/_concat.py
index 25695bad1..7e9eec52d 100644
--- a/dask/dataframe/dask_expr/_concat.py
+++ b/dask/dataframe/dask_expr/_concat.py
@@ -245,7 +245,8 @@ class Concat(Expr):
for frame in self._frames
]
if a... |
dask__dask-11743 | [
{
"changes": {
"added_entities": [
"dask/_expr.py:Expr.optimize",
"dask/_expr.py:Expr.fuse",
"dask/_expr.py:optimize_until"
],
"added_modules": [
"dask/_expr.py:optimize_until"
],
"edited_entities": [
"dask/_expr.py:Expr.analyze",
"da... | dask/dask | c44f7d0115162c9d1163e866fbf0f2dd7a3b8ad9 | dask.array.pad does not chunk up padded region
<!-- Please include a self-contained copy-pastable example that generates the issue if possible.
Please be concise with code posted. See guidelines below on how to provide a good bug report:
- Craft Minimal Bug Reports http://matthewrocklin.com/blog/work/2018/02/28/minim... | diff --git a/dask/_expr.py b/dask/_expr.py
index 9265bc1b6..6170691ee 100644
--- a/dask/_expr.py
+++ b/dask/_expr.py
@@ -40,9 +40,11 @@ def _unpack_collections(o):
class Expr:
- _parameters = [] # type: ignore
+ _parameters: list[str] = []
_defaults: dict[str, Any] = {}
- _instances = weakref.WeakVa... |
dask__dask-11801 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:arange"
],
"edited_modules": [
"dask/array/creation.py:arange"
]
},
"file": "dask/array/creation.py"
},
{
"changes": {
"added_entit... | dask/dask | b88fbbbb22722b24331c5b4ce76f522c069fdd92 | arange crashes for parameters near 2**63
python 3.11
numpy 2.2.2
dask 2025.1.0
```python
>>> start, stop, step = 0., -9_131_138_316_486_228_481, -92_233_720_368_547_759
>>> da.arange(start, stop, step)
NotImplementedError: An error occurred while calling the arange method registered to the numpy backend.
Original Mes... | diff --git a/continuous_integration/environment-3.12.yaml b/continuous_integration/environment-3.12.yaml
index 079c5afef..a47ab0c79 100644
--- a/continuous_integration/environment-3.12.yaml
+++ b/continuous_integration/environment-3.12.yaml
@@ -27,6 +27,7 @@ dependencies:
- numpy>=2
- pandas
- numba
+ - numba... |
dask__dask-11803 | [
{
"changes": {
"added_entities": [
"dask/dataframe/dask_expr/_indexing.py:_reverse_partition",
"dask/dataframe/dask_expr/_indexing.py:ReverseDataFrame._meta",
"dask/dataframe/dask_expr/_indexing.py:ReverseDataFrame._divisions",
"dask/dataframe/dask_expr/_indexing.py:Reverse... | dask/dask | 0e1418f02576c81d80c96e9fbed31257345a9e5f | assertionerror when trying to compute reversed cumulative sum
<!-- Please include a self-contained copy-pastable example that generates the issue if possible.
Please be concise with code posted. See guidelines below on how to provide a good bug report:
- Craft Minimal Bug Reports http://matthewrocklin.com/blog/work/2... | diff --git a/dask/dataframe/dask_expr/_indexing.py b/dask/dataframe/dask_expr/_indexing.py
index 7758c032d..b2b733472 100644
--- a/dask/dataframe/dask_expr/_indexing.py
+++ b/dask/dataframe/dask_expr/_indexing.py
@@ -15,10 +15,12 @@ from dask.dataframe.dask_expr import from_dask_array
from dask.dataframe.dask_expr._co... |
dask__dask-1529 | [
{
"changes": {
"added_entities": [
"dask/array/core.py:getarray_nofancy"
],
"added_modules": [
"dask/array/core.py:getarray_nofancy"
],
"edited_entities": [
"dask/array/core.py:getem",
"dask/array/core.py:from_array"
],
"edited_modules": ... | dask/dask | abde2826b9f3e591dd5a8b0f34286f5cbcfea6fe | da.compress() error with zarr array
I'm running into a problem using ``da.compress()`` with a 2D zarr array. Minimal example is below. I think what happens is that dask implements compress by trying to index (``__getitem__``) the input array with a list of integers. Zarr arrays don't support this, only contiguous slice... | diff --git a/dask/array/core.py b/dask/array/core.py
index 66de14033..6d0b6c812 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -55,6 +55,15 @@ def getarray(a, b, lock=None):
return c
+def getarray_nofancy(a, b, lock=None):
+ """ A simple wrapper around ``getarray``.
+
+ Used to indicate to t... |
dask__dask-1799 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/ufunc.py:wrap_elemwise"
],
"edited_modules": [
"dask/array/ufunc.py:wrap_elemwise"
]
},
"file": "dask/array/ufunc.py"
}
] | dask/dask | 7aa13ca969fde27ab4b81ed6926ef72f1358f11b | BUG: dask.array.maximum can trigger eager evaluation
The failure case seems to be `maximum(scalar, dask_array)`:
```
In [1]: import dask.array as da
In [2]: x = da.ones((3,), chunks=(3,))
In [3]: da.maximum(0, x)
Out[3]: array([ 1., 1., 1.])
In [4]: da.maximum(x, 0)
Out[4]: dask.array<maximum..., shape=(... | diff --git a/dask/array/ufunc.py b/dask/array/ufunc.py
index c107a2880..90ac357bb 100644
--- a/dask/array/ufunc.py
+++ b/dask/array/ufunc.py
@@ -17,15 +17,16 @@ def __array_wrap__(numpy_ufunc, x, *args, **kwargs):
def wrap_elemwise(numpy_ufunc, array_wrap=False):
""" Wrap up numpy function into dask.array """
-... |
dask__dask-1904 | [
{
"changes": {
"added_entities": [
"dask/array/chunk.py:arange"
],
"added_modules": [
"dask/array/chunk.py:arange"
],
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/chunk.py"
},
{
"changes": {
"added_entities": nul... | dask/dask | b2dbc973c1a454db9fb22778e4e35dfd78239c40 | Chunksize mismatch in `da.arange`
Hello,
I have tried to do the following with dask 0.13.0
```python
import dask.array as da
x = da.arange(0., 1., 0.01, chunks=20)
y = da.broadcast_to(x, (11, 100))
y.compute()
```
which raises belows exception. I couldn't find any details in the help, what `braodcast_to` ex... | diff --git a/dask/array/chunk.py b/dask/array/chunk.py
index d5b38a359..54c17d213 100644
--- a/dask/array/chunk.py
+++ b/dask/array/chunk.py
@@ -186,3 +186,8 @@ def topk(k, x):
k = np.minimum(k, len(x))
ind = np.argpartition(x, -k)[-k:]
return np.sort(x[ind])[::-1]
+
+
+def arange(start, stop, step, leng... |
dask__dask-2084 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/delayed.py:Delayed.__getattr__",
"dask/delayed.py:DelayedAttr.__init__"
],
"edited_modules": [
"dask/delayed.py:Delayed",
"dask/delayed.py:DelayedAttr"
]
... | dask/dask | 0c39da3493891891830ab9e8eb5d5d8db203f826 | Inheritance of Purity
(As discussed here: http://stackoverflow.com/questions/42773134/inheritance-of-purity/42773643)
I have a question about inheritance of function purity. For example, consider this case:
```python
In [1]: from dask import delayed
In [2]: myArr = delayed(np.ones, pure=True)((10,10))
In [... | diff --git a/dask/delayed.py b/dask/delayed.py
index d54d9b941..a9cbf6360 100644
--- a/dask/delayed.py
+++ b/dask/delayed.py
@@ -240,9 +240,29 @@ def delayed(obj, name=None, pure=False, nout=None, traverse=True):
>>> res.compute() # doctest: +SKIP
AttributeError("'list' object has no attribute 'not_a_real_me... |
dask__dask-2148 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/__init__.py"
},
{
"changes": {
"added_entities": [
"dask/array/core.py:tile"
],
"added_modules": [
"dask/... | dask/dask | d004c13e775fca0d7bd71448531590bc99f726f9 | unexpected behavior with da.vstack and broadcasting
I have run into some unexpected behavior with `dask.array.vstack`, which seems like a bug to me.
```python
import dask.array as da
import numpy as np
x = da.arange(12, chunks=100).reshape((4,3))
y = da.vstack([x[:,0], x[:,1], x[:,2]]).T
ans1 = x * [0,0,1]
... | diff --git a/dask/array/__init__.py b/dask/array/__init__.py
index 23cd3800a..57a6fd8f0 100644
--- a/dask/array/__init__.py
+++ b/dask/array/__init__.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function
from ..utils import ignoring
from .core import (Array, stack, concatenate, take, ten... |
dask__dask-2205 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/rechunk.py:_compute_rechunk"
],
"edited_modules": [
"dask/array/rechunk.py:_compute_rechunk"
]
},
"file": "dask/array/rechunk.py"
}
] | dask/dask | 0d741d79e02281c3c145636c2cad972fb247de7d | Reshape with empty dimensions
Reshaping with zero dimensions fails
```python
def test_reshape_empty():
x = da.ones((0, 10), chunks=(5, 5))
y = x.reshape((0, 5, 2))
assert_eq(x, x)
```
I've tracked this down to the fact that this line returns a list with one empty list
```python
def intersect... | diff --git a/dask/array/rechunk.py b/dask/array/rechunk.py
index de5da0f68..eea5470ff 100644
--- a/dask/array/rechunk.py
+++ b/dask/array/rechunk.py
@@ -18,6 +18,7 @@ from toolz import accumulate, reduce
from ..base import tokenize
from .core import concatenate3, Array, normalize_chunks
+from .wrap import empty
fr... |
dask__dask-2274 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:map_blocks",
"dask/array/core.py:stack"
],
"edited_modules": [
"dask/array/core.py:map_blocks",
"dask/array/core.py:stack"
]
},
"file... | dask/dask | c136b9dde885ba35dde85ba84afe2ad03c20e32d | da.stack dtype
Greetings dask dudes,
I'm using `dask` version `0.14.1`
I stumbled across the following behaviour with respect to the `dtype` of a **computed** `stack`, and I was curious as to whether it is as expected:
First, create some data ...
```python
import dask.array as da ... | diff --git a/dask/array/core.py b/dask/array/core.py
index 9bf4edb3e..83c5160b4 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -514,7 +514,8 @@ def map_blocks(func, *args, **kwargs):
drop_axis : number or iterable, optional
Dimensions lost by the function.
new_axis : number or iterable, ... |
dask__dask-2356 | [
{
"changes": {
"added_entities": [
"dask/array/ufunc.py:copy_docstring",
"dask/array/ufunc.py:ufunc.__init__",
"dask/array/ufunc.py:ufunc.__getattr__",
"dask/array/ufunc.py:ufunc.__dir__",
"dask/array/ufunc.py:ufunc.__repr__",
"dask/array/ufunc.py:ufunc.__ca... | dask/dask | 38ac6a98bca27a28fc97ae30022ff44340590744 | blocksize option to read_csv doesn't accept floats
The read_csv docstring presents floats as supported:
```
2. In some cases it can break up large files as follows:
>>> df = dd.read_csv('largefile.csv', blocksize=25e6) # 25MB chunks # doctest: +SKIP
```
but on Python 3 at least you get an error:
```
... | diff --git a/dask/array/ufunc.py b/dask/array/ufunc.py
index 7096c4071..e8e21f22c 100644
--- a/dask/array/ufunc.py
+++ b/dask/array/ufunc.py
@@ -1,10 +1,13 @@
from __future__ import absolute_import, division, print_function
from operator import getitem
+from functools import partial
import numpy as np
+from tool... |
dask__dask-2383 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:map_blocks"
],
"edited_modules": [
"dask/array/core.py:map_blocks"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities"... | dask/dask | 9288d5c861a6ca82a462c0138ec147e01b1130a6 | stack/concatenate duplicates last result in list comprehension
Am running into some strange behavior with Dask `stack` and `concatenate` where they end up duplicating the last value in a list comprehension for all other values in the stacked or concatenated array. Not seeing this across the board, but am seeing it reli... | diff --git a/dask/array/core.py b/dask/array/core.py
index 0f602a296..5e6830bee 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -533,9 +533,13 @@ def map_blocks(func, *args, **kwargs):
new_axis : number or iterable, optional
New dimensions created by the function. Note that these are applied
... |
dask__dask-2466 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/fft.py:_fftfreq_helper"
],
"edited_modules": [
"dask/array/fft.py:_fftfreq_helper"
]
},
"file": "dask/array/fft.py"
},
{
"changes": {
"added_en... | dask/dask | 37c3ae2e091412f5e2fdf3c957c383e89e4c8bb2 | Can't specify storage_options for bag.to_textfiles, dataframe.to_csv
The read functions allow specifying `storage_options` for things like AWS key/secret. The `to_parquet` function allows this as well.
However in other cases such as `bag.to_textfiles()` and `dataframe.to_csv()`, it is not possible to specify these o... | diff --git a/dask/array/fft.py b/dask/array/fft.py
index cfccda548..2f64c94ee 100644
--- a/dask/array/fft.py
+++ b/dask/array/fft.py
@@ -228,9 +228,9 @@ def _fftfreq_helper(n, d=1.0, chunks=None, real=False):
s = n // 2 + 1 if real else n
t = l - s
- chunks = _normalize_chunks(chunks, (s,))[0] + (t,)
+ ... |
dask__dask-2467 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/delayed.py:to_task_dask"
],
"edited_modules": [
"dask/delayed.py:to_task_dask"
]
},
"file": "dask/delayed.py"
}
] | dask/dask | ecdae84aa3b8ee5408876b0b7d7eade3d127e177 | Slicing delayed objects with delayed objects does not work
I'm trying to wrap my code with delayed, using `dask 0.15.0`, `python 3.6.0` and `numpy 1.12.1`, but I stumbled on an exception.
```
from dask import delayed
import numpy as np
a = delayed(np.arange(10))
b = delayed(2)
a[:b].compute()
```
results in: ... | diff --git a/dask/dataframe/io/io.py b/dask/dataframe/io/io.py
index 93b47bb3c..5c82683aa 100644
--- a/dask/dataframe/io/io.py
+++ b/dask/dataframe/io/io.py
@@ -343,7 +343,7 @@ def dataframe_from_ctable(x, slc, columns=None, categories=None, lock=lock):
def from_dask_array(x, columns=None):
- """ Create Dask Ar... |
dask__dask-2468 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/bag/core.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/delayed.py:to_... | dask/dask | ecdae84aa3b8ee5408876b0b7d7eade3d127e177 | Can't convert bag -> dataframe -> bag after flatten()
When I try to use `flatten()/concat()` on a bag and then proceed to convert to dataframe and back, the `pd.DataFrame` constructor fails because the data is passed in as an Iterator. See example below. Commenting out `.flatten()` or `.to_bag()` both cause it to be su... | diff --git a/dask/bag/core.py b/dask/bag/core.py
index aed4e6ca2..1cb43c01b 100644
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -1987,5 +1987,5 @@ def split(seq, n):
def to_dataframe(seq, columns, dtypes):
import pandas as pd
- res = pd.DataFrame(seq, columns=list(columns))
+ res = pd.DataFrame(reify(... |
dask__dask-2543 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:where"
],
"edited_modules": [
"dask/array/core.py:where"
]
},
"file": "dask/array/core.py"
}
] | dask/dask | 6d58b523a53bee22a76ea9860ca1a131b2f9312d | da.where breaks on non-bool condition
Using dask 0.15.1, numpy 1.13.1, Python 2.7, the following code throws an exception with dask, while the equivalent numpy code works correctly:
```python
>>> import numpy as np
>>> import dask.array as da
>>> a = da.arange(4, dtype=np.uint8, chunks=(4,))
>>> da.where(a, 1, 0).... | diff --git a/dask/array/core.py b/dask/array/core.py
index c880fa0cd..3f3f222db 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2842,12 +2842,10 @@ def where(condition, x=None, y=None):
x = broadcast_to(x, shape).astype(dtype)
y = broadcast_to(y, shape).astype(dtype)
- if isinstance(conditio... |
dask__dask-2544 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/core.py"
}
] | dask/dask | 6d58b523a53bee22a76ea9860ca1a131b2f9312d | Dask array repeat mishandles negative axis
When providing `repeat` with a valid negative value for `axis`, it appears to mishandle and raise an `IndexError` instead. An example of the problem is included in the details below along with the environment used to reproduce it.
Note: These all come from `conda-forge` whe... | diff --git a/dask/array/core.py b/dask/array/core.py
index c880fa0cd..2371200c4 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -3955,6 +3955,11 @@ def repeat(a, repeats, axis=None):
if not isinstance(repeats, Integral):
raise NotImplementedError("Only integer valued repeats supported")
+ ... |
dask__dask-2553 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:compress"
],
"edited_modules": [
"dask/array/core.py:compress"
]
},
"file": "dask/array/core.py"
}
] | dask/dask | 3ba30276753205c97e8b4838048aaba608e1922e | ResourceProfile has different behaviour using context manager vs `register`
I'm using the dask profilers with the pattern
```
for profiler in profilers: profiler.register()
foo() # Do work, some of it dask, some of it other
for profiler in profilers: profiler.unregister()
```
(although with some try/finally stuff... | diff --git a/dask/array/core.py b/dask/array/core.py
index 3f3f222db..3446e5723 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2451,20 +2451,25 @@ def take(a, indices, axis=0):
@wraps(np.compress)
def compress(condition, a, axis=None):
+ from .wrap import zeros
+
if axis is None:
- rais... |
dask__dask-2555 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/__init__.py"
},
{
"changes": {
"added_entities": [
"dask/array/core.py:extract"
],
"added_modules": [
"da... | dask/dask | 96ca782f239f133e539e4d7346b388f10414eaa2 | Lazy implementation of compress
The current implementation of Dask Array's [`compress`]( http://dask.pydata.org/en/latest/array-api.html#dask.array.compress ) appears to be eagerly evaluated. Would be nice if this implementation were modified to be lazily evaluated. This would require using some unknown lengths and unk... | diff --git a/dask/array/__init__.py b/dask/array/__init__.py
index 483dbd314..960270369 100644
--- a/dask/array/__init__.py
+++ b/dask/array/__init__.py
@@ -6,7 +6,7 @@ from .core import (Array, stack, concatenate, take, tensordot, transpose,
roll, fromfunction, unique, store, squeeze, topk, bincount, tile,
... |
dask__dask-2647 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/slicing.py:sanitize_index"
],
"edited_modules": [
"dask/array/slicing.py:sanitize_index"
]
},
"file": "dask/array/slicing.py"
}
] | dask/dask | d32e8b7b91e130037701daffabf663d8f1bae5de | Indexing dask.array by an unsigned-integer np.ndarray
Indexing dask.array by an unsigned-integer np.ndarray raises TypeError.
Is it an intended behavior?
```python
In [1]: import numpy as np
...: import dask.array as da
...:
...: array = da.from_array(np.arange(6), chunks=3)
...: array[np.array([0... | diff --git a/dask/array/slicing.py b/dask/array/slicing.py
index 269ffbc49..42e65cc45 100644
--- a/dask/array/slicing.py
+++ b/dask/array/slicing.py
@@ -62,7 +62,7 @@ def sanitize_index(ind):
# If a 1-element tuple, unwrap the element
nonzero = nonzero[0]
return np.asanyarray(nonzero)... |
dask__dask-2781 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:broadcast_shapes"
],
"edited_modules": [
"dask/array/core.py:broadcast_shapes"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"add... | dask/dask | 9e9fa10ef11bfe86a52214d8a2cda19508a4ee37 | Wrapper always pass None to random.choice
From dask/array/random.py:
> with ignoring(AttributeError):
> @doc_wraps(np.random.RandomState.choice)
> def choice(self, a, size=None, replace=True, p=None, chunks=None):
> return self._wrap(np.random.RandomState.choice, a,
> ... | diff --git a/dask/array/core.py b/dask/array/core.py
index 4a28b01fe..50c066574 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2497,8 +2497,8 @@ def broadcast_shapes(*shapes):
return shapes[0]
out = []
for sizes in zip_longest(*map(reversed, shapes), fillvalue=-1):
- dim = max(si... |
dask__dask-2871 | [
{
"changes": {
"added_entities": [
"dask/diagnostics/profile.py:ResourceProfiler._is_running"
],
"added_modules": null,
"edited_entities": [
"dask/diagnostics/profile.py:ResourceProfiler.__init__",
"dask/diagnostics/profile.py:ResourceProfiler._start_collect",
... | dask/dask | d0fac49699b46078b070d318d4c9a02612d0bd97 | ResourceProfiler keeps running after `__exit__`
If you write something like:
```
with ResourceProfiler(dt=0.01) as rprof:
# ...
```
then the profiler process keeps running at the end of the `with` block. You have to call `rprof.close()` as well, which is unexpected.
(noticed in the distributed test ... | diff --git a/dask/diagnostics/profile.py b/dask/diagnostics/profile.py
index 48e68a565..ec855173e 100644
--- a/dask/diagnostics/profile.py
+++ b/dask/diagnostics/profile.py
@@ -140,29 +140,35 @@ class ResourceProfiler(Callback):
data will only be collected while a dask scheduler is active.
"""
def __init... |
dask__dask-3016 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/bag/core.py:Bag.take",
"dask/bag/core.py:Bag.to_dataframe",
"dask/bag/core.py:safe_take"
],
"edited_modules": [
"dask/bag/core.py:Bag",
"dask/bag/core.py... | dask/dask | 9a1f92801eebeefba4481fa5c9fc00badeee148a | Dask objects inspection failing, issues with graph
Hi,
- I cannot reproduce the example given [here](http://dask.pydata.org/en/latest/inspect.html) on the dask website in order to inspect dask objects.
Please see the following notebook:
[inspect dask object](https://github.com/apatlpo/lops-array/blob/master/sandbo... | diff --git a/dask/array/core.py b/dask/array/core.py
index 9346b1c04..15a63bd8b 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2159,7 +2159,9 @@ def atop(func, out_ind, *args, **kwargs):
concatenate : bool, keyword only
If true concatenate arrays along dummy indices, else provide lists
... |
dask__dask-3024 | [
{
"changes": {
"added_entities": [
"dask/array/core.py:store_chunk"
],
"added_modules": [
"dask/array/core.py:store_chunk"
],
"edited_entities": [
"dask/array/core.py:insert_to_ooc"
],
"edited_modules": [
"dask/array/core.py:insert_to_ooc... | dask/dask | 076830c8e87c5f8806c85be639b92d97008ebf03 | `dask.array.nanmean()` generates unstable name (hash)
#### Code Sample
```python
import dask.array as da
import numpy as np
x = da.ones((5, 5), chunks=(2, 2))
x = da.nanmean(x, axis=0)
print(x.name)
```
#### Problem Description
Running the above sample three times outputs:
```
mean_agg-aggregate-815787... | diff --git a/dask/array/core.py b/dask/array/core.py
index 9346b1c04..8801c75aa 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2159,7 +2159,9 @@ def atop(func, out_ind, *args, **kwargs):
concatenate : bool, keyword only
If true concatenate arrays along dummy indices, else provide lists
... |
dask__dask-3028 | [
{
"changes": {
"added_entities": [
"dask/array/core.py:load_chunk",
"dask/array/core.py:retrieve_from_ooc"
],
"added_modules": [
"dask/array/core.py:load_chunk",
"dask/array/core.py:retrieve_from_ooc"
],
"edited_entities": [
"dask/array/core.... | dask/dask | 8149c4b67291bd91859f3c7ef7286f58aa09e646 | Implement .str.cat
This should be doable:
```python
a = dd.from_pandas(pd.Series(["a"] * 100), 2)
b = dd.from_pandas(pd.Series(['b'] * 100), 2)
a.str.cat(b, sep=":") # NotImplementedError
```
Some issues around alignment probably. | diff --git a/dask/array/core.py b/dask/array/core.py
index bfecfc992..206ac4c2d 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -18,12 +18,12 @@ import uuid
import warnings
try:
- from cytoolz import (partition, concat, join, first,
+ from cytoolz import (partition, concat, concatv, join, first,
... |
dask__dask-3042 | [
{
"changes": {
"added_entities": [
"dask/array/core.py:load_chunk",
"dask/array/core.py:retrieve_from_ooc"
],
"added_modules": [
"dask/array/core.py:load_chunk",
"dask/array/core.py:retrieve_from_ooc"
],
"edited_entities": [
"dask/array/core.... | dask/dask | a1653463534a7dd9212f45f833aa17b7dd12e574 | repeated cumsum on dataframe returns the results of the first cumsum
reproduce with
```python
import pandas as pd
import dask.dataframe as ddf
df = pd.DataFrame(dict(a=list('aabbcc')),
index=pd.date_range(start='20100101', periods=6))
df['ones']=1
df['twos']=2
dadf = ddf.from_pandas(df, n... | diff --git a/dask/array/core.py b/dask/array/core.py
index bfecfc992..206ac4c2d 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -18,12 +18,12 @@ import uuid
import warnings
try:
- from cytoolz import (partition, concat, join, first,
+ from cytoolz import (partition, concat, concatv, join, first,
... |
dask__dask-3067 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:Array.__len__"
],
"edited_modules": [
"dask/array/core.py:Array"
]
},
"file": "dask/array/core.py"
}
] | dask/dask | 1223f0167e1f760a93aaf286e6dcfa72ba21f773 | len(dask scalar) gives an error
```
Traceback (most recent call last):
File "make-pkhalo.py", line 12, in <module>
print(cath200['Mass'][0])
File "/home/yfeng1/anaconda3/install/envs/cfastpm/lib/python3.6/site-packages/nbodykit/base/catalog.py", line 75, in __str__
if len(self) > 0:
File "/home/yfen... | diff --git a/dask/array/core.py b/dask/array/core.py
index af23cc282..d7a944784 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1111,6 +1111,8 @@ class Array(Base):
chunks = property(_get_chunks, _set_chunks, "chunks property")
def __len__(self):
+ if not self.chunks:
+ raise ... |
dask__dask-3107 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/percentile.py:_percentile",
"dask/array/percentile.py:percentile",
"dask/array/percentile.py:merge_percentiles"
],
"edited_modules": [
"dask/array/percenti... | dask/dask | 35ee4dfea06392b3b359869b945d00202358d296 | BUG: da.percentile silently returns nan for array of unknown length
So the percentile on a normal dask array is fine:
```
In [2]: a = da.from_array(np.random.randn(10), chunks=(10,))
In [3]: a
Out[3]: dask.array<array, shape=(10,), dtype=float64, chunksize=(10,)>
In [4]: da.percentile(a, 50)
Out[4]: dask.ar... | diff --git a/dask/array/percentile.py b/dask/array/percentile.py
index baa1e5bf0..0fd239e74 100644
--- a/dask/array/percentile.py
+++ b/dask/array/percentile.py
@@ -14,21 +14,22 @@ from .. import sharedict
@wraps(np.percentile)
def _percentile(a, q, interpolation='linear'):
+ n = len(a)
if not len(a):
- ... |
dask__dask-3126 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:Array.to_delayed"
],
"edited_modules": [
"dask/array/core.py:Array"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities... | dask/dask | cceb6e2ac50a85b3f34154612dc98508432f057c | to_delayed always optimizes
The `da.Array.to_delayed` call optimizes the underlying dask array's task graph before creating the dask.delayed objects. In some cases this is not desired. One option here would be to have an `optimize_graph=True` keyword argument. There might also be broader solutions? | diff --git a/dask/array/core.py b/dask/array/core.py
index 254232621..edbf36f8a 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1833,10 +1833,14 @@ class Array(Base):
memo[id(self)] = c
return c
- def to_delayed(self):
- """ Convert Array into dask Delayed objects
+ def to_... |
dask__dask-3254 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:Array.squeeze"
],
"edited_modules": [
"dask/array/core.py:Array"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities": ... | dask/dask | cc9f8db12e4c43b61fb79bb74bbd71b3cd8ba1f7 | dask.Bag slow and very large memory consumption with join
In a certain application I am passing a (moderately) large argument to Bag.join. But I am encountering a few issues:
- The graph does not appear in the diagnostics page (presumably the graph is being communicated)
- The client consumes GB of memory
I suspec... | diff --git a/dask/array/core.py b/dask/array/core.py
index 6f132e1ad..a4990fe95 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1754,9 +1754,9 @@ class Array(Base):
return cumprod(self, axis, dtype, out=out)
@derived_from(np.ndarray)
- def squeeze(self):
+ def squeeze(self, axis=None)... |
dask__dask-3301 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:Array.store",
"dask/array/core.py:concatenate"
],
"edited_modules": [
"dask/array/core.py:Array",
"dask/array/core.py:concatenate"
]
},
... | dask/dask | 11a50f0d329bdaf1ea6b7f0cff9500f55699fd36 | optimization of array.concatenate depends strongly on endianness
I have encountered a dask optimization issue that I think is at the core of xgcm/xmitgcm#73.
Basically, I am constructing a big dask array by concatenating many numpy memmaps, each created within a `from_delayed` function. Then I want to get back out a... | diff --git a/dask/array/core.py b/dask/array/core.py
index a4990fe95..1d3d54f75 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1208,7 +1208,12 @@ class Array(Base):
@wraps(store)
def store(self, target, **kwargs):
- return store([self], [target], **kwargs)
+ r = store([self], [ta... |
dask__dask-3343 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:Series.map",
"dask/dataframe/core.py:Series.apply",
"dask/dataframe/core.py:DataFrame.apply",
"dask/dataframe/core.py:apply_concat_apply",
"dask/da... | dask/dask | a18e4e9934eda54ed78edb11b80228cf9124c607 | DataFrame: Splitting a list to multiple columns is throwing error
I was trying to split a string and saved value in a temp column and use that column to populate additional columns. I am able to split string and convert to a list. But while fetching elements from list and assigning to new column is throwing error.
... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index ff2e21e63..c4d6eb99f 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1970,7 +1970,7 @@ Dask Name: {name}, {task} tasks""".format(klass=self.__class__.__name__,
enumerate(self.__dask_keys__())}
dsk.update(sel... |
dask__dask-3429 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/__init__.py"
},
{
"changes": {
"added_entities": [
"dask/array/chunk.py:topk_postprocess",
"dask/array/chunk.py:argto... | dask/dask | a842d448b7dabd48f8ad23cba906f2502e6149a8 | Dropping NumPy 1.10
Increasingly we discover issues with PRs after merging them on NumPy 1.10, which we then either need to fix ourselves or hope the submitter of the PR will kindly fix the issue. While these issues can normally be solved by skipping, adding compat functions, etc., it starts to raise the question: how ... | diff --git a/.gitignore b/.gitignore
index cb1fc67ff..5b3080424 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
*.pyc
*.egg-info
+dask-worker-space/
docs/build
build/
dist/
diff --git a/.travis.yml b/.travis.yml
index 8ffe4f6ed..a1edcbfd9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,7 +35,7 @@ jobs:
... |
dask__dask-3436 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/gh... | dask/dask | 0fd986fb3f9aefb2c441f135fc807c18471a61b8 | Series comparison to NumPy scalar fails
Comparing a dask Series with a NumPy scalar or 0D array fails in certain cases. Here is a minimal reproducible example:
```python
import dask.dataframe as dd
import pandas as pd
np.float64(5.2) >= dd.from_array(np.arange(10))
```
```
---------------------------------... | diff --git a/dask/array/__init__.py b/dask/array/__init__.py
index 67c697118..bf37a71b2 100644
--- a/dask/array/__init__.py
+++ b/dask/array/__init__.py
@@ -7,13 +7,14 @@ from .core import (Array, block, concatenate, stack, from_array, store,
broadcast_arrays, broadcast_to)
from .routines import (t... |
dask__dask-3446 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/gh... | dask/dask | 0fd986fb3f9aefb2c441f135fc807c18471a61b8 | Dataframe groupby()[column].agg fails with AttributeError
Minimal not working example (dask 0.17.2, pandas 0.22.0, Python 3.6):
```
import pandas as pd
from dask import dataframe as dd
df = pd.DataFrame({'A': [1, 2, 3, 1, 2, 3, 1, 2, 4],
'B': [-0.776, -0.4, -0.873, 0.054, 1.419, -0.948, -0.967, -1.71... | diff --git a/dask/array/__init__.py b/dask/array/__init__.py
index 67c697118..bf37a71b2 100644
--- a/dask/array/__init__.py
+++ b/dask/array/__init__.py
@@ -7,13 +7,14 @@ from .core import (Array, block, concatenate, stack, from_array, store,
broadcast_arrays, broadcast_to)
from .routines import (t... |
dask__dask-3461 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:DataFrame.__getitem__"
],
"edited_modules": [
"dask/dataframe/core.py:DataFrame"
]
},
"file": "dask/dataframe/core.py"
},
{
"changes": {
... | dask/dask | f6c8a9c6304bb431d8e76c82efab9ea46a40138a | dask.dataframe __getitem__ does not work with subclasses of str in python 3.6
I am upgrading my code from python 2.7 to 3.6 and found that that the __getitem__ of a dask dataframe does not work as before: I use a subclass of `str` for the column names and then I want to access the columns with `df[column_name]`. This w... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 0ddbf62d4..59bd653ee 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -22,7 +22,7 @@ from .. import core
from ..utils import partial_by_order
from .. import threaded
-from ..compatibility import apply, operator_div, bind_method
+f... |
dask__dask-3472 | [
{
"changes": {
"added_entities": [
"dask/array/chunk.py:einsum"
],
"added_modules": [
"dask/array/chunk.py:einsum"
],
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/chunk.py"
},
{
"changes": {
"added_entities": nul... | dask/dask | 7c419580037f552befc2650cb13967dd6bdef86a | da.einsum ignores split_every
As of git head (495a3611c1ccc12ccc37cf8a56ec3a88743815f5), da.einsum accepts, but ignores, the split_every parameter:
```
import dask.array as da
a = da.ones((5, 40), chunks=10)
b = da.ones((40, ), chunks=10)
da.einsum('...i,...i', a, b, split_every=2).visualize()
```
:
else:
x = np.asfortranarray(x)
return x.T.view(dtype).T
+
+
+def einsum(*operands, **kwargs):
+ subsc... |
dask__dask-3499 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:DataFrame.apply",
"dask/dataframe/core.py:DataFrame.info"
],
"edited_modules": [
"dask/dataframe/core.py:DataFrame"
]
},
"file": "dask/da... | dask/dask | 48c4a589393ebc5b335cc5c7df291901401b0b15 | pandas 0.23.0 compatibility
Forgot to check this earlier :/ I'll carve out some time to do CI maintenance soon.
### breaks
- `result_type` arg to http://pandas.pydata.org/pandas-docs/version/0.23/whatsnew.html#changes-to-make-output-of-dataframe-apply-consistent
### warnings from deprecations
- rolling / ex... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 930bdecaa..5c55ab9b4 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -38,7 +38,8 @@ from .hashing import hash_pandas_object
from .optimize import optimize
from .utils import (meta_nonempty, make_meta, insert_meta_param_description,... |
dask__dask-3522 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:apply_and_enforce"
],
"edited_modules": [
"dask/dataframe/core.py:DataFrame",
"dask/dataframe/core.py:apply_and_enforce"
]
},
"file": "da... | dask/dask | 771a045cd9196b37af54bee16761da7330c943a6 | dask.dataframe.DataFrame.rename not allowed
Is it really not allowed to rename columns of Dask DataFrame's?
The code to reproduce it:
```python
import pandas as pd
import dask.dataframe as dd
df1 = pd.DataFrame(data={'a':[1,2,3],'b':[10,20,30]})
dd1 = dd.from_pandas(df1, npartitions=3)
dd1.rename(index=str, ... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 5c55ab9b4..54f256c24 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -2565,7 +2565,7 @@ class DataFrame(_Frame):
df2 = self._meta.assign(**_extract_meta(kwargs))
return elemwise(methods.assign, self, *pairs, meta=df... |
dask__dask-3536 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "dask/array/__init__.py"
},
{
"changes": {
"added_entities": [
"dask/array/core.py:Array.to_zarr",
"dask/array/core.py:from_zarr"... | dask/dask | d1f00aece8a48ccafdb040208c27cc14c4b4abfa | Subset dask.dataframe columns with an Index
I think this should be doable:
```python
In [1]: import pandas as pd; import dask.dataframe as dd
In [2]: df = pd.DataFrame({"A": [1, 2], "B": [3, 4], "C": [5, 6]})
In [3]: df[pd.Index(['C', 'A', 'B'])]
Out[3]:
C A B
0 5 1 3
1 6 2 4
In [4]: ddf =... | diff --git a/dask/array/__init__.py b/dask/array/__init__.py
index 02e13575f..804732df2 100644
--- a/dask/array/__init__.py
+++ b/dask/array/__init__.py
@@ -4,7 +4,7 @@ from ..utils import ignoring
from .core import (Array, block, concatenate, stack, from_array, store,
map_blocks, atop, to_hdf5, to... |
dask__dask-3606 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:_Frame.sample"
],
"edited_modules": [
"dask/dataframe/core.py:_Frame"
]
},
"file": "dask/dataframe/core.py"
}
] | dask/dask | 279fdf7a6a78a1dfaa0974598aead3e1b44f9194 | DataFrame.sample function signature differs from pandas
- `pandas.DataFrame.sample(n, frac, ...)`
- `dask.dataframe.DataFrame.sample(frac, ...)`
We can't reliably do `n`, so we should raise if it's anything but `None`. But it'd still be nice to match the signature. | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 146b1eb9f..be22829a1 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1030,12 +1030,15 @@ Dask Name: {name}, {task} tasks""".format(klass=self.__class__.__name__,
def bfill(self, axis=None, limit=None):
return self.fill... |
dask__dask-3767 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:Array.__setitem__"
],
"edited_modules": [
"dask/array/core.py:Array"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entitie... | dask/dask | 06248f39d44d45ff375ee364a1cfa593c161c990 | Dask array setitem with differently chunked data provides wrong shape
```python
>>> import dask.array as da
>>> x = da.zeros(5, chunks=2)
>>> m = da.zeros(5, chunks=3)
>>> x[m>0] = 1
>>> print x.shape, x.compute().shape
(5,) (4,)
```
This should probably unifiy chunks before slicing | diff --git a/.gitignore b/.gitignore
index 7fc3d3c76..f1f69b4c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.hypothesis
*.py[cod]
__pycache__/
*.egg-info
diff --git a/dask/array/core.py b/dask/array/core.py
index 384bc1fdc..a8e11b807 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1337,6 +... |
dask__dask-3810 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/chunk.py:argtopk"
],
"edited_modules": [
"dask/array/chunk.py:argtopk"
]
},
"file": "dask/array/chunk.py"
}
] | dask/dask | 3dddd1148d1050ea7eca16a9c6dd2bc187adb02a | Regression in 0.18.2: argtopk(split_every=2) broken
```
import dask.array as da
a = da.from_array([[1, 4, 2, 5, 3],
[7, 1, 8, 0, 2]], chunks=1)
a.argtopk(-3, split_every=2).compute()
AttributeError: 'tuple' object has no attribute 'shape'
```
I'm still in the middle of investigating h... | diff --git a/dask/array/chunk.py b/dask/array/chunk.py
index 498edfdf7..a36a4de7f 100644
--- a/dask/array/chunk.py
+++ b/dask/array/chunk.py
@@ -9,6 +9,7 @@ import numpy as np
from . import numpy_compat as npcompat
from ..compatibility import getargspec
+from ..core import flatten
from ..utils import ignoring
t... |
dask__dask-3833 | [
{
"changes": {
"added_entities": [
"dask/bytes/core.py:expand_paths_if_needed"
],
"added_modules": [
"dask/bytes/core.py:expand_paths_if_needed"
],
"edited_entities": [
"dask/bytes/core.py:get_fs_token_paths"
],
"edited_modules": [
"dask/... | dask/dask | b341ac841234cb06c170c7af0fc65b2827be2cef | Resample Dask Dataframe results in loss of index column name
I created this self containable example to demonstrate a bug I found when resampling a Dask Dataframe. As can be seen below, after resampling the Pandas Dataframe it still contains the name of the index, but after resampling the Dask Dataframe it loses the na... | diff --git a/dask/bytes/core.py b/dask/bytes/core.py
index 73b0eae33..aa395eead 100644
--- a/dask/bytes/core.py
+++ b/dask/bytes/core.py
@@ -263,6 +263,41 @@ def infer_options(urlpath):
return urlpath, protocol, options
+def expand_paths_if_needed(paths, mode, num, fs, name_function):
+ """Expand paths if t... |
dask__dask-3908 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/bytes/core.py:read_bytes"
],
"edited_modules": [
"dask/bytes/core.py:read_bytes"
]
},
"file": "dask/bytes/core.py"
},
{
"changes": {
"added_entities"... | dask/dask | 54ffe4330d217d50d5a10a8a5869cd0a70d9267c | Keep original filenames in dask.dataframe.read_csv
For the data I am reading, the path (directory name) is an important trait, and this would be useful to access (possibly as an additional column, ```path_as_column = True```) or at the very least in the collection of delayed objects
```
import dask.dataframe as dd
d... | diff --git a/dask/bytes/core.py b/dask/bytes/core.py
index 3bf0cbc5a..5b64d63ed 100644
--- a/dask/bytes/core.py
+++ b/dask/bytes/core.py
@@ -19,7 +19,7 @@ from ..utils import import_required, is_integer
def read_bytes(urlpath, delimiter=None, not_zero=False, blocksize=2**27,
- sample=True, compressio... |
dask__dask-3919 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/categorical.py:CategoricalAccessor.as_known"
],
"edited_modules": [
"dask/dataframe/categorical.py:CategoricalAccessor"
]
},
"file": "dask/dataframe/cate... | dask/dask | 09100d02ad8f2b23da70234707888b1374dd46bd | `.assign` leads to different results when using lambda vs not using lambda
`.assign` leads to different results when using lambda vs not using lambda. Please see the example below.
The difference seems to happen only in the divisions limits. I guess this is a bug? Any idea on why this is happening?
### Import... | diff --git a/dask/dataframe/categorical.py b/dask/dataframe/categorical.py
index 9900b54af..f372aa2ca 100644
--- a/dask/dataframe/categorical.py
+++ b/dask/dataframe/categorical.py
@@ -184,7 +184,7 @@ class CategoricalAccessor(Accessor):
Keywords to pass on to the call to `compute`.
"""
i... |
dask__dask-3944 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/slicing.py:_slice_1d"
],
"edited_modules": [
"dask/array/slicing.py:_slice_1d"
]
},
"file": "dask/array/slicing.py"
}
] | dask/dask | ab1e21ca589d9ccf0b5f4a5a83161f0e175ef58b | IndexError: tuple index out of range in optimization.py
Hi, I apologize but unfortunately I can't reproduce this issue without copy and pasting a lot of code. I was hoping that perhaps this would look familiar to somebody here and they might be able to point me toward a workaround.
If it looks like it's a more serio... | diff --git a/dask/array/slicing.py b/dask/array/slicing.py
index 964878798..4e170316f 100644
--- a/dask/array/slicing.py
+++ b/dask/array/slicing.py
@@ -391,7 +391,7 @@ def _slice_1d(dim_shape, lengths, index):
ind = index - chunk_boundaries[i - 1]
else:
ind = index
- return {i... |
dask__dask-3955 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:pad_udf"
],
"edited_modules": [
"dask/array/creation.py:pad_udf"
]
},
"file": "dask/array/creation.py"
},
{
"changes": {
"added_ent... | dask/dask | 92c8cba82e5e427f9acbdadcc6973a531466ae41 | Stacking list of arg reduction's produces duplicates of last list element
This is weird. As I do often, I create a list of _n_ dask.arrays in a for-loop for a number of cases, and stack this together to one big dask array. However, if I stack together `da.argmin` operations, the array contains _n_ copies of the last ar... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index e953c5055..1ae0e518d 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -943,7 +943,7 @@ def pad_udf(array, pad_width, mode, **kwargs):
result = result.map_blocks(
wrapped_pad_func,
- token="pad",
+ ... |
dask__dask-4003 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/multiprocessing.py:get_context"
],
"edited_modules": [
"dask/multiprocessing.py:get_context"
]
},
"file": "dask/multiprocessing.py"
}
] | dask/dask | 797b0cd530558f5eb7ec26e392a4dca9a3f8f4bd | Default `multiprocessing` context is broken and should never be used
The default `multiprocessing` context (on POSIX systems) is fork-without-exec. As a result, all process state is mirrored in the subprocesses, with often unexpected results.
1. Threads are not propagated. If the parent process started a thread and ... | diff --git a/MANIFEST.in b/MANIFEST.in
index 43008f1a3..d7ba3f627 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -7,6 +7,7 @@ include README.rst
include LICENSE.txt
include MANIFEST.in
include dask/dask.yaml
+include dask/dask-schema.yaml
include versioneer.py
include dask/_version.py
diff --git a/dask/multiproce... |
dask__dask-4042 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/optimization.py:fuse"
],
"edited_modules": [
"dask/optimization.py:fuse"
]
},
"file": "dask/optimization.py"
}
] | dask/dask | ecc1e806898410784efc3d4cecf1f02ea5ae2de1 | Fusing purely linear chains not working
On branch `master`, in particular after https://github.com/dask/dask/pull/3979 was merged: I am trying to make use of the new feature of merging linear chains in (sub)graphs. To do so, I enable it via the config:
In `config.yaml`:
```
fuse_subgraphs: True
```
The followi... | diff --git a/dask/optimization.py b/dask/optimization.py
index e2a181f76..c3af897ee 100644
--- a/dask/optimization.py
+++ b/dask/optimization.py
@@ -567,7 +567,10 @@ def fuse(dsk, keys=None, dependencies=None, ave_width=None, max_width=None,
reducible = {k for k, vals in rdeps.items() if len(vals) == 1}
if ke... |
dask__dask-4050 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/bag/core.py:groupby_tasks"
],
"edited_modules": [
"dask/bag/core.py:groupby_tasks"
]
},
"file": "dask/bag/core.py"
}
] | dask/dask | df1cee3b55706443303b85563e7c01e26611603d | Bag groupby error using tasks based shuffle
Looks like the issue is when the bag in question has only 1 partition.
```
>>> dask.bag.from_sequence('abc', npartitions = 1).groupby(lambda x: x, shuffle = 'tasks').compute()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/l... | diff --git a/dask/bag/core.py b/dask/bag/core.py
index bc79ee350..d8bf1c6eb 100644
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -1970,7 +1970,7 @@ def groupby_tasks(b, grouper, hash=hash, max_branch=32):
max_branch = max_branch or 32
n = b.npartitions
- stages = int(math.ceil(math.log(n) / math.log(m... |
dask__dask-4086 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/linalg.py:tsqr",
"dask/array/linalg.py:sfqr"
],
"edited_modules": [
"dask/array/linalg.py:tsqr",
"dask/array/linalg.py:sfqr"
]
},
"file": "da... | dask/dask | d8d0fee917cc8bfcc83da08916023977821da0b0 | `dask.config.set(num_workers=n)` context doesn't seem to work anymore
I don't know how to make a self contained example, but suffice to say that if I try something like
```python
with dask.config.set(num_workers=2):
# code the does something
```
All cores start firing, not just 2.
```
%watermark -v -m ... | diff --git a/dask/array/core.py b/dask/array/core.py
index 07aff0ac2..00d09a00c 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2387,6 +2387,8 @@ def from_delayed(value, shape, dtype, name=None):
name = name or 'from-value-' + tokenize(value, shape, dtype)
dsk = {(name,) + (0,) * len(shape): valu... |
dask__dask-4087 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:DataFrame._repr_data"
],
"edited_modules": [
"dask/dataframe/core.py:DataFrame"
]
},
"file": "dask/dataframe/core.py"
},
{
"changes": {
... | dask/dask | d33125c5249c9e996913ffca9315b3b9ce5cc55d | Dataframe does not support duplicate column names perfectly
I just realized that dask datafrmaes, in contrast to pandas, does not support duplicate column names (perfectly).
```
import dask.array as da
import dask.dataframe as dd
import numpy as np
arr = da.from_array(np.arange(10).reshape(5,2), chunks=(5,2))
d... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 510913a45..d478d9ff9 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -3124,8 +3124,8 @@ class DataFrame(_Frame):
def _repr_data(self):
meta = self._meta
index = self._repr_divisions
- values = {c: _repr_... |
dask__dask-4151 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:wrapped_pad_func"
],
"edited_modules": [
"dask/array/creation.py:wrapped_pad_func"
]
},
"file": "dask/array/creation.py"
},
{
"changes": ... | dask/dask | f52e073b89469c2d687aa7a93f55e57992f8b16e | DataFrame.__setitem__ fails for index
```python
In [10]: import pandas as pd
In [11]: import dask.dataframe as dd
In [12]: df = pd.DataFrame({"A": [1, 2], "B": [3, 4]})
In [13]: ddf = dd.from_pandas(df, 2)
In [14]: df[df.columns] = 1
In [15]: ddf[ddf.columns] = 1
---------------------------------------... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index 8884a06c7..c35c191f2 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -905,7 +905,7 @@ def pad_stats(array, pad_width, mode, *args):
def wrapped_pad_func(array, pad_func, iaxis_pad_width, iaxis, pad_func_kwargs):
- result = ar... |
dask__dask-4181 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/top.py:optimize_atop"
],
"edited_modules": [
"dask/array/top.py:optimize_atop"
]
},
"file": "dask/array/top.py"
},
{
"changes": {
"added_entiti... | dask/dask | 5255092ecb98858451d35efaedb3ae03036870b1 | ShareDict seems to cause issues with HighLevelGraphs in optimize_atop
Following up on https://github.com/dask/dask/issues/4038#issuecomment-434338006, this script:
```python
from dask.sharedict import ShareDict
import numpy as np
def foo(A):
return A[None, ...]
A = da.ones(shape=(10, 20, 4), chunks=... | diff --git a/dask/array/core.py b/dask/array/core.py
index 8bfb23a28..b63d5aa69 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -348,7 +348,7 @@ def apply_infer_dtype(func, args, kwargs, funcname, suggest_dtype='dtype', nout=
Function for which output dtype is to be determined
args: List of ... |
dask__dask-4193 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/top.py:atop"
],
"edited_modules": [
"dask/array/top.py:atop"
]
},
"file": "dask/array/top.py"
},
{
"changes": {
"added_entities": null,
"... | dask/dask | 45cf19876f278671ad9a3a38f953823dbc049b2e | Dataframe correlation function uses too much memory
Whenever I am calculating corr on a dask data frame with a larger but not enormous number of columns (200-2000) my worker memory is blowing up and getting a MemoryError at one of two lines:
```
from /dask/dataframe/core.py
3885 x = np.where(keep, mat[:, No... | diff --git a/continuous_integration/travis/install.sh b/continuous_integration/travis/install.sh
index e01bd1d57..195db9efb 100644
--- a/continuous_integration/travis/install.sh
+++ b/continuous_integration/travis/install.sh
@@ -51,7 +51,7 @@ conda install -q -c conda-forge \
partd \
psutil \
pytables \
... |
dask__dask-4207 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/top.py:optimize_atop"
],
"edited_modules": [
"dask/array/top.py:optimize_atop"
]
},
"file": "dask/array/top.py"
}
] | dask/dask | d4fe52975d1b3c5ca1f13e045fdf6f1ddd40e6cd | subgraph_callable failure with dask 0.20.1
This fails on python 2.7.14, dask 0.20.1, but works on dask 0.19.4.
As far as I can tell, a task like `(operator.mul, 0j, [np.ndarray(...)])` gets constructed by `subgraph_callable` which produces the `TypeError: can't multiply sequence by non-int of type 'complex'` except... | diff --git a/dask/array/top.py b/dask/array/top.py
index bbd601f5c..f71f588ae 100644
--- a/dask/array/top.py
+++ b/dask/array/top.py
@@ -601,20 +601,32 @@ def optimize_atop(full_graph, keys=()):
deps = set(top_layers)
while deps: # we gather as many sub-layers as we can
dep =... |
dask__dask-4212 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/top.py:optimize_atop"
],
"edited_modules": [
"dask/array/top.py:optimize_atop"
]
},
"file": "dask/array/top.py"
},
{
"changes": {
"added_entiti... | dask/dask | 8f60d0aeb0b2580c2f7a4becd5e64559d92bb001 | Sequential DataFrame joining error
I ran across a case where multiple DataFrame joins will sometimes fail, depending on how the DataFrames are partitioned.
The below example does sequential inner joins (i.e. `df1.join(df2, how='inner').join(df3, how='inner')`) using pandas DataFrames and then using dask DataFrames. ... | diff --git a/dask/array/top.py b/dask/array/top.py
index bbd601f5c..f71f588ae 100644
--- a/dask/array/top.py
+++ b/dask/array/top.py
@@ -601,20 +601,32 @@ def optimize_atop(full_graph, keys=()):
deps = set(top_layers)
while deps: # we gather as many sub-layers as we can
dep =... |
dask__dask-4304 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/routines.py:tensordot"
],
"edited_modules": [
"dask/array/routines.py:tensordot"
]
},
"file": "dask/array/routines.py"
}
] | dask/dask | 193e61403ccb3e1a13451a338f42018fe6cc9250 | tensordot cannot handle >26 dimensions
Currently ``tensordot`` is limited to tensors with 26 or fewer dimensions. Reproducing example:
```python
>>> import dask.array as da
>>> x = da.random.random([2]*26, chunks=-1)
>>> da.tensordot(x, x, 26) # works fine
dask.array<sum-aggregate, shape=(), dtype=float64, ch... | diff --git a/dask/array/routines.py b/dask/array/routines.py
index efb24d563..269c7c9e9 100644
--- a/dask/array/routines.py
+++ b/dask/array/routines.py
@@ -226,8 +226,8 @@ def tensordot(lhs, rhs, axes=2):
dt = np.promote_types(lhs.dtype, rhs.dtype)
- left_index = list(alphabet[:lhs.ndim])
- right_index ... |
dask__dask-4464 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/bag/core.py:inline_singleton_lists",
"dask/bag/core.py:optimize"
],
"edited_modules": [
"dask/bag/core.py:inline_singleton_lists",
"dask/bag/core.py:optimize"
... | dask/dask | 010f5f3757b6cfc03785ca25d572e4412ed1e575 | KeyError when trying to compute/persist multiple keys
Hi, having this code:
```
import dask
from dask.bag import from_sequence, zip as bag_zip
a = from_sequence(range(10), npartitions=2)
b = from_sequence(range(10), npartitions=2)
c = bag_zip(a, b)
d1 = c.pluck(0)
d2 = c.pluck(1)
e = d1.map(lambda x: x+1)
... | diff --git a/dask/bag/core.py b/dask/bag/core.py
index 99f5645ec..8e174a48e 100644
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -33,7 +33,7 @@ from ..base import tokenize, dont_optimize, DaskMethodsMixin
from ..bytes import open_files
from ..compatibility import apply, urlopen, Iterable, Iterator
from ..context ... |
dask__dask-4466 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/bag/core.py:inline_singleton_lists",
"dask/bag/core.py:optimize"
],
"edited_modules": [
"dask/bag/core.py:inline_singleton_lists",
"dask/bag/core.py:optimize"
... | dask/dask | 010f5f3757b6cfc03785ca25d572e4412ed1e575 | Off-by-one error on dataframe slicing
```
import dask.dataframe as dd
import pandas as pd
df = pd.DataFrame({'A': range(5), 'B': range(5)})
ddf = dd.from_pandas(df, npartitions=1)
for j in range(1, len(df) +1):
for i in range(0, j):
print("len(df[{}:{}]): {}".format(i, j, len(df[i:j]) == len(ddf[i:... | diff --git a/dask/bag/core.py b/dask/bag/core.py
index 99f5645ec..8e174a48e 100644
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -33,7 +33,7 @@ from ..base import tokenize, dont_optimize, DaskMethodsMixin
from ..bytes import open_files
from ..compatibility import apply, urlopen, Iterable, Iterator
from ..context ... |
dask__dask-4504 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
],
"edited_modules": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
]
},
... | dask/dask | faefaa837e7e63b35fd073270172f2440e7ae924 | Groupby nunique on empty dataframe fails
There seems to be an issue when calling Groupby.nunique on an empty dataframe
On plain pandas:
```python
ua_pd_df = pandas.DataFrame(columns=['username', 'user_agent', 'requests'])
ua_pd_df.groupby(['user_agent']).username.nunique()
Series([], Name: username, dtype: int64... | diff --git a/dask/array/core.py b/dask/array/core.py
index 61158f7c5..08ca79f7e 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2428,7 +2428,7 @@ def unify_chunks(*args, **kwargs):
if not args:
return {}, []
- arginds = [(asarray(a) if ind is not None else a, ind)
+ arginds = [(asanya... |
dask__dask-4505 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
],
"edited_modules": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
]
},
... | dask/dask | faefaa837e7e63b35fd073270172f2440e7ae924 | DataFrame.groupby.mean fails with multiple categoricals
Seems closely related to issue #2510, but it looks like there's still a problem with `groupby.mean`. Here's a quick example:
```
import dask.dataframe as dd
dt = {"col1": "category",
"col2": "category",
"col3": int}
df = dd.read_csv("data.cs... | diff --git a/dask/array/core.py b/dask/array/core.py
index 61158f7c5..08ca79f7e 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2428,7 +2428,7 @@ def unify_chunks(*args, **kwargs):
if not args:
return {}, []
- arginds = [(asarray(a) if ind is not None else a, ind)
+ arginds = [(asanya... |
dask__dask-4506 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
],
"edited_modules": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
]
},
... | dask/dask | 221eb099ea8690ef7da334aa97b9a4e30e679f61 | Is Masked-array arithmetic getting masks wrong ?
Arithmetic operations between a dask array and a numpy array have the effect of ignoring any mask on the latter.
Like this :
```
>>> lazy = da.asarray([5, 6])
>>> mask = np.ma.masked_array([2, 3], mask=[0, 1])
>>> (lazy + mask).compute()
array([7, 9])
>>>
>>> ... | diff --git a/dask/array/core.py b/dask/array/core.py
index 61158f7c5..08ca79f7e 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2428,7 +2428,7 @@ def unify_chunks(*args, **kwargs):
if not args:
return {}, []
- arginds = [(asarray(a) if ind is not None else a, ind)
+ arginds = [(asanya... |
dask__dask-4509 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
],
"edited_modules": [
"dask/array/core.py:unify_chunks",
"dask/array/core.py:asarray"
]
},
... | dask/dask | 221eb099ea8690ef7da334aa97b9a4e30e679f61 | Dataframe.reset_index() fails when index is named
```
import numpy as np
import pandas as pd
import dask.dataframe as dd
def test(idx_name=None):
index = pd.Series(list('abcde'), name=idx_name)
df = pd.DataFrame({
'A': np.arange(5, dtype=np.int32),
'B': np.arange(10, 15, dtype=np.int... | diff --git a/dask/array/core.py b/dask/array/core.py
index 61158f7c5..08ca79f7e 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2428,7 +2428,7 @@ def unify_chunks(*args, **kwargs):
if not args:
return {}, []
- arginds = [(asarray(a) if ind is not None else a, ind)
+ arginds = [(asanya... |
dask__dask-4530 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:repartition_freq"
],
"edited_modules": [
"dask/dataframe/core.py:repartition_freq"
]
},
"file": "dask/dataframe/core.py"
},
{
"changes": ... | dask/dask | 6ecbb0cae94fd3c12e799b5c9721dd373117f2c7 | Update make_timeseries for pandas deprecation
```python
In [3]: dd.demo.make_timeseries()
/Users/taugspurger/sandbox/dask/dask/dataframe/io/demo.py:91: FutureWarning: Creating a DatetimeIndex by passing range endpoints is deprecated. Use `pandas.date_range` instead.
freq=partition_freq))
/Users/taugspurger/sandb... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 826a2a5ed..341c0698f 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -4292,9 +4292,9 @@ def repartition_freq(df, freq=None):
start = df.divisions[0].ceil(freq)
except ValueError:
start = df.divisions[0]
- di... |
dask__dask-4535 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/groupby.py:_var_chunk",
"dask/dataframe/groupby.py:_GroupBy.mean"
],
"edited_modules": [
"dask/dataframe/groupby.py:_var_chunk",
"dask/dataframe/groupb... | dask/dask | 213f360473619d3637b6426e0d9e99e7439ac823 | dask dataframe .std() produces error in cases where there are NaNs in output
I was updating the dask-examples repository to use the current version of dask in mybinder, and noticed that one of the code cells in the `dataframes.ipynb` notebook doesn't work anymore in dask 1.1.2. It could be a bug, so I wanted to flag it... | diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
index b115833b4..7caa0d061 100644
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -240,6 +240,7 @@ def _apply_chunk(df, *index, **kwargs):
def _var_chunk(df, *index):
if is_series_like(df):
df = df.to_frame()
+ df = ... |
dask__dask-4755 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/routines.py:histogram"
],
"edited_modules": [
"dask/array/routines.py:histogram"
]
},
"file": "dask/array/routines.py"
}
] | dask/dask | d8a4f3be9a6ec685261ed043a45ecc019055ec0d | NumPy's histogram's normed argument deprecated
Saw the following NumPy deprecation warning in [the CI build]( https://travis-ci.org/dask/dask/jobs/502248855#L1701-L1702 ) for the Dask Array tests. Looks like NumPy deprecated the `normed` argument of `histogram` in 1.15.0 with PR ( https://github.com/numpy/numpy/pull/11... | diff --git a/dask/array/routines.py b/dask/array/routines.py
index 261f7501e..815de0747 100644
--- a/dask/array/routines.py
+++ b/dask/array/routines.py
@@ -609,6 +609,13 @@ def histogram(a, bins=None, range=None, normed=False, weights=None, density=None
raise ValueError('Input array and weights must have the ... |
dask__dask-4756 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:asanyarray"
],
"edited_modules": [
"dask/array/core.py:asanyarray"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities"... | dask/dask | d8a4f3be9a6ec685261ed043a45ecc019055ec0d | Xarray handling regression in 1.1.2
Since dask 1.1.2, this crashes:
```python
import xarray as xr
import dask.array as da
da.mean(xr.DataArray([1, 2, 3.0])).compute... | diff --git a/dask/array/core.py b/dask/array/core.py
index 7086c51e0..bdcf53956 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -3087,6 +3087,8 @@ def asanyarray(a):
return a
elif hasattr(a, 'to_dask_array'):
return a.to_dask_array()
+ elif hasattr(a, 'data') and type(a).__module__... |
dask__dask-4834 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:eye"
],
"edited_modules": [
"dask/array/creation.py:eye"
]
},
"file": "dask/array/creation.py"
},
{
"changes": {
"added_entities": ... | dask/dask | 1beabd5b6bd18f7eb80c13ab4667cd873b55090d | Use da.eye with chunks="auto" fails
Currently if a user tries to create an array with `da.eye(..., chunks="auto")`, it fails. An MRE is included below.
<details>
<summary>Example:</summary>
```python
In [1]: import dask.array as da
da.ey
In [2]: da.eye(100, ch... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index 76dafa092..4b5d85f0b 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -411,7 +411,7 @@ def indices(dimensions, dtype=int, chunks='auto'):
return grid
-def eye(N, chunks, M=None, k=0, dtype=float):
+def eye(N, chunks='auto', M... |
dask__dask-4903 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/config.py:rename"
],
"edited_modules": [
"dask/config.py:rename"
]
},
"file": "dask/config.py"
}
] | dask/dask | 30363187bfab64629e8eff3495854554b5742d69 | keyerror in dask.config.rename when working with distributed
calling `dask-worker` using `dask==1.2.2`, `distributed==1.28.1`, I get the following error:
`Traceback (most recent call last): File "/opt/conda/envs/worker/bin/dask-worker", line 7, in <module> from distributed.cli.dask_worker import go File "/opt/conda/... | diff --git a/dask/config.py b/dask/config.py
index 3785e6f98..918e1cb92 100644
--- a/dask/config.py
+++ b/dask/config.py
@@ -448,7 +448,7 @@ def rename(aliases, config=config):
new[n] = value
for k in old:
- del config[k] # TODO: support nested keys
+ del config[canonical_name(k, conf... |
dask__dask-5048 | [
{
"changes": {
"added_entities": [
"dask/array/core.py:implements"
],
"added_modules": [
"dask/array/core.py:implements"
],
"edited_entities": [
"dask/array/core.py:Array.__array_function__"
],
"edited_modules": [
"dask/array/core.py:Arra... | dask/dask | 140a27b57dfe0c3a5a694e04c3c0cd07412d56eb | enforce_type slowdown in meta computation in dask array
We have a LBFGS implementation where we are seeing a 40x increase in runtime during graph construction when using dask 2.0.0 compared to dask 1.2.2.
I have profiled it a bit and it seems all the additional time is spent resolving dtypes for the multiplications.... | diff --git a/dask/array/core.py b/dask/array/core.py
index f8db00625..4b80439ce 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -27,7 +27,7 @@ from toolz import map, reduce, frequencies
import numpy as np
from . import chunk
-from .. import config
+from .. import config, compute
from ..base import (
... |
dask__dask-5280 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:from_array",
"dask/array/core.py:asarray"
],
"edited_modules": [
"dask/array/core.py:from_array",
"dask/array/core.py:asarray"
]
},
"... | dask/dask | d855162b4880e875d57bba6fc0851ac339a47da4 | `from_array` no longer detects dask arrays
## Problem
Not sure if this needs to be supported, but I had some old code that accidentally did a `da.from_array(existing_dask_arr)`. This is obviously unnecessary, but the code ran fine. Starting with dask 2.2 this no longer seems to work and will result in `map_blocks` p... | diff --git a/dask/array/core.py b/dask/array/core.py
index 974f61640..286dbcbc6 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2634,6 +2634,10 @@ def from_array(
>>> a = da.from_array(x, chunks='100 MiB') # doctest: +SKIP
>>> a = da.from_array(x) # doctest: +SKIP
"""
+ if isinstance(x,... |
dask__dask-5289 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:Array.__repr__"
],
"edited_modules": [
"dask/array/core.py:Array"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities":... | dask/dask | 1f88b46affcb586bfbf35c5f58fb65f1af11a0e0 | Add meta to the repr for dask arrays?
It seems like `meta` would be nice to know for debugging. It's already in the HTML repr -- what about putting it in the text repr, too?
For example, instead of:
```
dask.array<array, shape=(3, 3), dtype=float64, chunksize=(3, 3)>
```
we could have:
```
dask.array<array, sh... | diff --git a/dask/array/core.py b/dask/array/core.py
index 286dbcbc6..c6f79f4b5 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -492,7 +492,7 @@ def map_blocks(
... return np.array([a.max(), b.max()])
>>> da.map_blocks(func, x, y, chunks=(2,), dtype='i8')
- dask.array<func, shape=(20,), d... |
dask__dask-5339 | [
{
"changes": {
"added_entities": [
"dask/array/reductions.py:_sqrt",
"dask/array/reductions.py:safe_sqrt"
],
"added_modules": [
"dask/array/reductions.py:_sqrt",
"dask/array/reductions.py:safe_sqrt"
],
"edited_entities": [
"dask/array/reducti... | dask/dask | 84a0bd67e282d15b6ba693f5e1e7e71fee663814 | std() fails on masked array of all masked elements
```python
In [1]: import numpy as np
In [2]: import dask.array as da ... | diff --git a/dask/array/reductions.py b/dask/array/reductions.py
index 29685ba6c..f21130bff 100644
--- a/dask/array/reductions.py
+++ b/dask/array/reductions.py
@@ -15,7 +15,6 @@ from .core import _concatenate2, Array, handle_out, implements
from .blockwise import blockwise
from ..blockwise import lol_tuples
from .c... |
dask__dask-5510 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/routines.py:array"
],
"edited_modules": [
"dask/array/routines.py:array"
]
},
"file": "dask/array/routines.py"
},
{
"changes": {
"added_entitie... | dask/dask | e734544ef74aa0b1db1144d3f0a193b8f313d9d1 | da.array(list) returns a list
Calling `da.array()` on a list returns the argument unchanged, i.e. the output is a list, not a dask array. This is unexpected. Either the docstring should be updated to indicate this, or the function should be changed to emit an ndarray as one would expect from the current docstring.
M... | diff --git a/dask/array/routines.py b/dask/array/routines.py
index 6c30d96da..c78f0ce4d 100644
--- a/dask/array/routines.py
+++ b/dask/array/routines.py
@@ -42,6 +42,7 @@ from .numpy_compat import _unravel_index_keyword
@derived_from(np)
def array(x, dtype=None, ndmin=None):
+ x = asarray(x)
while ndmin is ... |
dask__dask-5681 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/reductions.py:std"
],
"edited_modules": [
"dask/array/reductions.py:std"
]
},
"file": "dask/array/reductions.py"
}
] | dask/dask | c3367b47c0d5ce4b68cab7f2f0ad33b03f592693 | Applying da.std to numpy array yields keyword error
When applying `da.std` to a numpy array it yields a Keyword error, while all other combinations of numpy and dask arrays and functions do work.
Admittedly this is a bit of pathetic use case / anti-pattern, but should be easy to fix.
Would there be some more ge... | diff --git a/dask/array/reductions.py b/dask/array/reductions.py
index 9bbdc11c5..5dfda7af7 100644
--- a/dask/array/reductions.py
+++ b/dask/array/reductions.py
@@ -813,7 +813,8 @@ with ignoring(AttributeError):
@wraps(chunk.std)
def std(a, axis=None, dtype=None, keepdims=False, ddof=0, split_every=None, out=None):
... |
dask__dask-5740 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:map_blocks",
"dask/array/core.py:Array.shape"
],
"edited_modules": [
"dask/array/core.py:map_blocks",
"dask/array/core.py:Array"
]
},
... | dask/dask | d676b2d8a2e776cb711e4da4c95a936c52e338da | Use shallow copies when assigning columns
Currently when we run code like `df["z"] = df.x + df.y` we call `df = df.assign(z=df.x + df.y)`. However, the latter snippet calls the underlying assign method, which calls `df.copy()` which can be slow. Instead, it might be nice to do soemthing like the following:
```pyth... | diff --git a/continuous_integration/appveyor/environment.yaml b/continuous_integration/appveyor/environment.yaml
index 7c1dd0b63..6b0102296 100644
--- a/continuous_integration/appveyor/environment.yaml
+++ b/continuous_integration/appveyor/environment.yaml
@@ -10,6 +10,7 @@ dependencies:
- pytest
- cloudpickle
... |
dask__dask-5781 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/dataframe/core.py:_Frame.__repr__",
"dask/dataframe/core.py:DataFrame._repr_data"
],
"edited_modules": [
"dask/dataframe/core.py:_Frame",
"dask/dataframe/core.py... | dask/dask | 3b31ab57d60c0729ffc224786ac69456ea8e6435 | Possible bug when checking an empty dataframe
I am aware of [this question][1]. But check the code(minimal-working example) below:
```
import dask.dataframe as dd
import pandas as pd
# intialise data of lists.
data = {'Name': ['Tom', 'nick', 'krish', 'jack'], 'Age': [20, 21, 19, 18]}
# Create DataFrame
df = ... | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index cccd4307a..189e20632 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -413,9 +413,13 @@ class _Frame(DaskMethodsMixin, OperatorMethodMixin):
def __repr__(self):
data = self._repr_data().to_string(max_rows=5, show_dimen... |
dask__dask-5888 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:slices_from_chunks"
],
"edited_modules": [
"dask/array/core.py:slices_from_chunks"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
... | dask/dask | 5f61f7f79b861be5ffdbf59950889166628a8fa6 | Dask array with non-highlevelgraph leads to KeyError
I have some [older code](https://github.com/ska-sa/katsdpcal/blob/5caa806649de33324977727a5ca1b5b76d61ba08/katsdpcal/scan.py#L86-L92) that assigns a plain dict directly into `array.dask`, as a workaround for an old dask bug. If that's no longer supported then feel fr... | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f6154ffd8..e3c47ff1b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,7 +4,8 @@ repos:
hooks:
- id: black
language_version: python3.7
-- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v2.3.0
+... |
dask__dask-5898 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/blockwise.py:blockwise"
],
"edited_modules": [
"dask/array/blockwise.py:blockwise"
]
},
"file": "dask/array/blockwise.py"
},
{
"changes": {
"ad... | dask/dask | 2fee6bbbc49ef62e563322e7e0de7346d8333875 | normalize_token pickles data of literal
While investigating a slow call to `tokenize` I discovered that when a `literal` is passed to a function that tokenizes args, it ends up pickling the quoted data instead of recursively normalising it. This is because there is no normalizer registered for `literal`, so it goes dow... | diff --git a/dask/array/blockwise.py b/dask/array/blockwise.py
index 240baa35a..6c30e36e7 100644
--- a/dask/array/blockwise.py
+++ b/dask/array/blockwise.py
@@ -145,11 +145,15 @@ def blockwise(
chunkss, arrays = unify_chunks(*args)
else:
arginds = [(a, i) for (a, i) in toolz.partition(2, args) if... |
dask__dask-5905 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/core.py:quote"
],
"edited_modules": [
"dask/core.py:quote"
]
},
"file": "dask/core.py"
}
] | dask/dask | 5a7f4524217d0d3ee9e44b6b6513264de7f16171 | dask.core.quote does not quote dicts
It seems that dask now recurses into dicts stored within a graph to find keys (I'm not quite sure when that came in: #1748 proposed it but was never merged). However, `quote` doesn't take that into account.
```python3
from dask import core
core.get({"x": quote({"a": "x"})}, "x"... | diff --git a/dask/core.py b/dask/core.py
index 59d9fd921..153c39a4d 100644
--- a/dask/core.py
+++ b/dask/core.py
@@ -463,6 +463,6 @@ def quote(x):
>>> quote((add, 1, 2)) # doctest: +SKIP
(literal<type=tuple>,)
"""
- if istask(x) or type(x) is list:
+ if istask(x) or type(x) is list or type(x) is d... |
dask__dask-5909 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/rechunk.py:plan_rechunk"
],
"edited_modules": [
"dask/array/rechunk.py:plan_rechunk"
]
},
"file": "dask/array/rechunk.py"
},
{
"changes": {
"ad... | dask/dask | 5a7f4524217d0d3ee9e44b6b6513264de7f16171 | plan_rechunk sometimes adds a no-op step
I noticed this in production code, but it can be demonstrated by adding a test to `dask/array/tests/test_rechunk.py::test_plan_rechunk`:
```python
steps = _plan((c, c), (f, f), threshold=1)
_assert_steps(steps, [(f, f)])
```
The actual plan that's recreated is [(c... | diff --git a/dask/array/rechunk.py b/dask/array/rechunk.py
index 9e71b7d8e..c39ebbd97 100644
--- a/dask/array/rechunk.py
+++ b/dask/array/rechunk.py
@@ -511,7 +511,8 @@ def plan_rechunk(
)
if (chunks == current_chunks and not first_pass) or chunks == new_chunks:
break
- steps.appen... |
dask__dask-5931 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:pad_edge",
"dask/array/creation.py:pad"
],
"edited_modules": [
"dask/array/creation.py:pad_edge",
"dask/array/creation.py:pad"
]
},
... | dask/dask | 54deb7fa4cdbbf3e124be6834224272be27ace65 | Add "empty" mode for `da.pad`
NumPy 1.17.0 adds a new mode to `np.pad` called "empty", which pads the provided array with uninitialized arrays (like `np.empty`). Would be good to add this to `da.pad` as well. | diff --git a/continuous_integration/appveyor/environment.yaml b/continuous_integration/appveyor/environment.yaml
index 6b0102296..7c1dd0b63 100644
--- a/continuous_integration/appveyor/environment.yaml
+++ b/continuous_integration/appveyor/environment.yaml
@@ -10,7 +10,6 @@ dependencies:
- pytest
- cloudpickle
... |
dask__dask-5971 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/routines.py:tensordot"
],
"edited_modules": [
"dask/array/routines.py:tensordot"
]
},
"file": "dask/array/routines.py"
},
{
"changes": {
"added... | dask/dask | 2b7945ed783bc1be7bb67ab78b4ca246adfa9804 | Per-partition information in dask.dataframe.DataFrame.memory_usage
We currently provide a per-column information in a `pandas.Series` when calling `dask.dataframe.DataFrame.memory_usage` Series. It would also be nice to to have that information on a per-partition-per-column basis. This would allow easier analysis in th... | diff --git a/dask/array/routines.py b/dask/array/routines.py
index 03ea568df..e4668d466 100644
--- a/dask/array/routines.py
+++ b/dask/array/routines.py
@@ -239,7 +239,7 @@ def tensordot(lhs, rhs, axes=2):
if isinstance(axes, Iterable):
left_axes, right_axes = axes
else:
- left_axes = tuple(ra... |
dask__dask-5975 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/routines.py:tensordot"
],
"edited_modules": [
"dask/array/routines.py:tensordot"
]
},
"file": "dask/array/routines.py"
}
] | dask/dask | 2b7945ed783bc1be7bb67ab78b4ca246adfa9804 | Incorrect chunk size calculation in da.tensordot
Our original test case that showed that something is going wrong with `da.tensordot` in comparison to `np.tensordot`.
```
import numpy as np
import dask.array as da
from dask.array.utils import assert_eq
a = np.ones(20).reshape(4, 5)
b = da.from_array(a, chun... | diff --git a/dask/array/routines.py b/dask/array/routines.py
index 03ea568df..e4668d466 100644
--- a/dask/array/routines.py
+++ b/dask/array/routines.py
@@ -239,7 +239,7 @@ def tensordot(lhs, rhs, axes=2):
if isinstance(axes, Iterable):
left_axes, right_axes = axes
else:
- left_axes = tuple(ra... |
dask__dask-6017 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:repeat",
"dask/array/creation.py:expand_pad_value",
"dask/array/creation.py:pad"
],
"edited_modules": [
"dask/array/creation.py:repeat",
... | dask/dask | 007a8d7e9bce1f0d5b3677a553caf03ecb64d091 | `_metadata` is re-read for every partition when using `fastparquet` engine
## Background
Given a (poorly) partitioned dataset of 15000 partitions of ~3k rows each, with a `_metadata` file, we evaluate e.g.
```python
df = dd.read_parquet(source, engine=engine) # L1: mostly read _metadata
df.head() # L2: single t... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index 84a589879..2ca9ddbfd 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -763,7 +763,9 @@ def repeat(a, repeats, axis=None):
elif not 0 <= axis <= a.ndim - 1:
raise ValueError("axis(=%d) out of bounds" % axis)
- if rep... |
dask__dask-6042 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/creation.py:repeat",
"dask/array/creation.py:expand_pad_value",
"dask/array/creation.py:pad"
],
"edited_modules": [
"dask/array/creation.py:repeat",
... | dask/dask | aa84a9291400305dd9eb2267c80a47143edc83d7 | un-numpy-like behavior of `da.pad` with stats
`da.pad` with `mode` set to a statistic (e.g., `minimum`) a) doesn't match numpy and b) gives a confusing error message when it fails. The source of this problem is how `da.pad` tries to calculate the `stat_length` parameter when that kwarg is not specified.
If I have... | diff --git a/dask/array/creation.py b/dask/array/creation.py
index 84a589879..2ca9ddbfd 100644
--- a/dask/array/creation.py
+++ b/dask/array/creation.py
@@ -763,7 +763,9 @@ def repeat(a, repeats, axis=None):
elif not 0 <= axis <= a.ndim - 1:
raise ValueError("axis(=%d) out of bounds" % axis)
- if rep... |
dask__dask-6273 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:stack"
],
"edited_modules": [
"dask/array/core.py:stack"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities": null,
... | dask/dask | 9e994bad3be012c4ecb03678a88934c4e66cdebb | Error when using a Numpy boolean mask on a Dask array
I am trying to extract values from a Dask array using a boolean Numpy array and am running into the following error:
```python
In [8]: import numpy as np ... | diff --git a/dask/array/core.py b/dask/array/core.py
index ef8970091..a5c51ca87 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -4269,13 +4269,11 @@ def stack(seq, axis=0, allow_unknown_chunksizes=False):
if not seq:
raise ValueError("Need array(s) to stack")
if not allow_unknown_chunksiz... |
dask__dask-6437 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/base.py:normalize_seq"
],
"edited_modules": [
"dask/base.py:normalize_seq"
]
},
"file": "dask/base.py"
}
] | dask/dask | 55445565c3746f97f2bc50d5628a484576cef90e | dask.base.tokenize raises RecursionError when passed an object that contains cycles
**What happened**: `RecursionError` is raised when passing an object containing cycles to `dask.tokenize`
**What you expected to happen**: A valid token to be returned
**Minimal Complete Verifiable Example**:
```python
import ... | diff --git a/dask/base.py b/dask/base.py
index c05cdc7cc..c2cb0d050 100644
--- a/dask/base.py
+++ b/dask/base.py
@@ -697,7 +697,13 @@ def normalize_set(s):
@normalize_token.register((tuple, list))
def normalize_seq(seq):
- return type(seq).__name__, list(map(normalize_token, seq))
+ def func(seq):
+ tr... |
dask__dask-6564 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/percentile.py:percentile"
],
"edited_modules": [
"dask/array/percentile.py:percentile"
]
},
"file": "dask/array/percentile.py"
},
{
"changes": {
... | dask/dask | 519b62fed6fa577a52b9273e11ccd9ba6d49644b | `quantile` calculation using dask default method gives incorrect results
This is similar to #731 but reveals a broader issue and thus I would like to create a new issue for it. I'm using `dask==2.24.0` and `pandas==1.0.5`
```
import pandas as pd
import dask.dataframe as dd
x = pd.DataFrame({'a': [1,2,3]})
xd = dd.... | diff --git a/dask/array/percentile.py b/dask/array/percentile.py
index ef4e9c09f..e35c6f7a0 100644
--- a/dask/array/percentile.py
+++ b/dask/array/percentile.py
@@ -126,10 +126,12 @@ def percentile(a, q, interpolation="linear", method="default"):
# Otherwise use the custom percentile algorithm
else:
-
+ ... |
dask__dask-6573 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/reshape.py:reshape"
],
"edited_modules": [
"dask/array/reshape.py:reshape"
]
},
"file": "dask/array/reshape.py"
},
{
"changes": {
"added_entiti... | dask/dask | 588ba4ef49ba0c64d7603b32749eb26fc0bd2d52 | Wrong path when reading empty csv file
```python
import dask.dataframe as dd
for k, content in enumerate(["0, 1, 2", "3, 4, 5", "6, 7, 8"]):
with open(str(k) + ".csv", "w") as file:
file.write(content)
print(dd.read_csv("*.csv", include_path_column=True, names=["A", "B", "C"],).compute())
print... | diff --git a/dask/array/core.py b/dask/array/core.py
index b2583bbae..a47254ece 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -3903,7 +3903,7 @@ def elemwise(op, *args, **kwargs):
for arg in args:
shape = getattr(arg, "shape", ())
if any(is_dask_collection(x) for x in shape):
- ... |
dask__dask-6580 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/reshape.py:reshape"
],
"edited_modules": [
"dask/array/reshape.py:reshape"
]
},
"file": "dask/array/reshape.py"
},
{
"changes": {
"added_entiti... | dask/dask | 588ba4ef49ba0c64d7603b32749eb26fc0bd2d52 | Issue with trim_excess in dask.array.coarsen
I am trying to use ``dask.array.coarsen`` on 3-d arrays and am finding that the result depends on the chunking of the data, which doesn't seem right. The following example illustrates the issue:
```python
In [1]: import numpy as np ... | diff --git a/dask/array/core.py b/dask/array/core.py
index b2583bbae..a47254ece 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -3903,7 +3903,7 @@ def elemwise(op, *args, **kwargs):
for arg in args:
shape = getattr(arg, "shape", ())
if any(is_dask_collection(x) for x in shape):
- ... |
dask__dask-6594 | [
{
"changes": {
"added_entities": [
"dask/array/wrap.py:_broadcast_trick_inner"
],
"added_modules": [
"dask/array/wrap.py:_broadcast_trick_inner"
],
"edited_entities": [
"dask/array/wrap.py:broadcast_trick"
],
"edited_modules": [
"dask/arr... | dask/dask | 00843e3f810b0b76a8e71f97f4825ab616d9296b | Cannot pickle dask array objects
**What happened**:
Attempting to pickle a dask array gives:
```
AttributeError: Can't pickle local object 'broadcast_trick.<locals>.inner'
```
Dask arrays are no longer pickleable since v2.23.0.
**What you expected to happen**:
The dask array can be pickled.
**Minimal ... | diff --git a/dask/array/wrap.py b/dask/array/wrap.py
index 4c7be06a0..9a319953b 100644
--- a/dask/array/wrap.py
+++ b/dask/array/wrap.py
@@ -135,6 +135,11 @@ def wrap(wrap_func, func, **kwargs):
w = wrap(wrap_func_shape_as_first_arg)
+@curry
+def _broadcast_trick_inner(func, shape, *args, **kwargs):
+ return np... |
dask__dask-6605 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/core.py:from_array"
],
"edited_modules": [
"dask/array/core.py:from_array"
]
},
"file": "dask/array/core.py"
},
{
"changes": {
"added_entities"... | dask/dask | 377965addc6be168ad1c697999ded6f9abdf6cce | Task dependencies do not match chunking when using `from_array`
If I create an array chunked along the first axis like so:
```python
shape = (2,2)
chunks = (1,-1)
x = da.random.random(size=shape, chunks=chunks)
x.visualize()
```
 # doctest: +SKIP
>>> a = da.from_array('myarray-' + token) # doctest: +S... |
dask__dask-6624 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"dask/array/percentile.py:percentile"
],
"edited_modules": [
"dask/array/percentile.py:percentile"
]
},
"file": "dask/array/percentile.py"
},
{
"changes": {
... | dask/dask | 519b62fed6fa577a52b9273e11ccd9ba6d49644b | reduction "dtype" is required but docstring says optional
**What happened**:
I'm playing around with the dask.array.reduction function while working on a custom algorithm and was confused when I got a ValueError for not specifying the `dtype` when the docstring says it is optional and will default to `x.dtype` if no... | diff --git a/dask/array/percentile.py b/dask/array/percentile.py
index ef4e9c09f..e35c6f7a0 100644
--- a/dask/array/percentile.py
+++ b/dask/array/percentile.py
@@ -126,10 +126,12 @@ def percentile(a, q, interpolation="linear", method="default"):
# Otherwise use the custom percentile algorithm
else:
-
+ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.