instance_id stringlengths 21 53 | repo stringclasses 188
values | language stringclasses 1
value | pull_number int64 20 148k | title stringlengths 6 144 | body stringlengths 0 83.4k | created_at stringdate 2015-09-25 03:17:17 2025-07-10 16:50:35 | problem_statement stringlengths 188 240k | hints_text stringlengths 0 145k | resolved_issues listlengths 1 6 | base_commit stringlengths 40 40 | commit_to_review dict | reference_review_comments listlengths 1 62 | merged_commit stringlengths 40 40 | merged_patch stringlengths 297 9.87M | metadata dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cython__cython-4118@667fab8 | cython/cython | Python | 4,118 | Preserve default arguments values on methods for introspection | Fixes https://github.com/cython/cython/issues/4061.
Code is adjusted per discussion in issue to always add value to `default_args` or `default_kwargs`. | 2021-04-14T21:12:28Z | Default arguments in methods are not preserved for introspection
Tried on the latest master:
```
# test.pyx
def run(a, b=1):
return a + b
cdef class A:
def run(self, a, b=1):
return a + b
# app.py
from test import A, run
import inspect
a = A()
print(inspect.signature(run)) # ok - print... | I think the underlying cause of this is a known limitation
https://github.com/cython/cython/blob/8609e0fa7d361f1392823ff6e1a618720cd62df3/Cython/Compiler/ExprNodes.py#L9375-L9380
It might be possible to change it to make the introspection work without using the `__defaults__` attribute in the actual function thou... | [
{
"body": "Tried on the latest master:\r\n```\r\n# test.pyx\r\ndef run(a, b=1):\r\n return a + b\r\n\r\ncdef class A:\r\n def run(self, a, b=1):\r\n return a + b\r\n\r\n# app.py\r\nfrom test import A, run\r\nimport inspect\r\n\r\na = A()\r\nprint(inspect.signature(run)) # ok - prints (a, b=1)\r\npr... | f3f7b612dc005abdac2e0a0a48dcf9be7b4b0122 | {
"head_commit": "667fab85c0129a41a6fb9e0fb5e149fc3d7b37aa",
"head_commit_message": "Preserve default arguments values on methods for introspection",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 2714d3e4d7a..9be6d2b8324 100644\n--- a/Cython/Compiler/ExprNodes... | [
{
"diff_hunk": "@@ -9371,21 +9371,22 @@ def analyse_default_args(self, env):\n # so their optional arguments must be static, too.\n # TODO: change CyFunction implementation to pass both function object and owning object for method calls\n must_use_constants = env.is_c_class_scope or (sel... | 2aea896a092ae24f6456eec7f18e15835d5d4a85 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 2714d3e4d7a..aff954beaed 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -9371,21 +9371,22 @@ def analyse_default_args(self, env):
# so their optional arguments must be static, too.
# TODO: c... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
deepset-ai__haystack-7209@0025fde | deepset-ai/haystack | Python | 7,209 | ci: Add script to delete documentation that don't exist anymore | ### Related Issues
- fixes #7081
### Proposed Changes:
This PR adds a `delete_outdated_docs.py` script that can be used to delete documentation from Readme if it doesn't exist anymore.
This script deletes docs only from the categories found in the config files, as of now that's only `haystack-api`.
The `... | 2024-02-26T16:56:31Z | Rework workflow that updates documentation to delete pages that don't exist anymore
The `readme_sync.yml` workflow doesn't delete pages from Readme if those don't exist anymore.
When syncing documentation we should if all the hosted pages have local counterparts, and delete all those that don't.
The same should be... | [
{
"body": "The `readme_sync.yml` workflow doesn't delete pages from Readme if those don't exist anymore. \r\nWhen syncing documentation we should if all the hosted pages have local counterparts, and delete all those that don't.\r\n\r\nThe same should be done for the `haystack-core-integrations` repo.",
"num... | 22e9def2cd29ad70b70530fa9737390eafe80073 | {
"head_commit": "0025fde031d88fea87162ad89061ea33376253a6",
"head_commit_message": "Add script to delete documentation that don't exist anymore",
"patch_to_review": "diff --git a/.github/utils/delete_outdated_docs.py b/.github/utils/delete_outdated_docs.py\nnew file mode 100644\nindex 0000000000..3a99641233\n---... | [
{
"diff_hunk": "@@ -0,0 +1,74 @@\n+import argparse\n+import base64\n+import os\n+import re\n+from pathlib import Path\n+from typing import List\n+\n+import requests\n+import yaml\n+\n+VERSION_VALIDATOR = re.compile(r\"^[0-9]+\\.[0-9]+$\")\n+\n+\n+def readme_token():\n+ api_key = os.getenv(\"RDME_API_KEY\", N... | ca1d3d6e2c5df50d871663aa822582bad0989314 | diff --git a/.github/utils/delete_outdated_docs.py b/.github/utils/delete_outdated_docs.py
new file mode 100644
index 0000000000..b7ec2a719c
--- /dev/null
+++ b/.github/utils/delete_outdated_docs.py
@@ -0,0 +1,72 @@
+import argparse
+import base64
+import os
+import re
+from pathlib import Path
+from typing import List... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
cython__cython-3956@768d4c9 | cython/cython | Python | 3,956 | Fixed __class__() lookup on builtin types | Fixes https://github.com/cython/cython/issues/3954.
The problem seems to be that __Pyx_CallUnboundCMethod0 optimizes
the call incorrectly. This patch avoids it getting sent to
that mechanism. | 2020-12-26T09:08:11Z | Unexpected behavior of __class__ attribute for annotated python arguments
Hello, I'm kinda new to Cython so hopefully I didn't miss anything obvious, but I think I've found a weird behavior of annotated function arguments.
Seems like the ```__class__``` attribute acts unexpectedly when the arguments are annotated with... | [
{
"body": "Hello, I'm kinda new to Cython so hopefully I didn't miss anything obvious, but I think I've found a weird behavior of annotated function arguments.\r\nSeems like the ```__class__``` attribute acts unexpectedly when the arguments are annotated with pythonic \r\n\r\n```cython\r\ndef func(dict my_dict)... | e6f92c1753fd8b07c5beb040fb8be1c4a8b0591c | {
"head_commit": "768d4c911dae7828306652ca5eb01ae89a607fd2",
"head_commit_message": "Improve comment",
"patch_to_review": "diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py\nindex e1aea0fa406..77e54b16d16 100644\n--- a/Cython/Compiler/Optimize.py\n+++ b/Cython/Compiler/Optimize.py\n@@ -3009,6... | [
{
"diff_hunk": "@@ -3009,6 +3009,12 @@ def _handle_any_slot__new__(self, node, function, args,\n utility_code=utility_code,\n is_temp=node.is_temp\n )\n+ def _handle_any_slot__class__(self, node, function, args,",
"line": 3013,
"original_line": 3012,
"o... | 3b973d3ebc10c1002f43ff22d351f1e52fbe5230 | diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py
index e1aea0fa406..fc140302c66 100644
--- a/Cython/Compiler/Optimize.py
+++ b/Cython/Compiler/Optimize.py
@@ -3010,6 +3010,13 @@ def _handle_any_slot__new__(self, node, function, args,
is_temp=node.is_temp
)
+ def ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-5482@c3c8145 | cupy/cupy | Python | 5,482 | Import numpy before Cython | Closes #5476
Thanks to @kmaehashi for the alternative solution | 2021-07-12T03:59:43Z | Cupy cannot be compiled depending on the combination of versions of Setuptools, Numpy, Cython
It seems that Cupy cannot be compiled depending on the combination of versions of Setuptools, Numpy, Cython (and other components).
* Conditions
- CuPy 9.2.0 (try to compile)
- Linux OS 5.13.1 / glibc 2.33
- CUDA ... | Thanks for reporting! According to the logs it seems `import numpy` is happening during CuPy build. NumPy [monkypatches](https://github.com/numpy/numpy/blob/df9c973f28fb9c0e713db29285b07b57c622652a/numpy/distutils/ccompiler.py#L766) the distutils so if numpy is imported during the CuPy build it can fail.
I think you ca... | [
{
"body": "It seems that Cupy cannot be compiled depending on the combination of versions of Setuptools, Numpy, Cython (and other components).\r\n\r\n* Conditions \r\n - CuPy 9.2.0 (try to compile)\r\n - Linux OS 5.13.1 / glibc 2.33\r\n - CUDA 11.4 / NVIDIA driver 470.42.01 (Beta driver which supports CUDA 1... | f1eb9a82cf9d5ab26c015a8a81e6eebf2d0dff30 | {
"head_commit": "c3c8145137e3958d7b665a7dfa78e1464bd5dd6a",
"head_commit_message": "import distools instead",
"patch_to_review": "diff --git a/cupy_setup_build.py b/cupy_setup_build.py\nindex d1401f5ad04..483bd5d73b7 100644\n--- a/cupy_setup_build.py\n+++ b/cupy_setup_build.py\n@@ -18,6 +18,12 @@\n from install.... | [
{
"diff_hunk": "@@ -18,6 +18,12 @@\n from install.build import PLATFORM_LINUX\n from install.build import PLATFORM_WIN32\n \n+try:\n+ # This is to avoid getting numpy imported inside other modules and\n+ # overwritting setuptools compilers",
"line": null,
"original_line": 23,
"original_start_l... | f00e20d84b54a03737cbdfb587d865a679108c28 | diff --git a/cupy_setup_build.py b/cupy_setup_build.py
index d1401f5ad04..57fc0707bb1 100644
--- a/cupy_setup_build.py
+++ b/cupy_setup_build.py
@@ -18,6 +18,12 @@
from install.build import PLATFORM_LINUX
from install.build import PLATFORM_WIN32
+try:
+ # This is to avoid getting numpy imported inside other modu... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Dependency Updates & Env Compatibility"
} |
cython__cython-4085@e7dc1cf | cython/cython | Python | 4,085 | Fix type of self argument in cdef staticmethod declared in a pxd file | Fixes https://github.com/cython/cython/issues/3174
I've removed all assignment of `is_self_arg` out of the parser, since it can be overridden in too many ways so I don't think it's usefully done there. It's possible that the tests will show I've missed something important where its used (in which case I can undo the... | 2021-04-04T10:39:13Z | @staticmethod with implicit object argument type is handled wrongly
Hello up there. Please consider the following example:
---- 8< ---- `moda.pxd`
```pyx
cdef class MyClass:
@staticmethod
cdef static_func(x)
```
---- 8< ---- `moda.pyx`
```pyx
cdef class MyClass:
@staticmethod
cdef static_... | I forgot to mention that it fails for both current 0.29.x and master.
I added corresponding test in https://github.com/cython/cython/pull/3175.
My guess is that it fails because `@staticmethod` is not evaluated (correctly) in `.pxd` files. Or maybe it incorrectly overwrites the prior handling of the decorator in the i... | [
{
"body": "Hello up there. Please consider the following example:\r\n\r\n---- 8< ---- `moda.pxd`\r\n```pyx\r\ncdef class MyClass:\r\n @staticmethod\r\n cdef static_func(x)\r\n```\r\n\r\n---- 8< ---- `moda.pyx`\r\n```pyx\r\ncdef class MyClass:\r\n @staticmethod\r\n cdef static_func(x):\r\n ret... | 03e919a06007a8ce0d77eefb52a5ec697c70ef4f | {
"head_commit": "e7dc1cfaf0b4404a8345580d507db1286cc2d6a3",
"head_commit_message": "Fix merge\n\nSomehow deleted a colon",
"patch_to_review": "diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py\nindex ad740a379af..a11a496ef46 100644\n--- a/Cython/Compiler/Nodes.py\n+++ b/Cython/Compiler/Nodes.py\n@... | [
{
"diff_hunk": "@@ -2477,13 +2477,11 @@ def p_positional_and_keyword_args(s, end_sy_set, templates = None):\n s.next()\n return positional_args, keyword_args\n \n-def p_c_base_type(s, self_flag = 0, nonempty = 0, templates = None):\n- # If self_flag is true, this is the base type for the\n- # ... | e52c73c8db744398fad8f6f105ec67c23a6e5a4e | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index ad740a379af..4b0da59cf46 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -902,7 +902,7 @@ def hdr_cname(self):
def analyse(self, env, nonempty=0, is_self_arg=False):
if is_self_arg:
- self.base_type... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-3829@bad1b42 | cython/cython | Python | 3,829 | Add support for PEP 526 `__annotations__` in class body. | This is an attempt to resolve #2552 and follows recommendations by @scoder.
Looking forward to your feedback! | 2020-09-15T12:59:09Z | Classes lack __annotations__ (PEP-526)
With python 3.7 dataclasses were introduced.
They work just fine in Cython except for their standard __init__ function.
How to reproduce:
test.pyx
```
from dataclasses import dataclass
@dataclass
class TestClass:
x: int
y: int
some_string: str
```
This file comp... | I don't think we currently create a `__annotations__` for classes, although the syntax tree has the necessary information available. See the description in
https://www.python.org/dev/peps/pep-0526/#runtime-effects-of-type-annotations
PR welcome.
I'm also stumbling over this currently, especially Python 3.6-style Na... | [
{
"body": "With python 3.7 dataclasses were introduced.\r\nThey work just fine in Cython except for their standard __init__ function.\r\n\r\nHow to reproduce:\r\ntest.pyx\r\n```\r\nfrom dataclasses import dataclass\r\n\r\n@dataclass\r\nclass TestClass:\r\n\tx: int\r\n\ty: int\r\n\tsome_string: str\r\n```\r\nThi... | af1300f7655b2ccdf6308d9c9fb839d7083782e9 | {
"head_commit": "bad1b4299c58f4c4f0658bba81a4a6079d5560f3",
"head_commit_message": "Update cython3.pyx annotations tests for patch addressing `u` prefix in strings",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 5ce3032da43..8e7e80ee30d 100644\n--- a/Cython/C... | [
{
"diff_hunk": "@@ -0,0 +1,50 @@\n+# cython: language_level=3\n+# mode: run\n+# tag: pure3.7, pep526, pep484\n+\n+from __future__ import annotations\n+\n+try:\n+ from typing import ClassVar\n+except ImportError: # Py3.5\n+ try:\n+ from typing import Optional as ClassVar # Good enough for jazz.\n+... | 090244b3ae9f6197c0ec77a6e48844b09ef24fc6 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 5ce3032da43..8e7e80ee30d 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -28,7 +28,7 @@
from . import StringEncoding
from . import Naming
from . import Nodes
-from .Nodes import Node, utility_code_for_impor... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-6930@1b315a2 | deepset-ai/haystack | Python | 6,930 | feat: Add raise_on_failure to BaseConverter | ### Related Issues
- fixes [#6665](https://github.com/deepset-ai/haystack/issues/6665)
### Proposed Changes:
Followed the potential solution (Thanks @anakin87 !) to add a `raise_on_failure` to the `run` method in the BaseConverter class.
### How did you test it?
<!-- unit tests, integration tests, manua... | 2024-02-07T07:01:45Z | BaseConverter more robust and reliable when processing thousands of files.
**Is your feature request related to a problem? Please describe.**
I'm always frustrated when a conversion suddenly breaks the whole pipeline, especially when processing thousands of files. Imagine importing like 2500 PDF files into an object s... | ### Potential solution
Assuming we are talking of 1.x (the `BaseConverter` is only available in 1.x), this does not seem difficult to achieve.
We can add a `raise_on_failure` parameter in the `run method` of the `BaseConverter`.
- if True (default), raises an exception if the conversion of a single file fails (c... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nI'm always frustrated when a conversion suddenly breaks the whole pipeline, especially when processing thousands of files. Imagine importing like 2500 PDF files into an object store via Tika- or PDF-converter. When there is one cor... | af0166ff116b56f2f991e68c88be8f8ef12040ec | {
"head_commit": "1b315a232a14f24f5ffbe8537d9ac5d0d120c158",
"head_commit_message": "Merge branch 'raise_on_failure-base-converter' of github.com:isaac-chung/haystack into raise_on_failure-base-converter",
"patch_to_review": "diff --git a/haystack/nodes/file_converter/base.py b/haystack/nodes/file_converter/base.... | [
{
"diff_hunk": "@@ -199,24 +201,34 @@ def run( # type: ignore\n meta = [meta] * len(file_paths)\n \n documents: list = []\n+ failed_paths: list = []\n for file_path, file_meta in tqdm(\n zip(file_paths, meta), total=len(file_paths), disable=not self.progress_bar, ... | 27b85d44d23bf2352ce2143a78064f741b168948 | diff --git a/haystack/nodes/file_converter/base.py b/haystack/nodes/file_converter/base.py
index d5fbb3fc58..934cca4689 100644
--- a/haystack/nodes/file_converter/base.py
+++ b/haystack/nodes/file_converter/base.py
@@ -158,6 +158,7 @@ def run( # type: ignore
valid_languages: Optional[List[str]] = None,
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-3872@a742a9a | cython/cython | Python | 3,872 | Capturing and redirecting stdout/stderr for %%cython-magic | Fixes #3751 as discussed [here](https://github.com/cython/cython/issues/3751#issuecomment-702725848)
Some compilers (MSVC) and linkers write errors to stdout (and not stderr), so we need to catch both and if an error caught, redirect both to sys.stderr.
After fix, for this code:
```
%%cython
cdef extern from... | 2020-10-07T21:44:58Z | [Jupyter] Fails silently on importing C header file in same folder
The code below "evaluates" without any error messages. By myadd is never defined, and the annotation output is never produced.
Removing the dependency on add.h makes everything work without a problem.
## File system:
```
src/
- add.h
-... | Changing to the following makes it work. (Notice that I added `-I.` at the top)
```py
# Input cell [2]
%%cython --annotate -I.
cdef extern from "add.h":
int add(int x, int y)
cpdef myadd(int x, int y):
cdef int total = add(x, y)
return total
```
Would be nice if an error was thrown, saying t... | [
{
"body": "The code below \"evaluates\" without any error messages. By myadd is never defined, and the annotation output is never produced.\r\n\r\nRemoving the dependency on add.h makes everything work without a problem.\r\n\r\n## File system:\r\n```\r\nsrc/\r\n - add.h\r\n - Notebook.ipynb\r\n```\r\n## C... | 434882af22b8c1941f078557b6411a1af63d099b | {
"head_commit": "a742a9a928091e00c70f48c3e23039e5d9774eac",
"head_commit_message": "call explicit close on TextIOWrapper",
"patch_to_review": "diff --git a/Cython/Build/IpythonMagic.py b/Cython/Build/IpythonMagic.py\nindex 7aa7bf666b7..3bf0b7c325a 100644\n--- a/Cython/Build/IpythonMagic.py\n+++ b/Cython/Build/Ip... | [
{
"diff_hunk": "@@ -342,13 +381,25 @@ def critical_function(data):\n if args.pgo:\n self._profile_pgo_wrapper(extension, lib_dir)\n \n+ def print_compiler_output(stdout, stderr, where):\n+ # On windows, errors are printed to stdout, we redirect both to sys.stderr.\n... | 3efc7b11c9efd5e435146bd766f0b74d230bcb06 | diff --git a/Cython/Build/IpythonMagic.py b/Cython/Build/IpythonMagic.py
index 7aa7bf666b7..15868d862ed 100644
--- a/Cython/Build/IpythonMagic.py
+++ b/Cython/Build/IpythonMagic.py
@@ -82,6 +82,7 @@
from ..Compiler.Errors import CompileError
from .Inline import cython_inline
from .Dependencies import cythonize
+from... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-9719@bf30884 | dask/dask | Python | 9,719 | Support `dtype_backend="pandas|pyarrow"` configuration | This PR updates the `use_nullable_dtypes=` keyword in `read_parquet` to accept `"pandas"` and `"pyarrow"` as valid inputs. The equivalent in `pandas` would be `use_nullable_dtypes=True` + the new `io.nullable_backend` `pandas` config option that's coming in `pandas=2.0`. I like `use_nullable_dtypes="pandas|pyarrow"` in... | 2022-12-05T22:43:27Z | Read Parquet directly into string[pyarrow]
I would like to read parquet data directly into string pyarrow dtypes
So I'm trying this naively on a dataset:
```python
import dask.dataframe as dd
df = dd.read_parquet(
"s3://nyc-tlc/trip data/fhvhv_tripdata_2022-06.parquet",
split_row_groups=True,
... | Thanks @mrocklin. This sounds sensible. Something like `use_nullable_dtypes=True` + telling `pandas` to use `string[pyarrow]` as the default string type should do the trick.
Was the dataset originally written with extension string dtypes? Ideally I'd like to see us respect roundtripping
> Was the dataset originally... | [
{
"body": "I would like to read parquet data directly into string pyarrow dtypes\r\n\r\nSo I'm trying this naively on a dataset:\r\n\r\n```python\r\nimport dask.dataframe as dd\r\n\r\ndf = dd.read_parquet(\r\n \"s3://nyc-tlc/trip data/fhvhv_tripdata_2022-06.parquet\", \r\n split_row_groups=True, \r\n u... | 7a0e87342fa72ca9b755a41090872add607deeab | {
"head_commit": "bf30884fa8183438e9eaf29c6c159a49b6b9d4ea",
"head_commit_message": "Use config option",
"patch_to_review": "diff --git a/dask/dask-schema.yaml b/dask/dask-schema.yaml\nindex 8573c0e5b66..6be1a5b3bba 100644\n--- a/dask/dask-schema.yaml\n+++ b/dask/dask-schema.yaml\n@@ -72,6 +72,14 @@ properties:\n... | [
{
"diff_hunk": "@@ -12,6 +12,7 @@ dataframe:\n parquet:\n metadata-task-size-local: 512 # Number of files per local metadata-processing task\n metadata-task-size-remote: 16 # Number of files per remote metadata-processing task\n+ nullable_backend: \"pandas\" # Nullable dtype implementation to use"... | dd80bb8635d0c35ec2a3ce5ae1133335cb855e02 | diff --git a/dask/dask-schema.yaml b/dask/dask-schema.yaml
index 8573c0e5b66..7a7bc84680d 100644
--- a/dask/dask-schema.yaml
+++ b/dask/dask-schema.yaml
@@ -72,6 +72,14 @@ properties:
task when reading a parquet dataset from a REMOTE file system.
Specifying 0 will result in serial executio... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
dask__dask-9534@e71baa7 | dask/dask | Python | 9,534 | Fix project CSV columns when selecting | - [x] Closes #9518
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
| 2022-09-30T21:00:00Z | KeyError when supplying multiple paths to dask.dataframe.read_csv() AND including a path column AND using Dask compute
When using Dask compute in a Dask dataframe with `include_path_column=True` a `KeyError` is returned.
I would have expected that columns in lazy Dask collection will be the same in their memory equi... | [
{
"body": "When using Dask compute in a Dask dataframe with `include_path_column=True` a `KeyError` is returned.\r\n\r\nI would have expected that columns in lazy Dask collection will be the same in their memory equivalent. But unsure if that is the problem.\r\n\r\nExample 1:\r\n\r\n```py\r\nimport os\r\nimport... | 3ef47422b9f830f81562960ef549778819498aa1 | {
"head_commit": "e71baa7c6bf472e38cbf783398904cca38325503",
"head_commit_message": "add comment",
"patch_to_review": "diff --git a/dask/dataframe/io/csv.py b/dask/dataframe/io/csv.py\nindex 9276a06fc40..4d2f458a17d 100644\n--- a/dask/dataframe/io/csv.py\n+++ b/dask/dataframe/io/csv.py\n@@ -63,7 +63,11 @@ def __i... | [
{
"diff_hunk": "@@ -1770,3 +1770,19 @@ def test_csv_name_should_be_different_even_if_head_is_same(tmpdir):\n )\n \n assert new_df.dask.keys() != old_df.dask.keys()\n+\n+\n+def test_select_with_path_optimization(tmpdir):\n+ # https://github.com/dask/dask/issues/9518\n+\n+ d = {\"col1\": [i for i in... | dd05a5e94748a1958b4652fa4da86de3eb0da422 | diff --git a/dask/dataframe/io/csv.py b/dask/dataframe/io/csv.py
index 9276a06fc40..4d2f458a17d 100644
--- a/dask/dataframe/io/csv.py
+++ b/dask/dataframe/io/csv.py
@@ -63,7 +63,11 @@ def __init__(
@property
def columns(self):
- return self.full_columns if self._columns is None else self._columns
+ ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-3812@a158199 | cython/cython | Python | 3,812 | Avoid parsing failure on cast to ctuple | Fixes #3808 | 2020-09-03T19:40:00Z | [BUG] Compiler error when casting to `ctuple`
**Describe the bug**
When attempting to cast to a `ctuple`, Cython runs into a compiler error.
**To Reproduce**
Code to reproduce the behavior:
```cython
# cython: language_level=3
cdef double d
cdef int i
o = (3.0, 2)
d, i = <(double, int)>o # <--- co... | I realize this is probably a minimized example to demonstrate the issue, but I can't see why the cast to a ctuple is useful here? I'd think `d, i = o` should work just as efficiently?
Yeah it’s an oversimplified example just to demonstrate the issue.
> `d, i = <(double, int)>o # <--- compiler errors here`
You didn'... | [
{
"body": "**Describe the bug**\r\n\r\nWhen attempting to cast to a `ctuple`, Cython runs into a compiler error.\r\n\r\n**To Reproduce**\r\n\r\nCode to reproduce the behavior:\r\n\r\n```cython\r\n# cython: language_level=3\r\n\r\ncdef double d\r\ncdef int i\r\n\r\no = (3.0, 2)\r\nd, i = <(double, int)>o # <---... | 4aec02117deb1d9279a81920f21459fc015d1a77 | {
"head_commit": "a15819989f45319ed9ee3f9bfdb762bab6e9a5f5",
"head_commit_message": "Avoid parsing failure on cast to ctuple",
"patch_to_review": "diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py\nindex 4755f9ad171..2e3241b6b17 100644\n--- a/Cython/Compiler/Parsing.py\n+++ b/Cython/Compiler/Pa... | [
{
"diff_hunk": "@@ -318,7 +318,8 @@ def p_typecast(s):\n is_memslice = isinstance(base_type, Nodes.MemoryViewSliceTypeNode)\n is_template = isinstance(base_type, Nodes.TemplatedTypeNode)\n is_const_volatile = isinstance(base_type, Nodes.CConstOrVolatileTypeNode)\n- if not is_memslice and not is_t... | c3a4842e90d92aaae978e0c4f625140db9db878f | diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py
index 4755f9ad171..550b601e99b 100644
--- a/Cython/Compiler/Parsing.py
+++ b/Cython/Compiler/Parsing.py
@@ -316,9 +316,12 @@ def p_typecast(s):
s.next()
base_type = p_c_base_type(s)
is_memslice = isinstance(base_type, Nodes.MemoryViewSl... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-3728@0011337 | cython/cython | Python | 3,728 | always consider 0-sized arrays as C- and F-contiguous | fixes #2093 | 2020-07-06T10:38:10Z | ValueError continuous memory view and 0-size numpy array
A ValueError is raised if one gives a numpy array with shape `(2, 0, 1)` to such Cython functions with a 3d memoryview as argument:
```cython
cimport numpy as np
import numpy as np
np.import_array()
cpdef myfunc3d(np.float64_t[:, :, ::1] arr):
if ar... | Strangely enough, by changing the function definition as shown below does not raise any error.
```python
from cython cimport view
def myfunc3d(np.float_t[:,:,::view.contiguous] arr):
```
Possible explanation from [Cython docs](https://cython.readthedocs.io/en/latest/src/userguide/memoryviews.html?highlight=vie... | [
{
"body": "A ValueError is raised if one gives a numpy array with shape `(2, 0, 1)` to such Cython functions with a 3d memoryview as argument:\r\n\r\n```cython\r\ncimport numpy as np\r\nimport numpy as np\r\nnp.import_array()\r\n\r\ncpdef myfunc3d(np.float64_t[:, :, ::1] arr):\r\n if arr.size > 0:\r\n ... | c315c201d1e1d2d0a377d6b8210ef641ed3ab65d | {
"head_commit": "0011337f3159ae5b9eb2c50f7377d18c8e5fd72c",
"head_commit_message": "always consider 0-sized arrays as C- and F-contiguous\n\nfixes #2093",
"patch_to_review": "diff --git a/Cython/Utility/MemoryView_C.c b/Cython/Utility/MemoryView_C.c\nindex 063fbf3606b..dc34ef420c6 100644\n--- a/Cython/Utility/Me... | [
{
"diff_hunk": "@@ -347,18 +347,23 @@ static int __Pyx_ValidateAndInit_memviewslice(\n }\n \n /* Check axes */\n- for (i = 0; i < ndim; i++) {\n- spec = axes_specs[i];\n- if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))\n- goto fail;\n- if (unlikely(!__pyx_check... | c94ce985acbac6cc6483c136cf2b9db9a7ef094f | diff --git a/Cython/Utility/MemoryView_C.c b/Cython/Utility/MemoryView_C.c
index 063fbf3606b..c6d6601ed26 100644
--- a/Cython/Utility/MemoryView_C.c
+++ b/Cython/Utility/MemoryView_C.c
@@ -347,18 +347,22 @@ static int __Pyx_ValidateAndInit_memviewslice(
}
/* Check axes */
- for (i = 0; i < ndim; i++) {
-... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
cython__cython-3654@91eb518 | cython/cython | Python | 3,654 | Fix a bug where fused_to_specific was applied too widely | Fixes https://github.com/cython/cython/issues/3642 | 2020-05-31T11:23:31Z | fused type variable declared in unrelated function causes incorrect type inference
The following example
```cython
cimport cython
cdef unrelated(cython.floating x):
cdef cython.floating t
cdef handle_float(float* x): pass
cdef handle_double(double* x): pass
def main(cython.floating x):
if cython.f... | I think (but could yet be wrong) that it's https://github.com/cython/cython/blob/0532a0919be640210eeba1144717a6273707e112/Cython/Compiler/Nodes.py#L1035
cythonscope is having the attribute `fused_to_specific` set on it, and that influences all subsequent lookups. Not sure right now how it should be fixed though. | [
{
"body": "The following example\r\n```cython\r\ncimport cython\r\n\r\ncdef unrelated(cython.floating x):\r\n cdef cython.floating t\r\n\r\ncdef handle_float(float* x): pass\r\ncdef handle_double(double* x): pass\r\n\r\ndef main(cython.floating x):\r\n if cython.floating is float:\r\n handle_float(... | 3ee066283d503d9ed494f90793ee89e6973904f8 | {
"head_commit": "91eb518096d4f63d2db5a6e5140a70aecc0bc70f",
"head_commit_message": "Fix a bug where fused_to_specific was applied too widely\n\nFixes https://github.com/cython/cython/issues/3642",
"patch_to_review": "diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py\nindex c9a0422814a..1ef0ab9c57a... | [
{
"diff_hunk": "@@ -484,3 +484,25 @@ def test_fused_in_check():\n print(in_check_2(1.0, 2.0))\n print(in_check_2[float, double](1.0, 2.0))\n print(in_check_3[float](1.0))\n+\n+### see GH3642 - presence of cdef inside \"unrelated\" caused a type to be incorrectly inferred\n+cdef unrelated(cython.floa... | f808448f2a4493965703261ab5ae2c4743c118e8 | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index c9a0422814a..1ef0ab9c57a 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -1031,8 +1031,6 @@ def analyse(self, env, could_be_name=False):
if scope is None:
# Maybe it's a cimport.
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-4094@9a2c6df | cython/cython | Python | 4,094 | Fix behaviour of __class__ special variable | Finishes up https://github.com/cython/cython/pull/2916 and closes https://github.com/cython/cython/issues/2912
Uses `ClassClassNode` for regular classes to get the attribute reliably at runtime (for `cdef class` it can be resolved at compile-time).
It essentially adds the line:
```
__class__ = <ClassCellNode>... | 2021-04-05T12:31:40Z | Cython mishandles PEP-3135 __class__ cell in methods
Hello, I am having trouble with some inconsistent behaviour round the value of `__class__` in Cythonized code. This is on Python **3.6.7** with Cython **0.29.1**.
Briefly, in uncythonized code `__class__` inside a method on a `class` refers to the `class` object,... | I think we handle `super()` separately but not `__class__` (as defined by [PEP-3135](https://www.python.org/dev/peps/pep-3135/)).
PR welcome, it's probably quite easy. See `TransformBuiltinMethods._inject_super()` in `ParseTreeTransforms.py`. The `NameNode` with name `__class__` should be replaced in methods y a `Cl... | [
{
"body": "Hello, I am having trouble with some inconsistent behaviour round the value of `__class__` in Cythonized code. This is on Python **3.6.7** with Cython **0.29.1**. \r\n\r\nBriefly, in uncythonized code `__class__` inside a method on a `class` refers to the `class` object, whereas once cythonized, it s... | c8fe79db1356e8bc235b2e4684f417cc52f3ed35 | {
"head_commit": "9a2c6df5a65a01e7c20557260036952c0a1fa01a",
"head_commit_message": "Add missing attribute to pxd file\n\nfor \"all\" tests",
"patch_to_review": "diff --git a/Cython/Compiler/ParseTreeTransforms.pxd b/Cython/Compiler/ParseTreeTransforms.pxd\nindex 4026429ac65..9098b180886 100644\n--- a/Cython/Comp... | [
{
"diff_hunk": "@@ -3063,6 +3063,9 @@ class TransformBuiltinMethods(EnvTransform):\n \"\"\"\n Replace Cython's own cython.* builtins by the corresponding tree nodes.\n \"\"\"\n+ def __init__(self, *args, **kwds):\n+ super(TransformBuiltinMethods, self).__init__(*args, **kwds)\n+ sel... | b203a3e12cf81e035a9d11ef559dc8c64d9363d5 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 275a6233da5..a9fa0cff13a 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -9641,7 +9641,7 @@ def generate_result_code(self, code):
code.putln('%s = %s->classobj;' % (
self.result(... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-3667@bc8a325 | cython/cython | Python | 3,667 | Handle `for x in cpp_function_call()` | Fixes https://github.com/cython/cython/issues/3663
This ensures that rvalues here are saved as temps, while keeping the
exisiting behaviour for `for x in deref(vec)`, where the pointer for vec
is copied, meaning it doesn't crash if vec is reassigned.
The bit of this change liable to have the biggest effect is t... | 2020-06-05T19:31:54Z | error: taking address of rvalue in for loops over C++ function results
# context that is not a minimal reproducing example
I have a C++ function that returns a map<vector<bool>, int> and I want to convert it to python.
Obviously lists are not hashable so I convert the map to a list of pairs.
# code
```cyth... | [
{
"body": "# context that is not a minimal reproducing example\r\n\r\nI have a C++ function that returns a map<vector<bool>, int> and I want to convert it to python.\r\nObviously lists are not hashable so I convert the map to a list of pairs.\r\n\r\n\r\n# code\r\n\r\n```cython\r\ncdef extern from \"mylib.hpp\"... | a0e10cf604e62b6a08ba26c87e76d735a58988af | {
"head_commit": "bc8a32507159dc3e23f721a88b88246e60e2634a",
"head_commit_message": "Removed stray semi-colon",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 23028119fe6..fb27a361b50 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.p... | [
{
"diff_hunk": "@@ -2910,8 +2840,107 @@ def free_temps(self, code):\n if self.iter_func_ptr:\n code.funcstate.release_temp(self.iter_func_ptr)\n self.iter_func_ptr = None\n- if self.cpp_iterator_cname:\n- code.funcstate.release_temp(self.cpp_iterator_cname)\n+ ... | 8b03a0c3b71a0a400da93820b286ac17b80ad8c6 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 23028119fe6..8f6377f9301 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -2660,7 +2660,6 @@ class IteratorNode(ExprNode):
type = py_object_type
iter_func_ptr = None
counter_cname = None
- cpp... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
cupy__cupy-5214@5f45b6c | cupy/cupy | Python | 5,214 | Drop support for CUDA 9.2 & NCCL 2.4 | Closes #5120.
CUDA 9.2 / NCCL 2.4 specific code removals can be done in separate PRs. | 2021-05-20T08:25:38Z | [RFC] [v10] Dropping Support for CUDA 9.2 & NCCL 2.4
In CuPy v10, we are thinking of dropping support for CUDA 9.2 and NCCL 2.4. Please leave a comment if you have any concerns.
This does not affect CuPy v9.x releases. | [
{
"body": "In CuPy v10, we are thinking of dropping support for CUDA 9.2 and NCCL 2.4. Please leave a comment if you have any concerns.\r\n\r\nThis does not affect CuPy v9.x releases.",
"number": 5120,
"title": "[RFC] [v10] Dropping Support for CUDA 9.2 & NCCL 2.4"
}
] | 18d6f238e483cc1c1144ff10171822da19f998fd | {
"head_commit": "5f45b6cd23e27ca28939cf241b20306c68941e78",
"head_commit_message": "Merge branch 'master' into remove-cuda-92",
"patch_to_review": "diff --git a/README.md b/README.md\nindex 85b28451fd3..f6dc22b8d5e 100644\n--- a/README.md\n+++ b/README.md\n@@ -27,8 +27,6 @@ Choose the right package for your plat... | [
{
"diff_hunk": "@@ -54,11 +54,11 @@ Part of the CUDA features in CuPy will be activated only when the corresponding\n \n * The library to accelerate tensor operations. See :doc:`../reference/environment` for the details.\n \n-* `NCCL <https://developer.nvidia.com/nccl>`_: v2.4 (CUDA 9.2) / v2.6 (CUDA 10.0) ... | f7d20552ba925e4f52e21b768355afcfa62fde53 | diff --git a/README.md b/README.md
index 28e4d3c690c..6915fe08a4e 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,6 @@ Choose the right package for your platform.
| Platform | Command |
| --------- | ------------------------------ |
-| CUDA 9.2 | `pip install cupy-cuda92` |
| CUDA... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "New Feature Additions"
} | |
cython__cython-3743@63c9dbd | cython/cython | Python | 3,743 | Fix some issues with duplicated utilitycode | Fixes https://github.com/cython/cython/issues/3716
Hopefully fixes https://github.com/cython/cython/issues/3741 (but I can't produce a working test for it; @KmolYuan could you look at my C++ testcase and tell me what I've missed!)
Fixes https://github.com/cython/cython/issues/3734 | 2020-07-17T15:26:49Z | Redefinition error when putting functions in a dict
When trying to compile some Python code with Cython, I got the following kind of errors:
```
error: redefinition of XXX
```
I've managed to reduce my code to a reproducible example:
```
# cython: language_level=3
cdef f1(x, r):
pass
cdef f2(x1, ... | It probably give an error but it seems like a relatively pointless thing to do: you're not putting a bunch of `cdef` functions in a `dict` - you're putting a bunch of Python wrappers round `cdef` functions into a `dict`. It's pretty much equivalent to if you'd just declared the functions as `def/cpdef`
It doesn't look ... | [
{
"body": "When trying to compile some Python code with Cython, I got the following kind of errors:\r\n\r\n```\r\nerror: redefinition of XXX\r\n```\r\n\r\nI've managed to reduce my code to a reproducible example:\r\n\r\n```\r\n# cython: language_level=3\r\n\r\ncdef f1(x, r):\r\n pass\r\n\r\ncdef f2(x1, r):\r... | 883f8f5bd6e2dc095529ad5a33c766f73a9ff413 | {
"head_commit": "63c9dbde4d24eeb1e04f8dc4f308790a11902d17",
"head_commit_message": "Node -> StatNode",
"patch_to_review": "diff --git a/Cython/Compiler/Pipeline.py b/Cython/Compiler/Pipeline.py\nindex b7f512e7ea5..8372aaa7920 100644\n--- a/Cython/Compiler/Pipeline.py\n+++ b/Cython/Compiler/Pipeline.py\n@@ -285,1... | [
{
"diff_hunk": "@@ -285,11 +285,26 @@ def create_pyx_as_pxd_pipeline(context, result):\n FlattenInListTransform,\n WithTransform\n ])\n+ from .Visitor import VisitorTransform\n+ ... | fbf708d766238b4c255accb1a783674c17d85439 | diff --git a/Cython/Compiler/Pipeline.py b/Cython/Compiler/Pipeline.py
index b7f512e7ea5..4e8e98c713f 100644
--- a/Cython/Compiler/Pipeline.py
+++ b/Cython/Compiler/Pipeline.py
@@ -285,11 +285,25 @@ def create_pyx_as_pxd_pipeline(context, result):
FlattenInListTransform,
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-9419@04368db | dask/dask | Python | 9,419 | Filter by list | - [ X ] Closes #9411
- [ X ] Tests added / passed
- [ X ] Passes `pre-commit run --all-files`
This PR addresses the fact that filtering a Dask DataFrame with `ddf.isin(L)` if L is a large list, is much slower than if L is a numpy array. This appears to be a result of serializing lists with pickle, while serializ... | 2022-08-23T10:43:27Z | Filtering on a Python list is 2 orders of magnitude slower than filtering on a numpy array
**What happened**:
Filtering on a list of integers vs a numpy array on the example below is nearly 200 times slower
From the example below I get
```
Pandas with list took: 0.573s, len: 3,934,884
Pandas with array took: 0.... | @RogerThomas Thanks for reporting, this is surprising and seems like a bug.
I looked at this with @ian-r-rose, and we think this might be related to how the list is being serialized, specifically by the distributed scheduler.
A few notes:
* we see short overall times and short time _differences_ while using sing... | [
{
"body": "**What happened**:\r\nFiltering on a list of integers vs a numpy array on the example below is nearly 200 times slower \r\nFrom the example below I get\r\n\r\n```\r\nPandas with list took: 0.573s, len: 3,934,884\r\nPandas with array took: 0.366s, len: 3,934,884\r\nDask with list took: 41.739s, len: 3... | 57ff5c2e9c550e3c76592b0affa0d45e88375e12 | {
"head_commit": "04368db927dc36f215cac90b893e7b64acc19312",
"head_commit_message": "Handle versions of numpy that can not create an array of lists",
"patch_to_review": "diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py\nindex e9cd2795fbc..5df408e5eb5 100644\n--- a/dask/dataframe/core.py\n+++ b/dask/da... | [
{
"diff_hunk": "@@ -50,6 +51,18 @@\n )\n d = dd.DataFrame(dsk, \"x\", meta, [0, 5, 9, 9])\n full = d.compute()\n+\n+dsk2 = {\n+ (\"x\", 0): pd.DataFrame({\"a\": [[1, 2, 3]], \"b\": [4, 5, 6]}, index=[0, 1, 3]),\n+ (\"x\", 1): pd.DataFrame({\"a\": [4, 5, 6], \"b\": [[3, 4, 5]]}, index=[5, 6, 8]),\n+ (\"... | 1e8f2c344c3a37953555565bf7b8429969f0576c | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index e9cd2795fbc..5df408e5eb5 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -3094,6 +3094,22 @@ def isin(self, values):
# We wrap values in a delayed for two reasons:
# - avoid serializing data in every task
#... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Performance Optimizations"
} |
deepset-ai__haystack-6855@1c31350 | deepset-ai/haystack | Python | 6,855 | feat: Implement `Secret` for structured authentication | ### Related Issues
- Fixes https://github.com/deepset-ai/haystack/issues/6851
### Proposed Changes:
Expose a `Secret` type to provide common logic for any component that requires a secret for authentication, with the following variants:
- `token` - Use a string literal.
- `env_var` - Resolve the token from t... | 2024-01-30T13:56:33Z | Component secret management - Implement a discriminated union that handles the main authentication usecases
Expose an `AuthPolicy` type to provide common logic for any component that requires authentication, with the following variants:
- `Token` - Use a string literal.
- `EnvVar` - Resolve the token from the passed ... | [
{
"body": "Expose an `AuthPolicy` type to provide common logic for any component that requires authentication, with the following variants:\r\n- `Token` - Use a string literal.\r\n- `EnvVar` - Resolve the token from the passed environment variable.\r\n\r\nSome backends support additional methods such as on-disk... | ceda4cd6557274b992566d59085be1730f5613f8 | {
"head_commit": "1c31350592ba19ea545a17d224eeb5b1b9b1134c",
"head_commit_message": "feat: Implement `AuthPolicy` for structured authentication",
"patch_to_review": "diff --git a/haystack/utils/__init__.py b/haystack/utils/__init__.py\nindex e4cdb87d60..62c13052fb 100644\n--- a/haystack/utils/__init__.py\n+++ b/h... | [
{
"diff_hunk": "@@ -0,0 +1,194 @@\n+from enum import Enum\n+import os\n+from typing import Any, Dict, List, Optional, Union\n+from dataclasses import dataclass\n+from abc import ABC, abstractmethod\n+\n+\n+class AuthPolicyType(Enum):\n+ TOKEN = \"token\"\n+ ENV_VAR = \"env_var\"\n+\n+ def __str__(self)... | f5d638d2823e3278be18337c2ee2434b0d347763 | diff --git a/haystack/utils/__init__.py b/haystack/utils/__init__.py
index e4cdb87d60..df42fc59c8 100644
--- a/haystack/utils/__init__.py
+++ b/haystack/utils/__init__.py
@@ -2,3 +2,4 @@
from haystack.utils.requests_utils import request_with_retry
from haystack.utils.filters import document_matches_filter
from hayst... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
cython__cython-3440@fd42ce8 | cython/cython | Python | 3,440 | Make `Shadow.inline()` caching account for language version and compilation environment. | Closes #3419. | 2020-03-17T01:06:46Z | Caching for `cython.inline()` does not differentiate between different compiler configurations.
```python3
>>> cython.inline('def f(int a, int b):\n\treturn a/b\nreturn f', language_level=3)(5,2)
2.5
```
```python3
>>> cython.inline('def f(int a, int b):\n\treturn a/b\nreturn f', language_level=2)(5,2)
2
>>> c... | Interesting. I had added the `language_level` to the module hash, but it seems to have no effect.
https://github.com/cython/cython/blob/0b81c765bf9b23138b83311e07aacec74517e778/Cython/Build/Inline.py#L193-L194
I think that hash is being skipped entirely by the fast path at the very start of the function, which onl... | [
{
"body": "```python3\r\n>>> cython.inline('def f(int a, int b):\\n\\treturn a/b\\nreturn f', language_level=3)(5,2)\r\n2.5\r\n```\r\n\r\n```python3\r\n>>> cython.inline('def f(int a, int b):\\n\\treturn a/b\\nreturn f', language_level=2)(5,2)\r\n2\r\n>>> cython.inline('def f(int a, int b):\\n\\treturn a/b\\nre... | c5f2231ec462f23f53d5ec8d0963f8da6b7145cf | {
"head_commit": "fd42ce86eebeb6644b59dbd34b9e0a3ada93e70f",
"head_commit_message": "Update inlinecode.pyx",
"patch_to_review": "diff --git a/Cython/Build/Inline.py b/Cython/Build/Inline.py\nindex cbcc5822dcc..5257ada18ce 100644\n--- a/Cython/Build/Inline.py\n+++ b/Cython/Build/Inline.py\n@@ -141,6 +141,10 @@ def... | [
{
"diff_hunk": "@@ -14,4 +14,4 @@ def inline_langversion(language_level, a=5, b=2):\n \"\"\"\n # Caching for inline code didn't always respect language version.\n # https://github.com/cython/cython/issues/3419\n- print(Shadow.inline(_inline_divcode, language_level=language_level, quiet=True)(a=a,... | 4639c4ae6cb2a4aab7705a2ad844e977f2932bae | diff --git a/Cython/Build/Inline.py b/Cython/Build/Inline.py
index cbcc5822dcc..5257ada18ce 100644
--- a/Cython/Build/Inline.py
+++ b/Cython/Build/Inline.py
@@ -141,6 +141,10 @@ def _populate_unbound(kwds, unbound_symbols, locals=None, globals=None):
else:
print("Couldn't find %r" % symbol... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-3463@8861390 | cython/cython | Python | 3,463 | Specialize fused function local variables specified with pure-python | These were previously getting missed. Added code to specialize them
and tests to prove it.
Fixes https://github.com/cython/cython/issues/3142
Also fixes https://github.com/cython/cython/issues/3460 - (seems related enough to go in the same PR) | 2020-03-25T16:52:57Z | Bug pure-Python mode and fused types?
This .pyx file can be compiled:
```cython
import cython
import numpy as np
cimport numpy as np
ctypedef fused A:
np.int_t[:]
np.float_t[:]
cpdef func(A arg):
cdef A arr = np.empty_like(arg)
return arr
```
but this doesn't work whereas it seems to... | The code looks reasonable to me, so I consider it a bug that it doesn't work. My guess is that the `directive_locals` handling in the `AnalyseDeclarationsTransform` does not take (enough?) care about fused types.
Further investigation and PR welcome.
This is looking like a bug I introduced in https://github.com/cyth... | [
{
"body": "This .pyx file can be compiled:\r\n```cython\r\nimport cython\r\n\r\nimport numpy as np\r\ncimport numpy as np\r\n\r\nctypedef fused A:\r\n np.int_t[:]\r\n np.float_t[:]\r\n\r\ncpdef func(A arg):\r\n cdef A arr = np.empty_like(arg)\r\n return arr\r\n```\r\n\r\nbut this doesn't work wherea... | 48dc1f0169f81ed20c6b374941c2498ec94e57d0 | {
"head_commit": "8861390ad76670b0620f61b632b8d0e141789daf",
"head_commit_message": "Add comment.",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 1e9e4fcbb31..0596904d3d9 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\n@@ -1953,... | [
{
"diff_hunk": "@@ -17,17 +17,20 @@ def func1(self, arg: 'NotInPy'):\n >>> TestCls().func1(2)\n 'int'\n \"\"\"\n+ loc: 'NotInPy' = arg\n return cython.typeof(arg)\n \n if cython.compiled:\n- @cython.locals(arg = NotInPy) # NameError in pure Python\n+ @cy... | 2106f21ecfb866e7acf108e5e81526b56203d434 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 1e9e4fcbb31..0596904d3d9 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -1953,6 +1953,8 @@ def declare_from_annotation(self, env, as_target=False):
_, atype = annotation.analyse_type_annotation(e... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-6847@1f94774 | deepset-ai/haystack | Python | 6,847 | feat: Change `Pipeline.add_component` to fail when reusing `Component` instances | ### Related Issues
- fixes #6431
### Proposed Changes:
Add `__haystack_pipeline_owned__` field in all `Component` instances. Defaults to `False`.
Change `Pipeline.add_component()` to fail if the `Component` instance is already used in another `Pipeline`. The method will also set `__haystack_pipeline_owned__... | 2024-01-29T16:53:12Z | Warn users when adding the same component instance to multiple pipelines
Adding the same component instance to different pipelines causes side effects that often result in unexpected behaviour.
Except for any operation done during the `warm_up` phase, components are stateless so there's no gain in adding the same inst... | [
{
"body": "Adding the same component instance to different pipelines causes side effects that often result in unexpected behaviour.\n\nExcept for any operation done during the `warm_up` phase, components are stateless so there's no gain in adding the same instance to different pipelines, and our stance at this ... | f5e61338ba370772f5d941ded4c84deabe177226 | {
"head_commit": "1f94774a2f4cfbbe506d7ecad6baf433cc0e1f1f",
"head_commit_message": "Change Pipeline.add_component to fail when reusing Component instances",
"patch_to_review": "diff --git a/haystack/core/component/component.py b/haystack/core/component/component.py\nindex ab264ce11a..223fb2f1b4 100644\n--- a/hay... | [
{
"diff_hunk": "@@ -147,6 +147,12 @@ def __call__(cls, *args, **kwargs):\n if run_signature.parameters[param].default != inspect.Parameter.empty:\n socket_kwargs[\"default_value\"] = run_signature.parameters[param].default\n instance.__haystack_input__[param] ... | 4511614a0392ef4e79bcc7a5bd52e9287cea21bc | diff --git a/haystack/core/component/component.py b/haystack/core/component/component.py
index ab264ce11a..9db5a7aabc 100644
--- a/haystack/core/component/component.py
+++ b/haystack/core/component/component.py
@@ -147,6 +147,12 @@ def __call__(cls, *args, **kwargs):
if run_signature.parameters[param].... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-3514@b809683 | cython/cython | Python | 3,514 | Fixes CodeWriter for `cdef` functions aka. CFuncDefNode. | Resolves #3513. | 2020-04-14T08:21:47Z | CodeWriter doesn't work for 'CFuncDefNode'
```python
>>> writer = CodeWriter()
>>> writer.write(TreeFragment("def fn(): \n pass").root)
<Cython.CodeWriter.LinesResult at 0x121704a90>
>>> writer.write(TreeFragment("cdef fn(): \n pass").root)
Compiler crash traceback from this point on:
File "Cython/Com... | Interesting to see that people are actually using this. :)
PR welcome.
> Interesting to see that people are actually using this. :)
Is the `CodeWriter` the only way to dump Cython AST into syntastically-correct Cython code?
> PR welcome.
PR #3514 will fix that.
> Is the CodeWriter the only way to dump Cytho... | [
{
"body": "```python\r\n>>> writer = CodeWriter()\r\n\r\n>>> writer.write(TreeFragment(\"def fn(): \\n pass\").root)\r\n<Cython.CodeWriter.LinesResult at 0x121704a90>\r\n\r\n>>> writer.write(TreeFragment(\"cdef fn(): \\n pass\").root)\r\nCompiler crash traceback from this point on:\r\n File \"Cython/Comp... | a0e10cf604e62b6a08ba26c87e76d735a58988af | {
"head_commit": "b8096835745f36aed534bf138d22f35dbf8c58cf",
"head_commit_message": "Fix for the special case for `CSimpleBaseTypeNode` (when name is None).\n\nSigned-off-by: Tao He <linzhu.ht@alibaba-inc.com>",
"patch_to_review": "diff --git a/Cython/CodeWriter.py b/Cython/CodeWriter.py\nindex 24d57626b67..f09dd... | [
{
"diff_hunk": "@@ -241,14 +244,49 @@ def visit_FuncDefNode(self, node):\n self.startline(u\"def %s(\" % node.name)\n self.comma_separated_list(node.args)\n self.endline(u\"):\")\n- self.indent()\n- self.visit(node.body)\n- self.dedent()\n+ self.visit_indented... | cb9fdfdc652048fe8790ef80c0052ec965757442 | diff --git a/Cython/CodeWriter.py b/Cython/CodeWriter.py
index 24d57626b67..12fe14f6104 100644
--- a/Cython/CodeWriter.py
+++ b/Cython/CodeWriter.py
@@ -1,7 +1,6 @@
"""
Serializes a Cython code tree to Cython code. This is primarily useful for
debugging and testing purposes.
-
The output is in a strict format, no w... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-4904@a7b13d0 | cupy/cupy | Python | 4,904 | Add `out` arg verifier in new random interface. | Fixes #4903
BTW I want to rework the tests and add a common baseclass for distributions in the old and new API as most of them are 100% identical, right now we are duplicating code where we shouldnt. | 2021-03-18T07:19:24Z | `out` arg of methods of `random.Generator` should be more strict
At least, NumPy checks dtype and contiguity of `out`.
* Conditions (you can just paste the output of `python -c 'import cupy; cupy.show_config()'`)
- CuPy version: master
* Code to reproduce
```python
import traceback
import cupy
import num... | [
{
"body": "At least, NumPy checks dtype and contiguity of `out`.\r\n\r\n* Conditions (you can just paste the output of `python -c 'import cupy; cupy.show_config()'`)\r\n - CuPy version: master\r\n* Code to reproduce\r\n\r\n```python\r\nimport traceback\r\n\r\nimport cupy\r\nimport numpy\r\n\r\n\r\nfor xp in (n... | ea1956541a9d455d2b543282bafd4fb847c1e323 | {
"head_commit": "a7b13d09ab0412e1592d5853941946a2557afc39",
"head_commit_message": "Create a mixin for invalid outs tests",
"patch_to_review": "diff --git a/cupy/random/_generator_api.pyx b/cupy/random/_generator_api.pyx\nindex 669cd7fbd20..2092a0e9aea 100644\n--- a/cupy/random/_generator_api.pyx\n+++ b/cupy/ran... | [
{
"diff_hunk": "@@ -206,10 +206,37 @@ def test_beta_ks(self, dtype):\n a=self.a, b=self.b, size=2000, dtype=dtype)\n \n \n+class InvalidOutsMixin:\n+\n+ def invalid_dtype_out(self, **kwargs):\n+ out = cupy.zeros((3, 2), dtype=cupy.float32)\n+ with pytest.raises(TypeError):\n+ ... | 03fb724590e5588248a591c22e2b1dc5461d5dcd | diff --git a/cupy/random/_generator_api.pyx b/cupy/random/_generator_api.pyx
index 669cd7fbd20..2092a0e9aea 100644
--- a/cupy/random/_generator_api.pyx
+++ b/cupy/random/_generator_api.pyx
@@ -56,6 +56,27 @@ class Generator:
def __init__(self, bit_generator):
self.bit_generator = bit_generator
+ def ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
deepset-ai__haystack-6753@c5e84c6 | deepset-ai/haystack | Python | 6,753 | feat: added split by page to `DocumentSplitter` |
- fixes #6707
- The new split_by value, 'page', has been introduced in the DocumentSplitter to enable users to split documents based on the "\f" character, facilitating the preservation of context and allowing for more flexible chunking options.
| 2024-01-17T09:18:55Z | feat: Add split by `page` to `DocumentSplitter`
**Is your feature request related to a problem? Please describe.**
There are some cases where we would like to be able to split the contents of a PDF by page. Either to keep all text from a single page as a document to help preserve context or to be able to perform two s... | Hello @sjrl,
I gave it a try and found out that new page in was marked by `\x0c`, Do you have any suggestions on how should I proceed further. Do you think I should include both `\f` and `\x0c` for splitting?
Hey @sahusiddharth thanks for taking a look at this! `\f` and `\x0c` are the same thing. Take a look at thi... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nThere are some cases where we would like to be able to split the contents of a PDF by page. Either to keep all text from a single page as a document to help preserve context or to be able to perform two sets of chunking (i.e. split... | b8b8b5d5c64aa97108b957c9cfa9f4f0f4629153 | {
"head_commit": "c5e84c6bda7ab4b3b1532df2ba3f2b999a6fe464",
"head_commit_message": "feat-added-split-by-page-to-DocumentSplitter",
"patch_to_review": "diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py\nindex 57531b73c1..7ecf204009 100644\... | [
{
"diff_hunk": "@@ -14,17 +14,20 @@ class DocumentSplitter:\n \"\"\"\n \n def __init__(\n- self, split_by: Literal[\"word\", \"sentence\", \"passage\"] = \"word\", split_length: int = 200, split_overlap: int = 0\n+ self,\n+ split_by: Literal[\"word\", \"sentence\", \"page\", \"passa... | 40c5e3ec494cf17abe575d9c67a345e422e11ce2 | diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py
index 57531b73c1..4649c7f5d4 100644
--- a/haystack/components/preprocessors/document_splitter.py
+++ b/haystack/components/preprocessors/document_splitter.py
@@ -14,18 +14,21 @@ class DocumentSpl... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "New Feature Additions"
} |
cython__cython-3433@f8e3968 | cython/cython | Python | 3,433 | Only used PyUnicode_Concat on unicode objects | Closes https://github.com/cython/cython/issues/3426
-------------------------
~(I'm getting a segmentation fault on the fstring tests with the current master, which is making it difficult to run this through a thorough set of tests. It happens with and without this PR. I'm not sure where this is due to something ... | 2020-03-15T17:49:53Z | TypeError on list += str
When run via CPython the following function:
```
def appendinline():
y = []
y += 'ab'
return y
```
returns `['a', 'b']`, but when compiled with Cython (0.29.13) the result is
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "concat.py"... | I'm struggling to reproduce this (on Cython 0.29.13 -> master). Are you using any compiler directives/options that might be relevant?
I'm building a module with cythonize -i, using Cython 0.29.13 and then importing that module into CPython 3.7.6.
```
Thu Mar 12 17:46:26 cunkel@cunkel:~/misc
1017$ cat concat.py
d... | [
{
"body": "When run via CPython the following function:\r\n\r\n```\r\ndef appendinline():\r\n y = []\r\n y += 'ab'\r\n return y\r\n```\r\nreturns `['a', 'b']`, but when compiled with Cython (0.29.13) the result is\r\n```\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r... | b0e53e291f36a36f556bfb0195bd0e329c9049db | {
"head_commit": "f8e396843b52f5758bdffcbfe2088a6c4643c42d",
"head_commit_message": "Only used PyUnicode_Concat on unicode objects\n\nhttps://github.com/cython/cython/issues/3426",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 1915369df90..cc4205c6e48 100644\n... | [
{
"diff_hunk": "@@ -11364,13 +11364,8 @@ def compute_c_result_type(self, type1, type2):\n self, type1, type2)\n \n def py_operation_function(self, code):\n- is_unicode_concat = False\n- if isinstance(self.operand1, FormattedValueNode) or isinstance(self.operand2, FormattedValue... | 19738c223050e4077f6b32829002d8b893c11cea | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 1915369df90..d9ad15808d0 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -11364,19 +11364,24 @@ def compute_c_result_type(self, type1, type2):
self, type1, type2)
def py_operation_funct... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-3415@737e568 | cython/cython | Python | 3,415 | Memoryviews work with cache_builtins=False | Now they make their own tiny cache of the relevant exceptions
at module initialization so they can still access these without
the GIL.
closes https://github.com/cython/cython/issues/3406
I guess this slightly breaks the contract of the cache_builtins option, that you should be able to monkey-patch builtin stuff... | 2020-03-11T16:17:28Z | MemoryView implementation incompatible with Options.cache_builtins = False
Disabling the `cache_builtins` option in setup.py:
```
Options.cache_builtins = False
```
causes code that uses `MemoryView` to fail to compile:
```
Error compiling Cython file:
------------------------------------------------------------... | I've done this a tiny bit differently to how you've suggested, since I think the whole point of `_err_dim` was avoiding writing duplicate `with gil:` code but the basic diagnosis was good.
Great, thanks for the quick turnaround! Your way will prevent someone from mocking `ValueError`, but on the other hand I can't see ... | [
{
"body": "Disabling the `cache_builtins` option in setup.py:\r\n```\r\nOptions.cache_builtins = False\r\n```\r\ncauses code that uses `MemoryView` to fail to compile:\r\n```\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n if not is_slice:\r\n\r\n ... | 22213aa38cfb3460bbcd746910cea00eedea8a2c | {
"head_commit": "737e5686e1e39d231f279586d13a5ebf23e4fbef",
"head_commit_message": "Disabled test\n\nIt was affecting static state and breaking subsequent tests",
"patch_to_review": "diff --git a/Cython/Utility/MemoryView.pyx b/Cython/Utility/MemoryView.pyx\nindex 5d7a525d3fd..8d396335a8e 100644\n--- a/Cython/Ut... | [
{
"diff_hunk": "@@ -878,7 +878,7 @@ def setUp(self):\n from Cython.Compiler import Options\n self._saved_options = [\n (name, getattr(Options, name))\n- for name in ('warning_errors', 'clear_to_none', 'error_on_unknown_names', 'error_on_uninitialized')\n+ for na... | cae18033c48b95df125776d1dd18164984382896 | diff --git a/Cython/Utility/MemoryView.pyx b/Cython/Utility/MemoryView.pyx
index 5d7a525d3fd..0fb79c39e7b 100644
--- a/Cython/Utility/MemoryView.pyx
+++ b/Cython/Utility/MemoryView.pyx
@@ -8,8 +8,12 @@ cimport cython
# from cpython cimport ...
cdef extern from "Python.h":
+ ctypedef struct PyObject
int PyIn... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-4870@ae23d25 | cupy/cupy | Python | 4,870 | Add APIs for creating NumPy arrays backed by pinned memory | Close #3625.
This PR adds a few convenience functions to the `cupyx` namespace for allocating NumPy arrays backed by pinned/pagelocked memory, see the discussion around https://github.com/cupy/cupy/issues/3625#issuecomment-704384736. Currently the provided APIs are as follows:
- `cupyx.empty_pinned()`
- `cupyx.em... | 2021-03-11T06:19:09Z | Pinned memory allocation returns odd size
It looks like CuPy allocates more bytes than expected when calling `cupy.cuda.alloc_pinned_memory`. Any ideas why that might be?
```python
In [1]: import numpy
...: import cupy
In [2]: a = cupy.arange(1_00... | I think this was the reason:
https://github.com/cupy/cupy/blob/725c350884142c85c78df13a111f29b7c508540e/cupy/cuda/pinned_memory.pyx#L296-L298
So what's the best way to use this? Just trim the array viewing the allocation afterwards? Or is there a better way for one to be allocating pinned memory?
Hi John, sorry I dropp... | [
{
"body": "It looks like CuPy allocates more bytes than expected when calling `cupy.cuda.alloc_pinned_memory`. Any ideas why that might be?\r\n\r\n```python\r\nIn [1]: import numpy \r\n ...: import cupy \r\n\r\nIn [2]: a = cupy.arange(1_000_000) ... | e913f37c9a6b80402870c2cb6a4398c9e8a2d633 | {
"head_commit": "ae23d25a832483ed1b68a2547a3e799fe8c1d118",
"head_commit_message": "move _get_strides_for_order_K to cupy.core.internal",
"patch_to_review": "diff --git a/cupy/_creation/basic.py b/cupy/_creation/basic.py\nindex d633fbe39ef..aa6a633ac6a 100644\n--- a/cupy/_creation/basic.py\n+++ b/cupy/_creation/... | [
{
"diff_hunk": "@@ -0,0 +1,157 @@\n+import numpy\n+\n+from cupy import cuda\n+from cupy._creation.basic import _new_like_order_and_strides\n+from cupy.core import internal\n+\n+\n+def _update_shape(a, shape):\n+ if shape is None and a is not None:\n+ shape = a.shape\n+ elif isinstance(shape, int):\... | cc6fe6c2715d15b5cb17431865ca51fcfba93793 | diff --git a/cupy/_core/core.pyx b/cupy/_core/core.pyx
index 85ab3ecc487..ba82ffa6cc0 100644
--- a/cupy/_core/core.pyx
+++ b/cupy/_core/core.pyx
@@ -441,10 +441,11 @@ cdef class ndarray:
order_char == b'F' and self._f_contiguous):
return self
- order_char = _update_order_c... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-3413@ec05b2c | cython/cython | Python | 3,413 | Marks view.* extension types as imported | so that they can be inherited from.
Closes https://github.com/cython/cython/issues/3396 | 2020-03-11T08:43:57Z | Create subclass to cython array
I wrote a simple class which subclass cython.array in **demo.pyx** file.
```
#cython: language_level = 3
#cython: embedsignature = True
from cython.view cimport array as cyarray
cdef class newarray(cyarray):
pass
```
The code above compiled with no error. However, I cou... | [
{
"body": "I wrote a simple class which subclass cython.array in **demo.pyx** file.\r\n\r\n```\r\n#cython: language_level = 3\r\n#cython: embedsignature = True\r\n\r\nfrom cython.view cimport array as cyarray\r\n\r\ncdef class newarray(cyarray):\r\n pass\r\n```\r\nThe code above compiled with no error. Howev... | 22213aa38cfb3460bbcd746910cea00eedea8a2c | {
"head_commit": "ec05b2c5acfc57d506fd575a6c4adf5bffa1078c",
"head_commit_message": "Marks view.* extension types as imported\n\nso that they can be inherited from.\n\nCloses https://github.com/cython/cython/issues/3396",
"patch_to_review": "diff --git a/Cython/Compiler/CythonScope.py b/Cython/Compiler/CythonScop... | [
{
"diff_hunk": "@@ -127,6 +127,17 @@ def load_cythonscope(self):\n self.viewscope, cython_scope=self,\n whitelist=MemoryView.view_utility_whitelist)\n \n+ # Marks the types as imported so that they can be extended fro... | 9126a1d8964bc2fa6cefcd49aab699f9f31568a2 | diff --git a/Cython/Compiler/CythonScope.py b/Cython/Compiler/CythonScope.py
index 1c25d1a6b4c..8085d18905d 100644
--- a/Cython/Compiler/CythonScope.py
+++ b/Cython/Compiler/CythonScope.py
@@ -127,6 +127,15 @@ def load_cythonscope(self):
self.viewscope, cython_scope=self,
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
dask__dask-9272@f30ca4a | dask/dask | Python | 9,272 | Match input and output structure in `_sample_reduce` | - [ ] Partially resolves #9249
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
cc @ian-r-rose | 2022-07-14T12:13:29Z | `dask.bag.random.sample` throws various errors
**What happened**: I want to undersample items in a Bag using `dask.bag.random.sample`
**What you expected to happen**: Receive a Bag with specified amount of items.
**Minimal Complete Verifiable Example**:
```python
import dask.bag
from dask.bag import random
... | @MaximLippeveld Thanks for reporting. That does look like a bug.
@mesejo I know [you did some work on Bag Sampling](https://github.com/dask/dask/pull/7636) recently, do you have thoughts on this?
I'm able to reproduce this even with dask=2022.02.1, which suggested this was happening even before your refactor. :/
I t... | [
{
"body": "**What happened**: I want to undersample items in a Bag using `dask.bag.random.sample`\r\n\r\n**What you expected to happen**: Receive a Bag with specified amount of items.\r\n\r\n**Minimal Complete Verifiable Example**:\r\n\r\n```python\r\nimport dask.bag\r\nfrom dask.bag import random\r\n\r\n\r\nde... | 7b054f1d8f4a2343268f5182d47996a5469b10dc | {
"head_commit": "f30ca4af3bc4c91aed50082154cb25cd2672e33b",
"head_commit_message": "add comments",
"patch_to_review": "diff --git a/dask/bag/random.py b/dask/bag/random.py\nindex 8e6e8ab2fff..96ad8a4476f 100644\n--- a/dask/bag/random.py\n+++ b/dask/bag/random.py\n@@ -4,6 +4,8 @@\n from functools import partial\n... | [
{
"diff_hunk": "@@ -51,6 +51,20 @@ def test_choices_k_equal_bag_size_with_unbalanced_partitions():\n assert all(i in seq for i in li)\n \n \n+def test_choices_with_more_bag_partitons():\n+ # test with npartitions > split_every (split_every=8 by default)",
"line": null,
"original_line": 55,
"o... | 179faea6f414bc0089e916700781b86e652a8133 | diff --git a/dask/bag/random.py b/dask/bag/random.py
index 8e6e8ab2fff..45bcf9acbe9 100644
--- a/dask/bag/random.py
+++ b/dask/bag/random.py
@@ -4,10 +4,12 @@
from functools import partial
from itertools import islice
+from tlz import first
+
from dask.bag.core import Bag
-def sample(population, k):
+def sampl... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-4815@08b209e | cupy/cupy | Python | 4,815 | Complete build only when all of the essential modules are available | Fix #4750.
Currently, CuPy completes its build even if an essential module is failed to be built. This PR fixes the build process to complete only when we can successfully build all of the required modules. See #4750 for an exhaustive list of modules CuPy depends on mandatorily or optionally.
| 2021-03-05T03:43:39Z | Fail build if essential module cannot be built
Currently, when CuPy failed to configure a module other than `cuda`, build succeeds without building the module.
If non-optional (essential) modules cannot be built, the build should fail with an error.
Optional modules are nccl, cudnn, nvtx
Non-optional modules are o... | [
{
"body": "Currently, when CuPy failed to configure a module other than `cuda`, build succeeds without building the module.\r\nIf non-optional (essential) modules cannot be built, the build should fail with an error.\r\n\r\nOptional modules are nccl, cudnn, nvtx\r\nNon-optional modules are others e.g., random, ... | 5103f3a5c3c5979d5061b937940f7a2c437068ee | {
"head_commit": "08b209ed310c36ccc2d217bdc054a639337c55d1",
"head_commit_message": "Fail build if essential modules cannot be built",
"patch_to_review": "diff --git a/cupy_setup_build.py b/cupy_setup_build.py\nindex d4da3311a6d..d1c3f1e0992 100644\n--- a/cupy_setup_build.py\n+++ b/cupy_setup_build.py\n@@ -97,6 +... | [
{
"diff_hunk": "@@ -214,6 +217,7 @@\n \n MODULES.append({\n 'name': 'cutensor',\n+ 'required': True,",
"line": null,
"original_line": 220,
"original_start_line": null,
"path": "cupy_setup_build.py",
"start_line": null,
"text": "@user1:\ncuTENSOR is an optional. (sorry ... | 90e93d00e39b0c9bbc4642f05bdf60afb1c7c6b7 | diff --git a/cupy_setup_build.py b/cupy_setup_build.py
index d4da3311a6d..f73dfa519ed 100644
--- a/cupy_setup_build.py
+++ b/cupy_setup_build.py
@@ -97,6 +97,7 @@
MODULES.append({
# TODO(leofang): call this "rocm" or "hip" to avoid confusion?
'name': 'cuda',
+ 'required': True,
'f... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Test Suite / CI Enhancements"
} | |
cupy__cupy-4561@c781d06 | cupy/cupy | Python | 4,561 | Update doctest of `cupyx.scipy.linalg.lu_factor` | Close #4259.
It looks that `cupyx.scipy.linalg.lu_factor` returns the same result to `scipy.linalg.lu_factor`. I remove the note on the document and add a test given a singular matrix. | 2021-01-19T06:43:37Z | Doctest of `lu_factor` is not valid with newer CUDA
### Conditions
<details><summary>the output of `python -c 'import cupy; cupy.show_config()'`</summary>
```
OS : Linux-4.15.0-58-generic-x86_64-with-glibc2.27
CuPy Version : 9.0.0a1
NumPy Version : 1.19.... | [
{
"body": "### Conditions\r\n\r\n<details><summary>the output of `python -c 'import cupy; cupy.show_config()'`</summary>\r\n\r\n```\r\nOS : Linux-4.15.0-58-generic-x86_64-with-glibc2.27\r\nCuPy Version : 9.0.0a1\r\nNumPy Version : 1.19.2\r\nSciPy Version ... | 66b3cef8a04c09cd4624f9badf0befcf0bca9d44 | {
"head_commit": "c781d06ab0f7f54f154000fdf9662f6fbd8bc0d8",
"head_commit_message": "Add test for lu_factor given singular matrix",
"patch_to_review": "diff --git a/cupyx/scipy/linalg/decomp_lu.py b/cupyx/scipy/linalg/decomp_lu.py\nindex 537b70408e5..96a1700e80d 100644\n--- a/cupyx/scipy/linalg/decomp_lu.py\n+++ ... | [
{
"diff_hunk": "@@ -59,6 +59,17 @@ def test_lu_factor_reconstruction(self, dtype):\n cupy.testing.assert_allclose(LU, PA, atol=1e-5)\n \n \n+@testing.gpu\n+@testing.with_requires('scipy')\n+class TestLUFactorSingular:\n+\n+ @testing.for_dtypes('fdFD')\n+ @testing.numpy_cupy_allclose(scipy_name='sc... | 6ae68b3c44fb286119421412bbb21aee6dfa8238 | diff --git a/cupyx/scipy/linalg/decomp_lu.py b/cupyx/scipy/linalg/decomp_lu.py
index 537b70408e5..96a1700e80d 100644
--- a/cupyx/scipy/linalg/decomp_lu.py
+++ b/cupyx/scipy/linalg/decomp_lu.py
@@ -35,26 +35,6 @@ def lu_factor(a, overwrite_a=False, check_finite=True):
``i`` of the matrix was interchanged wi... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} | |
deepset-ai__haystack-6564@cad09cd | deepset-ai/haystack | Python | 6,564 | feat: Add `meta_fields_to_embed` to `TransformersSimilarityRanker` | ### Related Issues
- fixes #6563
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
Add `metadata_fields_to_embed` following the implementation in `SentenceTransformersDocumentEmb... | 2023-12-15T14:14:19Z | feat: Add embed_meta_fields support to rankers like in Haystack v1
**Is your feature request related to a problem? Please describe.**
We have found that `embed_meta_fields` greatly improves ranking when metadata is relevant while searching. This is a feature that we use a lot from v1 that would be great to also have i... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nWe have found that `embed_meta_fields` greatly improves ranking when metadata is relevant while searching. This is a feature that we use a lot from v1 that would be great to also have in v2.\r\n\r\n**Describe the solution you'd lik... | 00fed32024ae01202cdddb2791b008b54f995d67 | {
"head_commit": "cad09cd9c269dd40e54ff2dd15da2ec4283946a8",
"head_commit_message": "Add release notes",
"patch_to_review": "diff --git a/haystack/components/rankers/transformers_similarity.py b/haystack/components/rankers/transformers_similarity.py\nindex cf849f5824..883014a263 100644\n--- a/haystack/components/... | [
{
"diff_hunk": "@@ -40,6 +40,8 @@ def __init__(\n device: str = \"cpu\",\n token: Union[bool, str, None] = None,\n top_k: int = 10,\n+ metadata_fields_to_embed: Optional[List[str]] = None,",
"line": null,
"original_line": 43,
"original_start_line": null,
"path": "h... | 8d698684b7f49e1242d85a96688bb7e63b30fee3 | diff --git a/haystack/components/rankers/transformers_similarity.py b/haystack/components/rankers/transformers_similarity.py
index cf849f5824..61d7902c46 100644
--- a/haystack/components/rankers/transformers_similarity.py
+++ b/haystack/components/rankers/transformers_similarity.py
@@ -40,6 +40,8 @@ def __init__(
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-6689@a48ed8f | deepset-ai/haystack | Python | 6,689 | feat: Add `NamedEntityExtractor`component | ### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
This PR introduces a new extractor component, namely `NamedEntityExtractor`. This component accepts a list of `Documents` as its input ... | 2024-01-05T12:28:05Z | `NamedEntityExtractor`
Very similar to our Haystack 1.x `EntityExtractor`: given some text, extracts all named entities it can find. It will take Documents and attach those entities into the Document’s metadata (together with the entity’s position in the original text).
Draft I/O for `NamedEntityExtractor`:
```pyth... | here I would like to see https://github.com/deepset-ai/haystack/blob/main/haystack/nodes/extractor/entity.py being migrated to 2.x. I like the pure NER approach but I am not sure if we need the "QA for NER" approach. Instead I could see a prompt based approach of extracting NERs instead of using extrative QA. | [
{
"body": "Very similar to our Haystack 1.x `EntityExtractor`: given some text, extracts all named entities it can find. It will take Documents and attach those entities into the Document’s metadata (together with the entity’s position in the original text).\r\n\r\nDraft I/O for `NamedEntityExtractor`:\r\n```py... | 974d65f30ac5798f566ad3c7a4a48dd29e45d4e5 | {
"head_commit": "a48ed8fd6839792b2d07ac0cd41105a4549cf62e",
"head_commit_message": "feat: Add `NamedEntityExtractor`component\n\nThis component accepts a list of `Document`s which it annotates with named entities. The annotations are stored in the `meta` dictionary of each `Document` under a specific key.\n\nThe c... | [
{
"diff_hunk": "@@ -0,0 +1,399 @@\n+from abc import ABC, abstractmethod\n+from contextlib import contextmanager\n+from dataclasses import dataclass\n+from enum import Enum, EnumMeta\n+from typing import Any, Dict, List, Optional, Union\n+\n+from ... import ComponentError, DeserializationError, Document, compone... | 6c00c506bab955cbe4548e98521368560f5e4c17 | diff --git a/e2e/pipelines/test_named_entity_extractor.py b/e2e/pipelines/test_named_entity_extractor.py
new file mode 100644
index 0000000000..f64a921cff
--- /dev/null
+++ b/e2e/pipelines/test_named_entity_extractor.py
@@ -0,0 +1,110 @@
+import pytest
+
+from haystack import Document, Pipeline, ComponentError
+from ha... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-4544@7a8261b | cupy/cupy | Python | 4,544 | Implement `__format__` in `ndarray` | Closes #4532 | 2021-01-12T07:32:51Z | Unsupported f-string format
`f"{element}:.2f"` isn't a valid format string
* Code to reproduce
```python
import numpy as np
import cupy as cp
arr = [1.12345]
np_arr = np.asarray(arr)
cp_arr = cp.asarray(arr)
print(f"With 2 precisions: {np_arr[0]:.2f}) # With 2 precisions: 1.... | [
{
"body": "`f\"{element}:.2f\"` isn't a valid format string\r\n\r\n* Code to reproduce\r\n```python\r\nimport numpy as np\r\nimport cupy as cp\r\n\r\narr = [1.12345]\r\nnp_arr = np.asarray(arr)\r\ncp_arr = cp.asarray(arr)\r\n\r\nprint(f\"With 2 precisions: {np_arr[0]:.2f}) # With ... | e0da24b79975fa157c8a6ebe55ec2110ea5985a2 | {
"head_commit": "7a8261b761e963f7c416e00ee2522e8680ff2c5a",
"head_commit_message": "Update tests/cupy_tests/core_tests/test_ndarray.py\n\nCo-authored-by: Toshiki Kataoka <tos.lunar@gmail.com>",
"patch_to_review": "diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx\nindex c6366057bd1..b983cfe8a64 100644\n--- a/... | [
{
"diff_hunk": "@@ -1508,6 +1508,9 @@ cdef class ndarray:\n def __str__(self):\n return str(self.get())\n \n+ def __format__(self, format_spec):\n+ return self.get().__format__(format_spec)",
"line": null,
"original_line": 1512,
"original_start_line": null,
"path": "cupy/co... | 370eba0d0595fd22a53b2c25ec668ac0bedcb0c0 | diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx
index c6366057bd1..8600483a290 100644
--- a/cupy/core/core.pyx
+++ b/cupy/core/core.pyx
@@ -1508,6 +1508,9 @@ cdef class ndarray:
def __str__(self):
return str(self.get())
+ def __format__(self, format_spec):
+ return format(self.get(), form... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-4829@e574919 | cupy/cupy | Python | 4,829 | Ability to pass structured data types by value as kernel parameters | This PR is directly related to issue #4828.
Currently, we can only pass by value the following numpy items as kernel parameters: np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, np.float16, np.float32, np.float64, np.complex64 and np.comples128 and other numpy builtin datatypes if th... | 2021-03-06T15:35:03Z | Is there a way to pass a structured buffer to a custom kernel, like arrow cuda buffer or flatbuffers buffer
This isn't actually an issue, just a question and maybe a feature request or at least documentation request, as I didn't find other ways to ask a question, like chat or group.
I'm looking for a way / example ... | Thanks for the feedback, `cupy.cuda.MemoryPointer` can be passed as an argument to raw kernels but not documented very well. We now have a gitter channel so feel free to join and ask questions when needed. https://gitter.im/cupy/community
This example is now running with PR #4829.
This is very nice capability indeed! I... | [
{
"body": "This isn't actually an issue, just a question and maybe a feature request or at least documentation request, as I didn't find other ways to ask a question, like chat or group. \r\n\r\nI'm looking for a way / example to pass a structured byte buffer to a custom kernel. \r\n\r\nI didn't find any docume... | 4469fae998df33c72ff40ef954cb08b8f0004b18 | {
"head_commit": "e574919647565d046b40f31de765e111ffee9268",
"head_commit_message": "Add a test for custom struct examples.",
"patch_to_review": "diff --git a/cupy/cuda/function.pyx b/cupy/cuda/function.pyx\nindex 8a8d38304a3..fa616be2445 100644\n--- a/cupy/cuda/function.pyx\n+++ b/cupy/cuda/function.pyx\n@@ -90,... | [
{
"diff_hunk": "@@ -0,0 +1,91 @@\n+import sys\n+import numpy\n+import cupy\n+\n+code = '''\n+template<typename T>\n+struct Matrix {\n+ T value[4][4];\n+\n+ __device__ T& operator() (int i, int j) {\n+ return this->value[i][j];\n+ }\n+\n+ __device__ const T& operator() (int i, int j) const {\n... | 8d9b5425b6f6cd53cd3804d7f7d5db461769a181 | diff --git a/cupy/cuda/function.pyx b/cupy/cuda/function.pyx
index e481eee65f5..b29dab257c6 100644
--- a/cupy/cuda/function.pyx
+++ b/cupy/cuda/function.pyx
@@ -90,6 +90,15 @@ cdef class CIntptr(CPointer):
self.ptr = <void*>&self.val
+cdef class CNumpyArray(CPointer):
+ cdef:
+ object val
+
+ ... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cython__cython-3013@3f8ec06 | cython/cython | Python | 3,013 | Describe refcount behaviour of object vs PyObject* | Fixes #2589 | 2019-06-24T19:07:17Z | `object` vs `PyObject*`
From my (limited) understanding from reading the Cython includes directory along with the CPython API, in many cases it seems that `object` is used interchangeably with `PyObject*`. However, the compiler complains about not being able to convert between the two when again, they appear to be inte... | Hmm, right, that's probably worth explaining somewhere.
`object` is a refcounted owned reference, `PyObject*` is a non-refcounted (usually borrowed) pointer to an object. There is no dedicated borrowed reference type in Cython, that's why we use the pointer type for it. Converting between a pointer (any pointer in f... | [
{
"body": "From my (limited) understanding from reading the Cython includes directory along with the CPython API, in many cases it seems that `object` is used interchangeably with `PyObject*`. However, the compiler complains about not being able to convert between the two when again, they appear to be interchan... | 42cd2acf9fa62046823c9c9bc1047214a6267688 | {
"head_commit": "3f8ec06b722ef490807b1fe76f5d97f2bd1be88f",
"head_commit_message": "docs: Describe refcount behaviour of object vs PyObject*",
"patch_to_review": "diff --git a/docs/examples/userguide/language_basics/parameter_refcount.pyx b/docs/examples/userguide/language_basics/parameter_refcount.pyx\nnew file... | [
{
"diff_hunk": "@@ -0,0 +1,20 @@\n+from __future__ import print_function\n+\n+from cpython.ref cimport PyObject\n+\n+import sys\n+\n+python_string = \"foo\"\n+python_string_refcount = sys.getrefcount(python_string)",
"line": null,
"original_line": 8,
"original_start_line": null,
"path": "docs/ex... | 7f916895b08378346f0e2fc12a5ad50191b08f3b | diff --git a/docs/examples/userguide/language_basics/parameter_refcount.pyx b/docs/examples/userguide/language_basics/parameter_refcount.pyx
new file mode 100644
index 00000000000..5ffd28c4410
--- /dev/null
+++ b/docs/examples/userguide/language_basics/parameter_refcount.pyx
@@ -0,0 +1,20 @@
+from __future__ import pri... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-6460@24ba640 | deepset-ai/haystack | Python | 6,460 | fix: Prevent invalid answer from being selected in ExtractiveReader | ### Related Issues
- Fixes #6098 more fully
### Proposed Changes:
Issue: `ExtractiveReader` picked `answers_per_seq` number of answers per entry even if there weren't as many valid candidates. So it picked up invalid candidates too even if their probabilities were masked out to be 0. This meant the candidates ... | 2023-11-30T14:54:59Z | `ExtractiveReader` fails with proper input Documents
**Describe the bug**
`ExtractiveReader` seems to be very sensitive to the nature/format of input Documents
**Expected behavior**
It should be more robust and less error-prone.
**To Reproduce**
```python
from haystack.preview.components.readers import Extrac... | [
{
"body": "**Describe the bug**\r\n`ExtractiveReader` seems to be very sensitive to the nature/format of input Documents\r\n\r\n**Expected behavior**\r\nIt should be more robust and less error-prone.\r\n\r\n**To Reproduce**\r\n```python\r\nfrom haystack.preview.components.readers import ExtractiveReader\r\nfrom... | d4c275f8b7385e46b72e62b586376be7c2e2a699 | {
"head_commit": "24ba6409a89195e6419675c8bb93c9cbd9104d09",
"head_commit_message": "Fix invalid answer being selected issue on ExtractiveReader",
"patch_to_review": "diff --git a/haystack/components/readers/extractive.py b/haystack/components/readers/extractive.py\nindex 6cbda5f9f8..ebedc6d1d8 100644\n--- a/hays... | [
{
"diff_hunk": "@@ -206,62 +206,50 @@ def _postprocess(\n implementations, it doesn't normalize the scores to make them easier to compare across different\n splits. Returns the top k answer spans.\n \"\"\"\n- mask = sequence_ids == 1\n- mask = torch.logical_and(mask, attent... | 6e2059542dc60fcb3e7b75180a5b205ad9e90ac8 | diff --git a/haystack/components/readers/extractive.py b/haystack/components/readers/extractive.py
index 6cbda5f9f8..0b6fade49b 100644
--- a/haystack/components/readers/extractive.py
+++ b/haystack/components/readers/extractive.py
@@ -206,62 +206,52 @@ def _postprocess(
implementations, it doesn't normalize th... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-2910@aadb8ed | cython/cython | Python | 2,910 | BUG: prefer sys.path before Cython/Include when searching for pxd files | Fixes #2905 by raising the sys_path resolution into Context.search_include_directories
Also fix a bug in calling `os.path.join` with identical paths which merges them when they are absolute paths but concatenates them when they are relative paths, causing the test which adds a relative path to `sys.path` to fail. Th... | 2019-03-31T19:14:59Z | BUG: cannot easily override a cython Include
I am trying to vendor `numpy.pxd` (or `numpy/__init__.pxd`) into numpy. It seems the file in `Includes/numpy/__init__.pxd` is seen before mine when I try `cimport numpy`.
To reproduce: copy the `__init__.pxd` from `Includes/numpy` into `site-packages/numpy`, and add garba... | I think the problem is that `Includes` is appended to the search path [here](https://github.com/cython/cython/blob/0.29.6/Cython/Compiler/Main.py#L93), then later on `sys.path` is optionally appended to the search path [here](https://github.com/cython/cython/blob/0.29.6/Cython/Utils.py#L136). IMO if `sys_path` is True ... | [
{
"body": "I am trying to vendor `numpy.pxd` (or `numpy/__init__.pxd`) into numpy. It seems the file in `Includes/numpy/__init__.pxd` is seen before mine when I try `cimport numpy`.\r\n\r\nTo reproduce: copy the `__init__.pxd` from `Includes/numpy` into `site-packages/numpy`, and add garbage in the original fil... | 7b41a3a312c066fcf111830beab758725991c606 | {
"head_commit": "aadb8ed913892fa8d4b7d49b9fb77ae1f257bfd4",
"head_commit_message": "BUG: prefer sys.path before Cython/Include when searching for pxd files",
"patch_to_review": "diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py\nindex da4c3cc07f5..bf648a6059d 100644\n--- a/Cython/Compiler/Main.py\n+... | [
{
"diff_hunk": "@@ -253,8 +251,13 @@ def find_include_file(self, filename, pos):\n \n def search_include_directories(self, qualified_name, suffix, pos,\n include=False, sys_path=False):\n- return search_include_directories(\n- tuple(self.include_directori... | f73a46b7585a0e7c288e3c507cf4856cdd83300a | diff --git a/CHANGES.rst b/CHANGES.rst
index 4a6f7c5230e..1500aaf6e48 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -115,6 +115,12 @@ Other changes
* Support for Python 2.6 was removed.
+* The search order for include files was changed. Previously it was
+ ``include_directories``, ``Cython/Includes``, ``sys.path`... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-9193@ef25f9d | dask/dask | Python | 9,193 | Correct dtypes when `concat` with an empty dataframe | - [x] Closes #9046
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
| 2022-06-16T17:50:58Z | Implicit data type conversion after concat
**What happened**:
Dask implicitly converts column datatypes after DF's concat, when one of DF's is empty.
**What you expected to happen**:
Warning (at-least) or exception if dtype converted or same dtype for columns (this how it works in Pandas)
**Minimal Complete Ve... | @patefon Thanks for reporting this! I'm able to reproduce this, and it looks like a bug. | [
{
"body": "**What happened**: \r\nDask implicitly converts column datatypes after DF's concat, when one of DF's is empty.\r\n\r\n**What you expected to happen**:\r\nWarning (at-least) or exception if dtype converted or same dtype for columns (this how it works in Pandas)\r\n\r\n**Minimal Complete Verifiable Exa... | af1b65550442ead60f9d223e42d9473caabfc832 | {
"head_commit": "ef25f9df5913afb1fc58e412bd0b27d81cc9ca6a",
"head_commit_message": "use assert_eq",
"patch_to_review": "diff --git a/dask/dataframe/multi.py b/dask/dataframe/multi.py\nindex 169c1c76b67..9ca3ddb9e03 100644\n--- a/dask/dataframe/multi.py\n+++ b/dask/dataframe/multi.py\n@@ -1237,6 +1237,12 @@ def c... | [
{
"diff_hunk": "@@ -796,6 +796,23 @@ def test_concat_with_operation_remains_hlg():\n assert_eq(result, expected)\n \n \n+def test_concat_dataframe_empty():\n+ df = pd.DataFrame({\"a\": [100, 200, 300]}, dtype=\"int64\")\n+ empty_df = pd.DataFrame([], dtype=\"int64\")\n+ df_concat = pd.concat([df, e... | 6142b83547d57fb7e18e50eb7f27dd911e71d440 | diff --git a/dask/dataframe/multi.py b/dask/dataframe/multi.py
index 169c1c76b67..9ca3ddb9e03 100644
--- a/dask/dataframe/multi.py
+++ b/dask/dataframe/multi.py
@@ -1237,6 +1237,12 @@ def concat(
raise ValueError("'join' must be 'inner' or 'outer'")
axis = DataFrame._validate_axis(axis)
+ try:
+ ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-9156@b9466c4 | dask/dask | Python | 9,156 | Test round-tripping dataframe parquet I/O including pyspark | This is a proposed fix for #4096. It adds a new `test_pyspark_compat` module to make sure that we can round-trip data from spark. I've opted to create a new CI workflow for this to prevent the additional weight and pain of including scala in our normal CI environments. It runs nightly on just the pyspark compatibility... | 2022-06-02T02:00:21Z | Naively roundtrip parquet data from Spark
Currently it is not easy to roundtrip data between Spark and Dask Dataframe with Parquet. There are a variety of details one needs to know to do this well. This would be a good case study to improve our usability.
cc @martindurant | In particular I'm thinking that the following should probably just work for a variety of data types.
```python
spark_df.write.parquet(fn)
dask_df = dd.read_parquet(fn)
dask_df.to_parquet(fn2)
spark.read.parquet(fn2)
```
Fastparquet does have a number of tests specifically for spark round-tripping: https://git... | [
{
"body": "Currently it is not easy to roundtrip data between Spark and Dask Dataframe with Parquet. There are a variety of details one needs to know to do this well. This would be a good case study to improve our usability.\r\n\r\ncc @martindurant ",
"number": 4096,
"title": "Naively roundtrip parque... | 50792886e68899555a10269f64dfe0ae8cd3feb0 | {
"head_commit": "b9466c42bd7ae2a1e25a0c3ea77b7633645b7d56",
"head_commit_message": "Add test for round-tripping hive-partitioned datasets",
"patch_to_review": "diff --git a/.github/workflows/spark.yml b/.github/workflows/spark.yml\nnew file mode 100644\nindex 00000000000..3bee3dde653\n--- /dev/null\n+++ b/.githu... | [
{
"diff_hunk": "@@ -0,0 +1,83 @@\n+import pytest\n+\n+from dask.datasets import timeseries\n+\n+dd = pytest.importorskip(\"dask.dataframe\")\n+pyspark = pytest.importorskip(\"pyspark\")\n+\n+from dask.dataframe.utils import assert_eq\n+\n+pytestmark = pytest.mark.spark\n+\n+\n+@pytest.fixture(scope=\"module\")\... | 12a82f7d5782c553c3201c5eada807b8c1ec7f80 | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 7128e4b2609..c844ee26787 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -35,7 +35,12 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0 # Needed by codecov.io
-
+ - name: S... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cython__cython-1900@f9cf3ac | cython/cython | Python | 1,900 | Update Coverage.py | this commit fixes #1898
use filepath with the correct upper and lowercases | 2017-09-29T19:20:38Z | Cython.Coverage: error with pyx-file coverage with lower-case filenames and wrong line numbers in .coverage
On windows,
with cython0.27
and
Coverage.py, version 4.3.4 with C extension
I try to report the coverage of a pyx-file with the Cython.Coverage plugin for coverage.py
`coverage run --source=src -m py.tes... | I found an alternative to .lower(), that helped to get the right line_numbers:
Instead of converting the filepath to lowercase, the following function returnes the filepath as the file system returnes it (on Windows - on linux it remains as it is):
```
import glob
def get_actual_filename(name):
if not sys.... | [
{
"body": "On windows, \r\nwith cython0.27\r\nand \r\nCoverage.py, version 4.3.4 with C extension\r\n\r\nI try to report the coverage of a pyx-file with the Cython.Coverage plugin for coverage.py\r\n`coverage run --source=src -m py.test --pyargs cythonarrays` the .coverage-file including line-numbers that were ... | ba6f36abffa6817da2f05e32bbc9401484d6b776 | {
"head_commit": "f9cf3acaf96845304eb3e9e3910e700736cc2950",
"head_commit_message": "Update Coverage.py\n\nuse filepath with the correct upper and lowercases",
"patch_to_review": "diff --git a/Cython/Coverage.py b/Cython/Coverage.py\nindex 133137c751e..1bdc2f5cc30 100644\n--- a/Cython/Coverage.py\n+++ b/Cython/Co... | [
{
"diff_hunk": "@@ -45,6 +46,35 @@ def _find_dep_file_path(main_file, file_path):\n return abs_path\n \n \n+def _get_actual_filename(filepath):\n+ \"\"\"\n+ on windows:\n+ search the file `filepath' on the file system \n+ and return it with the correct upper/lowercases\n+ on linux: return the... | 4ef6bb83906a7f292bd1565808a3dd730638ec69 | diff --git a/Cython/Coverage.py b/Cython/Coverage.py
index 1c3a6f073a5..1ddac258101 100644
--- a/Cython/Coverage.py
+++ b/Cython/Coverage.py
@@ -12,6 +12,7 @@
from collections import defaultdict
from coverage.plugin import CoveragePlugin, FileTracer, FileReporter # requires coverage.py 4.0+
+from coverage.files im... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-4269@2578cc7 | cupy/cupy | Python | 4,269 | `testing.numpy_cupy_allclose` with per-dtype tolerance | Closes #4220.
This PR makes `testing.numpy_cupy_allclose` allow tolerance per dtype.
| 2020-11-11T23:24:22Z | Proposal: Tolerance per dtype for `cupy.testing.numpy_cupy_allclose`
Currently, `cupy.testing.numpy_cupy_allclose` takes only a tolerance value, so we need to split a test or make an imperative call of `cupy.testing.assert_allclose` to supply different tolerance values per dtype.
Here proposed is making `cupy.testin... | [
{
"body": "Currently, `cupy.testing.numpy_cupy_allclose` takes only a tolerance value, so we need to split a test or make an imperative call of `cupy.testing.assert_allclose` to supply different tolerance values per dtype.\r\n\r\nHere proposed is making `cupy.testing.numpy_cupy_allclose` take association from a... | b541adf845b32ec00e4aabb59c5d79005d69993a | {
"head_commit": "2578cc74b5e47c4ae8c1dfa2db610dca45cf2453",
"head_commit_message": "Update docstring",
"patch_to_review": "diff --git a/cupy/testing/helper.py b/cupy/testing/helper.py\nindex cbd6a03099a..d594e26970a 100644\n--- a/cupy/testing/helper.py\n+++ b/cupy/testing/helper.py\n@@ -352,6 +352,33 @@ def _con... | [
{
"diff_hunk": "@@ -352,15 +352,47 @@ def _convert_output_to_ndarray(c_out, n_out, sp_name, check_sparse_format):\n type(c_out), type(n_out)))\n \n \n+def _resolve_tolerance(type_check, result, rtol, atol):\n+ def _resolve(dtype, tol):\n+ if isinstance(tol, dict):\n+ tol1 = tol.... | 65f76fc3a5d8f127a58ea3943c5b6a2dbbbfb172 | diff --git a/cupy/testing/helper.py b/cupy/testing/helper.py
index cbd6a03099a..2286a1d2899 100644
--- a/cupy/testing/helper.py
+++ b/cupy/testing/helper.py
@@ -352,6 +352,41 @@ def _convert_output_to_ndarray(c_out, n_out, sp_name, check_sparse_format):
type(c_out), type(n_out)))
+def _check_tolerance_... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
dask__dask-9221@9603320 | dask/dask | Python | 9,221 | Revise divisions logic in from_pandas | - [x] Closes #9218
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
This PR was originally meant to be a small bug-fix for #9218 - However, I struggled to work with the existing `sorted_division_locations` function, and eventually decided to rewrite it in a slightly different way.
**Side Not... | 2022-06-28T03:23:30Z | Using ddf.from_pandas with chunksize=1 results in one partition having two rows
**What happened**: When creating a ddf using `from_pandas(chunksize=1)` not all partitions have 1 row. The last partition has two rows in it.
**What you expected to happen**: The dataframe should be evenly split into 10 partitions
**M... | Thanks for the simple example - I can also reproduce. I'll take a look at the `from_pandas` code to see whats going on. | [
{
"body": "**What happened**: When creating a ddf using `from_pandas(chunksize=1)` not all partitions have 1 row. The last partition has two rows in it.\r\n\r\n**What you expected to happen**: The dataframe should be evenly split into 10 partitions\r\n\r\n**Minimal Complete Verifiable Example**:\r\n\r\n```pytho... | 50ab8af982a31b186a8e47597f0ad7e5b59bcab5 | {
"head_commit": "9603320d3bba3fe9a4e3b93a91344cd7b7476bef",
"head_commit_message": "trigger linting",
"patch_to_review": "diff --git a/dask/array/core.py b/dask/array/core.py\nindex b24444058e9..aad26408c72 100644\n--- a/dask/array/core.py\n+++ b/dask/array/core.py\n@@ -5686,7 +5686,7 @@ def size(self) -> int:\n... | [
{
"diff_hunk": "@@ -743,37 +747,88 @@ def sorted_division_locations(seq, npartitions=None, chunksize=None):\n \n >>> L = ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'C']\n >>> sorted_division_locations(L, chunksize=3)\n- (['A', 'B', 'C'], [0, 4, 8])\n+ (['A', 'B', 'C', 'C'], [0, 4, 7, 8])\n \n >>> sor... | d3faff31a0db1cffcbd4ad12e663c2705c97185d | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 000867e8601..ea1fc03bf2b 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -7351,7 +7351,9 @@ def repartition_npartitions(df, npartitions):
]
return _repartition_from_boundaries(df, new_partitions_boundaries, new_name... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
dask__dask-9144@648ff2e | dask/dask | Python | 9,144 | Create show_versions.py | - [x] Closes #9099
- [x] Tests passed (nothing added)
- [x] Passes `pre-commit run --all-files`
For now the import is not integrated into `__init__.py`, not sure if that's feasible/reasonable.
```python
In [2]: from dask.utils import show_versions
In [3]: show_versions()
{
"Python": "3.10.4",
"Platfo... | 2022-05-28T16:04:16Z | Improving bug report template
This is a suggestion to simplify reporting the dask version in the issue template by providing a suggested code snippet to run (in the **Environment** section of the issue template):
```python
import dask; print("- Dask version:", dask.__version__)
import sys; print("- Python version:... | Thanks for the suggestion @SultanOrazbayev. I'd go a step further and follow the lead from other projects like `pandas` / `xarray` and add a `dask.show_versions()` method which outputs all the version/system-related information we want included when users open an issue. That would let us replace that section in the tem... | [
{
"body": "This is a suggestion to simplify reporting the dask version in the issue template by providing a suggested code snippet to run (in the **Environment** section of the issue template):\r\n\r\n```python\r\nimport dask; print(\"- Dask version:\", dask.__version__)\r\nimport sys; print(\"- Python version:... | 56eeb06103efbf36cc73e9405bcec42a5b92515a | {
"head_commit": "648ff2e5053e6a94442e4ef5954b7a82961684e5",
"head_commit_message": "Create show_versions.py",
"patch_to_review": "diff --git a/dask/show_versions.py b/dask/show_versions.py\nnew file mode 100644\nindex 00000000000..21eaa5f56b4\n--- /dev/null\n+++ b/dask/show_versions.py\n@@ -0,0 +1,57 @@\n+from j... | [
{
"diff_hunk": "@@ -0,0 +1,57 @@\n+from json import dumps\n+from platform import uname\n+from sys import stdout, version_info\n+\n+from pandas._typing import JSONSerializable\n+from pandas.compat._optional import get_version, import_optional_dependency\n+\n+\n+def show_versions(as_json: bool = False) -> None:\n... | 4091fba326a7ccb6e109729a290e28dee80b6fe3 | diff --git a/dask/utils.py b/dask/utils.py
index 5ee6c0cae6e..70710607a88 100644
--- a/dask/utils.py
+++ b/dask/utils.py
@@ -1945,3 +1945,45 @@ def cached_cumsum(seq, initial_zero=False):
# Construct a temporary tuple, and look up by value.
result = _cumsum(tuple(seq), initial_zero)
return result... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Documentation Updates"
} |
cupy__cupy-4160@5a0f59f | cupy/cupy | Python | 4,160 | Improve cupy.random.randint | Closes https://github.com/cupy/cupy/issues/4120 | 2020-10-21T12:56:11Z | cupy.random.randint is slow
Hi all. It seems, `numpy.random.randint` is notably faster than `cupy.random.randint`. Is this expected?
I've also attained a dramatic speedup, sampling uniform floats with `cupy` and rounding them to `int`.
```python
import cupy as cp
import numpy as np
import time
def runWith... | > Is there a reason why we cannot rewrite cupy.random.randint, relying cupy.random.uniform?
Perhaps it is because casting the output of `xp.random.uniform` to `int` doesn't make the results completely uniform?
As commented it is not appropriate to generate `randint` results from `uniform`, but will keep this issue o... | [
{
"body": "Hi all. It seems, `numpy.random.randint` is notably faster than `cupy.random.randint`. Is this expected? \r\n\r\nI've also attained a dramatic speedup, sampling uniform floats with `cupy` and rounding them to `int`. \r\n\r\n```python\r\nimport cupy as cp\r\nimport numpy as np\r\nimport time\r\n\r\nde... | a8dfcd66d89c8e66a60e4b7272f95a15c26fc907 | {
"head_commit": "5a0f59f483d77ed2aaa9e400f1da81dadd729950",
"head_commit_message": "Bug fix and code clean-up",
"patch_to_review": "diff --git a/cupy/random/_generator.py b/cupy/random/_generator.py\nindex 4481dfb6a10..0a7d5bc0a8d 100644\n--- a/cupy/random/_generator.py\n+++ b/cupy/random/_generator.py\n@@ -672,... | [
{
"diff_hunk": "@@ -672,50 +672,72 @@ def _interval(self, mx, size):\n 'mx must be non-negative (actual: {})'.format(mx))\n elif mx <= _UINT32_MAX:\n dtype = numpy.uint32\n+ upper_limit = _UINT32_MAX - (1 << 32) % (mx + 1)\n elif mx <= _UINT64_MAX:\n ... | fe704ec678824c3ef14d9d331c66959a9b330294 | diff --git a/cupy/random/_generator.py b/cupy/random/_generator.py
index 4481dfb6a10..3a82978861b 100644
--- a/cupy/random/_generator.py
+++ b/cupy/random/_generator.py
@@ -672,50 +672,72 @@ def _interval(self, mx, size):
'mx must be non-negative (actual: {})'.format(mx))
elif mx <= _UINT32_MA... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Performance Optimizations"
} |
deepset-ai__haystack-6301@9e7d999 | deepset-ai/haystack | Python | 6,301 | fix: Load additional fields from SQUAD-format file to meta field for labels #5978 | ### Related Issues
- Fixes #5978
### Proposed Changes:
Load additional fields from SQUAD-format file to meta field for labels. This change ensures that `eval_data_from_json` loads additional fields for Labels into the `meta` field, analogous to how it's done for Documents.
### How did you test it?
I adde... | 2023-11-14T09:17:23Z | Load additional fields from SQUAD-format file to meta field for labels
**Is your feature request related to a problem? Please describe.**
Currently `eval_data_from_json` loads additional fields for Documents as meta field but it doesn't do it for Labels.
**Describe the solution you'd like**
`eval_data_from_json` l... | Hey thanks for opening the issue.
I think it makes sense to add the label metadata, too. Just out of curiosity: Do you have a specific use in mind for this?
And do you want to add this functionality when the Label Objects are created. There is three occurences you might need to change in https://github.com/deepset-ai... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nCurrently `eval_data_from_json` loads additional fields for Documents as meta field but it doesn't do it for Labels.\r\n\r\n**Describe the solution you'd like**\r\n`eval_data_from_json` loads additional fields to `Label.meta` dict ... | 34136382c14d9aa9c3b624edd8091fcbfda84579 | {
"head_commit": "9e7d99981f8978066b3eb436ee135367234b426c",
"head_commit_message": "added a test function",
"patch_to_review": "diff --git a/haystack/document_stores/utils.py b/haystack/document_stores/utils.py\nindex ab84882510..70c2b29cdc 100644\n--- a/haystack/document_stores/utils.py\n+++ b/haystack/document... | [
{
"diff_hunk": "@@ -0,0 +1,76 @@\n+import unittest\n+import json\n+from haystack.document_stores import eval_data_from_json\n+\n+\n+class TestEvalDataFromJSON(unittest.TestCase):\n+ def test_eval_data_from_json(self):\n+ # Create a temporary SQuAD-style JSON file for testing\n+ temp_filename = ... | 5a45577ba512a47516b57dc24a8b361f97bd9ad3 | diff --git a/haystack/document_stores/utils.py b/haystack/document_stores/utils.py
index ab84882510..70c2b29cdc 100644
--- a/haystack/document_stores/utils.py
+++ b/haystack/document_stores/utils.py
@@ -172,6 +172,9 @@ def _extract_docs_and_labels_from_dict(
## Assign Labels to corresponding documents
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-6286@7fbe875 | deepset-ai/haystack | Python | 6,286 | Fix Document init when passing non existing fields | ### Related Issues
- fixes #6259
### Proposed Changes:
The `_BackwardCompatible` metaclass made it possible to create a `Document` by passing any parameter to it.
This parameters would end up in the `meta` field.
This PR fixes that so that only legacy and new fields can be used to build a `Document`.
`fr... | 2023-11-13T10:07:19Z | Document type creation with `text` doesn't fail, it should
We just discovered with @anakin87 that when creating a document with `Document(text="Mein Name ist Jean und ich wohne in Paris.")` it does not fail, but this then sneakily causes issues down the line with the pipeline these documents are used with.
The docum... | That's caused by the changes in `Document` to handle backward compatibility.
All arguments that are not explicit fields of `Document` are treated as `meta` fields by mistake.
I'll fix this. 👍 | [
{
"body": "We just discovered with @anakin87 that when creating a document with `Document(text=\"Mein Name ist Jean und ich wohne in Paris.\")` it does not fail, but this then sneakily causes issues down the line with the pipeline these documents are used with.\r\n\r\nThe document should be created with `Docume... | bf637e9c7e32e0e5bccc6853fb2d6d88ab11c0af | {
"head_commit": "7fbe875718f0a5f46378a98823b814a9c830af86",
"head_commit_message": "Fix Document init when passing non existing fields",
"patch_to_review": "diff --git a/haystack/preview/dataclasses/document.py b/haystack/preview/dataclasses/document.py\nindex 644d12cfee..d34d73963d 100644\n--- a/haystack/previe... | [
{
"diff_hunk": "@@ -0,0 +1,4 @@\n+---\n+preview:\n+ - |\n+ Fix Document init when passing non existing fields.",
"line": null,
"original_line": 4,
"original_start_line": null,
"path": "releasenotes/notes/fix-document-init-09c1cbb14202be7d.yaml",
"start_line": null,
"text": "@user1:\n... | d57a7bb12560e7d482f718e8e3938ea25300f478 | diff --git a/haystack/preview/dataclasses/document.py b/haystack/preview/dataclasses/document.py
index 644d12cfee..98db4d9444 100644
--- a/haystack/preview/dataclasses/document.py
+++ b/haystack/preview/dataclasses/document.py
@@ -2,7 +2,7 @@
import hashlib
import logging
from dataclasses import asdict, dataclass, f... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-9091@eabe09b | dask/dask | Python | 9,091 | Visualize task graphs using ipycytoscape | This adds a new graph visualization engine based on `ipycytoscape`. Right now it's pretty much a re-implementation of the `graphviz` visualizer, but with zooming and panning. However, there are a few things that this could be more useful for in the near future.
1. The ability to run in pyodide without compiling `graph... | 2022-05-15T19:03:19Z | Interactive alternatives to graphviz for .visualize()
Thoughts on improving the Jupyter display of dask objects with some of the JS libraries like cytoscape? Graphviz works, but there are some things that JS libraries do really well - like tooltips for additional data, zooming in on a section of the graph, etc. | Thanks for raising an issue @Madhu94! I'm not familiar with cytoscape, so I can't speak to that project specifically. Though providing a more rich graph visualization experience is certainly in scope. FWIW you might find the discussion over in https://github.com/dask/dask/issues/7141 interesting.
cc @ian-r-rose @Ge... | [
{
"body": "Thoughts on improving the Jupyter display of dask objects with some of the JS libraries like cytoscape? Graphviz works, but there are some things that JS libraries do really well - like tooltips for additional data, zooming in on a section of the graph, etc.",
"number": 7301,
"title": "Intera... | 34b706b3d38bcbfa99d5fe9ab9c15cdad8a3c88f | {
"head_commit": "eabe09b375b5da0a47129e15acbd46c30b3349fa",
"head_commit_message": "Set up test infra",
"patch_to_review": "diff --git a/continuous_integration/environment-3.10.yaml b/continuous_integration/environment-3.10.yaml\nindex 92ad6f2f01a..8fbc60237fe 100644\n--- a/continuous_integration/environment-3.1... | [
{
"diff_hunk": "@@ -601,7 +602,13 @@ def compute(\n \n \n def visualize(\n- *args, filename=\"mydask\", traverse=True, optimize_graph=False, maxval=None, **kwargs\n+ *args,\n+ filename=\"mydask\",\n+ traverse=True,\n+ optimize_graph=False,\n+ maxval=None,\n+ visualizer: Literal[\"cytoscape\... | fb51a0e590a6ef6169dc3710398466fee5cb36ee | diff --git a/continuous_integration/environment-3.10.yaml b/continuous_integration/environment-3.10.yaml
index 92ad6f2f01a..8fbc60237fe 100644
--- a/continuous_integration/environment-3.10.yaml
+++ b/continuous_integration/environment-3.10.yaml
@@ -49,6 +49,7 @@ dependencies:
- cytoolz
- distributed
- ipython
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-6232@5b925f4 | deepset-ai/haystack | Python | 6,232 | Standardize `TextFileToDocument` | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/6230
- closes https://github.com/deepset-ai/haystack/issues/6190
### Proposed Changes:
- Remove all init and run parameters except `encoding` in init: that functionality seems way more fitting for DocumentCleaner (removal of numeric rows... | 2023-11-03T23:06:18Z | Make `langdetect` optional for `TextFileToDocument` (2.x)
It's often unnecessary to use the component and adds confusion for smaller demos, because it needs to be installed separately.
We should check for it only if `valid_languages` is set.
Simplify `TextFileToDocument`
`TextFileToDocumentConverter` currently offe... | [
{
"body": "It's often unnecessary to use the component and adds confusion for smaller demos, because it needs to be installed separately.\r\n\r\nWe should check for it only if `valid_languages` is set.",
"number": 6190,
"title": "Make `langdetect` optional for `TextFileToDocument` (2.x)"
},
{
"b... | 8b092a90c0095529c4fe1c04280f09f141998638 | {
"head_commit": "5b925f415fd9b601b6a41f2d803071893037212b",
"head_commit_message": "reno",
"patch_to_review": "diff --git a/haystack/preview/components/file_converters/txt.py b/haystack/preview/components/file_converters/txt.py\nindex 2e620a9563..fd94e07210 100644\n--- a/haystack/preview/components/file_converte... | [
{
"diff_hunk": "@@ -21,189 +15,45 @@ class TextFileToDocument:\n A component for converting a text file to a Document.\n \"\"\"\n \n- def __init__(\n- self,\n- encoding: str = \"utf-8\",\n- remove_numeric_tables: bool = False,\n- numeric_row_threshold: float = 0.4,\n- ... | 086a8186ed72b7448683eee3c9ad120150992bb7 | diff --git a/haystack/preview/components/file_converters/txt.py b/haystack/preview/components/file_converters/txt.py
index 2e620a9563..2e63f72861 100644
--- a/haystack/preview/components/file_converters/txt.py
+++ b/haystack/preview/components/file_converters/txt.py
@@ -1,15 +1,9 @@
import logging
from pathlib import... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
deepset-ai__haystack-6189@3b78b0b | deepset-ai/haystack | Python | 6,189 | feat: MetaField Ranker | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/6054
### Proposed Changes:
- https://github.com/deepset-ai/haystack/pull/6141
### Why:
To allow users to rank documents by a relevant metadata field after having used a retriever.
### How can it be used:
``` python
from hayst... | 2023-10-29T14:46:03Z | Ranker based on custom meta field
I think it could be useful to add a custom meta field ranker. This will allow users to sort items based on their preferred meta fields (e.g., ratings, counts...).
Building upon the existing "Recentness Ranker," it's a relatively straightforward addition.
I would be happy to creat... | [
{
"body": "I think it could be useful to add a custom meta field ranker. This will allow users to sort items based on their preferred meta fields (e.g., ratings, counts...).\r\n\r\nBuilding upon the existing \"Recentness Ranker,\" it's a relatively straightforward addition.\r\n\r\nI would be happy to create a p... | 08e211f9d666c71bb0efd450e252c3f98372ae91 | {
"head_commit": "3b78b0b874db7b09053dc5dc61594ecb567fb19f",
"head_commit_message": "update code according to new Document class",
"patch_to_review": "diff --git a/haystack/preview/components/rankers/meta_field.py b/haystack/preview/components/rankers/meta_field.py\nnew file mode 100644\nindex 0000000000..7f972ff... | [
{
"diff_hunk": "@@ -0,0 +1,186 @@\n+import logging\n+import warnings\n+from collections import defaultdict\n+from typing import List, Dict, Any, Optional, Literal\n+\n+from haystack.preview import ComponentError, Document, component, default_to_dict\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+@component\n... | 7b6ec8b4d5d0d059245291ead3e855180e921c65 | diff --git a/haystack/preview/components/rankers/meta_field.py b/haystack/preview/components/rankers/meta_field.py
new file mode 100644
index 0000000000..f205d136f1
--- /dev/null
+++ b/haystack/preview/components/rankers/meta_field.py
@@ -0,0 +1,181 @@
+import logging
+import warnings
+from collections import defaultdi... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-6218@4cb0125 | deepset-ai/haystack | Python | 6,218 | Extends input types of `RemoteWhisperTranscriber` | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/6216
### Proposed Changes:
Extends input types of `RemoteWhisperTranscriber` from `List[ByteStream]` to `List[Union[str, Path, ByteStream]]` to make possible to connect it to `FileTypeRouter` (see issue)
### How did you test it?
Local... | 2023-11-02T09:18:55Z | Cannot connect `FileTypeRouter` to `RemoteWhisperTranscriber`
Error raised:
```
Cannot connect 'router.audio/mpeg' with 'mp3_converter.streams': their declared input and output types do not match.
'router':
- audio/mpeg (List[Path])
'mp3_converter':
- streams (List[ByteStream]), available
```
We should ma... | [
{
"body": "Error raised:\r\n\r\n```\r\nCannot connect 'router.audio/mpeg' with 'mp3_converter.streams': their declared input and output types do not match.\r\n'router':\r\n - audio/mpeg (List[Path])\r\n'mp3_converter':\r\n - streams (List[ByteStream]), available\r\n```\r\n\r\nWe should make `RemoteWhisperTransc... | e888852aec64686fe2203b1f66429678af70c8bd | {
"head_commit": "4cb012587ae07f272bdf95fc2e4cb514453ce52e",
"head_commit_message": "feedback",
"patch_to_review": "diff --git a/haystack/preview/components/audio/whisper_remote.py b/haystack/preview/components/audio/whisper_remote.py\nindex 7228b014ca..15d17e19a4 100644\n--- a/haystack/preview/components/audio/w... | [
{
"diff_hunk": "@@ -124,11 +125,21 @@ def run(self, streams: List[ByteStream]):\n \"\"\"\n documents = []\n \n- for stream in streams:\n- file = io.BytesIO(stream.data)\n- file.name = stream.metadata.get(\"file_path\", \"audio_input.wav\") # default name if `file_pa... | 44cd1fcb8921971a6bc7132e88f6fef53dd3d2ff | diff --git a/haystack/preview/components/audio/whisper_remote.py b/haystack/preview/components/audio/whisper_remote.py
index 7228b014ca..848a7c170f 100644
--- a/haystack/preview/components/audio/whisper_remote.py
+++ b/haystack/preview/components/audio/whisper_remote.py
@@ -1,7 +1,8 @@
import io
import logging
impor... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-3775@56c08d2 | cupy/cupy | Python | 3,775 | Fix CUDA 11 multi-GPU FFT bug | Close #3757. See https://github.com/cupy/cupy/issues/3757#issuecomment-673184478 for the trigger condition.
cc: @kmaehashi @pentschev @anaruse @maxpkatz | 2020-08-13T03:49:16Z | CUDA 11 Test: `cupy_tests.fft_tests.test_fft.TestMultiGpu`
```
FAILED tests/cupy_tests/fft_tests/test_fft.py::TestMultiGpuFft_param_2_{n=None, norm=None, shape=(64,)}::test_fft - AssertionError: Parameterized test failed.
FAILED tests/cupy_tests/fft_tests/test_fft.py::TestMultiGpuFft_param_2_{n=None, norm=None, shape... | Multi-gpu cuFFT failing with `CUFFT_EXEC_FAILED` for complex64.
cc/ @pentschev
We should suggest the cuFFT team to include CuPy's extensive FFT tests as part of their CI...It seems to me they keep breaking the behaviors/performance/precision/etc in every release...A better documentation is the minimal requirement.
... | [
{
"body": "```\r\nFAILED tests/cupy_tests/fft_tests/test_fft.py::TestMultiGpuFft_param_2_{n=None, norm=None, shape=(64,)}::test_fft - AssertionError: Parameterized test failed.\r\nFAILED tests/cupy_tests/fft_tests/test_fft.py::TestMultiGpuFft_param_2_{n=None, norm=None, shape=(64,)}::test_ifft - AssertionError:... | 99a0214073f372263b28b49acabcaa55a290b6fc | {
"head_commit": "56c08d2bf7550054c3008de26557dd6c3b0f2b79",
"head_commit_message": "add ref and fix flake8",
"patch_to_review": "diff --git a/cupy/testing/parameterized.py b/cupy/testing/parameterized.py\nindex a09123e6f8f..5efe58333c4 100644\n--- a/cupy/testing/parameterized.py\n+++ b/cupy/testing/parameterized... | [
{
"diff_hunk": "@@ -159,6 +161,17 @@ def test_ifft(self, xp, dtype):\n return out\n \n \n+# See #3757 and NVIDIA internal ticket 3093094\n+def _skip_multi_gpu_bug(shape, gpus):\n+ # avoid CUDA 11 bug triggered by",
"line": null,
"original_line": 166,
"original_start_line": null,
"path... | 6e75235a127018e1b7cd4c37b26f625e92085be2 | diff --git a/cupy/testing/parameterized.py b/cupy/testing/parameterized.py
index a09123e6f8f..5efe58333c4 100644
--- a/cupy/testing/parameterized.py
+++ b/cupy/testing/parameterized.py
@@ -6,6 +6,7 @@
import unittest
from cupy.testing import _bundle
+from cupy.cuda import cufft
from cupy.cuda import driver
@@ ... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-6159@3608897 | deepset-ai/haystack | Python | 6,159 | feat: Add `MarkdownToTextDocument` (v2) | ### Related Issues
- fixes #5669
### Proposed Changes:
Adds `MarkdownToTextDocument`, a file converter that converts Markdown files into a text Documents.
This component contains the same features as the [MarkdownConverter](https://github.com/deepset-ai/haystack/blob/main/haystack/nodes/file_converter/mark... | 2023-10-23T21:04:52Z | `MarkdownToTextDocument` (v2)
This file converter converts each Markdown files into a text Document.
Draft I/O:
```python
@component
class MarkdownToTextDocument:
@component.output_type(documents=List[Document])
def run(self, paths: List[Union[str, Path]]):
... loads the content of the file... | @ZanSara could you please assign this issue to me
Hey @Vishalk91-4 feel free to implement it and open a PR! To my knowledge no one else is working on this. Thank you for your contribution :blush: | [
{
"body": "This file converter converts each Markdown files into a text Document.\r\n\r\nDraft I/O:\r\n\r\n```python\r\n@component\r\nclass MarkdownToTextDocument:\r\n\r\n @component.output_type(documents=List[Document])\r\n def run(self, paths: List[Union[str, Path]]):\r\n ... loads the content of... | 5e1223043643410cba5a4e8dc50f754d414b5929 | {
"head_commit": "360889722899d3c0e1e7269d7d7a171f90995f54",
"head_commit_message": "Update GitHub workflows",
"patch_to_review": "diff --git a/.github/workflows/linting_preview.yml b/.github/workflows/linting_preview.yml\nindex ffd7c2b442..2fd5215fad 100644\n--- a/.github/workflows/linting_preview.yml\n+++ b/.gi... | [
{
"diff_hunk": "@@ -0,0 +1,119 @@\n+import logging\n+import re\n+from pathlib import Path\n+from typing import Dict, List, Optional, Tuple, Union, Any\n+\n+from tqdm import tqdm\n+\n+from haystack.preview import Document, component\n+from haystack.preview.lazy_imports import LazyImport\n+\n+with LazyImport(\"Ru... | fa034864754474c793e12ac2a942b0d19124e748 | diff --git a/.github/workflows/linting_preview.yml b/.github/workflows/linting_preview.yml
index 9b5ca67234..c69aeb91ef 100644
--- a/.github/workflows/linting_preview.yml
+++ b/.github/workflows/linting_preview.yml
@@ -74,7 +74,7 @@ jobs:
- name: Install Haystack
run: |
- pip install .[dev,pr... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-3838@a5159a7 | cupy/cupy | Python | 3,838 | Support sparse pointwise division by vectors or matrices | Closes https://github.com/cupy/cupy/issues/3830
This PR is to support sparse matrix point-wise division by another matrix or vector. | 2020-08-24T06:03:34Z | Sparse pointwise division
This is a very important feature as right now there is no way to perform point wise division of vectors, dense or sparse matrices with other sparse matrices. As a workaround, we have been multiplying by the reciprocal, but this is not immediately obvious to most users and adds complexity.
Poi... | [
{
"body": "This is a very important feature as right now there is no way to perform point wise division of vectors, dense or sparse matrices with other sparse matrices. As a workaround, we have been multiplying by the reciprocal, but this is not immediately obvious to most users and adds complexity.\n\nPointwis... | fc3272a681d6bd61f5e33c2501b19787a033cc35 | {
"head_commit": "a5159a756eee6b5e705f6cb579c753133c1d2135",
"head_commit_message": "Support sparse pointwise division by vectors or matrices",
"patch_to_review": "diff --git a/cupyx/scipy/sparse/csr.py b/cupyx/scipy/sparse/csr.py\nindex 51806930a8f..7290c28f5ee 100644\n--- a/cupyx/scipy/sparse/csr.py\n+++ b/cupy... | [
{
"diff_hunk": "@@ -477,6 +486,15 @@ def isspmatrix_csr(x):\n return isinstance(x, csr_matrix)\n \n \n+def check_shape_for_pointwise_op(a_shape, b_shape):",
"line": null,
"original_line": 489,
"original_start_line": null,
"path": "cupyx/scipy/sparse/csr.py",
"start_line": null,
"text... | ed6d03a0ca26899eef05b847b4ff9ebd6139f500 | diff --git a/cupyx/scipy/sparse/csr.py b/cupyx/scipy/sparse/csr.py
index 06495ebb22c..019e8d09882 100644
--- a/cupyx/scipy/sparse/csr.py
+++ b/cupyx/scipy/sparse/csr.py
@@ -178,7 +178,7 @@ def __rdiv__(self, other):
raise NotImplementedError
def __truediv__(self, other):
- """Point-wise division ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-6147@fd9d913 | deepset-ai/haystack | Python | 6,147 | feat: Add `ConditionalRouter` Haystack 2.x component | ### Why:
- Enable generic and conditionally expressive pipeline routing functionality by introducing a new `Router` component.
- The `Router` component orchestrates the flow of data by evaluating specified route conditions to determine the appropriate route among a set of provided route alternatives.
- fixes https:/... | 2023-10-21T18:36:51Z | Add Conditional Routing in Haystack 2.x Pipelines
### Description:
In the current state of Haystack 2.x pipelines, we can create pipelines by connecting output slots to input slots:
```python
pipe.connect("fetcher.streams", "converter.sources")
pipe.connect("converter.documents", "text_splitter.documents")
```... | Another use case where I needed such a `ConnectionRouter` is with LLM results and function calling. In step 4 of the colab [notebook](https://colab.research.google.com/drive/1hPyK7DKXuMRRm03uE7-h-oG0X4h3Lvpx), I want to inspect ChatMessage to see if it's metadata indicates `finish_reason` to be `function_call`. In such... | [
{
"body": "### Description:\r\n\r\nIn the current state of Haystack 2.x pipelines, we can create pipelines by connecting output slots to input slots:\r\n\r\n```python\r\npipe.connect(\"fetcher.streams\", \"converter.sources\")\r\npipe.connect(\"converter.documents\", \"text_splitter.documents\")\r\n```\r\n\r\nH... | ec3558021e0a5a007c53cd60b9d6a7997bc937a1 | {
"head_commit": "fd9d913d06c2e571013b37b3047ed43212ccbb89",
"head_commit_message": "Add release note",
"patch_to_review": "diff --git a/haystack/preview/components/routers/__init__.py b/haystack/preview/components/routers/__init__.py\nindex e049d63b87..f24413ddb3 100644\n--- a/haystack/preview/components/routers... | [
{
"diff_hunk": "@@ -0,0 +1,145 @@\n+import ast\n+import logging\n+from typing import List, Dict, Any\n+\n+from haystack.preview import component\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+class NoRouteSelectedException(Exception):\n+ \"\"\"Exception raised when no route is selected in Router.\"\"\"\n+... | 90b68a3329db38172fb46fa86c76ebe31eb572aa | diff --git a/haystack/preview/components/routers/__init__.py b/haystack/preview/components/routers/__init__.py
index 32e9a422c5..2da95625fc 100644
--- a/haystack/preview/components/routers/__init__.py
+++ b/haystack/preview/components/routers/__init__.py
@@ -1,7 +1,7 @@
from haystack.preview.components.routers.documen... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-3678@1bd32b5 | cupy/cupy | Python | 3,678 | Speed up `cupy.vdot` | Close #3672. Use CUB device reduction to accelerate it. If not available, fall back to the original kernel.
Before:
```
vdot : CPU: 17.272 us +/- 0.938 (min: 16.300 / max: 39.416) us GPU-0: 640.646 us +/-18.809 (min: 630.496 / max: 774.144) us
```
After:
```
vdot ... | 2020-07-28T06:06:14Z | `cupy.vdot` is way slower than naive implementation
I am on CUDA 10.0 + GTX 2080 Ti + master branch, and this is what I see (with `CUPY_ACCELERATORS=cub`):
```python
>>> import cupy as cp
>>> from cupyx.time import repeat
>>>
>>> a = cp.random.random(1000000)
>>> b = cp.random.random(1000000)
>>> def my_vdot(a,... | Without using CUB the naive implementation would win only by a margin:
```python
>>> cp.core._accelerator.set_routine_accelerators([])
>>> cp.core._accelerator.set_reduction_accelerators([])
>>> print(repeat(my_vdot, (a, b)))
my_vdot : CPU: 23.317 us +/- 4.025 (min: 22.159 / max: 223.056) us ... | [
{
"body": "I am on CUDA 10.0 + GTX 2080 Ti + master branch, and this is what I see (with `CUPY_ACCELERATORS=cub`):\r\n```python\r\n>>> import cupy as cp\r\n>>> from cupyx.time import repeat\r\n>>>\r\n>>> a = cp.random.random(1000000)\r\n>>> b = cp.random.random(1000000)\r\n>>> def my_vdot(a, b):\r\n... retu... | 49836b2a6e0aa37c36ab493e716707009b09806f | {
"head_commit": "1bd32b58d9e3d9448eff58f514b3b73ffff8b234",
"head_commit_message": "check if any accelerators is in use",
"patch_to_review": "diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx\nindex ba0e8d18b37..fd65744e0c0 100644\n--- a/cupy/core/core.pyx\n+++ b/cupy/core/core.pyx\n@@ -32,6 +32,7 @@ cimport ... | [
{
"diff_hunk": "@@ -2812,9 +2812,15 @@ cpdef ndarray tensordot_core(\n out = _ndarray_init(ret_shape, dtype)\n \n if m == 1 and n == 1:\n- # TODO(leofang): switch back to _tensordot_core_mul_sum when\n- # ReductionKernel supports CUB block reduction\n- out = (a.ravel() * b.r... | f03a9f61a541948e0b52b9be40c63ea3de0df331 | diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx
index ba0e8d18b37..fa8178dd223 100644
--- a/cupy/core/core.pyx
+++ b/cupy/core/core.pyx
@@ -32,6 +32,7 @@ cimport cython # NOQA
from libcpp cimport vector
from libc.stdint cimport int64_t
+from cupy.core cimport _accelerator
from cupy.core cimport _carray
from... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Performance Optimizations"
} |
deepset-ai__haystack-6112@7f4577f | deepset-ai/haystack | Python | 6,112 | refactor: make sure that Document's `id_hash_keys` has a valid value | ### Related Issues
- fixes #6111
### Proposed Changes:
Now, if `id_hash_keys` is None or empty, the Document dataclass populates this field in `__post_init__`
using the default factory.
Having valid values of `id_hash_keys` avoids generating the same Id over and over again (see the original issue).
### ... | 2023-10-18T16:29:24Z | Some file converters do not handle `id_hash_keys` properly
**Describe the bug**
Some file converters allow an optional parameter `id_hash_keys`, which defaults to None and is then converted into an empty list (if not explicitly specified).
So, during Document creation, text is not considered to compute the Id and a... | [
{
"body": "**Describe the bug**\r\nSome file converters allow an optional parameter `id_hash_keys`, which defaults to None and is then converted into an empty list (if not explicitly specified).\r\n\r\nSo, during Document creation, text is not considered to compute the Id and all Documents have the same Id.\r\n... | 6df077cbb4780defec72ae8f839dfbefdaf73e9a | {
"head_commit": "7f4577f0a6cd33f2a15ae5492f3eaeadd7fa7e50",
"head_commit_message": "reno",
"patch_to_review": "diff --git a/haystack/preview/components/file_converters/html.py b/haystack/preview/components/file_converters/html.py\nindex cf947c6d22..bb120e52f8 100644\n--- a/haystack/preview/components/file_conver... | [
{
"diff_hunk": "@@ -58,7 +58,10 @@ def run(self, sources: List[Union[str, Path, ByteStream]]):\n logger.warning(\"Failed to extract text from %s. Skipping it. Error: %s\", source, conversion_e)\n continue\n \n- document = Document(text=text, id_hash_keys=self.id_hash_k... | 1911864918d478dcead31f3daba06bcb7993b9d7 | diff --git a/haystack/preview/components/file_converters/azure.py b/haystack/preview/components/file_converters/azure.py
index 6368af9753..2173a3f01c 100644
--- a/haystack/preview/components/file_converters/azure.py
+++ b/haystack/preview/components/file_converters/azure.py
@@ -109,9 +109,6 @@ def _convert_azure_result... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
dask__dask-8897@47dce03 | dask/dask | Python | 8,897 | Make ``is_monotonic`` work when some partitions are empty | - [x] Closes #8880
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
| 2022-04-07T14:29:25Z | is_monotonic fails with empty partitions
**What happened**: if a dataframe has empty partitions the method `is_monotonic` crashes, both for the index and for columns.
**What you expected to happen**: empty partitions should be ignored while checking for sortedness and monotonicity. In the particular case of a 0-rows... | Thanks for opening this one as well! I am just writing up a little test, then I'll open a PR. | [
{
"body": "**What happened**: if a dataframe has empty partitions the method `is_monotonic` crashes, both for the index and for columns.\r\n\r\n**What you expected to happen**: empty partitions should be ignored while checking for sortedness and monotonicity. In the particular case of a 0-rows dataframe, Pandas... | 1b1a96b4ddf31d0879e718be463a731af7f1d086 | {
"head_commit": "47dce03759b7042d4ca462d17d67026c365f03c3",
"head_commit_message": "Make ``is_monotonic`` work when some partitions are empty",
"patch_to_review": "diff --git a/dask/dataframe/methods.py b/dask/dataframe/methods.py\nindex 3cf026481fe..ee982342c4b 100644\n--- a/dask/dataframe/methods.py\n+++ b/das... | [
{
"diff_hunk": "@@ -458,11 +460,13 @@ def monotonic_increasing_aggregate(concatenated):\n \n \n def monotonic_decreasing_chunk(x):\n- data = x if is_index_like(x) else x.iloc\n- return pd.DataFrame(\n- data=[[x.is_monotonic_decreasing, data[0], data[-1]]],\n- columns=[\"monotonic\", \"first\... | 7c2f41050442ac87c9e0584b5c6e5de66043341d | diff --git a/dask/dataframe/methods.py b/dask/dataframe/methods.py
index 3cf026481fe..eaae9b80c1c 100644
--- a/dask/dataframe/methods.py
+++ b/dask/dataframe/methods.py
@@ -443,11 +443,13 @@ def assign_index(df, ind):
def monotonic_increasing_chunk(x):
- data = x if is_index_like(x) else x.iloc
- return pd.D... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-3543@80a6c2f | cupy/cupy | Python | 3,543 | Support 0-size ndarray and fix possible error in __del__ at fft | Fix #3241
| 2020-07-04T17:04:15Z | `Invalid number of FFT data points` is not always raised
`cupy.fft.fft(cupy.array([]))` should raise `ValueError` even if `n` is default.
<details>
```
>>> np.fft.fft(np.array([]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 5, in fft
... | [
{
"body": "`cupy.fft.fft(cupy.array([]))` should raise `ValueError` even if `n` is default.\r\n\r\n<details>\r\n\r\n```\r\n>>> np.fft.fft(np.array([]))\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"<__array_function__ internals>\", line 5, in fft\r\n File \"/path/... | 0af4d978374e53fc9bd4568084a0386c12a45264 | {
"head_commit": "80a6c2fe253838251749d6cd0b0e2f4c415a7d9e",
"head_commit_message": "Support 0-size ndarray at fft",
"patch_to_review": "diff --git a/cupy/cuda/cufft.pyx b/cupy/cuda/cufft.pyx\nindex db12bc52b85..83d7474473d 100644\n--- a/cupy/cuda/cufft.pyx\n+++ b/cupy/cuda/cufft.pyx\n@@ -252,17 +252,32 @@ class ... | [
{
"diff_hunk": "@@ -493,6 +501,12 @@ def _fftn(a, s, axes, norm, direction, value_type='C2C', order='A', plan=None,\n # Note: need to call _cook_shape prior to sorting the axes\n a = _cook_shape(a, s, axes, value_type, order=order)\n \n+ print(a.shape, s, axes_sorted)",
"line": null,
"origina... | f83d980030b6245f57c00559a71f599d825bebce | diff --git a/cupy/cuda/cufft.pyx b/cupy/cuda/cufft.pyx
index db12bc52b85..8c31642c4c2 100644
--- a/cupy/cuda/cufft.pyx
+++ b/cupy/cuda/cufft.pyx
@@ -252,17 +252,32 @@ class Plan1d(object):
cdef Handle plan
cdef bint use_multi_gpus = 0 if devices is None else 1
+ self.plan = 0
+ self.xt... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
dask__dask-8858@d2d0a1b | dask/dask | Python | 8,858 | Documentation of Limitation of Sample() | Adding a documentation of the limitation of the dataframe method ```sample()```
- [ x] Closes #8712
- [ ] Tests added / passed
- [ ] Passes `pre-commit run --all-files`
| 2022-03-30T08:27:11Z | Sampling from Dataframe for frac < npartitions / nrows
**What happened**:
I have been trying to sample rows from a dataframe using `sample(frac)` and realised that it does only work properly if the parameter `frac >= npartitions / nrows`, where `nrows` is the number of rows of the dataframe. For example, for `frac = 1... | Thanks for writing this up so well! That is a pretty compelling example. I am taking a look at the sample code now to see if I can tell what's going on.
Ok so this makes sense. Dask just maps the `sample(frac)` to each partition so we get a little bit of rounding differences. I found this example illustrative:
```... | [
{
"body": "**What happened**:\r\nI have been trying to sample rows from a dataframe using `sample(frac)` and realised that it does only work properly if the parameter `frac >= npartitions / nrows`, where `nrows` is the number of rows of the dataframe. For example, for `frac = 1 / nrows` `sample(frac)` returns a... | f18f4fa8ff7950f7ec1ba72d079e88e95ac150a2 | {
"head_commit": "d2d0a1b5a4606a90911b64fe577c9bb14e1fffe2",
"head_commit_message": "Modifying accortding to comments",
"patch_to_review": "diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py\nindex dad710ed5ae..68e9435719a 100644\n--- a/dask/dataframe/core.py\n+++ b/dask/dataframe/core.py\n@@ -1538,14 +... | [
{
"diff_hunk": "@@ -1538,14 +1538,35 @@ def sample(self, n=None, frac=None, replace=False, random_state=None):\n n : int, optional\n Number of items to return is not supported by dask. Use frac\n instead.\n- frac : float, optional\n+ frac : frac : float, optional",
... | 730c7000f82c004e4867a424dd9c0f0d52a73e73 | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 41027f5f8d7..a807c097c24 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,7 +16,7 @@ repos:
args:
- --py38-plus
- repo: https://github.com/psf/black
- rev: 22.1.0
+ rev: 22.3.0
hooks:
... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-3730@2d3a94b | cupy/cupy | Python | 3,730 | Add a cuFFT plan cache | ***UPDATE***: Close #3588.
This PR implements a least recently used (LRU) cache for cuFFT plans. The implementation is done in Cython to minimize the Python overhead; yet, I still use cdef classes (instead of pointers to structs) to avoid managing memory myself, and cdef'ing as much as I can.
Properties of this ... | 2020-08-06T06:10:36Z | Reuse cufft plan objects
Reusing a plan object have a significant impact in the complete fft performance. I measured a ~500us time drop.
We should try to create a `PlanAllocator` or a pool of plans to reuse objects according to the requested size.
(Plans allocate gpu memory so we have to be careful when reusing t... | Previous discussion was in #1669. @grlee77 mentioned he has a cache prototype. For the purpose of #3587 to speed up correlate/convolve, we should first focus on memoizing `Plan1d`, as it has less parameters to be used as the cache key.
PyTorch refs:
- usage: https://github.com/pytorch/pytorch/blob/master/docs/source/n... | [
{
"body": "Reusing a plan object have a significant impact in the complete fft performance. I measured a ~500us time drop.\r\n\r\nWe should try to create a `PlanAllocator` or a pool of plans to reuse objects according to the requested size.\r\n\r\n(Plans allocate gpu memory so we have to be careful when reusing... | 4c81aebbec5d481ddee8685d982b24372e5f272b | {
"head_commit": "2d3a94b45d2dc7b39d36f5798bb536123149ddfd",
"head_commit_message": "try documenting PlanCache?",
"patch_to_review": "diff --git a/cupy/cuda/cufft.pyx b/cupy/cuda/cufft.pyx\nindex fe5f322b303..9d249c2a2b8 100644\n--- a/cupy/cuda/cufft.pyx\n+++ b/cupy/cuda/cufft.pyx\n@@ -278,6 +278,17 @@ class Plan... | [
{
"diff_hunk": "@@ -0,0 +1,599 @@\n+# distutils: language = c++\n+\n+from cupy_backends.cuda.api cimport runtime\n+from cupy.cuda cimport device\n+from cupy.cuda cimport memory\n+\n+import threading\n+\n+from cupy import util\n+from cupy.cuda import cufft\n+\n+\n+################################################... | 3784845d7b003beb71f6d13d72a62e0c8595210e | diff --git a/cupy/cuda/cufft.pyx b/cupy/cuda/cufft.pyx
index 8df8ba92019..166ea4993de 100644
--- a/cupy/cuda/cufft.pyx
+++ b/cupy/cuda/cufft.pyx
@@ -279,6 +279,17 @@ class Plan1d(object):
else:
self._multi_gpu_get_plan(
plan, nx, fft_type, batch, devices, out)
+ ... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Performance Optimizations"
} |
deepset-ai__haystack-5970@dc70569 | deepset-ai/haystack | Python | 5,970 | fixed join_docs.py concatenate | ### Related Issues
- fixes #4916
### Proposed Changes:
I merged the two lists keeping only the document with the highest score
### How did you test it?
Manual verification.
### Checklist
- I have read the [contributors guidelines](https://github.com/deepset-ai/haystack/blob/main/CONTRIBUTING.md) a... | 2023-10-04T18:20:47Z | JoinDocuments should use highest score when multiple retrievers recall the same document
**Is your feature request related to a problem? Please describe.**
The JoinDocuments node currently uses the document from the last retriever if their are multiple retrievers and they recall the same document. The first retriever ... | Hi @Koenlaermans I completely agree! It's a well defined, small issue so I will also add the Contributions Wanted Label here in case you ore somebody else would like to contribute to Haystack by fixing this issue. The starting point for a fix is here in the code: https://github.com/deepset-ai/haystack/blob/56d033e7e778... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nThe JoinDocuments node currently uses the document from the last retriever if their are multiple retrievers and they recall the same document. The first retriever could have the highest score and be more useful. That's why I propos... | aaee03aee87e96acd8791b9eff999055a8203237 | {
"head_commit": "dc70569b0995c205cb6743d984abae9c287e2d8e",
"head_commit_message": "Merge branch 'main' into dev/join_docs",
"patch_to_review": "diff --git a/haystack/nodes/other/join_docs.py b/haystack/nodes/other/join_docs.py\nindex 4185873a7c..7ce0de819d 100644\n--- a/haystack/nodes/other/join_docs.py\n+++ b/... | [
{
"diff_hunk": "@@ -0,0 +1,37 @@\n+---\n+prelude: >\n+ Replace this text with content to appear at the top of the section for this\n+ release. This is equivalent to the \"Highlights\" section we used before.\n+ The prelude might repeat some details that are also present in other notes\n+ from the sa... | 02b0c97c3a7a3c22b22fdc077d484bbc230b51bb | diff --git a/haystack/nodes/other/join_docs.py b/haystack/nodes/other/join_docs.py
index 4185873a7c..7ce0de819d 100644
--- a/haystack/nodes/other/join_docs.py
+++ b/haystack/nodes/other/join_docs.py
@@ -1,11 +1,10 @@
-from collections import defaultdict
import logging
+from collections import defaultdict
from math im... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-5870@93e7245 | deepset-ai/haystack | Python | 5,870 | feat: Add TextDocumentSplitter that splits by word, sentence, passage (2.0) | ### Related Issues
- fixes #5675
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
### How did you test it?
Added unit tests
### Notes for the reviewer
Behavior is not... | 2023-09-25T09:10:16Z | `TextDocumentSplitter`
Splits the text into chunks long enough that models can process them.
Ideally it should be able to split the text:
- By word, sentence, paragraph
- Implies sentence tokenization, now done with NLTK
- By token (makes this component tokenizer-aware)
- With customizable overlap
- O... | In addition to the listed requirements it would be great if users could specify a custom string that separates paragraphs in a long input string. For example, paragraphs might not be separated by `\n\n` but by `-----` as mentioned in the following feature request from our community: https://github.com/deepset-ai/haysta... | [
{
"body": "Splits the text into chunks long enough that models can process them.\r\n\r\nIdeally it should be able to split the text:\r\n\r\n- By word, sentence, paragraph\r\n - Implies sentence tokenization, now done with NLTK\r\n- By token (makes this component tokenizer-aware)\r\n- With customizable overla... | 6aa471ac5ea7168d0611ade34e8eb1954cbfeaf3 | {
"head_commit": "93e7245cc7f21a15b4298f45f74c8f078ffc7725",
"head_commit_message": "add tests",
"patch_to_review": "diff --git a/haystack/preview/components/preprocessors/__init__.py b/haystack/preview/components/preprocessors/__init__.py\nnew file mode 100644\nindex 0000000000..33a0e2cd18\n--- /dev/null\n+++ b/... | [
{
"diff_hunk": "@@ -0,0 +1,109 @@\n+from typing import List, Optional, Dict, Any, Literal, Tuple\n+\n+from more_itertools import windowed\n+\n+from haystack.preview import component, Document, default_from_dict, default_to_dict\n+\n+\n+@component\n+class TextDocumentSplitter:\n+ \"\"\"\n+ Split a text doc... | a050c2a854febb6a7ace0fcb6fb8bfeb9dc0c650 | diff --git a/haystack/preview/components/preprocessors/__init__.py b/haystack/preview/components/preprocessors/__init__.py
new file mode 100644
index 0000000000..33a0e2cd18
--- /dev/null
+++ b/haystack/preview/components/preprocessors/__init__.py
@@ -0,0 +1,3 @@
+from haystack.preview.components.preprocessors.text_docu... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
dask__dask-8734@eb79005 | dask/dask | Python | 8,734 | Added compute method to raise error on use | - [ ] Closes #8695
- [ ] Tests added / passed
- [ ] Passes `pre-commit run --all-files`
First (very) naive implementation of compute method | 2022-02-17T18:40:54Z | Nicer handling of incorrect usage of `DataFrameGroupBy`
<!-- Please do a quick search of existing issues to make sure that this has not been asked before. -->
I was trying to debug a `DataFrameGroupBy` operation and naively tried to `.compute()` it. This raised a `KeyError` that the `compute` column was missing.
``... | Would defining a `compute` method and raising a `NotImplementedError` (as done [here](https://github.com/dask/dask/blob/80a82008d5b02a08f6ff59d802defcc43247eb1a/dask/dataframe/reshape.py#L133-L148)) be the right approach? @jsignell do you have thoughts on this?
> Would defining a `compute` method and raising a `NotImpl... | [
{
"body": "<!-- Please do a quick search of existing issues to make sure that this has not been asked before. -->\r\nI was trying to debug a `DataFrameGroupBy` operation and naively tried to `.compute()` it. This raised a `KeyError` that the `compute` column was missing.\r\n\r\n```python\r\nimport dask\r\n\r\nd... | bd8e8dc3f1329e7f9ef24072479729d9effeb6ad | {
"head_commit": "eb79005c6be5959e815f10cf5c034436c7495def",
"head_commit_message": "Merge branch 'handling_dataframegroupby' of github.com:Dranaxel/dask into handling_dataframegroupby",
"patch_to_review": "diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py\nindex f8d2defa945..44a840c7e60 100644\n... | [
{
"diff_hunk": "@@ -1290,6 +1290,12 @@ def _cum_agg(self, token, chunk, aggregate, initial):\n graph = HighLevelGraph.from_collections(name, dask, dependencies=dependencies)\n return new_dd_object(graph, name, chunk(self._meta), self.obj.divisions)\n \n+ def _compute(self):",
"line": null... | 127730b942636f9b50d85d108f82d7fd02f7a075 | diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
index f8d2defa945..5613831097e 100644
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -1290,6 +1290,13 @@ def _cum_agg(self, token, chunk, aggregate, initial):
graph = HighLevelGraph.from_collections(name, dask, dependencies=... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-5841@c834798 | deepset-ai/haystack | Python | 5,841 | feat: `UrlCacheChecker` | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/5840
### Proposed Changes:
- Add `UrlCacheChecker` to check if documents with a specific URL in their metadata exist in the document store.
### How did you test it?
- Local tests
- CI
### Notes for the reviewer
n/a
### Ch... | 2023-09-20T09:00:46Z | `UrlCacheChecker` 2.0
`UrlCacheChecker` is a document store aware component designed to help the Web Retrieval usecase. It simply checks for the presence of a document coming from a specific URL into a document store, assuming that such URL is stored in the document's metadata. It may also support cache expiration feat... | [
{
"body": "`UrlCacheChecker` is a document store aware component designed to help the Web Retrieval usecase. It simply checks for the presence of a document coming from a specific URL into a document store, assuming that such URL is stored in the document's metadata. It may also support cache expiration feature... | bf6d306d683d05b87c5fe7d8d86ccd2d2d94339c | {
"head_commit": "c834798912e4bd891ea4c5d5563e61d0917b8995",
"head_commit_message": "pylint",
"patch_to_review": "diff --git a/haystack/preview/components/caching/__init__.py b/haystack/preview/components/caching/__init__.py\nnew file mode 100644\nindex 0000000000..e69de29bb2\ndiff --git a/haystack/preview/compon... | [
{
"diff_hunk": "@@ -0,0 +1,65 @@\n+from typing import List, Dict, Any\n+\n+from haystack.preview import component, Document, default_from_dict, default_to_dict, DeserializationError\n+from haystack.preview.document_stores import DocumentStore, document_store\n+\n+\n+@component\n+class UrlCacheChecker:\n+ \"\... | ef1f55e283ba7d5234057ced9c773d671cbbbf0a | diff --git a/haystack/preview/components/caching/__init__.py b/haystack/preview/components/caching/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/haystack/preview/components/caching/url_cache_checker.py b/haystack/preview/components/caching/url_cache_checker.py
new file mode 100644
index 000... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
dask__dask-8869@24f8120 | dask/dask | Python | 8,869 | Implement {Series,DataFrame}GroupBy `fillna` methods | - [x] Closes #8708
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
TODO before merging:
- [x] Add docstring
- [x] Open new issue for implementing value = dict/Series/DataFrame (done: #8922) | 2022-03-31T15:32:53Z | Missing Built-in methods for SeriesGroupBy `ffill`
Some of the "built-in" methods for dask SeriesGroupBy objects are missing.
In pandas we could do something like...
```
import numpy as np
import pandas as pd
df = pd.DataFrame({
'a_cat': list('aabbbaccc'),
'b_num': [np.nan if i%3!=0 else (i+1) for ... | Thanks for opening this issue @CJC-ds if you would like to work on it please feel free to open a pull request!
I'd like to take a pass at this, I'll open a PR soon :) | [
{
"body": "Some of the \"built-in\" methods for dask SeriesGroupBy objects are missing.\r\n\r\nIn pandas we could do something like...\r\n\r\n```\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\ndf = pd.DataFrame({\r\n 'a_cat': list('aabbbaccc'),\r\n 'b_num': [np.nan if i%3!=0 else (i+1) for i in range... | 6685666dd4e3d6542fe2cb2cfbb5a4eb004f76ce | {
"head_commit": "24f81209f1291e6f507ff46929028719c1c66195",
"head_commit_message": "implement axis=1 using apply()",
"patch_to_review": "diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py\nindex 780ccf36298..f8b372c8c3d 100644\n--- a/dask/dataframe/groupby.py\n+++ b/dask/dataframe/groupby.py\n@@ ... | [
{
"diff_hunk": "@@ -1023,6 +1023,15 @@ def _cumcount_aggregate(a, b, fill_value=None):\n return a.add(b, fill_value=fill_value) + 1\n \n \n+def _fillna_groups(groups, axis, **kwargs):\n+ if axis == 0:\n+ return groups.fillna(axis=axis, **kwargs)\n+ else:\n+ return groups.drop(columns=gro... | c3088d4432c2651c30a3820e279ae136a21c7cd5 | diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
index 42e4b54ad1f..ba5ac25d6b0 100644
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -8,6 +8,7 @@
import pandas as pd
from dask.base import tokenize
+from dask.dataframe._compat import PANDAS_GT_150
from dask.dataframe.core impo... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-3536@3d30465 | cupy/cupy | Python | 3,536 | Fix sparse min/max to return sparse matrix | Close #3504.
This PR fixes sparse min/max to return a value as a sparse matrix. I will parameterize the test in another PR. | 2020-07-03T12:34:12Z | Sparse min/max have less SciPy-compatibility
The outptus of sparse min/max are less compatible to those of Scipy.
```Python
import numpy
import scipy
import cupy
from cupy import testing
import cupyx.scipy
def _make(xp, sp):
m = testing.shaped_random((10, 20), xp=xp, dtype='f', scale=1)
m[m < 0.9... | [
{
"body": "The outptus of sparse min/max are less compatible to those of Scipy.\r\n\r\n```Python\r\nimport numpy\r\nimport scipy\r\n\r\nimport cupy\r\nfrom cupy import testing\r\nimport cupyx.scipy\r\n\r\ndef _make(xp, sp):\r\n m = testing.shaped_random((10, 20), xp=xp, dtype='f', scale=1)\r\n m[m < 0.95]... | 428b46dd78a28f413432266d789a59ddf0be7693 | {
"head_commit": "3d30465ef02bfce02589c5e17d8ba3dfeba223c9",
"head_commit_message": "Return sparse matrix",
"patch_to_review": "diff --git a/cupyx/scipy/sparse/data.py b/cupyx/scipy/sparse/data.py\nindex 891dc0af470..b33fe84443d 100644\n--- a/cupyx/scipy/sparse/data.py\n+++ b/cupyx/scipy/sparse/data.py\n@@ -1,5 +... | [
{
"diff_hunk": "@@ -915,10 +915,9 @@ def test_min_sparse_axis_0(self):\n cupy.array(dm_data.indptr)),\n shape=(10, 20))\n \n- da_cupy_values = cupy.asnumpy(cp_matrix.min(axis=0))\n- da_scipy_values = numpy.array(dm_data.m... | 570ddccad590b296d3e2b71114ea69f267e93f42 | diff --git a/cupyx/scipy/sparse/data.py b/cupyx/scipy/sparse/data.py
index a91d4daf1a6..99f920676e1 100644
--- a/cupyx/scipy/sparse/data.py
+++ b/cupyx/scipy/sparse/data.py
@@ -1,6 +1,7 @@
import cupy
from cupy.core import internal
from cupyx.scipy.sparse import base
+from cupyx.scipy.sparse import coo
from cupyx.s... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-3350@61d361d | cupy/cupy | Python | 3,350 | Fix `_count_non_nan` datatype for windows | Closes #2780
dtype `l` is `int32` in windows and `int64` in linux causing `_count_non_nan` to return different types.
This value is then passed as parameter to _nanvar_core which explicitly declares it as `int64 _count` in its args list.
Fix it by using the datatype `q` which is int64 in both, windows and linu... | 2020-05-19T02:44:02Z | `TypeError` when using `cupy.nanstd` and `cupy.nanvar`
Hello, `cupy` raised `TypeError` when I ran the following code.
```python
import cupy as cp
cp.nanstd(cp.asarray([1, 2, 3, 4, 5], dtype='float64'))
```
the error is shown as below:
```python
---------------------------------------------------------------... | Seems to be a bug on how some datatypes are being handled in windows.
We will look into this.
_count is being returned as int32 instead of int64
We should check
https://github.com/cupy/cupy/blob/master/cupy/core/_routines_statistics.pyx#L438 | [
{
"body": "Hello, `cupy` raised `TypeError` when I ran the following code.\r\n\r\n```python\r\nimport cupy as cp\r\n\r\ncp.nanstd(cp.asarray([1, 2, 3, 4, 5], dtype='float64'))\r\n```\r\nthe error is shown as below:\r\n```python\r\n---------------------------------------------------------------------------\r\nTy... | e6474838a922b7869fb56380c8b9421702da1b26 | {
"head_commit": "61d361d40369022673acb18e153b8b12b978bbca",
"head_commit_message": "Dtype clarifications for windows",
"patch_to_review": "diff --git a/cupy/core/_dtype.pyx b/cupy/core/_dtype.pyx\nindex e0abcda7b8d..54018e1c149 100644\n--- a/cupy/core/_dtype.pyx\n+++ b/cupy/core/_dtype.pyx\n@@ -9,12 +9,12 @@ all... | [
{
"diff_hunk": "@@ -9,12 +9,12 @@ all_type_chars = '?bhilqBHILQefdFD'\n # b ... int8\n # h ... int16\n # i ... int32\n-# l ... int64\n+# l ... int64 (int32 in windows)\n # q ... int64\n # B ... uint8\n # H ... uint16\n # I ... uint32\n-# L ... uint64\n+# L ... uint64 (uint32 in windows0",
"line": null,
... | 54a1c2ae8c53f8d1ef2ea726c742aec193172d13 | diff --git a/cupy/core/_dtype.pyx b/cupy/core/_dtype.pyx
index e0abcda7b8d..e4f13e0d36e 100644
--- a/cupy/core/_dtype.pyx
+++ b/cupy/core/_dtype.pyx
@@ -9,12 +9,12 @@ all_type_chars = '?bhilqBHILQefdFD'
# b ... int8
# h ... int16
# i ... int32
-# l ... int64
+# l ... int64 (int32 in windows)
# q ... int64
# B ...... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-5824@0f35897 | deepset-ai/haystack | Python | 5,824 | feat: Add `MetadataRouter` (2.0) | ### Related Issues
- fixes #5680
- depends on #5823
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
This PR adds the `MetadataRouter`, a component which allows to route docu... | 2023-09-15T13:50:01Z | `MetadataRouter`
An additional router with a similar purpose to v1's `RouteDocuments`. This component is able to route documents on different output connections according to the content of their metadata fields.
It can use a filtering logic similar to `MemoryDocumentStore`’s filtering, and possibly even reuse it.
... | [
{
"body": "An additional router with a similar purpose to v1's `RouteDocuments`. This component is able to route documents on different output connections according to the content of their metadata fields.\r\n\r\nIt can use a filtering logic similar to `MemoryDocumentStore`’s filtering, and possibly even reuse ... | 719c1c040cac10f43e3ba6d2b0ac0bf43a7b9d0a | {
"head_commit": "0f358974d1a8b12f91409cbe2767713ff5be1907",
"head_commit_message": "Merge branch 'main' into metadata_router_2.0",
"patch_to_review": "diff --git a/haystack/preview/components/classifiers/file_classifier.py b/haystack/preview/components/routers/file_router.py\nsimilarity index 86%\nrename from ha... | [
{
"diff_hunk": "@@ -0,0 +1,4 @@\n+---\n+preview:\n+ - |\n+ Add `MetadataRouter`, a component that routes documents to different edges based on their metadata and specified rules.",
"line": null,
"original_line": 4,
"original_start_line": null,
"path": "releasenotes/notes/add-metadata_router-... | d6d884e648dc395096fcd37f713ba18b565c88b1 | diff --git a/haystack/preview/components/classifiers/file_classifier.py b/haystack/preview/components/routers/file_router.py
similarity index 86%
rename from haystack/preview/components/classifiers/file_classifier.py
rename to haystack/preview/components/routers/file_router.py
index 86ce63e667..78604f92df 100644
--- a/... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
dask__dask-8700@233691c | dask/dask | Python | 8,700 | Cross-scheduler inconsistent result structure | Raises a warning when `compute` or `persist` are called with a scheduler different from "dask.distributed" or "distributed" in Dask.distributed mode
- [X] Closes #8474
- [X] Tests added / passed
- [X] Passes `pre-commit run --all-files`
| 2022-02-09T23:12:23Z | Cross-scheduler inconsistent result structure
**What happened**:
Due to a mistake in our code, we were persisting a dask dataframe in one scheduler, but then ran the compute while specifying threads scheduler. What was weird was that the computation returned a pandas Series of Futures instead of the expected DataFra... | Hmmm that's an interesting issue! Raising an error seems like the best bet. So then the question is where to raise the error from. I think `compute` should probably be in charge of making sure that the task graph doesn't contain references to objects that the scheduler can't understand. The other option is to put that ... | [
{
"body": "**What happened**:\r\n\r\nDue to a mistake in our code, we were persisting a dask dataframe in one scheduler, but then ran the compute while specifying threads scheduler. What was weird was that the computation returned a pandas Series of Futures instead of the expected DataFrame (or exception).\r\n\... | f5b42d4b90d45f9c9bf42fcae99e4a4589246f18 | {
"head_commit": "233691c080eb2faf2e53ff5a6566dd20c6fa4a66",
"head_commit_message": "Cross-scheduler inconsistent result structure (#8474)\n\nRaises a warning when `compute` or `persist` are called with a scheduler different from \"dask.distributed\" or \"distributed\" in Dask.distributed",
"patch_to_review": "di... | [
{
"diff_hunk": "@@ -130,8 +130,20 @@ def test_futures_to_delayed_array(c):\n assert_eq(A.compute(), np.concatenate([x, x], axis=0))\n \n \n+# with pytest.warns(UserWarning, match=warning_message) as user_warnings_b:\n+# get_scheduler(scheduler=\"dask.distributed\")\n+# get_scheduler(scheduler=\"dist... | 7936a0a805574c86af6662c9c52bb02897fb3e43 | diff --git a/dask/base.py b/dask/base.py
index 2761b56dd41..a21fabb9e42 100644
--- a/dask/base.py
+++ b/dask/base.py
@@ -8,6 +8,7 @@
import pickle
import threading
import uuid
+import warnings
from collections import OrderedDict
from collections.abc import Callable, Iterator, Mapping
from concurrent.futures impor... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-3264@ac5e419 | cupy/cupy | Python | 3,264 | Raise `IndexError` for R2C/C2R FFT with `axes=()` | Close #3240. This makes the behavior compatible with NumPy. | 2020-04-07T02:56:17Z | Real FFTs with empty `axes` should fail
The shape of the output of `fft.(i)rfft*` depends on the last axis.
```
>>> numpy.fft.rfftn(numpy.arange(3), axes=())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 5, in rfftn
File "/path/to/python3.... | Is this issue introduced in recent NumPy changes? Otherwise I guess it should it be considered as a bug (cc/ #3241)
> Is this issue introduced in recent NumPy changes?
No. The result with NumPy 1.15.4 is the same.
Should I fix this in #3102? I am touching rfft/irfft there.
> Should I fix this in #3102? I am to... | [
{
"body": "The shape of the output of `fft.(i)rfft*` depends on the last axis.\r\n```\r\n>>> numpy.fft.rfftn(numpy.arange(3), axes=())\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"<__array_function__ internals>\", line 5, in rfftn\r\n File \"/path/to/python3.8/si... | 0cef64425e24e41bf2358d03785c7d6cbab272f5 | {
"head_commit": "ac5e419f900a756999e0c3265d0aaa60a81d9558",
"head_commit_message": "raise IndexError for R2C/C2R FFT with axes=()",
"patch_to_review": "diff --git a/cupy/fft/fft.py b/cupy/fft/fft.py\nindex 6c9938ea851..d6ca3a1b3b2 100644\n--- a/cupy/fft/fft.py\n+++ b/cupy/fft/fft.py\n@@ -166,8 +166,11 @@ def _ff... | [
{
"diff_hunk": "@@ -166,8 +166,11 @@ def _fft(a, s, axes, norm, direction, value_type='C2C', overwrite_x=False,\n axes = [i for i in range(-dim, 0)]\n else:\n axes = tuple(axes)\n- if not axes:\n- return a\n+ if len(axes) == 0:",
"line": null,
"original_line": 169,
"... | 6a37634fd2bf4198d60a6b0c66636823fbfd0906 | diff --git a/cupy/fft/fft.py b/cupy/fft/fft.py
index 6c9938ea851..a9d81b22c4d 100644
--- a/cupy/fft/fft.py
+++ b/cupy/fft/fft.py
@@ -167,7 +167,10 @@ def _fft(a, s, axes, norm, direction, value_type='C2C', overwrite_x=False,
else:
axes = tuple(axes)
if not axes:
- return a
+ if value_ty... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-3189@da5565a | cupy/cupy | Python | 3,189 | Add `array_equal` | closes #3125 | 2020-03-11T18:16:44Z | implementing array_equal() for CuPy
I was trying to implement array_equal() for Cupy and was thinking along these lines
```py
def array_equal(a1, a2):
try:
a1, a2 = cupy.asarray(a1), cupy.asarray(a2)
except Exception:
return False
if a1.shape != a2.shape:
return False
... | Hello, thanks for being interested in contributing to CuPy!.
1st is that `asarray` checks are not needed, since cupy functions accepts only cupy arrays. https://docs-cupy.chainer.org/en/stable/reference/difference.html#universal-functions-only-work-with-cupy-array-or-scalar
2nd is that this function currently syn... | [
{
"body": "I was trying to implement array_equal() for Cupy and was thinking along these lines\r\n\r\n```py\r\ndef array_equal(a1, a2):\r\n try:\r\n a1, a2 = cupy.asarray(a1), cupy.asarray(a2)\r\n except Exception:\r\n return False\r\n if a1.shape != a2.shape:\r\n return False\r\n ... | 05c8194dc9955f5fad2fbd8fb538389decca1756 | {
"head_commit": "da5565a8c34e062d8a7789f595b2fa39ce5d86f4",
"head_commit_message": "fix linting",
"patch_to_review": "diff --git a/cupy/logic/comparison.py b/cupy/logic/comparison.py\nindex 1f2b8e30507..d1c47c7e205 100644\n--- a/cupy/logic/comparison.py\n+++ b/cupy/logic/comparison.py\n@@ -38,6 +38,28 @@\n )\n \... | [
{
"diff_hunk": "@@ -38,6 +38,28 @@\n )\n \n \n+def array_equal(a, b):\n+ \"\"\"Returns True if two arrays are element-wise exactly equal.\n+\n+ Args:\n+ a (cupy.ndarray): Input array to compare.\n+ b (cupy.ndarray): Input array to compare.\n+\n+ Returns:\n+ cupy.ndarray: A boolean ... | 1eae082250b0aaffab50c8396cadc5aaef5a56ef | diff --git a/cupy/__init__.py b/cupy/__init__.py
index 3086b71522e..82962d0cde8 100644
--- a/cupy/__init__.py
+++ b/cupy/__init__.py
@@ -487,6 +487,7 @@ def base_repr(number, base=2, padding=0): # NOQA (needed to avoid redefinition
# Logic functions
# -----------------------------------------------------------------... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-3157@7c96b16 | cupy/cupy | Python | 3,157 | Allow `MatDescriptor` to be pickle-able | Fixes https://github.com/cupy/cupy/issues/3061 | 2020-03-05T20:31:02Z | cupy.sparse.MatDescriptor is not pickleable
I am encountering a segfault when freeing a CuPy sparse `csr_matrix` which was computed from a Dask array. I have an intuition that Dask might not be the cause of this problem. From a simple inspection of properties like `__cuda_array_interface__` and the allocator on the und... | I believe I just figured out why this is happening:
```
>>> import cupy as cp
>>> import pickle
>>>
>>> a = cp.sparse.random(1000, 100, format='csr', dtype=cp.float32)
>>> b = pickle.dumps(a)
>>> c = pickle.loads(b)
>>> c._descr.descriptor
94834805355424
>>> a._descr.descriptor
94834805355424
```
We sh... | [
{
"body": "I am encountering a segfault when freeing a CuPy sparse `csr_matrix` which was computed from a Dask array. I have an intuition that Dask might not be the cause of this problem. From a simple inspection of properties like `__cuda_array_interface__` and the allocator on the underlying index/data arrays... | 43c3c21e1fea5f0fc8a449aa97f10227c8ae6f91 | {
"head_commit": "7c96b16fe26277f383ebde190cc36d5518940565",
"head_commit_message": "Add a few tests for `MatDescriptor` directly",
"patch_to_review": "diff --git a/cupy/cusparse.py b/cupy/cusparse.py\nindex a58ef0e4e89..e46f7e37d90 100644\n--- a/cupy/cusparse.py\n+++ b/cupy/cusparse.py\n@@ -20,6 +20,9 @@ def cre... | [
{
"diff_hunk": "@@ -155,6 +156,14 @@ def test_init_copy_other_scipy_sparse(self, xp, sp):\n assert n.shape == m.shape\n return n\n \n+ def test_pickle_roundtrip(self, xp, sp):\n+ s = _make(xp, sp, self.dtype)",
"line": null,
"original_line": 160,
"original_start_line": 159,... | c2d40b3f5f8c59049aefca457b1f2e599f634d8d | diff --git a/cupy/cusparse.py b/cupy/cusparse.py
index a58ef0e4e89..e46f7e37d90 100644
--- a/cupy/cusparse.py
+++ b/cupy/cusparse.py
@@ -20,6 +20,9 @@ def create(cls):
descr = cusparse.createMatDescr()
return MatDescriptor(descr)
+ def __reduce__(self):
+ return self.create, ()
+
def ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-5399@ffde5c6 | deepset-ai/haystack | Python | 5,399 | ci: Add Github workflow to automate benchmark runs | ### Related Issues
- fixes #4904
- depends on #5432
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
This PR adapts the Github workflow `cml.yml` which does the following:
- S... | 2023-07-20T10:19:40Z | Automate running benchmarking script
We want to automate the benchmarking process using Github Actions to ensure that we can monitor the performance of Haystack easily. The benchmarks should be triggered weekly and whenever we branch off for a new version release. The action should spin up an EC2 instance for each conf... | [
{
"body": "We want to automate the benchmarking process using Github Actions to ensure that we can monitor the performance of Haystack easily. The benchmarks should be triggered weekly and whenever we branch off for a new version release. The action should spin up an EC2 instance for each configuration we want ... | bb7af3827d4822b2cd5151c8f6d76570c9d027bf | {
"head_commit": "ffde5c6b529afac95db2b2d7902adc81bb60256b",
"head_commit_message": "Always terminate runner",
"patch_to_review": "diff --git a/.github/workflows/cml.yml b/.github/workflows/cml.yml\nindex 545034427f..2b24757226 100644\n--- a/.github/workflows/cml.yml\n+++ b/.github/workflows/cml.yml\n@@ -3,87 +3,... | [
{
"diff_hunk": "",
"line": null,
"original_line": null,
"original_start_line": null,
"path": ".github/workflows/cml.yml",
"start_line": null,
"text": "@author:\nShould we change the name of the file to something that makes it clearer that this workflow is about running benchmarks, like `... | 4355377f6cf1479e53f152e1ef5c02c17c84eae5 | diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml
new file mode 100644
index 0000000000..971d0459e5
--- /dev/null
+++ b/.github/workflows/benchmarks.yml
@@ -0,0 +1,228 @@
+name: Benchmarks
+
+on:
+ workflow_dispatch:
+ schedule:
+ # At 00:01 on Sunday
+ - cron: "1 0 * * 0"
+
+perm... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Test Suite / CI Enhancements"
} | |
cupy__cupy-3130@ddcfff0 | cupy/cupy | Python | 3,130 | add support for `ord` = 2, -2, and 'nuc' in `cupy.linalg.norm` | closes #3053 | 2020-02-27T13:33:00Z | Got ValueError when `ord` in `cupy.linalg.norm()` is 2 or -2
Reproducer:
```python
>>> import numpy as np
>>> a = [[2, 0, 1], [-1, 1, 0], [-3, 3, 0]]
>>> a = np.asarray(a, dtype=np.float64)
>>> np.linalg.norm(a, ord=2)
4.723421263784789
>>>
>>> import cupy as cp
>>> b = cp.asarray(a)
>>> cp.linalg.norm(b, or... | I would like to tackle this.
Will be opening a PR soon! | [
{
"body": "Reproducer:\r\n```python\r\n>>> import numpy as np\r\n>>> a = [[2, 0, 1], [-1, 1, 0], [-3, 3, 0]]\r\n>>> a = np.asarray(a, dtype=np.float64)\r\n>>> np.linalg.norm(a, ord=2)\r\n4.723421263784789\r\n>>>\r\n>>> import cupy as cp\r\n>>> b = cp.asarray(a)\r\n>>> cp.linalg.norm(b, ord=2)\r\nTraceback (mos... | c5567bb56422cef1905983ea88c897cd0dcd8897 | {
"head_commit": "ddcfff0742cf9ee5004ab7896d23703a4dcacda9",
"head_commit_message": "solve import error",
"patch_to_review": "diff --git a/cupy/linalg/norms.py b/cupy/linalg/norms.py\nindex 873f246b965..43b55d1e217 100644\n--- a/cupy/linalg/norms.py\n+++ b/cupy/linalg/norms.py\n@@ -6,6 +6,30 @@\n from cupy.linalg... | [
{
"diff_hunk": "@@ -6,6 +6,30 @@\n from cupy.linalg import util\n \n \n+def _multi_svd_norm(x, row_axis, col_axis, op):\n+ \"\"\"Compute a function of the singular values of the 2-D matrices in `x`.\n+ This is a private utility function used by `cumpy.linalg.norm()`.\n+ Parameters\n+ ----------\n+ ... | e1fdef142790cd3cd5ed8a99463c0b48cf9f105d | diff --git a/cupy/linalg/norms.py b/cupy/linalg/norms.py
index 873f246b965..9a80faa7b0c 100644
--- a/cupy/linalg/norms.py
+++ b/cupy/linalg/norms.py
@@ -5,6 +5,14 @@
from cupy.linalg import decomposition
from cupy.linalg import util
+import functools
+
+
+def _multi_svd_norm(x, row_axis, col_axis, op):
+ y = cup... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-5467@cc8b6d5 | deepset-ai/haystack | Python | 5,467 | feat: Add `TextFileToDocument` component (v2) | ### Related Issues
- fixes #5363
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
This PR adds the `TextFileToDocument` component to the v2 preview which allows to provide path... | 2023-07-28T15:36:19Z | `TextFileToDocument` (v2)
Simple component that loads a text file into a document.
Does not perform any pre-processing, chunking, cleaning: those tasks are delegated to the preprocessors components.
However, let's make sure that metadata (any metadata the file carries, like its name, its mimetype, anything you could ... | [
{
"body": "Simple component that loads a text file into a document.\n\nDoes not perform any pre-processing, chunking, cleaning: those tasks are delegated to the preprocessors components.\n\nHowever, let's make sure that metadata (any metadata the file carries, like its name, its mimetype, anything you could thi... | 5f013918272402934a1d5ccd85c14370dc4f0f3d | {
"head_commit": "cc8b6d5e9f5d6b93dcd3a5ffb8d2d492d1165c0b",
"head_commit_message": "Compare file path against path object",
"patch_to_review": "diff --git a/haystack/preview/components/__init__.py b/haystack/preview/components/__init__.py\nindex 889df06ccf..c204f60171 100644\n--- a/haystack/preview/components/__... | [
{
"diff_hunk": "@@ -0,0 +1,234 @@\n+import logging\n+from pathlib import Path\n+from typing import Optional, List, Union, Dict\n+\n+from canals.errors import PipelineRuntimeError\n+from tqdm import tqdm\n+\n+from haystack import Document\n+from haystack.lazy_imports import LazyImport\n+from haystack.preview imp... | 308a8b7c5088dbc89d9e17174cc963b16799e841 | diff --git a/haystack/preview/components/__init__.py b/haystack/preview/components/__init__.py
index 889df06ccf..aef8809c95 100644
--- a/haystack/preview/components/__init__.py
+++ b/haystack/preview/components/__init__.py
@@ -1,2 +1,3 @@
from haystack.preview.components.audio.whisper_local import LocalWhisperTranscri... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
dask__dask-8637@762f75d | dask/dask | Python | 8,637 | Result of reducing an array should not depend on its chunk-structure!!! | - [x] Closes #8541
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
It's taken me a while to find a good example to motivate the seriousness of #8541 and prove that it is in fact a bug. I think I might have found one now.
As the source-code currently stands, running the following code to ... | 2022-01-29T11:33:38Z | Mutually inconsistent `x_chunk` and `axis` argument-values during `dask.array.reduction()`
Hi all @dask
I continue to thank you guys for the wonderful program that `dask` is!
I'm not sure if the behavior described below is by design or an oversight. But feel free to let me know what you think.
When "tree-redu... | To illustrate the above issue, see the following example:
```python
import dask.array as da
import numpy as np
from threading import Lock
from more_itertools import collapse
from functools import reduce
print_lock = Lock()
def display(x_chunks, axis):
x_chunks = [f' {chunk}' if type(chunk) is l... | [
{
"body": "Hi all @dask\r\n\r\nI continue to thank you guys for the wonderful program that `dask` is!\r\n\r\nI'm not sure if the behavior described below is by design or an oversight. But feel free to let me know what you think.\r\n\r\nWhen \"tree-reducing\" a `dask` array `x` along multiple axes using \r\n```... | 6824e5dd7807971270d5828a61618ccd81592199 | {
"head_commit": "762f75dfcd7a3c3a0626fc2e59ed9bbd62b9a210",
"head_commit_message": "fixed more linting errors in test_chunk_structure_dependence()",
"patch_to_review": "diff --git a/dask/array/chunk.py b/dask/array/chunk.py\nindex b8b2bb7f5b3..1a7bb648d7a 100644\n--- a/dask/array/chunk.py\n+++ b/dask/array/chunk... | [
{
"diff_hunk": "@@ -809,3 +809,37 @@ def test_nan_func_does_not_warn(func):\n with pytest.warns(None) as rec:\n getattr(da, func)(d).compute()\n assert not rec # did not warn\n+\n+\n+@pytest.mark.parametrize(\"chunks\", [((3, 3), (2, 1, 2, 1)), ((2, 1, 2, 1), (3, 3))])\n+def test_chunk_structur... | d373dd7aff227a7cb55e1c348180be4990d3723b | diff --git a/dask/array/chunk.py b/dask/array/chunk.py
index b8b2bb7f5b3..1a7bb648d7a 100644
--- a/dask/array/chunk.py
+++ b/dask/array/chunk.py
@@ -244,6 +244,7 @@ def argtopk_aggregate(a_plus_idx, k, axis, keepdims):
and return the index only.
"""
assert keepdims is True
+ a_plus_idx = a_plus_idx if... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
dask__dask-8604@b2d323a | dask/dask | Python | 8,604 | Update documentation of `ProgressBar` `out` parameter | Added documentation for the out parameter from diagnostics.ProgressBar
- [X] Closes #8524
- [X] Tests added / passed
- [X] Passes `pre-commit run --all-files`
cc @ian-r-rose
| 2022-01-21T17:34:06Z | ProgressBar `out` parameter issues
The `out` parameter in `diagnostics.ProgressBar` is not documented. It appears it should be a file-like object, which means bytes should be written to it by default. The current implementation raises `TypeError: a bytes-like object is required, not 'str'`.
Example:
```python
from... | The lack of documentation (and the name `_file`) certainly makes this hard to decipher, but going back to when this change was first introduced(https://github.com/dask/dask/pull/3185), it looks like the intention was just to allow the user to specify `stdout` or `stderr`. So I think that your original issue is not supp... | [
{
"body": "The `out` parameter in `diagnostics.ProgressBar` is not documented. It appears it should be a file-like object, which means bytes should be written to it by default. The current implementation raises `TypeError: a bytes-like object is required, not 'str'`.\r\n\r\nExample:\r\n```python\r\nfrom tempfil... | 95e1cf3108590ff3186bfb8312bdbc237259e3f1 | {
"head_commit": "b2d323ace9f42734a37de3a4fa8ed952c40c91ce",
"head_commit_message": "ProgressBar out parameter (#8524)\n\nafter running pre-commit",
"patch_to_review": "diff --git a/dask/diagnostics/progress.py b/dask/diagnostics/progress.py\nindex 4783b70ffe8..afa19118286 100644\n--- a/dask/diagnostics/progress.... | [
{
"diff_hunk": "@@ -37,6 +37,8 @@ class ProgressBar(Callback):\n Width of the bar\n dt : float, optional\n Update resolution in seconds, default is 0.1 seconds\n+ out : file object, optional\n+ File object to which the progress bar will be written. Default is sys.stdout.",
"lin... | eaa63a0d39675887731f20fb31d5bc5dab78c2c3 | diff --git a/dask/diagnostics/progress.py b/dask/diagnostics/progress.py
index 4783b70ffe8..1cb81cb49db 100644
--- a/dask/diagnostics/progress.py
+++ b/dask/diagnostics/progress.py
@@ -37,6 +37,10 @@ class ProgressBar(Callback):
Width of the bar
dt : float, optional
Update resolution in seconds, ... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-5455@9cd0f95 | deepset-ai/haystack | Python | 5,455 | feat: support search_fields in DeepsetCloudDocumentStore | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/5456
### Proposed Changes:
- add `search_fields` to `DeepsetCloudDocumentStore`
### How did you test it?
- no explicit tests needed, we only want that this param is allowed during Haystack schema validation
### Notes for the reviewer... | 2023-07-27T14:31:47Z | Support `search_fields` in `DeepsetCloudDocumentStore`
**Is your feature request related to a problem? Please describe.**
For dense retrieval we can search multiple fields using `EmbeddingRetriever.embed_meta_fields`. For sparse this is possible via `search_fields` param that's offered by most document stores. `Deepse... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nFor dense retrieval we can search multiple fields using `EmbeddingRetriever.embed_meta_fields`. For sparse this is possible via `search_fields` param that's offered by most document stores. `DeepsetCloudDocumentStore` is lacking of... | 62029ba4417f0ce9694a35f6fcb888bb9c4098f5 | {
"head_commit": "9cd0f95d4451b311d569931154e6155d4a60e1b6",
"head_commit_message": "Update releasenotes/notes/deepset-cloud-document-store-search-fields-40b2322466f808a3.yaml",
"patch_to_review": "diff --git a/haystack/document_stores/deepsetcloud.py b/haystack/document_stores/deepsetcloud.py\nindex 1a9dbec83e..... | [
{
"diff_hunk": "@@ -90,6 +91,7 @@ def __init__(\n :param use_prefiltering: By default, DeepsetCloudDocumentStore uses post-filtering when querying with filters.\n To use pre-filtering instead, set this parameter to `True`. Note that pre-filtering\n ... | 9b87af0b652db29159aa12f7b1552148ffcdba57 | diff --git a/haystack/document_stores/deepsetcloud.py b/haystack/document_stores/deepsetcloud.py
index 1a9dbec83e..a9c8caccc5 100644
--- a/haystack/document_stores/deepsetcloud.py
+++ b/haystack/document_stores/deepsetcloud.py
@@ -47,6 +47,7 @@ def __init__(
label_index: str = "default",
embedding_dim... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-5553@98f2143 | deepset-ai/haystack | Python | 5,553 | feat: initial ExtractiveReader implementation | ### Related Issues
- fixes #5431
### Proposed Changes:
It implements an `ExtractiveReader` similarly to the inference functionality of `FARMReader`, but without all the farm dependencies
### How did you test it?
I still need to add tests, but I tried it with the following code:
```py
docs = [[Document(co... | 2023-08-11T17:17:21Z | `ExtractiveReader` (v2)
`ExtractiveReader` is a port of the former `Reader`s. If it's the only Reader we end up porting to v2, we may be able to stick with a generic name that clarifies it's an extractive component, not a generative one.
Depending on what we decide in the discussion, we may have another Reader, whic... | [
{
"body": "`ExtractiveReader` is a port of the former `Reader`s. If it's the only Reader we end up porting to v2, we may be able to stick with a generic name that clarifies it's an extractive component, not a generative one.\r\n\r\nDepending on what we decide in the discussion, we may have another Reader, which... | 28f5c4c7806456929dafbbba5982e795740fda56 | {
"head_commit": "98f2143a8246a6b0521183d0d3df9810ed21e755",
"head_commit_message": "initial ExtractiveReader implementation",
"patch_to_review": "diff --git a/haystack/preview/__init__.py b/haystack/preview/__init__.py\nindex 66f27add11..f3a5804acf 100644\n--- a/haystack/preview/__init__.py\n+++ b/haystack/previ... | [
{
"diff_hunk": "@@ -0,0 +1,151 @@\n+from pathlib import Path\n+from typing import List, Optional, Tuple, Union\n+from haystack.preview import component, Document, Answer\n+from haystack.preview.pipeline import Pipeline\n+from haystack.lazy_imports import LazyImport\n+\n+with LazyImport(message=\"Run 'pip instal... | d13926cded82d3fbb2f3b4fc7a80cb3d631a4da5 | diff --git a/haystack/preview/components/readers/__init__.py b/haystack/preview/components/readers/__init__.py
new file mode 100644
index 0000000000..bb78e17759
--- /dev/null
+++ b/haystack/preview/components/readers/__init__.py
@@ -0,0 +1 @@
+from haystack.preview.components.readers.extractive import ExtractiveReader
... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
cupy__cupy-3118@089e2b2 | cupy/cupy | Python | 3,118 | Use larger type to represent index range in `cupy.take` | Fix #3017 .
`cupy.take()` currently returns unexpected results when the data size of an array to take is the same with `n + 1`, where `n` is the maximum integer the type of indices can represent. For example, `n + 1 = 256` for the indices of type `uint8`.
This PR fixes the issue to use larger type to represent in... | 2020-02-25T03:24:39Z | cupy.take() does not function correctly when indices are unsigned integers or negative
```
CuPy Version : 7.1.1
CUDA Root : /usr/local/cuda
CUDA Build Version : 10020
CUDA Driver Version : 10020
CUDA Runtime Version : 10020
cuBLAS Version : 10202
cuFFT Version : 10102
c... | Thanks for the reporting. I reproduced the issue and will look into its detail.
I’ve found that the issue is not because the index to take is interpreted as `int8` but the type of `index_range` in the take kernel is specified to `uint8` as well as that of `indeces`, which can not represent 256 that is the size of `a` a... | [
{
"body": "```\r\nCuPy Version : 7.1.1\r\nCUDA Root : /usr/local/cuda\r\nCUDA Build Version : 10020\r\nCUDA Driver Version : 10020\r\nCUDA Runtime Version : 10020\r\ncuBLAS Version : 10202\r\ncuFFT Version : 10102\r\ncuRAND Version : 10102\r\ncuSOLVER Version ... | 28fde4013cc4dcd2aa544bbfa8f12a2dfa835a5d | {
"head_commit": "089e2b25184461c7570bf4416c878662a106464b",
"head_commit_message": "Use larger type to represent index range in `cupy.take`",
"patch_to_review": "diff --git a/cupy/core/_routines_indexing.pyx b/cupy/core/_routines_indexing.pyx\nindex efbd8c834af..4bd5e947b8e 100644\n--- a/cupy/core/_routines_inde... | [
{
"diff_hunk": "@@ -29,6 +31,15 @@ def test_take_no_axis(self, xp):\n b = xp.array([[10, 5], [3, 20]])\n return a.take(b)\n \n+ # see cupy#3017\n+ @testing.for_dtypes('bBhH')",
"line": null,
"original_line": 35,
"original_start_line": null,
"path": "tests/cupy_tests/indexin... | bf559ebb5ee66ecd0d1e73cff3f797d64a1732c0 | diff --git a/cupy/core/_routines_indexing.pyx b/cupy/core/_routines_indexing.pyx
index 46b1b4c42c6..e5c72355f67 100644
--- a/cupy/core/_routines_indexing.pyx
+++ b/cupy/core/_routines_indexing.pyx
@@ -389,7 +389,8 @@ out = a[out_i];
_take_kernel = ElementwiseKernel(
- 'raw T a, S indices, uint32 ldim, uint32 cd... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-3088@41bbe7a | cupy/cupy | Python | 3,088 | Fix condition to use slice copy in ndarray.__setitem__ | Fix #3013 .
This PR fixes the condition to use CUPY_EXPERIMENTAL_SLICE_COPY feature in `ndarray.__setitem__` to check if the supplied `slices` is a slice object. | 2020-02-18T06:51:11Z | [Bug] Mask assignment throws an error when CUPY_EXPERIMENTAL_SLICE_COPY=1
An error occurs when setting CUPY_EXPERIMENTAL_SLICE_COPY = 1
- CuPy version: 6.6.0
- OS/Platform: Ubuntu 16.04.6 LTS
- CUDA version: 10.0
* Code to reproduce
```
import os
os.environ["CUPY_EXPERIMENTAL_SLICE_COPY"] = "1"
import... | @pentschev Thanks!
Thanks for the reporting. I reproduced the issue, let me check its detail.
When CUPY_EXMERIMENTAL_SLICE_COPY is enabled, a comparison ufunc is invoked between a ndarray and a slicing object in the following line, causing the type error above:
https://github.com/cupy/cupy/blob/9da978ba0b4fa0605d475... | [
{
"body": "An error occurs when setting CUPY_EXPERIMENTAL_SLICE_COPY = 1\r\n\r\n - CuPy version: 6.6.0\r\n - OS/Platform: Ubuntu 16.04.6 LTS\r\n - CUDA version: 10.0\r\n\r\n* Code to reproduce\r\n```\r\nimport os\r\nos.environ[\"CUPY_EXPERIMENTAL_SLICE_COPY\"] = \"1\"\r\nimport cupy as cp\r\n\r\na = cp.array... | c704320a3d6e36a0067a8a28195545ec37fa334c | {
"head_commit": "41bbe7aceddfd72d127c2337cf2c0b12926ec203",
"head_commit_message": "Flake8",
"patch_to_review": "diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx\nindex 5d2a88b1cf4..7eb0f4ee9e3 100644\n--- a/cupy/core/core.pyx\n+++ b/cupy/core/core.pyx\n@@ -1233,10 +1233,13 @@ cdef class ndarray:\n ... | [
{
"diff_hunk": "@@ -1233,11 +1233,13 @@ cdef class ndarray:\n array([9998., 9999.])\n \n \"\"\"\n- if (util.ENABLE_SLICE_COPY and\n- type(slices) is slice and slices == slice(None, None, None) and\n- isinstance(value, numpy.ndarray)):\n- if (self.dtype... | d8fa1105f16146022365b06ebfbb11e9da4e1799 | diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx
index 5d2a88b1cf4..a5a9156e438 100644
--- a/cupy/core/core.pyx
+++ b/cupy/core/core.pyx
@@ -1233,10 +1233,12 @@ cdef class ndarray:
array([9998., 9999.])
"""
- if (util.ENABLE_SLICE_COPY and slices == slice(None, None, None) and
- ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-2973@b7d7087 | cupy/cupy | Python | 2,973 | Disallow boolean `negative` | Close #692. | 2020-01-17T10:53:26Z | Negative operation for a boolean array is forbidden in NumPy
In NumPy negative operation for a boolean array is forbidden.
```
>>> -numpy.array([True])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: The numpy boolean negative, the `-` operator, is not supported, use the `~` ope... | Related to this issue, NumPy raises DeprecationWarning for boolean subtract operation, which causes test failure (via pytest-warning).
```
>>> x = np.array([True])
>>> x - x
__main__:1: DeprecationWarning: numpy boolean subtract, the `-` operator, is deprecated, use the bitwise_xor, the `^` operator, or the logic... | [
{
"body": "In NumPy negative operation for a boolean array is forbidden.\r\n```\r\n>>> -numpy.array([True])\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nTypeError: The numpy boolean negative, the `-` operator, is not supported, use the `~` operator or the logical_not funct... | 043a845d1b9aa104644284cf0ab8b9645dcdd619 | {
"head_commit": "b7d70877054e30cd6b6c10b3783f58c2d9c1e91b",
"head_commit_message": "fix import",
"patch_to_review": "diff --git a/cupy/core/_kernel.pyx b/cupy/core/_kernel.pyx\nindex 4ce74a4dadc..0fa6f2f3006 100644\n--- a/cupy/core/_kernel.pyx\n+++ b/cupy/core/_kernel.pyx\n@@ -1115,16 +1115,18 @@ cdef class _Ops... | [
{
"diff_hunk": "@@ -1115,16 +1115,18 @@ cdef class _Ops:\n cdef _Ops from_tuples(object ops, routine):\n ops_ = []\n for t in ops:\n- if isinstance(t, _Op):\n- ops_.append(t)\n- elif isinstance(t, tuple):\n+ if isinstance(t, tuple):\n ... | b8e2ade2b1192d5dc7cfd9825ed0038971686e94 | diff --git a/cupy/core/_kernel.pyx b/cupy/core/_kernel.pyx
index 4ce74a4dadc..89a9dedbd98 100644
--- a/cupy/core/_kernel.pyx
+++ b/cupy/core/_kernel.pyx
@@ -1115,16 +1115,18 @@ cdef class _Ops:
cdef _Ops from_tuples(object ops, routine):
ops_ = []
for t in ops:
- if isinstance(t, _Op):... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-5284@60a39ef | deepset-ai/haystack | Python | 5,284 | fix: Improve robustness of get_task HF pipeline invocations | ### Related Issues
- fixes #4848
### Proposed Changes:
Before this fix, the HF invocation layer was tested early which caused the process not to reach the correct invocation layer check if the HF servers were unresponsive. This PR changes the invocation order so HF is checked later and adds a timeout of 1s so i... | 2023-07-06T09:46:09Z | Improve robustness of get_task HF pipeline invocations
**Is your feature request related to a problem? Please describe.**
As a Haystack user, I noticed that when HF infra is temp down I can't use a newly added Cohere model. The issue has been traced to the `PromptModelInvocationLayer.supports` invocation order. Becaus... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nAs a Haystack user, I noticed that when HF infra is temp down I can't use a newly added Cohere model. The issue has been traced to the `PromptModelInvocationLayer.supports` invocation order. Because HFLocalInvocationLayer is listed... | ac412193ccca1abd624d9df67fe484146a39db43 | {
"head_commit": "60a39ef3c3b20ef3b65de872128a469553394e03",
"head_commit_message": "Merge branch 'main' into fix-invocation-layer-hf-timeout",
"patch_to_review": "diff --git a/haystack/nodes/prompt/invocation_layer/__init__.py b/haystack/nodes/prompt/invocation_layer/__init__.py\nindex 72df2edfda..a50aafc082 100... | [
{
"diff_hunk": "@@ -43,6 +43,15 @@ def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwa\n stop_result = torch.isin(self.stop_words[\"input_ids\"], input_ids[-1])\n return any(all(stop_word) for stop_word in stop_result)\n \n+ def get_task(model: str, use_au... | b7d6b96638bc49d26c1e02b1b4db5649ec61a390 | diff --git a/haystack/nodes/prompt/invocation_layer/__init__.py b/haystack/nodes/prompt/invocation_layer/__init__.py
index 72df2edfda..a50aafc082 100644
--- a/haystack/nodes/prompt/invocation_layer/__init__.py
+++ b/haystack/nodes/prompt/invocation_layer/__init__.py
@@ -3,10 +3,10 @@
from haystack.nodes.prompt.invocat... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
dask__dask-8533@8e884db | dask/dask | Python | 8,533 | Add dask.dataframe.series.view() | - [x] Closes #8439
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files` | 2022-01-05T11:52:26Z | Series / DataFrame view method not implemented.
When attempting to convert a column from one dtype to another using `astype`, there is a `FutureWarning` raised by Dask and Pandas regarding the move to using `view`.
Pandas suggests replacing the `astype` method with `view`, however `view` appears not to be implemente... | Thanks for raising this @ocqco . It looks like this deprecation was added in [pandas 1.3.0](https://pandas.pydata.org/docs/whatsnew/v1.3.0.html#other-deprecations). I also see some heartache downstream related to this in holoviews: https://github.com/holoviz/holoviews/issues/5146.
I don't *think* it would be hugely ... | [
{
"body": "When attempting to convert a column from one dtype to another using `astype`, there is a `FutureWarning` raised by Dask and Pandas regarding the move to using `view`.\r\n\r\nPandas suggests replacing the `astype` method with `view`, however `view` appears not to be implemented in `dask.dataframe.core... | e4799c0498b5e5877705bb5542d8d01116ee1320 | {
"head_commit": "8e884db34436ea6763289d1f8651b7ba2fdba73c",
"head_commit_message": "black reformat",
"patch_to_review": "diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py\nindex 3a1e517b541..5f2dcc100fa 100644\n--- a/dask/dataframe/core.py\n+++ b/dask/dataframe/core.py\n@@ -3839,6 +3839,10 @@ def is_m... | [
{
"diff_hunk": "@@ -3839,6 +3839,10 @@ def is_monotonic_decreasing(self):\n token=\"monotonic_decreasing\",\n )\n \n+ @derived_from(pd.Series)\n+ def view(self, dtype):\n+ return self.map_partitions(M.view, dtype, enforce_metadata=False)",
"line": null,
"original_line": ... | 5bc0d936f9f5898dfa27e65deabe62b8f88294ab | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 3a1e517b541..71dff1751a0 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -3839,6 +3839,11 @@ def is_monotonic_decreasing(self):
token="monotonic_decreasing",
)
+ @derived_from(pd.Series)
+ def view(self,... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-2872@158ac6a | cupy/cupy | Python | 2,872 | Fix `argmin`/`argmax` `dtype` argument | Fixes #2595
Requires #2870
| 2019-12-24T10:53:19Z | Signatures and behaviors of `argmax` and `argmin` are incompatible with NumPy
First, for the signature: In CuPy the signature for `argmax()` and `argmin()` is
```python
cupy.argm*(a, axis=None, dtype=None, out=None, keepdims=False)
```
But in NumPy it's
```python
numpy.argm*(a, axis=None, out=None)
```
That i... | From my viewpoint, I don't mind at all such deviations. I think it'd help more use cases. Rather than fixing them, I think documenting them clearly is enough. But it's not my call 😄
Although the `dtype` argument is provided in argmin/argmax in CuPy, isn't it broken for anything except `dtype=None`?.
At least when ... | [
{
"body": "First, for the signature: In CuPy the signature for `argmax()` and `argmin()` is \r\n```python\r\ncupy.argm*(a, axis=None, dtype=None, out=None, keepdims=False)\r\n```\r\nBut in NumPy it's \r\n```python\r\nnumpy.argm*(a, axis=None, out=None)\r\n```\r\nThat is, `dtype` and `keepdims` should be removed... | 06972b52781b76d5785c5ad1160afc8864593f6c | {
"head_commit": "158ac6ad108a7b609b169c4d6c5880fee0f1718b",
"head_commit_message": "Fix argmin/argmax dtype argument",
"patch_to_review": "diff --git a/cupy/core/_routines_statistics.pyx b/cupy/core/_routines_statistics.pyx\nindex 6ebd5b070c9..c1f08cbfdad 100644\n--- a/cupy/core/_routines_statistics.pyx\n+++ b/c... | [
{
"diff_hunk": "@@ -206,27 +206,27 @@ nanmax = create_reduction_func(\n \n cdef _argmin = create_reduction_func(\n 'cupy_argmin',\n- ('?->q', 'B->q', 'h->q', 'H->q', 'i->q', 'I->q', 'l->q', 'L->q',\n- 'q->q', 'Q->q',\n- ('e->q', (None, 'my_argmin_float(a, b)', None, None)),\n- ('f->q', (None,... | ecb3e72254e494727f126beed56629f7ceaa21b3 | diff --git a/cupy/core/_routines_statistics.pyx b/cupy/core/_routines_statistics.pyx
index 6ebd5b070c9..e2097609987 100644
--- a/cupy/core/_routines_statistics.pyx
+++ b/cupy/core/_routines_statistics.pyx
@@ -206,13 +206,13 @@ nanmax = create_reduction_func(
cdef _argmin = create_reduction_func(
'cupy_argmin',
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-2802@f61b9a7 | cupy/cupy | Python | 2,802 | Avoid looking up null pointers' attributes | Follow-up of #2611. Close #2789.
This PR fixes the consumer side (while #2611 fixed the producer side) for handling zero-size arrays.
cc: @jakirkham | 2019-12-12T09:11:59Z | `__cuda_array_interface__ ` with `NULL` pointer fails to convert to CuPy array
Recently ran into an issue with CuPy's `__cuda_array_interface__` conversion support where it fails if it holds a `NULL` pointer for the data. Here's an example using an existing CuPy array. Though this happens with any `__cuda_array_interfa... | Thanks, @jakirkham. This was my oversight when fixing it in #2611. As we discussed elsewhere, in this case `ptr = 0` is used as a flag to prevent from looking up the pointer attribute.
Are you able to create a PR to fix this? It should just be a simple one liner `if ptr > 0: ...` added to `cupy.cuda.memory.UnownedM... | [
{
"body": "Recently ran into an issue with CuPy's `__cuda_array_interface__` conversion support where it fails if it holds a `NULL` pointer for the data. Here's an example using an existing CuPy array. Though this happens with any `__cuda_array_interface__` supporting object that holds a `NULL` pointer. \r\n\r\... | f121d14f6d3d2f5b25a58f26d2f8bca40dd10812 | {
"head_commit": "f61b9a72c61a4699f72568c8ac26164a01e6241f",
"head_commit_message": "apply https://github.com/cupy/cupy/pull/2802#issuecomment-565037306",
"patch_to_review": "diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx\nindex 7eb451ec4f5..cdfa5338898 100644\n--- a/cupy/core/core.pyx\n+++ b/cupy/core/core... | [
{
"diff_hunk": "@@ -122,9 +122,14 @@ cdef class UnownedMemory(BaseMemory):\n def __init__(self, intptr_t ptr, size_t size, object owner,\n int device_id=-1):\n cdef runtime.PointerAttributes ptr_attrs\n+ # ptr=0 for 0-size arrays from __cuda_array_interface__ v2:\n+ # ... | 230e83af650aa3258a5f5e9dde220648b23d1372 | diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx
index 7eb451ec4f5..dfe63058f2c 100644
--- a/cupy/core/core.pyx
+++ b/cupy/core/core.pyx
@@ -2776,13 +2776,16 @@ not_equal = create_comparison(
cpdef ndarray _convert_object_with_cuda_array_interface(a):
cdef Py_ssize_t sh, st
- desc = a.__cuda_array_interf... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-8522@d5a3699 | dask/dask | Python | 8,522 | Add groupby shift method | - [x] Closes #7095
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
I have to implemented the shift `method` following the `transform` and `apply` methods. Let me know if you'd like any changes/improvements. | 2022-01-01T20:42:30Z | Groupby shift
I'd like to be able to use `shift` on groupby Series and DataFrame objects to create per-group lag or lead columns. Today, I can do this in pandas but not Dask.
```python
import pandas as pd
import dask.dataframe as dd
pdf = pd.DataFrame({
"a": [0,1,0,1,1,0],
"b": range(6),
"c": ["... | That seems like a reasonable feature request. Are you interested in working on it? In the meantime I wonder if `map_overlap` could suit your needs.
Thanks for the suggestion! I'll take a look at map_overlap.
I don't have the bandwidth to work on the implementation at the moment, but may in the future.
FYI, cuDF rece... | [
{
"body": "I'd like to be able to use `shift` on groupby Series and DataFrame objects to create per-group lag or lead columns. Today, I can do this in pandas but not Dask.\r\n\r\n```python\r\nimport pandas as pd\r\nimport dask.dataframe as dd\r\n\r\npdf = pd.DataFrame({\r\n \"a\": [0,1,0,1,1,0],\r\n \"b\... | e4799c0498b5e5877705bb5542d8d01116ee1320 | {
"head_commit": "d5a369970ab8c9638ac3e2ec6957d56e23a197c7",
"head_commit_message": "remove groupby shift example that fails doctest\n\nprovide meta for doc example",
"patch_to_review": "diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py\nindex efe9206010f..4042e0d63c1 100644\n--- a/dask/dataframe... | [
{
"diff_hunk": "@@ -1800,6 +1813,94 @@ def transform(self, func, *args, **kwargs):\n \n return df3\n \n+ @insert_meta_param_description(pad=12)\n+ def shift(self, periods=1, freq=None, axis=0, fill_value=None, meta=no_default):\n+ \"\"\"Parallel version of pandas GroupBy.shift\n+\n+ ... | aa1fbdaf340e9f39723e128ebbaf9279e705c5a5 | diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
index efe9206010f..d75055f111d 100644
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -188,6 +188,19 @@ def _groupby_slice_transform(
return g.transform(func, *args, **kwargs)
+def _groupby_slice_shift(
+ df, grouper, key,... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-5261@d54a953 | deepset-ai/haystack | Python | 5,261 | feat: extend `pipeline.add_component` to support stores | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/5238
- blocked by #5259
### Proposed Changes:
- Changes the API of v2 Pipelines with respect to connecting docstores with components (see the issue for usage examples). The old API left all responsibility to the components, while the ne... | 2023-07-03T16:07:20Z | Change docstore connection in pipelines preview
Connecting components to their own document stores is right now responsibility of the component. Let's shift that on the pipeline instead.
To achieve it, let's change:
```python
search_pipe.add_component("retriever", MemoryRetriever(document_store_name="docstore"))... | [
{
"body": "Connecting components to their own document stores is right now responsibility of the component. Let's shift that on the pipeline instead.\r\n\r\nTo achieve it, let's change:\r\n\r\n```python\r\nsearch_pipe.add_component(\"retriever\", MemoryRetriever(document_store_name=\"docstore\"))\r\n```\r\n\r\n... | 237d67dbfd89e4253ece7e3ca2e6c65a293e68c7 | {
"head_commit": "d54a953bcb454d9cde1e1629481d0db22ca1b442",
"head_commit_message": "pylint",
"patch_to_review": "diff --git a/haystack/preview/components/retrievers/memory.py b/haystack/preview/components/retrievers/memory.py\nindex 54d0ce8b5d..43c52d169c 100644\n--- a/haystack/preview/components/retrievers/memo... | [
{
"diff_hunk": "",
"line": null,
"original_line": null,
"original_start_line": null,
"path": "haystack/preview/document_stores/mixins.py",
"start_line": null,
"text": "@user1:\nWe don't need the `Protocol`s in this case.\r\nThe interface is already implemented by the `Mixin`s.\n\n@author... | e5ccad937eacb78aea6bdfd40286fec42da40b64 | diff --git a/haystack/preview/components/retrievers/memory.py b/haystack/preview/components/retrievers/memory.py
index 1e3171b53a..63de5b0690 100644
--- a/haystack/preview/components/retrievers/memory.py
+++ b/haystack/preview/components/retrievers/memory.py
@@ -1,72 +1,67 @@
from typing import Dict, List, Any, Option... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
cupy__cupy-2725@9497105 | cupy/cupy | Python | 2,725 | keepdims should always preserve all dimensions in CUB-based reductions | closes #2720
The bug is fixed by the lines computing `out_shape` within `device_reduce`.
In order to avoid multiple calls to `_get_axis`, I moved the `_get_axis` call outside of `_preprocess_array` and call it directly in `_routines_math.pyx` and `_routines_statistics.pyx` instead. The duplicate logic could poten... | 2019-11-27T16:05:03Z | inconsistent behavior of keepdims for CUB-based reductions
It appears that keepdims does not keep all of the reduction dimensions when CUB is enabled and axis is a tuple containing more than one axis.
* Conditions (you can just paste the output of `python -c 'import cupy; cupy.show_config()'`)
```
CuPy Version ... | actually the behavior is as above only for `sum`, `min` and `max`
For `argmin` and `argmax` the CUB case gives shape `()` instead( while non-CUB is still (1, 1) as expected)
The issue is within `device_reduce` rather than `device_segmented_reduce`.
This can be confirmed by using `axis=(1, 0)` instead of `axis=(0... | [
{
"body": "It appears that keepdims does not keep all of the reduction dimensions when CUB is enabled and axis is a tuple containing more than one axis.\r\n\r\n* Conditions (you can just paste the output of `python -c 'import cupy; cupy.show_config()'`)\r\n```\r\nCuPy Version : 7.0.0rc1 (build from ma... | 6e60e4a32adda817b394b028f91bb53b03f2756e | {
"head_commit": "94971057762ddfd3c7b405b16f4c58c2694f8d3c",
"head_commit_message": "remove unused import",
"patch_to_review": "diff --git a/cupy/core/_reduction.pyx b/cupy/core/_reduction.pyx\nindex 7933d1cfc01..2f2420e6f80 100644\n--- a/cupy/core/_reduction.pyx\n+++ b/cupy/core/_reduction.pyx\n@@ -109,7 +109,7 ... | [
{
"diff_hunk": "@@ -126,10 +132,19 @@ def test_sum_dtype(self, xp, src_dtype, dst_dtype):\n a = testing.shaped_arange((2, 3, 4), xp, src_dtype)\n return a.sum(dtype=dst_dtype)\n \n+ @testing.for_all_dtypes_combination(names=['src_dtype', 'dst_dtype'])\n+ @testing.numpy_cupy_allclose()\n+ ... | a4bba42a99bbd0e32e1bcb3a2efc9a8bf4006661 | diff --git a/cupy/core/_reduction.pyx b/cupy/core/_reduction.pyx
index 7933d1cfc01..2f2420e6f80 100644
--- a/cupy/core/_reduction.pyx
+++ b/cupy/core/_reduction.pyx
@@ -109,7 +109,7 @@ extern "C" __global__ void ${name}(${params}) {
cpdef tuple _get_axis(object axis, Py_ssize_t ndim):
cdef Py_ssize_t dim
if ... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-2646@c130327 | cupy/cupy | Python | 2,646 | Add support of complex dtypes for `sinc` | Closes #2645
`sinpi` is a cuda only function that does not have an equivalent in thrust for complex numbers.
Note that the original numpy implementation uses the product of pi instead of an optimized sin.
Question:
Should we split the routines using a dispatcher, as the ufuncs doesnt seem to support overloadin... | 2019-11-18T01:52:14Z | cp.sinc fails for complex input
Unlike the numpy version, `cupy.sinc` fails on complex inputs:
```python
>>> np.sinc(1j)
(3.676077910374978+0j)
>>> cp.sinc(1j)
TypeError Traceback (most recent call last)
----> 1 cp.sinc(1j)
cupy/core/_kernel.pyx in cupy.core._kernel.ufunc.__call... | [
{
"body": "Unlike the numpy version, `cupy.sinc` fails on complex inputs:\r\n\r\n```python\r\n>>> np.sinc(1j)\r\n(3.676077910374978+0j)\r\n>>> cp.sinc(1j)\r\nTypeError Traceback (most recent call last)\r\n----> 1 cp.sinc(1j)\r\ncupy/core/_kernel.pyx in cupy.core._kernel.ufunc.__c... | 59e6c2b2e0c722b09c7a7af13f908942ef7806cc | {
"head_commit": "c130327ac499960a9ee3425b8ad1ee28a1391388",
"head_commit_message": "Per dtype implementations",
"patch_to_review": "diff --git a/cupy/math/special.py b/cupy/math/special.py\nindex 1631962db88..345dabed221 100644\n--- a/cupy/math/special.py\n+++ b/cupy/math/special.py\n@@ -12,7 +12,12 @@\n \n \n s... | [
{
"diff_hunk": "@@ -12,7 +12,12 @@\n \n \n sinc = core.create_ufunc(\n- 'cupy_sinc', ('e->e', 'f->f', 'd->d'),\n+ 'cupy_sinc',\n+ ('e->e', 'f->f', 'd->',",
"line": null,
"original_line": 16,
"original_start_line": null,
"path": "cupy/math/special.py",
"start_line": null,
"text":... | 2a8fff9ef74bd473d2817ecd88d533d95886e7d7 | diff --git a/cupy/math/special.py b/cupy/math/special.py
index 1631962db88..36fdd0d4c3a 100644
--- a/cupy/math/special.py
+++ b/cupy/math/special.py
@@ -12,7 +12,12 @@
sinc = core.create_ufunc(
- 'cupy_sinc', ('e->e', 'f->f', 'd->d'),
+ 'cupy_sinc',
+ ('e->e', 'f->f', 'd->d',
+ ('F->F', 'in0_type pi_i... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
deepset-ai__haystack-5163@c957d61 | deepset-ai/haystack | Python | 5,163 | fix: Check Agent's prompt template variables and prompt resolver parameters are aligned | ### Proposed Changes:
**What?**
* Introduced a method check_prompt_template that validates the PromptTemplate against the parameters supplied by the prompt parameter resolver
* Implemented logging of a detailed error message if ReAct-based agents' PromptTemplate does not contain `{transcript}` variable
* A debug ... | 2023-06-18T11:48:49Z | Haystack v1.17 introduces {transcript} at end of ReAct Agents
We noticed that the latest Haystack release introduces a setup where a user now needs to add a `{transcript}` at the end of a prompt, which we used to not require to do manually. This would break any custom agent prompt out there as of v1.17
One other con... | Requiring `{transcript}` was added here: https://github.com/deepset-ai/haystack/pull/4931 | [
{
"body": "We noticed that the latest Haystack release introduces a setup where a user now needs to add a `{transcript}` at the end of a prompt, which we used to not require to do manually. This would break any custom agent prompt out there as of v1.17\r\n\r\nOne other concern/understanding issue @bilgeyucel br... | f52477d31b348e55d342150ade22ff55318ca50f | {
"head_commit": "c957d61410f326ab856eab2dc21fd0f80a76f33b",
"head_commit_message": "Check Agent's prompt template parameters and prompt resolver parameters are aligned",
"patch_to_review": "diff --git a/haystack/agents/base.py b/haystack/agents/base.py\nindex 4b0eeba8ef..3a9a32809a 100644\n--- a/haystack/agents/... | [
{
"diff_hunk": "@@ -427,3 +425,32 @@ def prepare_data_for_memory(self, **kwargs) -> dict:\n return {\n k: v if isinstance(v, str) else next(iter(v)) for k, v in kwargs.items() if isinstance(v, (str, Iterable))\n }\n+\n+ def check_prompt_template(self, template_params: Dict[str, An... | 55d701a19d5895e131bea880ef3d5a426b3e9005 | diff --git a/haystack/agents/base.py b/haystack/agents/base.py
index 4b0eeba8ef..aa5f11a0f0 100644
--- a/haystack/agents/base.py
+++ b/haystack/agents/base.py
@@ -401,17 +401,15 @@ def _plan(self, query, current_step):
# first resolve prompt template params
template_params = self.prompt_parameters_res... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
dask__dask-8432@a7dff84 | dask/dask | Python | 8,432 | Fix docs build warnings | - [X] Fixes #5610
- [X] Tests added / passed
- [X] Passes `pre-commit run --all-files`
Fixes all remaining docs build warnings via the following changes:
- Change `array` to `Array` in Array API docs page
- Set `:noindex:` option on `.. autofunction:: map_overlap` and `.. autoclass:: Pub` to avoid duplicate ob... | 2021-11-30T04:17:41Z | Clean up warnings in doc build
Right now our doc build has many warnings. This makes it hard to catch newly introduced errors in the doc build. Sphinx has an option to elevate warnings to errors.
In the details, I've included some warnings from a recent local build
<details>
```
/Users/taugspurger/miniconda3/... | Just wanted to drop a note here that there are still many docs warnings https://readthedocs.org/api/v2/build/13290377.txt for example
There are a few warnings, such as:
> /home/docs/checkouts/readthedocs.org/user_builds/dask/checkouts/7419/docs/source/scheduler-overview.rst: WARNING: document isn't included in any t... | [
{
"body": "Right now our doc build has many warnings. This makes it hard to catch newly introduced errors in the doc build. Sphinx has an option to elevate warnings to errors.\r\n\r\nIn the details, I've included some warnings from a recent local build\r\n\r\n<details>\r\n\r\n```\r\n/Users/taugspurger/miniconda... | a5aecac8313fea30c5503f534c71f325b1775b9c | {
"head_commit": "a7dff845dd868d7dbd44b4aff7a2f99a04377f16",
"head_commit_message": "Avoid duplicate reference",
"patch_to_review": "diff --git a/docs/Makefile b/docs/Makefile\nindex 2860b0f8bbd..7e91843cec3 100644\n--- a/docs/Makefile\n+++ b/docs/Makefile\n@@ -2,7 +2,7 @@\n #\n \n # You can set these variables f... | [
{
"diff_hunk": "@@ -30,7 +30,7 @@ Top level functions\n argtopk\n argwhere\n around\n- array\n+ Array",
"line": null,
"original_line": 33,
"original_start_line": null,
"path": "docs/source/array-api.rst",
"start_line": null,
"text": "@user1:\nWas this giving a warning before... | 3770a64957ff20f15976b606db17666bf8d1b3ec | diff --git a/docs/Makefile b/docs/Makefile
index 2860b0f8bbd..7e91843cec3 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -2,7 +2,7 @@
#
# You can set these variables from the command line.
-SPHINXOPTS =
+SPHINXOPTS = -W --keep-going
SPHINXBUILD = sphinx-build
PYTEST = pytest
PAPER =
dif... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Documentation Updates"
} |
dbt-labs__dbt-core-11795@9c8a69c | dbt-labs/dbt-core | Python | 11,795 | Create and protect dbt engine environment variable namespace via prefix `DBT_ENGINE` | Resolves #11340
### Problem
Any time we added a new dbt engine environment variable using the `DBT_` environment variable (like `DBT_SAMPLE`) we were potentially _breaking_ projects that already has a custom environment variable for their own purposes which the same name. We _need_ to be able to add new environme... | 2025-07-03T22:52:44Z | Deprecate unconstrained user space of environment variables
# Problem
The current environment variable landscape is that:
1. All core defined env vars are prefixed with `DBT_`
2. Core users can create custom environment variables with any name
3. Cloud users must create env vars with the `DBT_` prefix
The issue is tha... | [
{
"body": "# Problem\nThe current environment variable landscape is that:\n1. All core defined env vars are prefixed with `DBT_`\n2. Core users can create custom environment variables with any name\n3. Cloud users must create env vars with the `DBT_` prefix\n\nThe issue is that whenever we add a new core define... | e1c98e8123fc271e3ff36b10c3bdf19d2566fa00 | {
"head_commit": "9c8a69c9ac3c4af6f3e1c2cb81c1b28234ea6b98",
"head_commit_message": "Get the env vars from the invocation context in `validate_engine_env_vars`",
"patch_to_review": "diff --git a/.changes/unreleased/Features-20250703-175341.yaml b/.changes/unreleased/Features-20250703-175341.yaml\nnew file mode 10... | [
{
"diff_hunk": "@@ -0,0 +1,61 @@\n+from dataclasses import dataclass\n+from typing import List, Optional\n+\n+from dbt.cli import params\n+from dbt.deprecations import warn\n+from dbt_common.constants import ENGINE_ENV_PREFIX\n+from dbt_common.context import get_invocation_context\n+\n+# These are env vars that... | a077aa9e0d9e24dd66f92a63370d224ee3a765f4 | diff --git a/.changes/unreleased/Features-20250703-175341.yaml b/.changes/unreleased/Features-20250703-175341.yaml
new file mode 100644
index 00000000000..a1048342772
--- /dev/null
+++ b/.changes/unreleased/Features-20250703-175341.yaml
@@ -0,0 +1,6 @@
+kind: Features
+body: Create constrained namespace for dbt engine ... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
deepset-ai__haystack-5205@b596443 | deepset-ai/haystack | Python | 5,205 | fix: Support all SageMaker HF text generation models (other than Falcon) | ### What?
We are introducing a new class, `SageMakerHFInferenceInvocationLayer`, which supports a variety of Hugging Face text generation models including: MPT, Dolly V2, Flan-U2, Flan-T5, RedPajama, Open Llama, GPT-J-6B and others.
- fixes #5201
### Why?
During our continuous testing of the PromptNode and Sage... | 2023-06-25T21:42:31Z | MPT models from SageMaker
I've been trying to use the new MPT models via the newly merged SageMaker invocation layer. However, I get an error because there are some differences in what the MPT models expect in the payload in comparison to e.g.: falcon (which I believe is what was used to test the SageMaker invocation l... | [
{
"body": "I've been trying to use the new MPT models via the newly merged SageMaker invocation layer. However, I get an error because there are some differences in what the MPT models expect in the payload in comparison to e.g.: falcon (which I believe is what was used to test the SageMaker invocation layer).\... | eb2255c0dd756d95a64b389bc984ebffa2c2fa8c | {
"head_commit": "b596443d1ac2dca7a5b8d478b6e99d7bb7af5b93",
"head_commit_message": "Improve PyDoc regarding JSON payload format testing",
"patch_to_review": "diff --git a/haystack/nodes/prompt/invocation_layer/__init__.py b/haystack/nodes/prompt/invocation_layer/__init__.py\nindex 535cd9264c..72df2edfda 100644\n... | [
{
"diff_hunk": "@@ -0,0 +1,176 @@\n+import json\n+import logging\n+from abc import abstractmethod, ABC\n+from typing import Optional, Dict, Union, List, Any\n+\n+\n+from haystack.errors import SageMakerConfigurationError\n+from haystack.lazy_imports import LazyImport\n+from haystack.nodes.prompt.invocation_laye... | c36455be8428b49da67f4ed50242b9e4f034d7c3 | diff --git a/haystack/nodes/prompt/invocation_layer/__init__.py b/haystack/nodes/prompt/invocation_layer/__init__.py
index 535cd9264c..72df2edfda 100644
--- a/haystack/nodes/prompt/invocation_layer/__init__.py
+++ b/haystack/nodes/prompt/invocation_layer/__init__.py
@@ -8,4 +8,5 @@
from haystack.nodes.prompt.invocatio... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-2551@57790f9 | cupy/cupy | Python | 2,551 | Support cuComplex.h in `cupy.RawKernel` and `cupy.RawModule` | Closes #1866. Closes #2111.
Previously the support of complex numbers in `cupy.RawKernel` (and thus `cupy.RawModule`) was poorly documented, see https://github.com/cupy/cupy/pull/1866#issuecomment-457791608 and #2111 for example. This PR aims to solve this problem once and for all. This PR supersedes #1866.
The s... | 2019-10-18T04:47:10Z | Use complex number in cupy.RawKernel
Hi!
I wonder what is the native/suggested way to use complex numbers in Cupy.RawKernel?
I was using `#include<cuComplex.h>` until I got an error on my newly installed cupy on another computer. I scrambled through your code and it seems to me that the preferred way is to use `#... | See #1866 for some discussion of this and an example
@grlee77 Fantastic. Hope that PR got merged soon. | [
{
"body": "Hi!\r\n\r\nI wonder what is the native/suggested way to use complex numbers in Cupy.RawKernel?\r\n\r\nI was using `#include<cuComplex.h>` until I got an error on my newly installed cupy on another computer. I scrambled through your code and it seems to me that the preferred way is to use `#include<cu... | b2404c95c44f98b25c5d051a024fcffd6e11f58e | {
"head_commit": "57790f9bbd531577511ce183f6173bb904c59106",
"head_commit_message": "apply review from https://github.com/cupy/cupy/pull/2551#discussion_r344032104",
"patch_to_review": "diff --git a/cupy/core/carray.pxi b/cupy/core/carray.pxi\nindex fdc57ba2299..f42a8b3a63f 100644\n--- a/cupy/core/carray.pxi\n+++... | [
{
"diff_hunk": "@@ -6,6 +6,7 @@ cdef class RawKernel:\n readonly tuple options\n object _kernel\n readonly str backend\n+ bint cuComplex",
"line": null,
"original_line": 9,
"original_start_line": null,
"path": "cupy/core/raw.pxd",
"start_line": null,
"text"... | 0ff24d75402789a8ce7c832fed77aad2fe43e664 | diff --git a/cupy/core/carray.pxi b/cupy/core/carray.pxi
index fdc57ba2299..0209f37a40e 100644
--- a/cupy/core/carray.pxi
+++ b/cupy/core/carray.pxi
@@ -1,4 +1,5 @@
import os
+import re
from cupy import cuda
@@ -122,9 +123,30 @@ cpdef str _get_header_source():
return _header_source
+# added at the module... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-2491@77ef6ab | cupy/cupy | Python | 2,491 | Update `__cuda_array_interface__` to protocol version 2 | Closes #2462.
This PR is a parallel effort of the upstream PR numba/numba#4609. Although this PR is ready, it is marked as WIP and please do not review or merge until that one is approved. I will ensure any changes there to be reflected here as well.
In the proposed v2 protocol, the `strides` field is made mand... | 2019-09-25T04:59:47Z | __cuda_array_interface__ doesn't include always strides
The current `__cuda_array_interface__` implementation doesn't include strides for `c_contiguous`. Even though it's obvious what the strides are in that case, it would be useful to have them there, in particular since there's no information on contiguity in that in... | AFAIK, it's not included because `strides` is, as you said, obvious when `c_contiguous`. Plus in this situation `strides` is explicitly marked as "optional" in the Numba's doc on `__cuda_array_interface__`. IMHO CuPy is compliant while Numba isn't (numba/numba#4175 is a "counter-issue" of this one). Can't Dask assume t... | [
{
"body": "The current `__cuda_array_interface__` implementation doesn't include strides for `c_contiguous`. Even though it's obvious what the strides are in that case, it would be useful to have them there, in particular since there's no information on contiguity in that interface.\r\n\r\nWould there be any ob... | f2ef649cafa0553945553bc031f4d4d5aec19a55 | {
"head_commit": "77ef6ab019b65337dca398c5ac6b410db53ce043",
"head_commit_message": "update cuda array interface to v2",
"patch_to_review": "diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx\nindex 143b2ccb238..9b6cf5f6dc3 100644\n--- a/cupy/core/core.pyx\n+++ b/cupy/core/core.pyx\n@@ -142,9 +142,11 @@ cdef cl... | [
{
"diff_hunk": "@@ -2743,14 +2745,23 @@ not_equal = create_comparison(\n cpdef ndarray _convert_object_with_cuda_array_interface(a):\n cdef Py_ssize_t sh, st\n desc = a.__cuda_array_interface__\n+ # TODO(leofang): enforce compliance to the latest protocol?\n shape = desc['shape']\n dtype = nu... | 925ed8680451a3c0417b157087f738a75fa6d4d6 | diff --git a/cupy/core/core.pyx b/cupy/core/core.pyx
index 143b2ccb238..8c03767b320 100644
--- a/cupy/core/core.pyx
+++ b/cupy/core/core.pyx
@@ -142,9 +142,11 @@ cdef class ndarray:
'typestr': self.dtype.str,
'descr': self.dtype.descr,
'data': (self.data.ptr, False),
- ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-8341@ac5f45f | dask/dask | Python | 8,341 | Use blockwise in `single_partition_join` | ~Blocked by https://github.com/dask/dask/issues/8338~
- [ ] Closes #8306
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
| 2021-11-03T23:37:32Z | Use Blockwise/`map_partitions` in various DataFrame join methods
I noticed that some join methods have things like
```python
dsk = {
(name, i): (apply, merge_chunk, [left_key, right_key], kwargs)
for i, right_key in enumerate(right.__dask_keys__())
}
```
where we're genera... | Thanks for flagging these @gjoseph92. In general, lifting low-level task graphs into high-level graphs is a nice improvement
I just realized this is slightly more important than I'd originally thought, because now that low-level optimization is turned off for DataFrames, the only way we get task fusion is through High... | [
{
"body": "I noticed that some join methods have things like\r\n```python\r\n dsk = {\r\n (name, i): (apply, merge_chunk, [left_key, right_key], kwargs)\r\n for i, right_key in enumerate(right.__dask_keys__())\r\n }\r\n```\r\nwhere we're generating a low-level graph that coul... | 4aa9dca8a3de15b0c4801bd48789b29556194546 | {
"head_commit": "ac5f45f056c94959a5078e5d45d41c21475b5ff8",
"head_commit_message": "Add utils for getting HLG layers",
"patch_to_review": "diff --git a/dask/dataframe/multi.py b/dask/dataframe/multi.py\nindex 3f7f744ec84..ab54ffb91de 100644\n--- a/dask/dataframe/multi.py\n+++ b/dask/dataframe/multi.py\n@@ -61,7 ... | [
{
"diff_hunk": "@@ -412,42 +412,50 @@ def single_partition_join(left, right, **kwargs):\n kwargs[\"empty_index_dtype\"] = meta.index.dtype\n kwargs[\"categorical_columns\"] = meta.select_dtypes(include=\"category\").columns\n \n- name = \"merge-\" + tokenize(left, right, **kwargs)\n-\n if right.n... | 2ed258f8fbcbe14582300e9e0b86f83eac4c11fd | diff --git a/dask/dataframe/multi.py b/dask/dataframe/multi.py
index 3f7f744ec84..e3606a5cc78 100644
--- a/dask/dataframe/multi.py
+++ b/dask/dataframe/multi.py
@@ -61,7 +61,7 @@
import numpy as np
import pandas as pd
from pandas.api.types import is_categorical_dtype, is_dtype_equal
-from tlz import first, merge_sor... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
cupy__cupy-2461@fed21b3 | cupy/cupy | Python | 2,461 | support array-like start/stop and add axis argument to linspace | This supports array-like inputs and an `axis` argument in linspace as implemented in NumPy 1.16+.
closes #2446
~I have marked this as WIP due to what is currently relatively slow performance for the array-like code path.~ (**edit:** slow for small `num`. For large enough `num`, cupy should always be faster)
A... | 2019-09-12T16:59:11Z | Add support for array-like inputs for linspace
Currently, numpy supports array-like inputs while cupy only considers scalars for start & stop values of linspace function. It would be great to match the functionality.
Sample code to reproduce the feature:
```
import numpy as np
a = np.linspace(0, 9, 10)
b = np... | [
{
"body": "Currently, numpy supports array-like inputs while cupy only considers scalars for start & stop values of linspace function. It would be great to match the functionality. \r\n\r\nSample code to reproduce the feature:\r\n\r\n```\r\nimport numpy as np\r\na = np.linspace(0, 9, 10)\r\nb = np.linspace(10, ... | f29afba4facf5903648c7f6257b74dfeae875ccf | {
"head_commit": "fed21b33bd4f9fbc49288325c4de8a16fe26d670",
"head_commit_message": "add linspace tests with array start/stop and axis",
"patch_to_review": "diff --git a/cupy/creation/ranges.py b/cupy/creation/ranges.py\nindex ca30cda62d0..2009bde7917 100644\n--- a/cupy/creation/ranges.py\n+++ b/cupy/creation/ran... | [
{
"diff_hunk": "@@ -145,6 +145,34 @@ def test_linspace_float_underflow(self, xp):\n x /= 2\n return xp.linspace(0., x, 10, dtype=float)\n \n+ @testing.with_requires('numpy>=1.16')\n+ @testing.numpy_cupy_array_equal()\n+ def test_linspace_array_start_stop(self, xp):\n+ start =... | 315e69447725e0b214ee61cd6ec09b300804abf6 | diff --git a/cupy/creation/ranges.py b/cupy/creation/ranges.py
index ca30cda62d0..5a2125e0bfc 100644
--- a/cupy/creation/ranges.py
+++ b/cupy/creation/ranges.py
@@ -58,7 +58,8 @@ def arange(start, stop=None, step=1, dtype=None):
return ret
-def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
Subsets and Splits
Review Test Instances
Retrieves basic metadata about code review instances but doesn't provide any analytical insights or patterns beyond raw data access.