selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,000 | swe_bench::test::1036 | swe_bench | test | 1,036 | matplotlib__matplotlib-24189 | matplotlib/matplotlib | matplotlib/matplotlib | python | deb7b1145b71c9f60b87d4eaf32e848b1ea5ebe6 | [Bug]: Error using width_ratios with nested mosaic in subplot_mosaic()
### Bug summary
plt.subplot_mosaic() fails with a confusing error message when passing width_ratios (or height_ratios) with a nested list mosaic, unless all outer and inner mosaics have the same number of columns (or rows).
### Code for reproducti... | I advocate that passing these kwargs to nested definitions is simply a bug. We should only apply them to the outermost grid. - Typically it does not make sense to use the same parameters for inner definitions even if they are compatible.
Defining parameters for inner layouts might be added later by supporting nested... | diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -1838,13 +1838,15 @@ def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False,
Defines the relative widths of the columns. Each column gets a
relative width o... | diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py
--- a/lib/matplotlib/tests/test_figure.py
+++ b/lib/matplotlib/tests/test_figure.py
@@ -922,6 +922,26 @@ def test_nested_tuple(self, fig_test, fig_ref):
fig_ref.subplot_mosaic([["F"], [x]])
fig_test.subplot_mosaic([... | ["lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested_width_ratios", "lib/matplotlib/tests/test_figure.py::TestSubplotMosaic::test_nested_height_ratios"] | ["lib/matplotlib/tests/test_figure.py::test_align_labels[png]", "lib/matplotlib/tests/test_figure.py::test_align_labels_stray_axes", "lib/matplotlib/tests/test_figure.py::test_figure_label", "lib/matplotlib/tests/test_figure.py::test_fignum_exists", "lib/matplotlib/tests/test_figure.py::test_clf_keyword", "lib/matplotl... | null | true | 2022-10-16T15:17:40Z | 1 | 13 | 2 | 2,836 | 0 | 0.8 | 1 | 0.85 | 1 | 0.516 | 90.473 | |
3,001 | swe_bench::test::1906 | swe_bench | test | 1,906 | sphinx-doc__sphinx-9997 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 31ed71dfb335f46c97ba227cbfc34172eeb71f1f | autodoc typehints do not create link for parametrized types
**Describe the bug**
autodoc typehints normally generate a link to the hinted type, but do not do so for parametrized types.
**To Reproduce**
Steps to reproduce the behavior:
```
$ cat >project.py <<EOF
from typing import Literal
def func(x: Literal["a", "b... | Duplicated with #9195? Closing.
Oh, sorry. I understood these are different topic. Reopened now.
The issue seems to be stemming from https://github.com/sphinx-doc/sphinx/blob/80fbbb8462f075644e229c9d00293d4afde7adf2/sphinx/ext/autodoc/typehints.py#L33 -- since the types coming from typing are "stringified" and not bein... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -83,7 +83,8 @@ class ModuleEntry(NamedTuple):
def type_to_xref(target: str, env: BuildEnvironment = None, suppress_prefix: bool = False
) -> addnodes.pending_xref:
""... | diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -348,6 +348,17 @@ def test_parse_annotation(app):
assert_node(doctree, ([pending_xref, "None"],))
assert_node(doctree[0], pending_xref, refdomain="py", reftype="obj", reftarget="None")... | ["tests/test_domain_py.py::test_parse_annotation", "tests/test_domain_py.py::test_parse_annotation_suppress", "tests/test_domain_py.py::test_parse_annotation_Literal", "tests/test_ext_autodoc_autofunction.py::test_wrapped_function_contextmanager", "tests/test_ext_autodoc_automodule.py::test_subclass_of_mocked_object", ... | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f... | null | true | 2021-12-20T16:29:37Z | 3 | 102 | 13 | 1,014 | 0 | 0.8 | 1 | 0.85 | 1 | 0.509 | 90.452 | |
3,002 | swe_bench::test::997 | swe_bench | test | 997 | matplotlib__matplotlib-22929 | matplotlib/matplotlib | matplotlib/matplotlib | python | 89b21b517df0b2a9c378913bae8e1f184988b554 | [Bug]: bar_label fails with nan errorbar values
### Bug summary
`ax.bar_label` appears not to be robust to bars with missing (nan) values when also including error values. This issue is similar to [#20058](https://github.com/matplotlib/matplotlib/issues/20058/), but occurs in each of three cases:
Case 1. When a depe... | I have a solution that works when running in the shell, but not in the test as I get a runtime warning because of the nan-values. Will see if I can find a solution in the next few days. | diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -1083,10 +1083,10 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
lines._internal_update(kwargs)
if len(y) > 0:
- minx = mi... | diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -7549,6 +7549,26 @@ def test_bar_label_nan_ydata_inverted():
assert labels[0].get_va() == 'bottom'
+def test_nan_barlabels():
+ fig, ax = plt.... | ["lib/matplotlib/tests/test_axes.py::test_nan_barlabels"] | ["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[... | null | true | 2022-04-28T16:00:17Z | 1 | 22 | 1 | 2,601 | 0 | 0.8 | 1 | 0.85 | 1 | 0.506833 | 90.4455 | |
3,003 | swe_bench::test::1338 | swe_bench | test | 1,338 | pylint-dev__pylint-5730 | pylint-dev/pylint | pylint-dev/pylint | python | 44ad84a4332dfb89e810106fef2616a0bc7e47e4 | [crash] doc params extension: --accept-no-param-doc: conflicting option string(s)
### Bug description
There is a crash when using the doc_params extension.
### Command used
```shell
pylint --load-plugins=pylint.extensions.docparams a.py
```
### Pylint output
```shell
Traceback (most recent call last):
File "/hom... | See:
https://github.com/PyCQA/pylint/pull/5315#discussion_r749716016
You are likely loading the extension twice because the only effect of loading `check_docs` is to load the `docparams` extension.
> You are likely loading the extension twice because the only effect of loading `check_docs` is to load the `docparams... | diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py
--- a/doc/exts/pylint_extensions.py
+++ b/doc/exts/pylint_extensions.py
@@ -14,13 +14,6 @@
from pylint.lint import PyLinter
from pylint.utils import get_rst_title
-# Some modules have been renamed and deprecated under their old names.
-# Ski... | diff --git a/tests/extensions/test_check_docs_utils.py b/tests/extensions/test_check_docs_utils.py
--- a/tests/extensions/test_check_docs_utils.py
+++ b/tests/extensions/test_check_docs_utils.py
@@ -12,9 +12,7 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://g... | ["tests/test_self.py::TestRunTC::test_enable_all_extensions"] | ["tests/extensions/test_check_docs_utils.py::test_space_indentation[abc-0]", "tests/extensions/test_check_docs_utils.py::test_space_indentation[-0]", "tests/extensions/test_check_docs_utils.py::test_space_indentation[", "tests/extensions/test_check_docs_utils.py::test_space_indentation[\\n", "tests/extensions/test_chec... | null | true | 2022-01-27T08:43:30Z | 3 | 42 | 1 | 2,173 | 0 | 0.8 | 1 | 0.85 | 1 | 0.502167 | 90.4315 | |
3,004 | swe_bench::test::2111 | swe_bench | test | 2,111 | sympy__sympy-17038 | sympy/sympy | sympy/sympy | python | ffa2a22cb06ecd7de1b95875f5d732ea37b990ac | isqrt gives incorrect results
The `isqrt` function in `sympy.core.power` gives incorrect results for some inputs. For example:
```
>>> from sympy.core.power import isqrt
>>> n = 4503599761588224
>>> s = isqrt(n)
>>> s # correct result is 67108864
67108865
>>> s**2 <= n # expect True
False
```
or
```
>>> isqrt(9999... | Thanks @mdickinson for reporting and looking into this.
I think that the simple fix is that we should reduce the threshold to 4503599761588224 and check the result before returning it with
```
if s**2 <= n and (s+1)**2 > n:
return s
# Fall back to integer_nthroot
```
Using sqrt as a potential speed-boost i... | diff --git a/sympy/core/power.py b/sympy/core/power.py
--- a/sympy/core/power.py
+++ b/sympy/core/power.py
@@ -22,9 +22,21 @@
def isqrt(n):
"""Return the largest integer less than or equal to sqrt(n)."""
- if n < 17984395633462800708566937239552:
- return int(_sqrt(n))
- return integer_nthroot(int(... | diff --git a/sympy/core/tests/test_numbers.py b/sympy/core/tests/test_numbers.py
--- a/sympy/core/tests/test_numbers.py
+++ b/sympy/core/tests/test_numbers.py
@@ -1026,12 +1026,38 @@ def test_integer_log():
def test_isqrt():
from math import sqrt as _sqrt
- limit = 17984395633462800708566937239551
+ limit... | ["test_isqrt"] | ["test_seterr", "test_mod", "test_divmod", "test_igcd", "test_igcd_lehmer", "test_igcd2", "test_ilcm", "test_igcdex", "test_Integer_new", "test_Rational_new", "test_Number_new", "test_Number_cmp", "test_Rational_cmp", "test_Float", "test_float_mpf", "test_Float_RealElement", "test_Float_default_to_highprec_from_str", "... | null | true | 2019-06-16T15:28:03Z | 1 | 18 | 1 | 2,642 | 0 | 0.8 | 1 | 0.85 | 1 | 0.500333 | 90.426 | |
3,005 | swe_bench::test::1593 | swe_bench | test | 1,593 | scikit-learn__scikit-learn-13333 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 04a5733b86bba57a48520b97b9c0a5cd325a1b9a | DOC Improve doc of n_quantiles in QuantileTransformer
#### Description
The `QuantileTransformer` uses numpy.percentile(X_train, .) as the estimator of the quantile function of the training data. To know this function perfectly we just need to take `n_quantiles=n_samples`. Then it is just a linear interpolation (which i... | When you say prevent, do you mean that we should raise an error if
n_quantiles > n_samples, or that we should adjust n_quantiles to
min(n_quantiles, n_samples)? I'd be in favour of the latter, perhaps with a
warning. And yes, improved documentation is always good (albeit often
ignored).
I was only talking about the do... | diff --git a/sklearn/preprocessing/data.py b/sklearn/preprocessing/data.py
--- a/sklearn/preprocessing/data.py
+++ b/sklearn/preprocessing/data.py
@@ -424,7 +424,7 @@ def minmax_scale(X, feature_range=(0, 1), axis=0, copy=True):
X_scaled = X_std * (max - min) + min
where min, max = feature_range.
-
+
... | diff --git a/sklearn/preprocessing/tests/test_data.py b/sklearn/preprocessing/tests/test_data.py
--- a/sklearn/preprocessing/tests/test_data.py
+++ b/sklearn/preprocessing/tests/test_data.py
@@ -1260,6 +1260,13 @@ def test_quantile_transform_check_error():
assert_raise_message(ValueError,
... | ["sklearn/preprocessing/tests/test_data.py::test_quantile_transform_check_error"] | ["sklearn/preprocessing/tests/test_data.py::test_polynomial_features", "sklearn/preprocessing/tests/test_data.py::test_polynomial_feature_names", "sklearn/preprocessing/tests/test_data.py::test_polynomial_feature_array_order", "sklearn/preprocessing/tests/test_data.py::test_polynomial_features_csc_X[1-True-False-int]",... | null | true | 2019-02-28T15:01:19Z | 1 | 31 | 1 | 2,349 | 0 | 0.8 | 1 | 0.85 | 1 | 0.494833 | 90.4095 | |
3,006 | swe_bench::test::1573 | swe_bench | test | 1,573 | scikit-learn__scikit-learn-13010 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 365c1b2071b4020cdce1cb81da1cba43a004e370 | StandardScaler fit overflows on float16
#### Description
When using StandardScaler on a large float16 numpy array the mean and std calculation overflows. I can convert the array to a larger precision but when working with a larger dataset the memory saved by using float16 on smaller numbers kind of matter. The error i... | If adding dtype on the mean calculation is sufficient, that's probably a
good idea. Pull request?
| diff --git a/sklearn/utils/extmath.py b/sklearn/utils/extmath.py
--- a/sklearn/utils/extmath.py
+++ b/sklearn/utils/extmath.py
@@ -658,6 +658,38 @@ def make_nonnegative(X, min_value=0):
return X
+# Use at least float64 for the accumulating functions to avoid precision issue
+# see https://github.com/numpy/nump... | diff --git a/sklearn/preprocessing/tests/test_data.py b/sklearn/preprocessing/tests/test_data.py
--- a/sklearn/preprocessing/tests/test_data.py
+++ b/sklearn/preprocessing/tests/test_data.py
@@ -450,6 +450,31 @@ def test_scaler_2d_arrays():
assert X_scaled is not X
+def test_scaler_float16_overflow():
+ # T... | ["sklearn/preprocessing/tests/test_data.py::test_scaler_float16_overflow"] | ["sklearn/preprocessing/tests/test_data.py::test_polynomial_features", "sklearn/preprocessing/tests/test_data.py::test_polynomial_feature_names", "sklearn/preprocessing/tests/test_data.py::test_polynomial_feature_array_order", "sklearn/preprocessing/tests/test_data.py::test_polynomial_features_csc_X[1-True-False-int]",... | null | true | 2019-01-18T07:14:27Z | 2 | 50 | 1 | 1,952 | 0 | 0.8 | 1 | 0.85 | 1 | 0.492 | 90.401 | |
3,007 | swe_bench::test::614 | swe_bench | test | 614 | django__django-14495 | django/django | django/django | python | cbba49971bbbbe3e8c6685e4ce6ab87b1187ae87 | KeyError when trying to migrate backward to a replaced migration
Description
Django exhibits some internal confusion regarding whether replaced migrations exist or not. Consider this simple app with two migrations and squashed migration replacing both:
$ ls testproj/migrations/
0001_initial.py 0001_squashed_0002_thing... | I agree, that should be possible and I think it is possible.
Just ran into this. FWIW, workaround, as long as we do not do what comment:5:ticket:24902 recommends (which is to keep the state of squashed migrations in the db), is to simply move the squashed migration file away, migrate backwards to your heart's content, ... | diff --git a/django/db/migrations/executor.py b/django/db/migrations/executor.py
--- a/django/db/migrations/executor.py
+++ b/django/db/migrations/executor.py
@@ -40,6 +40,15 @@ def migration_plan(self, targets, clean_start=False):
# If the migration is already applied, do backwards mode,
# ot... | diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -980,6 +980,19 @@ def test_migrate_partially_applied_squashed_migration(self):
# Unmigrate everything.
call_command('mig... | ["test_migrate_backward_to_squashed_migration (migrations.test_commands.MigrateTests)", "test_migrate_backward_to_squashed_migration (migrations.test_executor.ExecutorTests)"] | ["If the current state satisfies the given target, do nothing.", "Minimize unnecessary rollbacks in connected apps.", "Minimize rollbacks when target has multiple in-app children.", "Tests marking migrations as applied/unapplied.", "MigrationLoader reraises ImportErrors caused by \"bad magic number\" pyc", "To support ... | null | true | 2021-06-05T15:08:27Z | 1 | 9 | 2 | 2,747 | 0 | 0.8 | 1 | 0.85 | 1 | 0.487833 | 90.3885 | |
3,008 | swe_bench::test::1859 | swe_bench | test | 1,859 | sphinx-doc__sphinx-8969 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | ae413e95ed6fd2b3a9d579a3d802e38846906b54 | Absolute/"source-relative" imports for csv-table :file:
**Describe the bug**
To be honest, I am not sure if this can be considered a bug, or if it is rather a feature request. Sorry about that.
When using the `csv-table` directive, the use of `:file:` with absolute paths are really absolute, unlike with (eg) the `figu... | +1: I agree this is inconsistent behavior. It should behave like the figure directive. But changing the behavior is an incompatible change. So we have to change it carefully...
I'd greatly appreciate this change too. Changing the behavior of `:file:` flag for `csv-table` to mimic that of `figure` directive would be gre... | diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py
--- a/sphinx/directives/patches.py
+++ b/sphinx/directives/patches.py
@@ -6,7 +6,9 @@
:license: BSD, see LICENSE for details.
"""
+import os
import warnings
+from os import path
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, c... | diff --git a/tests/roots/test-directive-csv-table/conf.py b/tests/roots/test-directive-csv-table/conf.py
new file mode 100644
diff --git a/tests/roots/test-directive-csv-table/example.csv b/tests/roots/test-directive-csv-table/example.csv
new file mode 100644
--- /dev/null
+++ b/tests/roots/test-directive-csv-table/exa... | ["tests/test_directive_patch.py::test_csv_table_directive"] | ["tests/test_directive_patch.py::test_code_directive", "tests/test_directive_patch.py::test_math_directive"] | null | true | 2021-03-06T17:04:30Z | 1 | 37 | 1 | 2,174 | 0 | 0.8 | 1 | 0.85 | 1 | 0.485667 | 90.382 | |
3,009 | swe_bench::test::1854 | swe_bench | test | 1,854 | sphinx-doc__sphinx-8731 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | a71028bf9e18cf9fb6314c8a13a467d724cd9328 | Return type for Yield attribute not properly hyperlinked in apidocs
**Describe the bug**
Typically when one defines a return value in a method they will use the following syntax:
```
Returns:
int:
some value
```
When doing so the return type, `int` in this case, is hyperlinked to the api docs for the appr... | What about introducing a `:ytype:` field that would specify the type of the yielded values, just as `:rtype:` ? :)
Then napoleon can use this to link to the type. | diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py
--- a/sphinx/ext/napoleon/docstring.py
+++ b/sphinx/ext/napoleon/docstring.py
@@ -59,6 +59,19 @@
_SINGLETONS = ("None", "True", "False", "Ellipsis")
+def _convert_type_spec(_type: str, translations: Dict[str, str] = {}) -> str:
+ "... | diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -1167,6 +1167,30 @@ def test_pep526_annotations(self):
"""
self.assertEqual(expected, actual)
+ def test_preprocess_types(s... | ["tests/test_ext_napoleon_docstring.py::GoogleDocstringTest::test_preprocess_types"] | ["tests/test_ext_napoleon_docstring.py::NamedtupleSubclassTest::test_attributes_docstring", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member_inline", "tests/test_ext_napoleon_docstring.py::InlineAttrib... | null | true | 2021-01-23T05:17:35Z | 1 | 31 | 1 | 2,288 | 0 | 0.8 | 1 | 0.85 | 1 | 0.484667 | 90.379 | |
3,010 | swe_bench::dev::29 | swe_bench | dev | 29 | pvlib__pvlib-python-1213 | pvlib/pvlib-python | pvlib/pvlib-python | python | 40ba4bd5c8b91754aa73e638ed984ab9657847cd | Bug within scaling.py wavelet calculation methodology
**Describe the bug**
Mathematical error within the wavelet computation for the scaling.py WVM implementation. Error arises from the methodology, as opposed to just a software bug.
**To Reproduce**
Steps to reproduce the behavior:
```
import numpy as np
from pvlib i... | @jranalli thanks for finding and reporting this. Can I ask how you contacted PVLIB MATLAB? Because I maintain that repository and I didn't see the email, so we need to fix something on our end with communications.
@cwhanse Now that I look again, I think I used the wrong form. It was just a general Questions and Comment... | diff --git a/pvlib/scaling.py b/pvlib/scaling.py
--- a/pvlib/scaling.py
+++ b/pvlib/scaling.py
@@ -13,8 +13,8 @@
def wvm(clearsky_index, positions, cloud_speed, dt=None):
"""
Compute spatial aggregation time series smoothing on clear sky index based
- on the Wavelet Variability model of Lave et al [1-2]. ... | diff --git a/pvlib/tests/test_scaling.py b/pvlib/tests/test_scaling.py
--- a/pvlib/tests/test_scaling.py
+++ b/pvlib/tests/test_scaling.py
@@ -48,21 +48,24 @@ def positions():
@pytest.fixture
def expect_tmscale():
# Expected timescales for dt = 1
- return [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]... | ["pvlib/tests/test_scaling.py::test_compute_wavelet_series", "pvlib/tests/test_scaling.py::test_compute_wavelet_series_numindex", "pvlib/tests/test_scaling.py::test_compute_wavelet_array", "pvlib/tests/test_scaling.py::test_compute_wavelet_dwttheory", "pvlib/tests/test_scaling.py::test_wvm_series", "pvlib/tests/test_sc... | ["pvlib/tests/test_scaling.py::test_latlon_to_xy_zero", "pvlib/tests/test_scaling.py::test_latlon_to_xy_single", "pvlib/tests/test_scaling.py::test_latlon_to_xy_array", "pvlib/tests/test_scaling.py::test_latlon_to_xy_list", "pvlib/tests/test_scaling.py::test_compute_wavelet_array_invalid", "pvlib/tests/test_scaling.py:... | null | true | 2021-04-23T01:38:03Z | 1 | 72 | 7 | 1,460 | 0 | 0.8 | 1 | 0.85 | 1 | 0.483333 | 90.375 | |
3,011 | swe_bench::test::909 | swe_bench | test | 909 | django__django-16879 | django/django | django/django | python | 89f10a80d7e681cd0cccf22d932e380f51bd3524 | Case-When aggregation over aggregated fields doesn't work since 4.2
Description
(last modified by Denis Roldán)
This same QuerySet was working on 4.1.X and prior versions and stopped working on 4.2.X:
annotated_users = users_qs.annotate(
total_things=Subquery(
OtherModel.objects.filter(user_id=OuterRef("pk")... | Can you reproduce your issue with Django 4.2.1 (see 511dc3db539122577aaba71f5a24d65d5adab092)? If yes, please share your models.
Replying to Mariusz Felisiak: Can you reproduce your issue with Django 4.2.1 (see 511dc3db539122577aaba71f5a24d65d5adab092)? If yes, please share your models. Correct. It doesn't work on Djan... | diff --git a/django/db/models/aggregates.py b/django/db/models/aggregates.py
--- a/django/db/models/aggregates.py
+++ b/django/db/models/aggregates.py
@@ -65,7 +65,14 @@ def resolve_expression(
c.filter = c.filter and c.filter.resolve_expression(
query, allow_joins, reuse, summarize
)
- ... | diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py
--- a/tests/aggregation/tests.py
+++ b/tests/aggregation/tests.py
@@ -1260,7 +1260,7 @@ def test_annotate_over_annotate(self):
self.assertEqual(author.sum_age, other_author.sum_age)
def test_aggregate_over_aggregate(self):
- msg... | ["test_referenced_subquery_requires_wrapping (aggregation.tests.AggregateAnnotationPruningTests.test_referenced_subquery_requires_wrapping)", "test_aggregate_over_aggregate (aggregation.tests.AggregateTestCase.test_aggregate_over_aggregate)", "test_multiple_aggregate_references (aggregation.tests.AggregateTestCase.test... | ["test_non_aggregate_annotation_pruned (aggregation.tests.AggregateAnnotationPruningTests.test_non_aggregate_annotation_pruned)", "test_referenced_aggregate_annotation_kept (aggregation.tests.AggregateAnnotationPruningTests.test_referenced_aggregate_annotation_kept)", "test_referenced_group_by_annotation_kept (aggregat... | null | true | 2023-05-20T05:40:20Z | 3 | 32 | 3 | 2,240 | 0 | 0.8 | 1 | 0.85 | 1 | 0.48 | 90.365 | |
3,012 | swe_bench::test::41 | swe_bench | test | 41 | astropy__astropy-13933 | astropy/astropy | astropy/astropy | python | 5aa2d0beca53988e054d496c6dcfa2199a405fb8 | Unpickled Angle.to_string fails
### Description
Pickling and unpickling an Angle object causes the to_string function to fail claiming hourangle and degree units cannot be represented in sexagesimal notation.
### Steps to Reproduce
```python
import astropy.coordinates
import pickle
ang = astropy.coordinates.Angle(0... | Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta... | diff --git a/astropy/coordinates/angles.py b/astropy/coordinates/angles.py
--- a/astropy/coordinates/angles.py
+++ b/astropy/coordinates/angles.py
@@ -5,6 +5,7 @@
coordinates in astropy.
"""
+import functools
from collections import namedtuple
import numpy as np
@@ -157,7 +158,7 @@ def _tuple_to_float(angle, un... | diff --git a/astropy/coordinates/tests/test_angles.py b/astropy/coordinates/tests/test_angles.py
--- a/astropy/coordinates/tests/test_angles.py
+++ b/astropy/coordinates/tests/test_angles.py
@@ -1,6 +1,7 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test initialization and other aspects of Ang... | ["astropy/coordinates/tests/test_angles.py::test_create_angles", "astropy/coordinates/tests/test_angles.py::test_angle_formatting", "astropy/coordinates/tests/test_angles.py::test_angle_pickle_to_string", "astropy/coordinates/tests/test_formatting.py::test_to_string_decimal", "astropy/coordinates/tests/test_formatting.... | ["astropy/coordinates/tests/test_angles.py::test_angle_from_view", "astropy/coordinates/tests/test_angles.py::test_angle_ops", "astropy/coordinates/tests/test_angles.py::test_angle_methods", "astropy/coordinates/tests/test_angles.py::test_angle_convert", "astropy/coordinates/tests/test_angles.py::test_to_string_vector"... | null | true | 2022-10-28T21:49:47Z | 2 | 107 | 5 | 734 | 0 | 0.8 | 1 | 0.85 | 1 | 0.479 | 90.362 | |
3,013 | swe_bench::test::1933 | swe_bench | test | 1,933 | sympy__sympy-12227 | sympy/sympy | sympy/sympy | python | d60497958f6dea7f5e25bc41e9107a6a63694d01 | Float constructor should allow to set binary precision
I discussed this in some other issues, but I don't think I've opened an issue for it.
The Float constructor only allows you to set the decimal precision. It then converts this to binary precision and saves that in `Float._prec`.
The problem here is that there are... | I'll work on this issue.
What if `Float(s, prec='b54')` is treated to refer to binary precision and `Float(s, prec=54)` to 54 decimal digits.Would that be a decent workaround ?
That would make it more annoying for the user, who has to do `'b' + str(prec)`. The API I suggested above would match other functions (like Rea... | diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py
--- a/sympy/core/numbers.py
+++ b/sympy/core/numbers.py
@@ -3,6 +3,7 @@
import decimal
import fractions
import math
+import warnings
import re as regex
from collections import defaultdict
@@ -27,6 +28,8 @@
from sympy.utilities.misc import debug, fillded... | diff --git a/sympy/core/tests/test_numbers.py b/sympy/core/tests/test_numbers.py
--- a/sympy/core/tests/test_numbers.py
+++ b/sympy/core/tests/test_numbers.py
@@ -487,14 +487,34 @@ def teq(a):
assert Float(decimal.Decimal('-Infinity')) == S.NegativeInfinity
assert '{0:.3f}'.format(Float(4.236622)) == '4.237... | ["test_Float"] | ["test_integers_cache", "test_seterr", "test_mod", "test_divmod", "test_igcd", "test_ilcm", "test_igcdex", "test_Integer_new", "test_Rational_new", "test_Number_new", "test_float_mpf", "test_Float_default_to_highprec_from_str", "test_Float_eval", "test_Float_issue_2107", "test_Infinity", "test_Mul_Infinity_Zero", "test... | null | true | 2017-02-27T15:20:15Z | 2 | 61 | 1 | 1,641 | 0 | 0.8 | 1 | 0.85 | 1 | 0.476833 | 90.3555 | |
3,014 | swe_bench::test::13 | swe_bench | test | 13 | astropy__astropy-13073 | astropy/astropy | astropy/astropy | python | 43ee5806e9c6f7d58c12c1cb9287b3c61abe489d | Document reading True/False in ASCII table as bool not str
### Description
#12826 showed a use case for having an ASCII table column consisting of only "True" and "False" be read as `bool` instead of `str` (current behavior). That issue discusses reasons to maintain the current behavior, but there are simple workarou... | Hi!
I'm wondering if something as simple as this is sufficient or if you think it needs its own example altogether:
```python
>>> import numpy as np
>>> converters = {'uint_col': [ascii.convert_numpy(np.uint)],
... 'float32_col': [ascii.convert_numpy(np.float32)],
... 'bool_col': [... | diff --git a/astropy/io/ascii/core.py b/astropy/io/ascii/core.py
--- a/astropy/io/ascii/core.py
+++ b/astropy/io/ascii/core.py
@@ -1016,7 +1016,10 @@ class BaseOutputter:
"""Output table as a dict of column objects keyed on column name. The
table data are stored as plain python lists within the column object... | diff --git a/astropy/io/ascii/tests/test_read.py b/astropy/io/ascii/tests/test_read.py
--- a/astropy/io/ascii/tests/test_read.py
+++ b/astropy/io/ascii/tests/test_read.py
@@ -1686,3 +1686,47 @@ def test_read_converters_wildcard():
t = ascii.read(['Fabc Iabc', '1 2'], converters=converters)
assert np.issubdtyp... | ["astropy/io/ascii/tests/test_read.py::test_read_converters_simplified"] | ["astropy/io/ascii/tests/test_read.py::test_convert_overflow[True]", "astropy/io/ascii/tests/test_read.py::test_convert_overflow[fast_reader2]", "astropy/io/ascii/tests/test_read.py::test_convert_overflow[fast_reader3]", "astropy/io/ascii/tests/test_read.py::test_convert_overflow[force]", "astropy/io/ascii/tests/test_r... | null | true | 2022-04-06T16:29:58Z | 2 | 35 | 1 | 2,136 | 0 | 0.8 | 1 | 0.85 | 1 | 0.472667 | 90.343 | |
3,015 | swe_bench::test::1788 | swe_bench | test | 1,788 | sphinx-doc__sphinx-7814 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 55fc097833ee1e0efc689ddc85bd2af2e77f4af7 | Warnings raised on variable and attribute type annotations
**Describe the bug**
autodoc signature for non-builtin types raises warning and thus fails nitpicking:
```
/path/to/foo.py:docstring of foo.Foo.a:: WARNING: py:class reference target not found: Optional[str]
```
**To Reproduce**
Steps to reproduce the behav... | We have a similar problem in the Trio project where we use annotations like "str or list", ThisType or None" or even "bytes-like" in a number of place. Here's an example: https://github.com/python-trio/trio/blob/dependabot/pip/sphinx-3.1.0/trio/_subprocess.py#L75-L96
To clarify a bit on the Trio issue: we don't expect ... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -623,7 +623,8 @@ def handle_signature(self, sig: str, signode: desc_signature) -> Tuple[str, str]
typ = self.options.get('type')
if typ:
- signode += addnodes.... | diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -679,7 +679,7 @@ def test_pyattribute(app):
text = (".. py:class:: Class\n"
"\n"
" .. py:attribute:: attr\n"
- " :type: str\n"
+ " ... | ["tests/test_domain_py.py::test_pyattribute"] | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam... | null | true | 2020-06-10T14:00:51Z | 1 | 6 | 1 | 2,667 | 0 | 0.8 | 1 | 0.85 | 1 | 0.4645 | 90.3185 | |
3,016 | swe_bench::dev::123 | swe_bench | dev | 123 | pydicom__pydicom-958 | pydicom/pydicom | pydicom/pydicom | python | 40652fc0a18fd9f1204cb3d4b9829e3a8be5cbe0 | Encoding to ISO 2022 IR 159 doesn't work
#### Description
Encoding to ISO 2022 IR 159 doesn't work even if 'ISO 2022 IR 159' is passed to pydicom.charset.convert_encodings.
#### Steps/Code to Reproduce
ISO 2022 IR 159 is designed as supplement characters to ISO 2022 IR 87. So these characters are not frequent use. Bu... | In my opinion, this is caused by selecting the wrong python codec corresponding to 'ISO 2022 IR 159'. In the current implementation, 'iso-2022-jp' is used if 'ISO 2022 IR 159' is passed. But 'iso-2022-jp' is alias to 'iso200_jp'. I think we have to use 'iso-2022-jp-2'. It contains all 'iso-2022-jp' characters and 'ISO... | diff --git a/pydicom/charset.py b/pydicom/charset.py
--- a/pydicom/charset.py
+++ b/pydicom/charset.py
@@ -45,7 +45,7 @@
'ISO 2022 IR 144': 'iso_ir_144',
'ISO 2022 IR 148': 'iso_ir_148',
'ISO 2022 IR 149': 'euc_kr',
- 'ISO 2022 IR 159': 'iso-2022-jp',
+ 'ISO 2022 IR 159': 'iso2022_jp_2',
'ISO ... | diff --git a/pydicom/tests/test_charset.py b/pydicom/tests/test_charset.py
--- a/pydicom/tests/test_charset.py
+++ b/pydicom/tests/test_charset.py
@@ -9,6 +9,7 @@
from pydicom.data import get_charset_files, get_testdata_files
from pydicom.dataelem import DataElement
from pydicom.filebase import DicomBytesIO
+from py... | ["pydicom/tests/test_charset.py::TestCharset::test_bad_decoded_multi_byte_encoding", "pydicom/tests/test_charset.py::TestCharset::test_bad_decoded_multi_byte_encoding_enforce_standard", "pydicom/tests/test_charset.py::TestCharset::test_japanese_multi_byte_personname", "pydicom/tests/test_charset.py::TestCharset::test_j... | ["pydicom/tests/test_charset.py::TestCharset::test_encodings", "pydicom/tests/test_charset.py::TestCharset::test_nested_character_sets", "pydicom/tests/test_charset.py::TestCharset::test_inherited_character_set_in_sequence", "pydicom/tests/test_charset.py::TestCharset::test_standard_file", "pydicom/tests/test_charset.p... | null | true | 2019-10-16T13:06:11Z | 1 | 50 | 4 | 1,759 | 0 | 0.8 | 1 | 0.85 | 1 | 0.459833 | 90.3045 | |
3,017 | swe_bench::test::1805 | swe_bench | test | 1,805 | sphinx-doc__sphinx-8037 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 0cfb433b25c085071ea46c3ecf8e84f17228643f | sphinx.util.cfamily.DefinitionError: Error in template parameter list.
**Describe the bug**
I appear to have some valid C++14 syntax which causes Sphinx's C++ parser to choke. Here is the full error trace:
```
# Sphinx version: 3.1.2
# Python version: 3.7.4 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: ... | Thanks for reporting. I believe it's because the parser assumes that every template parameter that starts with ``typename`` must be a type parameter. Your example clearly illustrates this is not always the case. | diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -6250,23 +6250,18 @@ def parser() -> ASTExpression:
# ==========================================================================
- def _parse_template_parameter_list(self) -> ASTTemplatePara... | diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -760,6 +760,7 @@ def test_templates():
check('class', "template<typename T = Test> {key}A", {2: "I0E1A"})
check('class', "template<template<typename> typename T> {key}A", {2: "II... | ["tests/test_domain_cpp.py::test_templates"] | ["tests/test_domain_cpp.py::test_fundamental_types", "tests/test_domain_cpp.py::test_expressions", "tests/test_domain_cpp.py::test_type_definitions", "tests/test_domain_cpp.py::test_concept_definitions", "tests/test_domain_cpp.py::test_member_definitions", "tests/test_domain_cpp.py::test_function_definitions", "tests/t... | null | true | 2020-08-02T08:38:10Z | 1 | 126 | 1 | 9,622 | 0 | 0.8 | 1 | 0.8 | 1 | 0.92 | 90.26 | |
3,018 | swe_bench::test::850 | swe_bench | test | 850 | django__django-16400 | django/django | django/django | python | 0bd2c0c9015b53c41394a1c0989afbfd94dc2830 | migrate management command does not respect database parameter when adding Permissions.
Description
(last modified by Vasanth)
When invoking migrate with a database parameter, the migration runs successfully. However, there seems to be a DB read request that runs after the migration. This call does not respect the ... | Thanks for this report, it's related with adding missing permissions. I was able to fix this by setting _state.db, however I'm not convinced that it's the best solution: django/contrib/auth/management/__init__.py diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py index ... | diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
--- a/django/contrib/auth/management/__init__.py
+++ b/django/contrib/auth/management/__init__.py
@@ -95,11 +95,16 @@ def create_permissions(
.values_list("content_type", "codename")
)
- perms = [
- ... | diff --git a/tests/auth_tests/test_management.py b/tests/auth_tests/test_management.py
--- a/tests/auth_tests/test_management.py
+++ b/tests/auth_tests/test_management.py
@@ -1485,3 +1485,22 @@ def test_permission_with_proxy_content_type_created(self):
codename=codename,
).exists()
... | ["test_set_permissions_fk_to_using_parameter (auth_tests.test_management.CreatePermissionsMultipleDatabasesTests)"] | ["test_actual_implementation (auth_tests.test_management.GetDefaultUsernameTestCase)", "test_existing (auth_tests.test_management.GetDefaultUsernameTestCase)", "test_i18n (auth_tests.test_management.GetDefaultUsernameTestCase)", "test_simple (auth_tests.test_management.GetDefaultUsernameTestCase)", "test_with_database ... | null | true | 2022-12-23T17:17:00Z | 1 | 15 | 1 | 2,346 | 0 | 0.8 | 1 | 0.85 | 1 | 0.441 | 90.248 | |
3,019 | swe_bench::dev::191 | swe_bench | dev | 191 | sqlfluff__sqlfluff-2907 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 305159ea643baf6b4744b98c3566613754b2f659 | sqlfluff doesn't recognise a jinja variable set inside of "if" statement
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
When I try to define a jinja variable using "set" jinja directive inside of an "if" jinja stateme... | Does Jinja support this? I don't see how this could be a SQLFluff issue.
Your example does work on this website. I wonder if there's a Jinja runtime setting that affects whether this works.
http://jinja.quantprogramming.com/
It also works with `j2cli` on my local machine. Seems like this _has_ to be a Jinja runtime ... | diff --git a/src/sqlfluff/core/templaters/jinja.py b/src/sqlfluff/core/templaters/jinja.py
--- a/src/sqlfluff/core/templaters/jinja.py
+++ b/src/sqlfluff/core/templaters/jinja.py
@@ -343,20 +343,33 @@ def process(
# first Exception which serves only to catch catastrophic errors.
try:
synt... | diff --git a/test/core/templaters/jinja_test.py b/test/core/templaters/jinja_test.py
--- a/test/core/templaters/jinja_test.py
+++ b/test/core/templaters/jinja_test.py
@@ -411,6 +411,20 @@ def test__templater_jinja_error_variable():
assert any(v.rule_code() == "TMP" and v.line_no == 1 for v in vs)
+def test__te... | ["test/core/templaters/jinja_test.py::test__templater_jinja_dynamic_variable_no_violations"] | ["test/core/templaters/jinja_test.py::test__templater_jinja[simple]", "test/core/templaters/jinja_test.py::test__templater_jinja[unboundlocal_bugfix]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[basic_block]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[strip_left_block]", "... | null | true | 2022-03-23T21:32:13Z | 1 | 35 | 1 | 1,937 | 0 | 0.8 | 1 | 0.85 | 1 | 0.4395 | 90.2435 | |
3,020 | swe_bench::test::977 | swe_bench | test | 977 | matplotlib__matplotlib-21318 | matplotlib/matplotlib | matplotlib/matplotlib | python | a1eef38f6f5a8acccc49f3b54ac429b04d8af15c | RuntimeError: adjustable='datalim' is not allowed when both axes are shared.
### Bug report
**Bug summary**
Matplotlib 2.2.2 fails to plot the figure described below. The code works with Matplotlib 2.0.2.
The issue seems to be the combination of ``sharex=True, sharey=True`` and ``axis('equal')``.
**Code for reprod... | This was a purposeful change in #10033. However, it should have had an API change entry - our apologies.
I'm also not sure that your use case should error. I think we need to still think about all the sharing/datalim interactions to make sure we always do the right thing.... ping @efiring
This combination is i... | diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py
--- a/lib/matplotlib/axes/_base.py
+++ b/lib/matplotlib/axes/_base.py
@@ -1939,10 +1939,12 @@ def apply_aspect(self, position=None):
shared_x = self in self._shared_axes["x"]
shared_y = self in self._shared_axes["y"]
- #... | diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -4938,6 +4938,13 @@ def test_shared_with_aspect_3():
assert round(expected, 4) == round(ax.get_aspect(), 4)
+def test_shared_aspect_error... | ["lib/matplotlib/tests/test_axes.py::test_shared_aspect_error"] | ["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[... | null | true | 2021-10-08T15:04:46Z | 1 | 9 | 1 | 2,423 | 0 | 0.8 | 1 | 0.85 | 1 | 0.433833 | 90.2265 | |
3,021 | swe_bench::test::1200 | swe_bench | test | 1,200 | psf__requests-4718 | psf/requests | psf/requests | python | dd754d13de250a6af8a68a6a83a8b4419fd429c6 | Should Authorization header be cleared in https -> http redirect?
This may be considered intentional behaviour (in which case feel free to close this), but if a request is made to an https endpoint with authorization and it redirects to http on the same host, the Authorization header is not stripped and will be exposed... | From what I can tell by experiment, Firefox and Chromium treat http and https versions of a site as separate authentication realms, and don't automatically reuse basic credentials on either a redirect or manual browsing between the two. Two http URLs with the same host (localhost) and different port numbers also seem t... | diff --git a/requests/sessions.py b/requests/sessions.py
--- a/requests/sessions.py
+++ b/requests/sessions.py
@@ -115,6 +115,22 @@ def get_redirect_target(self, resp):
return to_native_string(location, 'utf8')
return None
+ def should_strip_auth(self, old_url, new_url):
+ """Decide wh... | diff --git a/tests/test_requests.py b/tests/test_requests.py
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -1573,15 +1573,15 @@ def test_nonhttp_schemes_dont_check_URLs(self):
preq = req.prepare()
assert test_url == preq.url
- @pytest.mark.xfail(raises=ConnectionError)
- ... | ["tests/test_requests.py::TestRequests::test_should_strip_auth_host_change", "tests/test_requests.py::TestRequests::test_should_strip_auth_http_downgrade", "tests/test_requests.py::TestRequests::test_should_strip_auth_https_upgrade", "tests/test_requests.py::TestRequests::test_should_strip_auth_port_change"] | ["tests/test_requests.py::TestRequests::test_entry_points", "tests/test_requests.py::TestRequests::test_invalid_url[MissingSchema-hiwpefhipowhefopw]", "tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-localhost:3128]", "tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-localhost.l... | null | true | 2018-06-28T14:48:34Z | 1 | 24 | 4 | 2,107 | 0 | 0.8 | 1 | 0.85 | 1 | 0.431167 | 90.2185 | |
3,022 | swe_bench::test::2202 | swe_bench | test | 2,202 | sympy__sympy-20131 | sympy/sympy | sympy/sympy | python | 706007ca2fe279020e099d36dd1db0e33123ac4c | Warn the user when trees of points or trees of reference frames are not self consistent.
sympy.physics.vector has Point and ReferenceFrame. These can be positioned and oriented relative to objects of their same type, respectively. The user is expected to define relative positions and orientations in a consistent manner... | If we have multiple points defined at a same level , currently automated velocity would choose the point which comes first, but what I suggest is that we calculate all possible velocities of shortest path by and update _vel_dict by a dictionary
p._vel_dict[frame] = { point1 : calculated_velocity, point2 : calc_veloc... | diff --git a/sympy/physics/vector/point.py b/sympy/physics/vector/point.py
--- a/sympy/physics/vector/point.py
+++ b/sympy/physics/vector/point.py
@@ -1,6 +1,7 @@
from __future__ import print_function, division
from .vector import Vector, _check_vector
from .frame import _check_frame
+from warnings import warn
__... | diff --git a/sympy/physics/vector/tests/test_point.py b/sympy/physics/vector/tests/test_point.py
--- a/sympy/physics/vector/tests/test_point.py
+++ b/sympy/physics/vector/tests/test_point.py
@@ -1,6 +1,6 @@
from sympy.physics.vector import dynamicsymbols, Point, ReferenceFrame
-from sympy.testing.pytest import raises
... | ["test_auto_point_vel_multiple_paths_warning_arises", "test_auto_vel_cyclic_warning_arises", "test_auto_vel_cyclic_warning_msg"] | ["test_point_v1pt_theorys", "test_point_a1pt_theorys", "test_point_v2pt_theorys", "test_point_a2pt_theorys", "test_point_funcs", "test_point_pos", "test_point_partial_velocity", "test_point_vel", "test_auto_point_vel", "test_auto_point_vel_multiple_point_path", "test_auto_vel_dont_overwrite", "test_auto_point_vel_if_tr... | null | true | 2020-09-22T12:39:33Z | 1 | 22 | 3 | 2,143 | 0 | 0.8 | 1 | 0.85 | 1 | 0.4305 | 90.2165 | |
3,023 | swe_bench::test::1576 | swe_bench | test | 1,576 | scikit-learn__scikit-learn-13046 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | fcec951bc9f0003d157604bb9f7003c2c397074a | MissingIndicator failed with non-numeric inputs
#### Description
```sklearn.Imputer.MissingIndicator``` fails with string and object type numpy arrays
#### String Types
##### Steps/Code to Reproduce
```python
import numpy as np
from sklearn.impute import MissingIndicator
a = np.array([[c] for c in 'abcdea'], dtype... | This may be a problem for #11886 given that SimpleImputer now handles
non-numerics
The issue is that `check_array` convert to `float64` object array. We need to turn `dtype=None` in case of `string` or `object` dtype to avoid the conversion.
> This may be a problem for #11886 given that SimpleImputer now handles non-n... | diff --git a/sklearn/impute.py b/sklearn/impute.py
--- a/sklearn/impute.py
+++ b/sklearn/impute.py
@@ -533,6 +533,23 @@ def _get_missing_features_info(self, X):
return imputer_mask, features_with_missing
+ def _validate_input(self, X):
+ if not is_scalar_nan(self.missing_values):
+ for... | diff --git a/sklearn/tests/test_impute.py b/sklearn/tests/test_impute.py
--- a/sklearn/tests/test_impute.py
+++ b/sklearn/tests/test_impute.py
@@ -13,6 +13,7 @@
from sklearn.impute import MissingIndicator
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline
+from sklearn.pipeline import mak... | ["sklearn/tests/test_impute.py::test_missing_indicator_error[X_fit3-X_trans3-params3-MissingIndicator", "sklearn/tests/test_impute.py::test_missing_indicator_string", "sklearn/tests/test_impute.py::test_missing_indicator_with_imputer[X0-a-X_trans_exp0]", "sklearn/tests/test_impute.py::test_missing_indicator_with_impute... | ["sklearn/tests/test_impute.py::test_imputation_shape", "sklearn/tests/test_impute.py::test_imputation_error_invalid_strategy[const]", "sklearn/tests/test_impute.py::test_imputation_error_invalid_strategy[101]", "sklearn/tests/test_impute.py::test_imputation_error_invalid_strategy[None]", "sklearn/tests/test_impute.py:... | null | true | 2019-01-26T21:29:52Z | 2 | 50 | 5 | 4,485 | 0.043478 | 0.8 | 1 | 0.92 | 1 | 0.666667 | 90.213739 | |
3,024 | swe_bench::test::1026 | swe_bench | test | 1,026 | matplotlib__matplotlib-23742 | matplotlib/matplotlib | matplotlib/matplotlib | python | 942aa77a4ba1bd5b50e22c0246240b27ba925305 | [Bug]: Bug with toolbar instantiation in notebook
### Bug summary
In MNE-Python we have an abstraction layer for widgets+toolbars. Until today's latest `pip --pre` install it was working fine. Now it fails with:
```
E TraitError: The 'toolbar' trait of a Canvas instance expected a Toolbar or None, not the Navigatio... | Okay I can replicate on 3.6.0.rc0 in a notebook with just:
```
%matplotlib widget
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
```
<details>
<summary>Traceback</summary>
```
---------------------------------------------------------------------------
TraitError Tr... | diff --git a/examples/user_interfaces/embedding_webagg_sgskip.py b/examples/user_interfaces/embedding_webagg_sgskip.py
--- a/examples/user_interfaces/embedding_webagg_sgskip.py
+++ b/examples/user_interfaces/embedding_webagg_sgskip.py
@@ -30,7 +30,7 @@
import matplotlib as mpl
-from matplotlib.backends.backend_web... | diff --git a/lib/matplotlib/tests/test_backend_webagg.py b/lib/matplotlib/tests/test_backend_webagg.py
--- a/lib/matplotlib/tests/test_backend_webagg.py
+++ b/lib/matplotlib/tests/test_backend_webagg.py
@@ -2,6 +2,7 @@
import os
import sys
import pytest
+import matplotlib.backends.backend_webagg_core
@pytest.ma... | ["lib/matplotlib/tests/test_backend_webagg.py::test_webagg_core_no_toolbar"] | ["lib/matplotlib/tests/test_backend_webagg.py::test_webagg_fallback[webagg]", "lib/matplotlib/tests/test_backend_webagg.py::test_webagg_fallback[nbagg]"] | null | true | 2022-08-26T01:13:33Z | 2 | 6 | 1 | 2,453 | 0 | 0.8 | 1 | 0.85 | 1 | 0.428833 | 90.2115 | |
3,025 | swe_bench::test::2268 | swe_bench | test | 2,268 | sympy__sympy-23141 | sympy/sympy | sympy/sympy | python | 0bc2587aef09ab150bd408b7cd9e08baf7b5fd9c | polytope_integrate and max_degree
Trying to build on the examples as `https://docs.sympy.org/latest/modules/integrals/integrals.html#sympy.integrals.intpoly.polytope_integrate:
```
polygon = Polygon(Point(0, 0), Point(0, 1), Point(1, 1), Point(1, 0))
polys = [1, x, y, x*y, x**2*y, x*y**2]
polytope_integrate(polygon, po... | I think that this is an issue with some fragile implementation for treating list than a single expression
I'm not familiar with the stuff under the hood, but simply iterating over each individual expressions can be a temporary workaround.
```
polygon = Polygon(Point(0, 0), Point(0, 1), Point(1, 1), Point(1, 0))
p... | diff --git a/sympy/integrals/intpoly.py b/sympy/integrals/intpoly.py
--- a/sympy/integrals/intpoly.py
+++ b/sympy/integrals/intpoly.py
@@ -21,7 +21,7 @@
from sympy.core import S, diff, Expr, Symbol
from sympy.core.sympify import _sympify
from sympy.geometry import Segment2D, Polygon, Point, Point2D
-from sympy.polys... | diff --git a/sympy/integrals/tests/test_intpoly.py b/sympy/integrals/tests/test_intpoly.py
--- a/sympy/integrals/tests/test_intpoly.py
+++ b/sympy/integrals/tests/test_intpoly.py
@@ -152,6 +152,14 @@ def test_polytope_integrate():
assert result_dict[expr2] == Rational(13062161, 27)
assert result_dict[expr3] =... | ["test_max_degree"] | ["test_decompose", "test_best_origin", "test_point_sort", "test_polytopes_intersecting_sides", "test_main_integrate3d", "test_main_integrate", "test_polygon_integrate", "test_distance_to_side", "test_lineseg_integrate", "test_integration_reduction", "test_integration_reduction_dynamic", "test_is_vertex"] | null | true | 2022-02-21T18:16:17Z | 1 | 59 | 1 | 1,383 | 0 | 0.8 | 1 | 0.85 | 1 | 0.427167 | 90.2065 | |
3,026 | swe_bench::test::2077 | swe_bench | test | 2,077 | sympy__sympy-16085 | sympy/sympy | sympy/sympy | python | b68caad822d3ad0ae1fa09c78c9ed2db927e73cb | Make assumptions about indexed symbols
I think this should be possible to do:
```
>>> x = IndexedBase("x", positive=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/sympy/sympy/tensor/indexed.py", line 403, in __new__
obj = Expr.__new__(cls, label, **kw_args)
TypeE... | Can I work on this?
Yes, you can.
@Nirvan101 any progress on this?
+1
Since it doesn't subclass from Symbol, it should reapply the logic in the Symbol constructor: https://github.com/sympy/sympy/blob/cd98ba006b5c6d6a6d072eafa28ea6d0ebdaf0e7/sympy/core/symbol.py#L233-L235
Specifically, create a `StdFactKB` from the a... | diff --git a/sympy/tensor/indexed.py b/sympy/tensor/indexed.py
--- a/sympy/tensor/indexed.py
+++ b/sympy/tensor/indexed.py
@@ -106,9 +106,11 @@
from __future__ import print_function, division
+from sympy.core.assumptions import StdFactKB, _assume_defined
from sympy.core import Expr, Tuple, Symbol, sympify, S
fro... | diff --git a/sympy/tensor/tests/test_indexed.py b/sympy/tensor/tests/test_indexed.py
--- a/sympy/tensor/tests/test_indexed.py
+++ b/sympy/tensor/tests/test_indexed.py
@@ -4,7 +4,7 @@
from sympy.utilities.pytest import raises, XFAIL
# import test:
-from sympy import IndexedBase, Idx, Indexed, S, sin, cos, Sum, Piece... | ["test_IndexedBase_assumptions"] | ["test_Idx_construction", "test_Idx_properties", "test_Idx_bounds", "test_Idx_fixed_bounds", "test_Idx_inequalities", "test_Idx_func_args", "test_Idx_subs", "test_IndexedBase_sugar", "test_IndexedBase_subs", "test_IndexedBase_shape", "test_Indexed_constructor", "test_Indexed_func_args", "test_Indexed_subs", "test_Index... | null | true | 2019-02-26T20:07:25Z | 1 | 59 | 1 | 1,367 | 0 | 0.8 | 1 | 0.85 | 1 | 0.4245 | 90.1985 | |
3,027 | swe_bench::test::61 | swe_bench | test | 61 | astropy__astropy-14566 | astropy/astropy | astropy/astropy | python | fc2e0754d9020bb9998bd0bb6ecb459d7f38bd44 | Problem with "decimalyear" applied to MaskedColumn type
### Description
The "decimalyear" type produces odd errors when applied to the MaskedColumn type.
The "jyear" type does not, and appears to behave properly.
### Expected behavior
I would expect "decimalyear" and "jyear" to work similarly, although the differenc... | Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta... | diff --git a/astropy/time/formats.py b/astropy/time/formats.py
--- a/astropy/time/formats.py
+++ b/astropy/time/formats.py
@@ -121,6 +121,8 @@ class TimeFormat:
----------
val1 : numpy ndarray, list, number, str, or bytes
Values to initialize the time or times. Bytes are decoded as ascii.
+ Q... | diff --git a/astropy/time/tests/test_basic.py b/astropy/time/tests/test_basic.py
--- a/astropy/time/tests/test_basic.py
+++ b/astropy/time/tests/test_basic.py
@@ -1504,6 +1504,11 @@ def test_decimalyear():
assert np.all(t.jd == [jd0 + 0.5 * d_jd, jd0 + 0.75 * d_jd])
+def test_decimalyear_no_quantity():
+ wi... | ["astropy/time/tests/test_basic.py::test_decimalyear_no_quantity"] | ["astropy/time/tests/test_basic.py::TestBasic::test_different_dimensions", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[jd]", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[mjd]", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[decimalyear]", "astropy/time/tests/test_bas... | null | true | 2023-03-22T23:04:16Z | 1 | 49 | 1 | 1,534 | 0 | 0.8 | 1 | 0.85 | 1 | 0.419 | 90.182 | |
3,028 | swe_bench::test::1322 | swe_bench | test | 1,322 | pylint-dev__pylint-4516 | pylint-dev/pylint | pylint-dev/pylint | python | 0b5a44359d8255c136af27c0ef5f5b196a526430 | Ignore clause not ignoring directories
This is a different issue to [issues/908](https://github.com/PyCQA/pylint/issues/908).
### Steps to reproduce
1. Create a directory `test` and within that a directory `stuff`.
2. Create files `test/a.py` and `test/stuff/b.py`. Put syntax errors in both.
3. From `test`, run `pylin... | The problem seems to be in `utils.expand_modules()` in which we find the code that actually performs the ignoring:
```python
if os.path.basename(something) in black_list:
continue
if _basename_in_blacklist_re(os.path.basename(something), black_list_re):
continue
```
Here `something` will be of the form... | diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py
--- a/pylint/lint/expand_modules.py
+++ b/pylint/lint/expand_modules.py
@@ -1,5 +1,6 @@
import os
import sys
+from typing import List, Pattern, Tuple
from astroid import modutils
@@ -28,32 +29,33 @@ def get_python_path(filepath: str) -> s... | diff --git a/tests/lint/unittest_expand_modules.py b/tests/lint/unittest_expand_modules.py
--- a/tests/lint/unittest_expand_modules.py
+++ b/tests/lint/unittest_expand_modules.py
@@ -7,19 +7,29 @@
import pytest
-from pylint.lint.expand_modules import _basename_in_ignore_list_re, expand_modules
+from pylint.lint.ex... | ["tests/lint/unittest_expand_modules.py::test__is_in_ignore_list_re_match", "tests/lint/unittest_expand_modules.py::test__is_in_ignore_list_re_nomatch", "tests/lint/unittest_expand_modules.py::test_expand_modules[files_or_modules0-expected0]", "tests/lint/unittest_expand_modules.py::test_expand_modules[files_or_modules... | [] | null | true | 2021-05-26T15:15:27Z | 2 | 55 | 4 | 1,401 | 0 | 0.8 | 1 | 0.85 | 1 | 0.416833 | 90.1755 | |
3,029 | swe_bench::test::1170 | swe_bench | test | 1,170 | psf__requests-1713 | psf/requests | psf/requests | python | 340b2459031feb421d678c3c75865c3b11c07938 | Regression 2.0.1: Using MozillaCookieJar does not work
Could not find an issue raised for this, not sure if this was an expected change either. This is reproducible on master.
Existing code fails on update to `requests-2.0.1`. The cause seems to be triggered by the change at https://github.com/kennethreitz/requests/co... | Mm, good spot. I think we should try to do something smarter here. Thanks for raising this issue! :cake:
| diff --git a/requests/cookies.py b/requests/cookies.py
--- a/requests/cookies.py
+++ b/requests/cookies.py
@@ -421,3 +421,25 @@ def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True):
cookiejar.set_cookie(create_cookie(name, cookie_dict[name]))
return cookiejar
+
+
+def merge_cooki... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -187,6 +187,14 @@ def test_generic_cookiejar_works(self):
assert r.json()['cookies']['foo'] == 'bar'
# Make sure the session cj is still the custom one
assert s.cookies is cj
+
+ def test_... | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_HTTP_302_ALLOW_REDIRECT_GET", "test_requests.py::RequestsTestCase::test_POSTBIN_GET_POST_FILES", "test_requests.py::RequestsTestCase::test_param_cookiejar_works", "test_requests.py::RequestsTestCase::t... | ["test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_DIGEST_STREAM", "test_requests.py::RequestsTestCase::te... | null | true | 2013-10-29T14:49:12Z | 2 | 32 | 5 | 1,837 | 0 | 0.8 | 1 | 0.85 | 1 | 0.412833 | 90.1635 | |
3,030 | swe_bench::test::1876 | swe_bench | test | 1,876 | sphinx-doc__sphinx-9261 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 4d90277c49633705148793ab02b28353c8a59b48 | Building autodocs for derived classes produces invalid warnings
**Describe the bug**
Generating API docs using the autodoc extensions, when a base class has doc strings in the constructor as well as in the class definition, and the autoclass_content feature is set to "both", produces superfluous warnings when parsing d... | This is a rather insidious warning because it points the developer to the derived class as the root cause of the problem, but there is no obvious correlation between the code of the derived class and the actual cause of the problem. This is further exacerbated when the derived class is in a different project or library... | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1704,7 +1704,7 @@ def get_doc(self, ignore: int = None) -> Optional[List[List[str]]]:
__init__ = self.get_attr(self.object, '__init__', None)
... | diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py
--- a/tests/test_util_inspect.py
+++ b/tests/test_util_inspect.py
@@ -674,7 +674,10 @@ def func1(a, b, c):
def test_getdoc_inherited_decorated_method():
class Foo:
def meth(self):
- """docstring."""
+ """
+ ... | ["tests/test_util_inspect.py::test_getdoc_inherited_decorated_method"] | ["tests/test_util_inspect.py::test_TypeAliasNamespace", "tests/test_util_inspect.py::test_signature", "tests/test_util_inspect.py::test_signature_partial", "tests/test_util_inspect.py::test_signature_methods", "tests/test_util_inspect.py::test_signature_partialmethod", "tests/test_util_inspect.py::test_signature_annota... | null | true | 2021-05-22T13:30:56Z | 2 | 29 | 1 | 1,882 | 0 | 0.8 | 1 | 0.85 | 1 | 0.410333 | 90.156 | |
3,031 | swe_bench::test::807 | swe_bench | test | 807 | django__django-16002 | django/django | django/django | python | 806e9e2d0dcf8f58e376fb7e2a8b9771e2a9ce16 | "NaN" can be stored in DecimalField but cannot be retrieved
Description
(last modified by Xabier Bello)
Same as ticket https://code.djangoproject.com/ticket/33033, but I managed to trigger it anyway:
Steps to reproduce
Create a brand new project using python 3.10 and django 4.1 with the default sqlite3 backend.
Cre... | Django offers both model et form validation. If you insert values without using either one, you are on your own and responsible for what you insert in the database. I dont' think Django should do more here. To be confirmed.
Replying to Claude Paroz: Django offers both model et form validation. If you insert values with... | diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -2,7 +2,6 @@
import copy
import datetime
import decimal
-import math
import operator
import uuid
import warnings
@@ -1703,22 +1702,24 @@ def... | diff --git a/tests/model_fields/test_decimalfield.py b/tests/model_fields/test_decimalfield.py
--- a/tests/model_fields/test_decimalfield.py
+++ b/tests/model_fields/test_decimalfield.py
@@ -67,10 +67,19 @@ def test_save_without_float_conversion(self):
def test_save_nan_invalid(self):
msg = "“nan” value... | ["test_save_inf_invalid (model_fields.test_decimalfield.DecimalFieldTests)", "test_save_nan_invalid (model_fields.test_decimalfield.DecimalFieldTests)"] | ["test_default (model_fields.test_decimalfield.DecimalFieldTests)", "Should be able to filter decimal fields using strings (#8023).", "test_get_prep_value (model_fields.test_decimalfield.DecimalFieldTests)", "test_invalid_value (model_fields.test_decimalfield.DecimalFieldTests)", "Really big values can be used in a fil... | null | true | 2022-08-26T13:11:53Z | 1 | 21 | 2 | 2,032 | 0 | 0.8 | 1 | 0.85 | 1 | 0.408667 | 90.151 | |
3,032 | swe_bench::test::1395 | swe_bench | test | 1,395 | pytest-dev__pytest-5103 | pytest-dev/pytest | pytest-dev/pytest | python | 10ca84ffc56c2dd2d9dc4bd71b7b898e083500cd | Unroll the iterable for all/any calls to get better reports
Sometime I need to assert some predicate on all of an iterable, and for that the builtin functions `all`/`any` are great - but the failure messages aren't useful at all!
For example - the same test written in three ways:
- A generator expression
```sh
def... | Hello, I am new here and would be interested in working on this issue if that is possible.
@danielx123
Sure! But I don't think this is an easy issue, since it involved the assertion rewriting - but if you're familar with Python's AST and pytest's internals feel free to pick this up.
We also have a tag "easy" for is... | diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py
--- a/src/_pytest/assertion/rewrite.py
+++ b/src/_pytest/assertion/rewrite.py
@@ -964,6 +964,8 @@ def visit_Call_35(self, call):
"""
visit `ast.Call` nodes on Python3.5 and after
"""
+ if isinstance(call.f... | diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py
--- a/testing/test_assertrewrite.py
+++ b/testing/test_assertrewrite.py
@@ -656,6 +656,12 @@ def __repr__(self):
else:
assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"]
+ def test_unroll_expression(self... | ["testing/test_assertrewrite.py::TestAssertionRewrite::test_unroll_expression"] | ["testing/test_assertrewrite.py::TestAssertionRewrite::test_place_initial_imports", "testing/test_assertrewrite.py::TestAssertionRewrite::test_dont_rewrite", "testing/test_assertrewrite.py::TestAssertionRewrite::test_name", "testing/test_assertrewrite.py::TestAssertionRewrite::test_dont_rewrite_if_hasattr_fails", "test... | null | true | 2019-04-13T16:17:45Z | 1 | 25 | 1 | 1,936 | 0 | 0.8 | 1 | 0.85 | 1 | 0.406 | 90.143 | |
3,033 | swe_bench::test::1080 | swe_bench | test | 1,080 | matplotlib__matplotlib-25442 | matplotlib/matplotlib | matplotlib/matplotlib | python | 73394f2b11321e03a5df199ec0196f27a728b0b0 | [Bug]: Attribute Error combining matplotlib 3.7.1 and mplcursor on data selection
### Bug summary
If you combine mplcursor and matplotlib 3.7.1, you'll get an `AttributeError: 'NoneType' object has no attribute 'canvas'` after clicking a few data points. Henceforth, selecting a new data point will trigger the same tra... | Can you report to https://github.com/anntzer/mplcursors/issues? I'll close here but feel free to open an issue if a Matplotlib bug is identified. | diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py
--- a/lib/matplotlib/offsetbox.py
+++ b/lib/matplotlib/offsetbox.py
@@ -1500,16 +1500,23 @@ def __init__(self, ref_artist, use_blit=False):
ref_artist.set_picker(True)
self.got_artist = False
self._use_blit = use_blit ... | diff --git a/lib/matplotlib/tests/test_offsetbox.py b/lib/matplotlib/tests/test_offsetbox.py
--- a/lib/matplotlib/tests/test_offsetbox.py
+++ b/lib/matplotlib/tests/test_offsetbox.py
@@ -450,3 +450,11 @@ def test_paddedbox():
pb = PaddedBox(ta, pad=15, draw_frame=True)
ab = AnchoredOffsetbox('lower right', ch... | ["lib/matplotlib/tests/test_offsetbox.py::test_remove_draggable"] | ["lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_clipping[png]", "lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_clipping[pdf]", "lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_clip_children", "lib/matplotlib/tests/test_offsetbox.py::test_offsetbox_loc_codes", "lib/matplotlib/tests/test_offsetbo... | null | true | 2023-03-12T21:58:08Z | 1 | 31 | 1 | 1,814 | 0 | 0.8 | 1 | 0.85 | 1 | 0.405667 | 90.142 | |
3,034 | swe_bench::test::1093 | swe_bench | test | 1,093 | matplotlib__matplotlib-25712 | matplotlib/matplotlib | matplotlib/matplotlib | python | 690884facc1e80b40640649f2a64ceab67afb42e | [Bug]: fill_between{x} does not respect Axes transform
### Bug summary
Using an axes transform with `fill_between` and `fill_betweenx` incorrectly sets the axes limits if the Axes coordinates are larger than the data coordinates.
### Code for reproduction
```python
fig, ax = plt.subplots()
x = np.arange(0, 4 * np.pi... | https://github.com/matplotlib/matplotlib/blob/b86ebbafe4673583345d0a01a6ea205af34c58dc/lib/matplotlib/axes/_axes.py#L5413
So the fundamental thing here is that `transform` is not actually directly inspected in `fill_between`'s implementation (which is shared for x/y variants), instead that falls under the `**kwargs`... | diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -5409,7 +5409,12 @@ def get_interp_point(idx):
np.column_stack([ind[where], dep2[where]])])
if ind_dir == "y":
pts = pts[:,... | diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -8558,3 +8558,19 @@ def test_ecdf_invalid():
plt.ecdf([1, np.nan])
with pytest.raises(ValueError):
plt.ecdf(np.ma.array([1, 2], mas... | ["lib/matplotlib/tests/test_axes.py::test_fill_between_axes_limits"] | ["lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/test... | null | true | 2023-04-18T01:04:17Z | 1 | 7 | 1 | 2,290 | 0 | 0.8 | 1 | 0.85 | 1 | 0.405 | 90.14 | |
3,035 | swe_bench::test::1258 | swe_bench | test | 1,258 | pydata__xarray-4911 | pydata/xarray | pydata/xarray | python | 7c4e2ac83f7b4306296ff9b7b51aaf016e5ad614 | Sum and prod with min_count forces evaluation
If I use the `sum` method on a lazy array with `min_count != None` then evaluation is forced. If there is some limitation of the implementation which means it cannot be added to the computation graph for lazy evaluation then this should be mentioned in the docs.
**Minimal ... | Thanks for the report, the culprit is likely
https://github.com/pydata/xarray/blob/5296ed18272a856d478fbbb3d3253205508d1c2d/xarray/core/nanops.py#L34
We fixed a similar problem in [weighted](https://github.com/pydata/xarray/blob/master/xarray/core/weighted.py#L100).
grepping the code, the only other function that... | diff --git a/xarray/core/dtypes.py b/xarray/core/dtypes.py
--- a/xarray/core/dtypes.py
+++ b/xarray/core/dtypes.py
@@ -78,7 +78,7 @@ def maybe_promote(dtype):
return np.dtype(dtype), fill_value
-NAT_TYPES = (np.datetime64("NaT"), np.timedelta64("NaT"))
+NAT_TYPES = {np.datetime64("NaT").dtype, np.timedelta64("... | diff --git a/xarray/tests/test_dtypes.py b/xarray/tests/test_dtypes.py
--- a/xarray/tests/test_dtypes.py
+++ b/xarray/tests/test_dtypes.py
@@ -90,3 +90,9 @@ def test_maybe_promote(kind, expected):
actual = dtypes.maybe_promote(np.dtype(kind))
assert actual[0] == expected[0]
assert str(actual[1]) == expec... | ["xarray/tests/test_dtypes.py::test_nat_types_membership", "xarray/tests/test_duck_array_ops.py::test_min_count_specific[None-sum-False]", "xarray/tests/test_duck_array_ops.py::test_min_count_specific[None-prod-False]", "xarray/tests/test_duck_array_ops.py::test_docs"] | ["xarray/tests/test_dtypes.py::test_result_type[args0-bool]", "xarray/tests/test_dtypes.py::test_result_type[args1-object_]", "xarray/tests/test_dtypes.py::test_result_type[args2-float64]", "xarray/tests/test_dtypes.py::test_result_type[args3-object_]", "xarray/tests/test_dtypes.py::test_result_type[args4-object_]", "x... | null | true | 2021-02-15T13:53:34Z | 3 | 30 | 4 | 1,786 | 0 | 0.8 | 1 | 0.85 | 1 | 0.397667 | 90.118 | |
3,036 | swe_bench::test::1767 | swe_bench | test | 1,767 | sphinx-doc__sphinx-7356 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 4050f2df9d618d4deb4ce28ccea69ede65b45005 | Breaking change to Python domain IDs
**Describe the bug**
Previously, anchors for Python functions were using underscores, #7236 changed this to dashes.
**To Reproduce**
Document some Python function whose name contains underscores:
```rst
.. py:function:: example_python_function(foo)
Some function.
```
**Exp... | Are you sure the old links are broken? While the permalink is indeed using a new ID generation scheme, the old ID should still be attached to the declaration (using ``<span id="theOldID"></span>``).
Yes, I changed the style of node_ids in #7236. Therefore, the main hyperlink anchor will be changed in the next release. ... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -370,7 +370,7 @@ def add_target_and_index(self, name_cls: Tuple[str, str], sig: str,
signode: desc_signature) -> None:
modname = self.options.get('modu... | diff --git a/tests/test_build_epub.py b/tests/test_build_epub.py
--- a/tests/test_build_epub.py
+++ b/tests/test_build_epub.py
@@ -320,13 +320,13 @@ def test_epub_anchor_id(app):
app.build()
html = (app.outdir / 'index.xhtml').read_text()
- assert ('<p id="std-setting-staticfiles-finders">'
+ assert (... | ["tests/test_build_epub.py::test_epub_anchor_id", "tests/test_build_html.py::test_html5_output[autodoc.html-expect25]", "tests/test_build_html.py::test_html5_output[autodoc.html-expect26]", "tests/test_build_html.py::test_html5_output[autodoc.html-expect27]", "tests/test_build_html.py::test_html5_output[markup.html-exp... | ["tests/test_build_epub.py::test_build_epub", "tests/test_build_epub.py::test_epub_cover", "tests/test_build_epub.py::test_nested_toc", "tests/test_build_epub.py::test_escaped_toc", "tests/test_build_epub.py::test_epub_writing_mode", "tests/test_build_epub.py::test_epub_assets", "tests/test_build_epub.py::test_epub_css... | null | true | 2020-03-22T07:10:35Z | 2 | 80 | 27 | 781 | 0 | 0.8 | 1 | 0.85 | 1 | 0.396833 | 90.1155 | |
3,037 | swe_bench::dev::117 | swe_bench | dev | 117 | pydicom__pydicom-903 | pydicom/pydicom | pydicom/pydicom | python | 88ca0bff105c75a632d7351acb6895b70230fa12 | Handling of DS too long to be encoded in explicit encoding
#### Description
This is probably not a bug, but I'm not sure about the wanted behavior.
An RTPlan dataset encoded as Little Endian Implicit contains multiple values in the DS tag DHV Data (3004,0058) with an overall length not fitting into 2 bytes. Trying to ... | Interesting situation. To summarize: with implicit VR and the four-byte length it uses, we can read in something longer than **Ex**plicit VR can write, because it uses only two bytes for encoding the length (for VRs like DS).
I say we catch the exception and re-raise with a meaningful error message. If the user w... | diff --git a/pydicom/filewriter.py b/pydicom/filewriter.py
--- a/pydicom/filewriter.py
+++ b/pydicom/filewriter.py
@@ -3,7 +3,7 @@
from __future__ import absolute_import
-import struct
+import warnings
from struct import pack
from pydicom import compat
@@ -439,27 +439,19 @@ def write_data_element(fp, data_elem... | diff --git a/pydicom/tests/test_filewriter.py b/pydicom/tests/test_filewriter.py
--- a/pydicom/tests/test_filewriter.py
+++ b/pydicom/tests/test_filewriter.py
@@ -2513,20 +2513,31 @@ def test_writing_too_big_data_in_explicit_encoding(self):
large_value,
... | ["pydicom/tests/test_filewriter.py::TestWriteUndefinedLengthPixelData::test_writing_too_big_data_in_explicit_encoding"] | ["pydicom/tests/test_filewriter.py::TestWriteFile::testRTPlan", "pydicom/tests/test_filewriter.py::TestWriteFile::testRTDose", "pydicom/tests/test_filewriter.py::TestWriteFile::testCT", "pydicom/tests/test_filewriter.py::TestWriteFile::testMR", "pydicom/tests/test_filewriter.py::TestWriteFile::testUnicode", "pydicom/te... | null | true | 2019-07-27T19:22:28Z | 1 | 57 | 1 | 1,173 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3855 | 90.0815 | |
3,038 | swe_bench::test::1543 | swe_bench | test | 1,543 | scikit-learn__scikit-learn-11585 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 58fa28e3e5e7be677f3bf0a95e4d1010f46e42d0 | SparsePCA incorrectly scales results in .transform()
#### Description
When using `SparsePCA`, the `transform()` method incorrectly scales the results based on the *number of rows* in the data matrix passed.
#### Proposed Fix
I am regrettably unable to do a pull request from where I sit. The issue is with this chunk of... | > Actual Results
>
> The test results min/max values are much larger than the training results, because fewer examples were used.
@andrewww Thanks for opening this issue. I can confirm your results (they are also true for the `MiniBatchSparsePCA`), and that in unit tests `sklearn/decomposition/tests/test_sparse_pc... | diff --git a/examples/decomposition/plot_faces_decomposition.py b/examples/decomposition/plot_faces_decomposition.py
--- a/examples/decomposition/plot_faces_decomposition.py
+++ b/examples/decomposition/plot_faces_decomposition.py
@@ -81,7 +81,8 @@ def plot_gallery(title, images, n_col=n_col, n_row=n_row, cmap=plt.cm.g... | diff --git a/sklearn/decomposition/tests/test_sparse_pca.py b/sklearn/decomposition/tests/test_sparse_pca.py
--- a/sklearn/decomposition/tests/test_sparse_pca.py
+++ b/sklearn/decomposition/tests/test_sparse_pca.py
@@ -2,19 +2,20 @@
# License: BSD 3 clause
import sys
+import pytest
import numpy as np
from skl... | ["sklearn/decomposition/tests/test_sparse_pca.py::test_correct_shapes[False]", "sklearn/decomposition/tests/test_sparse_pca.py::test_correct_shapes[True]", "sklearn/decomposition/tests/test_sparse_pca.py::test_fit_transform[False]", "sklearn/decomposition/tests/test_sparse_pca.py::test_fit_transform[True]", "sklearn/de... | [] | null | true | 2018-07-17T09:30:51Z | 2 | 100 | 18 | 2,689 | 0.019608 | 0.8 | 1 | 0.85 | 1 | 0.7815 | 90.076412 | |
3,039 | swe_bench::test::182 | swe_bench | test | 182 | django__django-11354 | django/django | django/django | python | a9c6ab03560424ed7dff24849c8ddaa3e1eae62e | QuerySet.count() does not with work raw sql annotations on inherited model fields
Description
Consider these models
class BaseItem(models.Model):
title = models.CharField(max_length=32)
class Item(BaseItem):
pass
If I use a RawSQL annotation of Item's queryset that includes one of the fields defined in BaseItem and ... | I'm attaching a test for Django's test suite that I wrote quickly to reproduce this.
Hi, PR To finding the inherited columns, thought two approaches: a- try to parse the columns from raw sql with using a convert function which returns a list from sql string. (with regex pattern maybe) b- if the query contains a column... | diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py
--- a/django/db/models/expressions.py
+++ b/django/db/models/expressions.py
@@ -699,6 +699,16 @@ def as_sql(self, compiler, connection):
def get_group_by_cols(self, alias=None):
return [self]
+ def resolve_expression(self,... | diff --git a/tests/annotations/models.py b/tests/annotations/models.py
--- a/tests/annotations/models.py
+++ b/tests/annotations/models.py
@@ -38,6 +38,7 @@ class Store(models.Model):
books = models.ManyToManyField(Book)
original_opening = models.DateTimeField()
friday_night_closing = models.TimeField()
... | ["test_raw_sql_with_inherited_field (annotations.tests.NonAggregateAnnotationTestCase)"] | ["test_aggregate_over_annotation (annotations.tests.NonAggregateAnnotationTestCase)", "test_annotate_exists (annotations.tests.NonAggregateAnnotationTestCase)", "test_annotate_with_aggregation (annotations.tests.NonAggregateAnnotationTestCase)", "test_annotation_filter_with_subquery (annotations.tests.NonAggregateAnnot... | null | true | 2019-05-11T12:43:07Z | 1 | 10 | 1 | 2,088 | 0 | 0.8 | 1 | 0.85 | 1 | 0.381333 | 90.069 | |
3,040 | swe_bench::test::1809 | swe_bench | test | 1,809 | sphinx-doc__sphinx-8095 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | bf26080042fabf6e3aba22cfe05ad8d93bcad3e9 | Warning: Inline literal start-string without end-string in Numpy style Parameters section
**Describe the bug**
The following docstring generates a warning on the line of the timeout parameter. Removing the quote around `default` cause the warning to go away.
```python
def lock(
self,
timeout: Union[floa... | @keewis Could you check this please? I think this is related to convert_numpy_type_spec.
`napoleon` converts the docstring to
```rst
Establish a shared lock to the resource.
:Parameters: * **timeout** (:class:`Union[float`, :class:`Literal[```"default"``:class:`]]`, *optional*) -- Absolute time period (in millisec... | diff --git a/sphinx/ext/napoleon/__init__.py b/sphinx/ext/napoleon/__init__.py
--- a/sphinx/ext/napoleon/__init__.py
+++ b/sphinx/ext/napoleon/__init__.py
@@ -41,6 +41,7 @@ class Config:
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_use_keyword = True
+ napoleon_preproce... | diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -66,19 +66,19 @@ def test_attributes_docstring(self):
Quick description of attr1
- :type: :class:`Arbitrary type`
+ :type: Arbitra... | ["tests/test_ext_napoleon_docstring.py::NamedtupleSubclassTest::test_attributes_docstring", "tests/test_ext_napoleon_docstring.py::NumpyDocstringTest::test_list_in_parameter_description", "tests/test_ext_napoleon_docstring.py::NumpyDocstringTest::test_multiple_parameters", "tests/test_ext_napoleon_docstring.py::NumpyDo... | ["tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member_inline", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member_inline_no_type", "tests/test_ext_napoleon_docstring.py::Inl... | null | true | 2020-08-10T11:09:15Z | 2 | 18 | 7 | 1,867 | 0 | 0.8 | 1 | 0.85 | 1 | 0.371167 | 90.0385 | |
3,041 | swe_bench::test::1599 | swe_bench | test | 1,599 | scikit-learn__scikit-learn-13447 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | a62775e99f2a5ea3d51db7160fad783f6cd8a4c5 | label_ranking_average_precision_score: sample_weighting isn't applied to items with zero true labels
#### Description
label_ranking_average_precision_score offers a sample_weighting argument to allow nonuniform contribution of individual samples to the reported metric. Separately, individual samples whose labels are t... | Thanks for the bug report. A pull request with a fix is welcome
Will take this
In the file `sklearn/metrics/ranking.py`. I added the following lines.
<img width="977" alt="Screen Shot 2019-03-10 at 2 46 53 PM" src="https://user-images.githubusercontent.com/17526499/54089811-70738700-4343-11e9-89d5-a045c5a58326.png">... | diff --git a/sklearn/metrics/ranking.py b/sklearn/metrics/ranking.py
--- a/sklearn/metrics/ranking.py
+++ b/sklearn/metrics/ranking.py
@@ -728,13 +728,13 @@ def label_ranking_average_precision_score(y_true, y_score, sample_weight=None):
if (relevant.size == 0 or relevant.size == n_labels):
# If al... | diff --git a/sklearn/metrics/tests/test_ranking.py b/sklearn/metrics/tests/test_ranking.py
--- a/sklearn/metrics/tests/test_ranking.py
+++ b/sklearn/metrics/tests/test_ranking.py
@@ -952,6 +952,25 @@ def test_alternative_lrap_implementation(n_samples, n_classes, random_state):
n_classes, n_samples, rand... | ["sklearn/metrics/tests/test_ranking.py::test_lrap_sample_weighting_zero_labels"] | ["sklearn/metrics/tests/test_ranking.py::test_roc_curve[True]", "sklearn/metrics/tests/test_ranking.py::test_roc_curve[False]", "sklearn/metrics/tests/test_ranking.py::test_roc_curve_end_points", "sklearn/metrics/tests/test_ranking.py::test_roc_returns_consistency", "sklearn/metrics/tests/test_ranking.py::test_roc_curv... | null | true | 2019-03-14T11:56:35Z | 1 | 12 | 1 | 1,966 | 0 | 0.8 | 1 | 0.85 | 1 | 0.367667 | 90.028 | |
3,042 | swe_bench::dev::126 | swe_bench | dev | 126 | pydicom__pydicom-996 | pydicom/pydicom | pydicom/pydicom | python | d21e97c9a35b5c225dc3340faaa7c293e7c8ee9b | Memory leaks when accessing sequence tags with Dataset.__getattr__.
**Describe the bug**
Accessing sequences via `Dataset.__getattr__` seems to leak memory. The bug occurred for me when I was processing many DICOMs and manipulating some tags contained in sequences and each leaked a bit of memory, ultimately crashing th... | I could reproduce this with a smaller sequence (2MB) under Windows. The memory usage got up until it was about twice the initial value (after a few hundred iterations), after that got back down to the initial value and started to rise again.
If removing the code that sets the parent, this does not happen - the memory ... | diff --git a/pydicom/dataset.py b/pydicom/dataset.py
--- a/pydicom/dataset.py
+++ b/pydicom/dataset.py
@@ -769,13 +769,7 @@ def __getattr__(self, name):
if tag is not None: # `name` isn't a DICOM element keyword
tag = Tag(tag)
if tag in self._dict: # DICOM DataElement not in the Dat... | diff --git a/pydicom/tests/test_filewriter.py b/pydicom/tests/test_filewriter.py
--- a/pydicom/tests/test_filewriter.py
+++ b/pydicom/tests/test_filewriter.py
@@ -875,47 +875,90 @@ def test_write_new_ambiguous(self):
assert ds[0x00283002].VR == 'US'
assert ds.LUTDescriptor == [1, 0]
- def test_am... | ["pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVR::test_ambiguous_element_in_sequence_implicit_using_index"] | ["pydicom/tests/test_filewriter.py::TestWriteFile::testRTPlan", "pydicom/tests/test_filewriter.py::TestWriteFile::testRTDose", "pydicom/tests/test_filewriter.py::TestWriteFile::testCT", "pydicom/tests/test_filewriter.py::TestWriteFile::testMR", "pydicom/tests/test_filewriter.py::TestWriteFile::testUnicode", "pydicom/te... | null | true | 2019-12-18T20:51:14Z | 3 | 24 | 1 | 1,725 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3675 | 90.0275 | |
3,043 | swe_bench::test::1073 | swe_bench | test | 1,073 | matplotlib__matplotlib-25340 | matplotlib/matplotlib | matplotlib/matplotlib | python | 5e8c140da6f61338c8eeb04c6fe2335ffbacd78e | [Bug]: set_val of rangeslider sets incorrect value
### Bug summary
The set_val() method of a range slider doesn't set the value correctly with values close to the minimal and maximal values of the range slider. With values in the middle, everything works fine.
### Code for reproduction
```python
import matplotlib.py... | This is because the min/max is clipped to the opposite min/max in case only one is being set. But if setting both min/max together, it doesn't make sense to do that clipping.
It seems like changing the parameter valinit also has an effect on the value set by set_val. The example below will set the value of the range sl... | diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py
--- a/lib/matplotlib/widgets.py
+++ b/lib/matplotlib/widgets.py
@@ -702,7 +702,7 @@ def __init__(
valmin, valmax, valfmt, dragging, valstep)
# Set a value to allow _value_in_bounds() to work.
- self.val = [val... | diff --git a/lib/matplotlib/tests/test_widgets.py b/lib/matplotlib/tests/test_widgets.py
--- a/lib/matplotlib/tests/test_widgets.py
+++ b/lib/matplotlib/tests/test_widgets.py
@@ -1297,12 +1297,12 @@ def handle_positions(slider):
else:
return [h.get_xdata()[0] for h in slider._handles]
- slide... | ["lib/matplotlib/tests/test_widgets.py::test_range_slider[horizontal]", "lib/matplotlib/tests/test_widgets.py::test_range_slider[vertical]"] | ["lib/matplotlib/tests/test_widgets.py::test_save_blitted_widget_as_pdf", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs0]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs1]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs2]", "lib/matplotlib/tests/te... | null | true | 2023-02-28T01:02:54Z | 1 | 8 | 2 | 2,044 | 0 | 0.8 | 1 | 0.85 | 1 | 0.367333 | 90.027 | |
3,044 | swe_bench::test::1902 | swe_bench | test | 1,902 | sphinx-doc__sphinx-9902 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | a7462d57b414c6f75b1a456c1367cf90caa56df1 | .. py:data:: :type: option does not correctly link to type supplied
### Describe the bug
when using the .. py:data:: directive there is the :type: option to specify the type for the data being stored in the module level attribute. It does not work within the context of the module. What I mean by that is I have to key... | I did also want to mention the use of :py:class:`Unit` does not work in the :type: option field.
Yet it does work when specifying the type for a parameter of a function.
I have also placed the import of "Unit" before the docstring and explicitly set the docstring to __doc__ and that did not work either.
Reprodu... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -80,9 +80,9 @@ class ModuleEntry(NamedTuple):
deprecated: bool
-def type_to_xref(text: str, env: BuildEnvironment = None) -> addnodes.pending_xref:
+def type_to_xref(target: str, en... | diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -1170,6 +1170,28 @@ def test_info_field_list_var(app):
refdomain="py", reftype="class", reftarget="int", **{"py:class": "Class"})
+def test_type_field(app):
+ text = ("..... | ["tests/test_domain_py.py::test_type_field"] | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f... | null | true | 2021-11-28T05:47:37Z | 1 | 18 | 1 | 1,834 | 0 | 0.8 | 1 | 0.85 | 1 | 0.365667 | 90.022 | |
3,045 | swe_bench::test::1803 | swe_bench | test | 1,803 | sphinx-doc__sphinx-8028 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 5e6da19f0e44a0ae83944fb6ce18f18f781e1a6e | Instance attributes are omitted with autosummary
This issue is a followup of #7948. Sorry, I forgot to open it.
**Is your feature request related to a problem? Please describe.**
Instance attributes are omitted when using the autosummary, as they cannot be imported. Consider the following class
```python
# contents o... | @tk0miya, I cannot add labels or milestones here, but nonetheless already closed #7948
Okay, I'll try to fix this if I have time until the next release. | diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py
--- a/sphinx/ext/autosummary/__init__.py
+++ b/sphinx/ext/autosummary/__init__.py
@@ -75,7 +75,7 @@
from sphinx.deprecation import RemovedInSphinx40Warning, RemovedInSphinx50Warning
from sphinx.environment import BuildEnvironment
fr... | diff --git a/tests/roots/test-ext-autosummary/autosummary_dummy_module.py b/tests/roots/test-ext-autosummary/autosummary_dummy_module.py
--- a/tests/roots/test-ext-autosummary/autosummary_dummy_module.py
+++ b/tests/roots/test-ext-autosummary/autosummary_dummy_module.py
@@ -16,7 +16,8 @@ class Bar:
pass
... | ["tests/test_ext_autosummary.py::test_autosummary_generate"] | ["tests/test_ext_autosummary.py::test_mangle_signature", "tests/test_ext_autosummary.py::test_escaping", "tests/test_ext_autosummary.py::test_autosummary_generate_content_for_module", "tests/test_ext_autosummary.py::test_autosummary_generate_content_for_module_skipped", "tests/test_ext_autosummary.py::test_autosummary_... | null | true | 2020-08-01T10:24:14Z | 2 | 46 | 1 | 1,212 | 0 | 0.8 | 1 | 0.85 | 1 | 0.355333 | 89.991 | |
3,046 | swe_bench::dev::176 | swe_bench | dev | 176 | sqlfluff__sqlfluff-1577 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 500505877769ab02504427284e4efdf832d299ea | "ValueError: Position Not Found" with macro spanning entire file
## Expected Behaviour
`sqlfluff parse` should probably not fail with an exception and stack trace.
## Observed Behaviour
`sqlfluff parse` throws an exception, given an input file which is entirely spanned by a Jinja macro.
## Steps to Reproduce
```co... | Hi @CyberShadow, @tunetheweb, what is expected output of
```console
$ echo -n '{% macro foo() %}{% endmacro %}' | sqlfluff parse -
```
?
Probably the same as the input. Definitely not an exception, in any case.
Edit: Whoops, forgot this was a `parse` case. What @tunetheweb said below, then.
For parse we don't ... | diff --git a/src/sqlfluff/core/templaters/base.py b/src/sqlfluff/core/templaters/base.py
--- a/src/sqlfluff/core/templaters/base.py
+++ b/src/sqlfluff/core/templaters/base.py
@@ -84,7 +84,8 @@ def __init__(
is the same as the source view.
"""
self.source_str = source_str
- self.templat... | diff --git a/test/core/templaters/jinja_test.py b/test/core/templaters/jinja_test.py
--- a/test/core/templaters/jinja_test.py
+++ b/test/core/templaters/jinja_test.py
@@ -75,6 +75,18 @@ def test__templater_jinja_error_catatrophic():
assert len(vs) > 0
+def test__templater_jinja_lint_empty():
+ """Check that... | ["test/core/templaters/jinja_test.py::test__templater_jinja_lint_empty"] | ["test/core/templaters/jinja_test.py::test__templater_jinja[simple]", "test/core/templaters/jinja_test.py::test__templater_jinja[unboundlocal_bugfix]", "test/core/templaters/jinja_test.py::test__templater_jinja_error_variable", "test/core/templaters/jinja_test.py::test__templater_jinja_error_syntax", "test/core/templat... | null | true | 2021-10-09T15:32:42Z | 1 | 5 | 1 | 2,976 | 0 | 0.8 | 1 | 1 | 0.8 | 0.512667 | 89.988 | |
3,047 | swe_bench::test::1304 | swe_bench | test | 1,304 | pydata__xarray-7120 | pydata/xarray | pydata/xarray | python | 58ab594aa4315e75281569902e29c8c69834151f | Raise nicer error if passing a list of dimension names to transpose
### What happened?
Hello,
in xarray 0.20.1, I am getting the following error
`ds = xr.Dataset({"foo": (("x", "y", "z"), [[[42]]]), "bar": (("y", "z"), [[24]])})`
`ds.transpose("y", "z", "x")`
```
868 """Depending on the setting of missing_dims, dr... | I can't reproduce on our dev branch. Can you try upgrading xarray please?
EDIT: can't reproduce on 2022.03.0 either.
Thanks. I upgraded to 2022.03.0
I am still getting the error
```
Python 3.9.12 (main, Apr 5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "l... | diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py
--- a/xarray/core/dataset.py
+++ b/xarray/core/dataset.py
@@ -5401,6 +5401,13 @@ def transpose(
numpy.transpose
DataArray.transpose
"""
+ # Raise error if list is passed as dims
+ if (len(dims) > 0) and (isinstance(dim... | diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py
--- a/xarray/tests/test_dataset.py
+++ b/xarray/tests/test_dataset.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import pickle
+import re
import sys
import warnings
from copy import copy, deepcopy
@@ -6806,3 +6807,17 @@ def test_str... | ["xarray/tests/test_dataset.py::test_transpose_error"] | ["xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "... | null | true | 2022-10-03T23:53:43Z | 1 | 7 | 1 | 1,957 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3495 | 89.9735 | |
3,048 | swe_bench::test::1447 | swe_bench | test | 1,447 | pytest-dev__pytest-7499 | pytest-dev/pytest | pytest-dev/pytest | python | 358150c30ee77c4b38dd63125d42d071304baf48 | suggestion: improve raises confusing message when matching
- [x] a detailed description of the bug or suggestion
I would like `pytest.raises` to check if strings have parenthesis in them when match is not None, so that people have that lightbulb moment, rather than head-scratching when it presents two identical strin... | Perhaps the messaging can be changed from "Pattern" to "Regex" or "Regex pattern" to make it more clear? I'm not sure a warning for strings is appropriate here (unless we want to remove that functionality) since the api allows strings
A check for exact equality + a value error on forgotten regex escape may prevent som... | diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py
--- a/src/_pytest/_code/code.py
+++ b/src/_pytest/_code/code.py
@@ -609,9 +609,10 @@ def match(self, regexp: "Union[str, Pattern]") -> "Literal[True]":
If it matches `True` is returned, otherwise an `AssertionError` is raised.
"""
... | diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py
--- a/testing/code/test_excinfo.py
+++ b/testing/code/test_excinfo.py
@@ -423,7 +423,7 @@ def test_division_zero():
result = testdir.runpytest()
assert result.ret != 0
- exc_msg = "Pattern '[[]123[]]+' does not match 'division by ze... | ["testing/python/raises.py::TestRaises::test_raises_match", "testing/python/raises.py::TestRaises::test_match_failure_string_quoting", "testing/python/raises.py::TestRaises::test_match_failure_exact_string_message", "testing/code/test_excinfo.py::test_match_raises_error"] | ["testing/code/test_excinfo.py::test_excinfo_simple", "testing/code/test_excinfo.py::test_excinfo_from_exc_info_simple", "testing/code/test_excinfo.py::test_excinfo_getstatement", "testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_entries", "testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceb... | null | true | 2020-07-14T18:59:56Z | 1 | 7 | 4 | 1,951 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3485 | 89.9705 | |
3,049 | swe_bench::test::5 | swe_bench | test | 5 | astropy__astropy-12842 | astropy/astropy | astropy/astropy | python | 3a0cd2d8cd7b459cdc1e1b97a14f3040ccc1fffc | No longer able to read BinnedTimeSeries with datetime column saved as ECSV after upgrading from 4.2.1 -> 5.0+
### Description
Hi, [This commit](https://github.com/astropy/astropy/commit/e807dbff9a5c72bdc42d18c7d6712aae69a0bddc) merged in PR #11569 breaks my ability to read an ECSV file created using Astropy v 4.2.1, ... | I hope you don't mind me tagging you @taldcroft as it was your commit, maybe you can help me figure out if this is a bug or an evolution in `astropy.TimeSeries` that requires an alternative file format? I was pretty happy using ecsv formatted files to save complex data as they have been pretty stable, easy to visually ... | diff --git a/astropy/time/core.py b/astropy/time/core.py
--- a/astropy/time/core.py
+++ b/astropy/time/core.py
@@ -34,7 +34,7 @@
from astropy.extern import _strptime
-__all__ = ['TimeBase', 'Time', 'TimeDelta', 'TimeInfo', 'update_leap_seconds',
+__all__ = ['TimeBase', 'Time', 'TimeDelta', 'TimeInfo', 'TimeInfoBas... | diff --git a/astropy/io/ascii/tests/test_ecsv.py b/astropy/io/ascii/tests/test_ecsv.py
--- a/astropy/io/ascii/tests/test_ecsv.py
+++ b/astropy/io/ascii/tests/test_ecsv.py
@@ -822,13 +822,13 @@ def _make_expected_values(cols):
'name': '2-d regular array',
'subtype': 'float16[2,2]'}]
-cols['scalar object'] ... | ["astropy/time/tests/test_basic.py::test_write_every_format_to_ecsv[datetime]", "astropy/time/tests/test_basic.py::test_write_every_format_to_ecsv[datetime64]", "astropy/time/tests/test_basic.py::test_write_every_format_to_ecsv[byear]"] | ["astropy/io/ascii/tests/test_ecsv.py::astropy.io.ascii.tests.test_ecsv.test_round_trip_masked_table_default", "astropy/io/ascii/tests/test_ecsv.py::test_write_simple", "astropy/io/ascii/tests/test_ecsv.py::test_write_full", "astropy/io/ascii/tests/test_ecsv.py::test_write_read_roundtrip", "astropy/io/ascii/tests/test_... | null | true | 2022-02-12T12:38:10Z | 2 | 97 | 3 | 7,026 | 0 | 0.8 | 1 | 0.8 | 1 | 0.823333 | 89.97 | |
3,050 | swe_bench::test::980 | swe_bench | test | 980 | matplotlib__matplotlib-21490 | matplotlib/matplotlib | matplotlib/matplotlib | python | b09aad279b5dcfc49dcf43e0b064eee664ddaf68 | [Bug]: Line2D should copy its inputs
### Bug summary
Currently, Line2D doesn't copy its inputs if they are already arrays. Most of the time, in-place modifications to the input arrays do *not* affect the draw line, because there is a cache that doesn't get invalidated, but in some circumstances, it *is* possible for ... | I agree, for most practical purposes, the memory consumption should be negligable.
If one wanted to be on the safe side, one could add a flag, but I tend to think that's not neccesary.
Seems like a well defined what-to-do (with a lot of examples at other places in the code) -- adding it as a good first issue/hacktob... | diff --git a/examples/units/basic_units.py b/examples/units/basic_units.py
--- a/examples/units/basic_units.py
+++ b/examples/units/basic_units.py
@@ -132,6 +132,9 @@ def __init__(self, value, unit):
self.unit = unit
self.proxy_target = self.value
+ def __copy__(self):
+ return TaggedValue... | diff --git a/lib/matplotlib/tests/test_lines.py b/lib/matplotlib/tests/test_lines.py
--- a/lib/matplotlib/tests/test_lines.py
+++ b/lib/matplotlib/tests/test_lines.py
@@ -332,3 +332,14 @@ def test_picking():
found, indices = l2.contains(mouse_event)
assert found
assert_array_equal(indices['ind'], [0])
+
... | ["lib/matplotlib/tests/test_lines.py::test_input_copy[png]", "lib/matplotlib/tests/test_lines.py::test_input_copy[pdf]"] | ["lib/matplotlib/tests/test_lines.py::test_segment_hits", "lib/matplotlib/tests/test_lines.py::test_invisible_Line_rendering", "lib/matplotlib/tests/test_lines.py::test_set_line_coll_dash", "lib/matplotlib/tests/test_lines.py::test_line_dashes[png]", "lib/matplotlib/tests/test_lines.py::test_line_dashes[pdf]", "lib/mat... | null | true | 2021-10-28T22:36:00Z | 2 | 9 | 2 | 1,899 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3465 | 89.9645 | |
3,051 | swe_bench::test::1473 | swe_bench | test | 1,473 | pytest-dev__pytest-8906 | pytest-dev/pytest | pytest-dev/pytest | python | 69356d20cfee9a81972dcbf93d8caf9eabe113e8 | Improve handling of skip for module level
This is potentially about updating docs, updating error messages or introducing a new API.
Consider the following scenario:
`pos_only.py` is using Python 3,8 syntax:
```python
def foo(a, /, b):
return a + b
```
It should not be tested under Python 3.6 and 3.7.
This is a ... | SyntaxErrors are thrown before execution, so how would the skip call stop the interpreter from parsing the 'incorrect' syntax?
unless we hook the interpreter that is.
A solution could be to ignore syntax errors based on some parameter
if needed we can extend this to have some functionality to evaluate conditions in ... | diff --git a/src/_pytest/python.py b/src/_pytest/python.py
--- a/src/_pytest/python.py
+++ b/src/_pytest/python.py
@@ -608,10 +608,10 @@ def _importtestmodule(self):
if e.allow_module_level:
raise
raise self.CollectError(
- "Using pytest.skip outside of a test i... | diff --git a/testing/test_skipping.py b/testing/test_skipping.py
--- a/testing/test_skipping.py
+++ b/testing/test_skipping.py
@@ -1341,7 +1341,7 @@ def test_func():
)
result = pytester.runpytest()
result.stdout.fnmatch_lines(
- ["*Using pytest.skip outside of a test is not allowed*"]
+ ["*... | ["testing/test_skipping.py::test_module_level_skip_error"] | ["testing/test_skipping.py::test_importorskip", "testing/test_skipping.py::TestEvaluation::test_no_marker", "testing/test_skipping.py::TestEvaluation::test_marked_xfail_no_args", "testing/test_skipping.py::TestEvaluation::test_marked_skipif_no_args", "testing/test_skipping.py::TestEvaluation::test_marked_one_arg", "tes... | null | true | 2021-07-14T08:00:50Z | 1 | 8 | 1 | 1,917 | 0 | 0.8 | 1 | 0.85 | 1 | 0.346167 | 89.9635 | |
3,052 | swe_bench::test::327 | swe_bench | test | 327 | django__django-12464 | django/django | django/django | python | f37d548ede290690589e86b892c4f106e2a8e1bc | DISTINCT with GROUP_CONCAT() and multiple expressions raises NotSupportedError on SQLite.
Description
Contrary to what is suggested in lines 60-64 of django.db.backends.sqlite3.operations.py, SQLite does support DISTINCT on aggregate functions.
One such example is GROUP_CONCAT, which is quite similar to PostgreSQL's ... | Thanks for this ticket. I agree that it shouldn't raise an error in some cases, but removing this check is not an option, IMO. Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111.
There seems to be problem for concatenation style aggregation in general, here is what i experimented on postgresql: In [18]: Blog.object... | diff --git a/django/db/backends/sqlite3/operations.py b/django/db/backends/sqlite3/operations.py
--- a/django/db/backends/sqlite3/operations.py
+++ b/django/db/backends/sqlite3/operations.py
@@ -56,7 +56,11 @@ def check_expression_support(self, expression):
'aggregations on date/time fields... | diff --git a/tests/backends/sqlite/tests.py b/tests/backends/sqlite/tests.py
--- a/tests/backends/sqlite/tests.py
+++ b/tests/backends/sqlite/tests.py
@@ -63,6 +63,15 @@ class DistinctAggregate(Aggregate):
with self.assertRaisesMessage(NotSupportedError, msg):
connection.ops.check_expression_suppo... | ["test_distinct_aggregation_multiple_args_no_distinct (backends.sqlite.tests.Tests)"] | ["test_parameter_escaping (backends.sqlite.tests.EscapingChecksDebug)", "test_parameter_escaping (backends.sqlite.tests.EscapingChecks)", "test_large_number_of_parameters (backends.sqlite.tests.LastExecutedQueryTest)", "test_no_interpolation (backends.sqlite.tests.LastExecutedQueryTest)", "test_parameter_quoting (backe... | null | true | 2020-02-18T07:34:42Z | 1 | 6 | 1 | 1,952 | 0 | 0.8 | 1 | 0.85 | 1 | 0.345333 | 89.961 | |
3,053 | swe_bench::test::1290 | swe_bench | test | 1,290 | pydata__xarray-6857 | pydata/xarray | pydata/xarray | python | 434f9e8929942afc2380eab52a07e77d30cc7885 | Testing DataArray equality using built-in '==' operator leads to mutilated DataArray.attrs dictionary
### What happened?
In previous versions of xarray, testing numerical equivalence of two DataArrays was possible using the built-in operator '==' and without side affects. Now in version 2022.6.0, when one DataArray la... | ~can you try if setting `keep_attrs=True` helps?~
That's wrong, I can reproduce the side-effects. Not sure where that's coming from, though. And interestingly, only the first operand is mutated, `da_withoutunits == da_withunits` does not drop the units on `da_withunits`.
keep_attrs=True doesn't help
```python
In [... | diff --git a/xarray/core/alignment.py b/xarray/core/alignment.py
--- a/xarray/core/alignment.py
+++ b/xarray/core/alignment.py
@@ -467,7 +467,7 @@ def override_indexes(self) -> None:
if obj_idx is not None:
for name, var in self.aligned_index_vars[key].items():
... | diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py
--- a/xarray/tests/test_dataset.py
+++ b/xarray/tests/test_dataset.py
@@ -2333,6 +2333,20 @@ def test_align_str_dtype(self) -> None:
assert_identical(expected_b, actual_b)
assert expected_b.x.dtype == actual_b.x.dtype
+ @pyt... | ["xarray/tests/test_dataset.py::TestDataset::test_align_index_var_attrs[left]", "xarray/tests/test_dataset.py::TestDataset::test_align_index_var_attrs[override]"] | ["xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "... | null | true | 2022-08-01T10:57:16Z | 1 | 4 | 2 | 2,939 | 0 | 0.8 | 1 | 1 | 0.8 | 0.503167 | 89.9595 | |
3,054 | swe_bench::test::678 | swe_bench | test | 678 | django__django-15044 | django/django | django/django | python | 1f9874d4ca3e7376036646aedf6ac3060f22fd69 | CacheMiddleware and FetchFromCacheMiddleware are not thread safe.
Description
CacheMiddleware persist self.cache = caches[cache_alias] on startup and it is not thread safe. https://github.com/django/django/blob/main/django/middleware/cache.py#L186
I found that after some production errors with pylibmc and uwsgi threa... | PR https://github.com/django/django/pull/15044
Possibly related to #33092.
Thanks for the report! | diff --git a/django/middleware/cache.py b/django/middleware/cache.py
--- a/django/middleware/cache.py
+++ b/django/middleware/cache.py
@@ -67,7 +67,10 @@ def __init__(self, get_response):
self.page_timeout = None
self.key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
self.cache_alias = settin... | diff --git a/tests/cache/tests.py b/tests/cache/tests.py
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -994,9 +994,9 @@ def test_custom_key_func(self):
self.assertEqual(caches['custom_key'].get('answer2'), 42)
self.assertEqual(caches['custom_key2'].get('answer2'), 42)
+ @override_setti... | ["The cache instance is different for each thread."] | ["test_createcachetable_observes_database_router (cache.tests.CreateCacheTableForDBCacheTests)", "If None is cached, get() returns it instead of the default.", "Passing in None into timeout results in a value that is cached forever", "Follow memcached's convention where a timeout greater than 30 days is", "Nonexistent ... | null | true | 2021-11-01T02:34:46Z | 1 | 11 | 1 | 1,843 | 0 | 0.8 | 1 | 0.85 | 1 | 0.343833 | 89.9565 | |
3,055 | swe_bench::test::1822 | swe_bench | test | 1,822 | sphinx-doc__sphinx-8362 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 8981e84779ff87f1a058939a5d678e5993d67aa8 | autodoc uses a wrapper's signature for a decorated class
**Describe the bug**
`autodoc` uses a wrapper's signature for a decorated class.
**To Reproduce**
Branch: https://github.com/harupy/sphinx/tree/decorated-class
Steps to reproduce the behavior:
In `tests/roots/test-ext-autodoc/target/decorator.py`, add:.
```... | `ClassDocumenter` doesn't seem to set `follow_wrapped` to `True` when extracting a signature.
https://github.com/sphinx-doc/sphinx/blob/38b868cc0d0583d9a58496cd121f0bc345bf9eaa/sphinx/ext/autodoc/__init__.py#L1401
The same thing occurs here:
https://github.com/sphinx-doc/sphinx/blob/38b868cc0d0583d9a58496cd121f0b... | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1222,7 +1222,7 @@ def format_args(self, **kwargs: Any) -> str:
try:
self.env.app.emit('autodoc-before-process-signature', self.object, False)... | diff --git a/tests/roots/test-ext-autodoc/target/decorator.py b/tests/roots/test-ext-autodoc/target/decorator.py
--- a/tests/roots/test-ext-autodoc/target/decorator.py
+++ b/tests/roots/test-ext-autodoc/target/decorator.py
@@ -29,3 +29,25 @@ class Bar:
@deco1
def meth(self, name=None, age=None):
pass... | ["tests/test_ext_autodoc_autoclass.py::test_decorators", "tests/test_util_inspect.py::test_signature_methods"] | ["tests/test_ext_autodoc_autoclass.py::test_classes", "tests/test_util_inspect.py::test_signature", "tests/test_util_inspect.py::test_signature_partial", "tests/test_util_inspect.py::test_signature_partialmethod", "tests/test_util_inspect.py::test_signature_annotations", "tests/test_util_inspect.py::test_signature_anno... | null | true | 2020-11-03T17:39:46Z | 2 | 13 | 2 | 1,801 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3435 | 89.9555 | |
3,056 | swe_bench::test::1620 | swe_bench | test | 1,620 | scikit-learn__scikit-learn-13877 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 88846b3be23e96553fb90d0c5575d74ffd8dbff2 | pairwise_distances returns zeros for metric cosine when executed in parallel
#### Description
`pairwise_distances` returns a list of zeros when calculating `cosine` with `n_jobs` equal to -1 or greater than 2. Using `n_jobs=1` calculates the expected results.
Using the metric `euclidean` returns non-zero results, but ... | Thanks for the thorough report. It seems to be casting to integer dtype here:
https://github.com/scikit-learn/scikit-learn/blob/88846b3be23e96553fb90d0c5575d74ffd8dbff2/sklearn/metrics/pairwise.py#L1191
I think instead it should be using the dtype of the return values, or else something like `_return_float_dtype`. ... | diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py
--- a/sklearn/metrics/pairwise.py
+++ b/sklearn/metrics/pairwise.py
@@ -1182,17 +1182,23 @@ def _parallel_pairwise(X, Y, func, n_jobs, **kwds):
if Y is None:
Y = X
+ X, Y, dtype = _return_float_dtype(X, Y)
if effective_n_jo... | diff --git a/sklearn/metrics/tests/test_pairwise.py b/sklearn/metrics/tests/test_pairwise.py
--- a/sklearn/metrics/tests/test_pairwise.py
+++ b/sklearn/metrics/tests/test_pairwise.py
@@ -231,31 +231,6 @@ def test_pairwise_precomputed_non_negative():
metric='precomputed')
-def check_pairwis... | ["sklearn/metrics/tests/test_pairwise.py::test_pairwise_parallel[float64-array-pairwise_distances-euclidean-kwds0]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_parallel[int-array-pairwise_distances-euclidean-kwds0]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_parallel[int-array-pairwise_kernels-... | ["sklearn/metrics/tests/test_pairwise.py::test_pairwise_distances", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[dice]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[jaccard]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[kulsinski]", "skl... | null | true | 2019-05-14T14:14:47Z | 1 | 8 | 8 | 1,897 | 0 | 0.8 | 1 | 0.85 | 1 | 0.342833 | 89.9535 | |
3,057 | swe_bench::test::1863 | swe_bench | test | 1,863 | sphinx-doc__sphinx-9128 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | dfdc7626b5dd06bff3d326e6efddc492ef00c471 | autodoc: duplication warning on documenting aliased object
**Describe the bug**
autodoc: duplication warning on documenting aliased object
**To Reproduce**
```
# example.py
from io import StringIO
```
```
# index.rst
.. autoclass:: example.StringIO
.. autoclass:: io.StringIO
```
```
Removing everything under '_build'.... | I noticed the example is not good. Both `example.StringIO` and `io.StringIO` are aliases of `_io.StringIO`. So they're surely conflicted.
It would be better to not emit a warning for this case:
```
.. autoclass:: _io.StringIO
.. autoclass:: io.StringIO
```
The former one is a canonical name of the `io.StringI... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -68,7 +68,7 @@ class ObjectEntry(NamedTuple):
docname: str
node_id: str
objtype: str
- canonical: bool
+ aliased: bool
class ModuleEntry(NamedTuple):
@@ -505,7 +505... | diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -870,6 +870,39 @@ def test_canonical(app):
assert domain.objects['_io.StringIO'] == ('index', 'io.StringIO', 'class', True)
+def test_canonical_definition_overrides(app, warning):
+ ... | ["tests/test_domain_py.py::test_canonical_definition_overrides", "tests/test_domain_py.py::test_canonical_definition_skip"] | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f... | null | true | 2021-04-22T16:21:25Z | 1 | 26 | 2 | 1,496 | 0 | 0.8 | 1 | 0.85 | 1 | 0.336 | 89.933 | |
3,058 | swe_bench::test::979 | swe_bench | test | 979 | matplotlib__matplotlib-21481 | matplotlib/matplotlib | matplotlib/matplotlib | python | d448de31b7deaec8310caaf8bba787e097bf9211 | [Bug]: Subfigure breaks for some `Gridspec` slices when using `constrained_layout`
### Bug summary
When creating a figure with `constrained_layout=True` you cannot use arbitrary gridspecs to create subfigures as it throws an error at some point ( I think once the layout manager actually takes effect?). This happened i... | Not 100% sure what is going on, but pretty sure we never tested add_subfigure on arbitrary gridspec slices. Maybe it can be made to work, but you may be stretching the limits of what is possible.
For the layout above I'm not sure why you don't just have two columns. But maybe that si just a simple example. | diff --git a/lib/matplotlib/_layoutgrid.py b/lib/matplotlib/_layoutgrid.py
--- a/lib/matplotlib/_layoutgrid.py
+++ b/lib/matplotlib/_layoutgrid.py
@@ -169,7 +169,8 @@ def hard_constraints(self):
self.solver.addConstraint(c | 'required')
def add_child(self, child, i=0, j=0):
- self.childre... | diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
--- a/lib/matplotlib/tests/test_constrainedlayout.py
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
@@ -560,3 +560,10 @@ def test_suplabels():
pos = ax.get_tightbbox(fig.canvas.get_renderer())
as... | ["lib/matplotlib/tests/test_figure.py::test_subfigure_spanning"] | ["lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout1[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout2[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout3[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout4[pn... | null | true | 2021-10-28T08:05:46Z | 1 | 3 | 1 | 2,861 | 0 | 0.8 | 1 | 1 | 0.8 | 0.486833 | 89.9105 | |
3,059 | swe_bench::test::1008 | swe_bench | test | 1,008 | matplotlib__matplotlib-23174 | matplotlib/matplotlib | matplotlib/matplotlib | python | d73ba9e00eddae34610bf9982876b5aa62114ad5 | [Bug]: Crash when adding clabels to subfigures
### Bug summary
Adding a clabel to a contour plot of a subfigure results in a traceback.
### Code for reproduction
```python
# Taken from the Contour Demo example
delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 =... | Not sure if one should add `self._cachedRenderer = None` to `FigureBase` (and remove in `Figure`) or to `SubFigure` init-functions, but that should fix it.
I thought it was a recent regression, but it doesn't look like it, so maybe should be labelled 3.6.0 instead? | diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -2060,6 +2060,14 @@ def dpi(self):
def dpi(self, value):
self._parent.dpi = value
+ @property
+ def _cachedRenderer(self):
+ return self._parent._cachedRenderer
... | diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -585,3 +585,23 @@ def test_all_algorithms():
ax.contourf(x, y, z, algorithm=algorithm)
ax.contour(x, y, z, algorithm=algorit... | ["lib/matplotlib/tests/test_contour.py::test_subfigure_clabel"] | ["lib/matplotlib/tests/test_contour.py::test_contour_shape_1d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_2d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args0-Length", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args1-Length", "lib/matplotlib/tests/t... | null | true | 2022-06-01T10:32:18Z | 1 | 8 | 1 | 1,795 | 0 | 0.8 | 1 | 0.85 | 1 | 0.325833 | 89.9025 | |
3,060 | swe_bench::test::1393 | swe_bench | test | 1,393 | pytest-dev__pytest-11178 | pytest-dev/pytest | pytest-dev/pytest | python | 97ed533f63d5780a05702a711555cb6744247a37 | `pytest.approx` fails with `TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'`
When using `approx` to test float and one of the objects in the `assert` statement contain `None` I see the following TypeError:
`TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'.
`
## Minimal example... | We should probably error earlier, none is not approx-able
It seems to be a mistake to let approx take dict for convenience
It appears that `None` is currently functional when passing it directly to approx, but not when passed as part of a dictionary (which gets processed by the `ApproxMapping` class, and a subtractio... | diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py
--- a/src/_pytest/python_api.py
+++ b/src/_pytest/python_api.py
@@ -265,19 +265,20 @@ def _repr_compare(self, other_side: Mapping[object, float]) -> List[str]:
approx_side_as_map.items(), other_side.values()
):
if appr... | diff --git a/testing/python/approx.py b/testing/python/approx.py
--- a/testing/python/approx.py
+++ b/testing/python/approx.py
@@ -122,6 +122,23 @@ def test_error_messages_native_dtypes(self, assert_approx_raises_regex):
],
)
+ assert_approx_raises_regex(
+ {"a": 1.0, "b": None... | ["testing/python/approx.py::TestApprox::test_error_messages_native_dtypes"] | ["testing/python/approx.py::TestApprox::test_repr_string", "testing/python/approx.py::TestApprox::test_repr_complex_numbers", "testing/python/approx.py::TestApprox::test_bool", "testing/python/approx.py::TestApprox::test_operator_overloading", "testing/python/approx.py::TestApprox::test_exactly_equal", "testing/python/... | null | true | 2023-07-07T19:54:58Z | 1 | 25 | 1 | 1,422 | 0 | 0.8 | 1 | 0.85 | 1 | 0.320333 | 89.886 | |
3,061 | swe_bench::test::932 | swe_bench | test | 932 | django__django-5158 | django/django | django/django | python | f9de1972685ab5ab31ce483a297d85d3e119088b | Unknown django-admin command raises "settings not configured" when no project exists
Description
When you try to execute a command that does not exist outside a Django project (e.g. createproject instead of startproject...), Django raise a ImproperlyConfigured that does not fit with the real error:
(testdjango):~/test... | Suggestion of patch
I think your proposal makes sense. It keeps the fix for #21634, but only when using manage.py. Claude, what do you think? | diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -177,8 +177,14 @@ def fetch_command(self, subcommand):
try:
app_name = commands[subcommand]
except KeyError:
- ... | diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -283,7 +283,8 @@ def test_custom_command(self):
args = ['noargs_command']
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
- ... | ["alternate: django-admin can't execute user commands unless settings are provided", "default: django-admin can't execute user commands if it isn't provided settings", "fulldefault: django-admin can't execute user commands unless settings are provided", "minimal: django-admin can't execute user commands unless settings... | ["test_custom_project_destination_missing (admin_scripts.tests.StartProject)", "Make sure the startproject management command is able to use a different project template", "Make sure template context variables are rendered with proper values", "Make sure the startproject management command is able to use a different pr... | null | true | 2015-08-19T10:02:04Z | 1 | 10 | 5 | 1,651 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3085 | 89.8505 | |
3,062 | swe_bench::test::1025 | swe_bench | test | 1,025 | matplotlib__matplotlib-23740 | matplotlib/matplotlib | matplotlib/matplotlib | python | 87b801b9574df8fa65ddd49b24a0584f50b79510 | [Bug]: colorbar with unattached mappables can't steal space
### Bug summary
This is something I noticed downstream in networkx: https://github.com/networkx/networkx/pull/5937#issuecomment-1223097369
Formerly, space for a `Colorbar` was stolen from the current `Axes`; that was deprecated and now in 3.6, it is stolen f... | Not directly related to #23502, but it may be that the logic for stealing and returning space should be discussed jointly.
Do we know when we changed to following the mappable's axes? That seems like we made a mistake there, and this may be a release critical bug fix. Marking as such to make sure it gets discussed. ... | diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -1245,13 +1245,19 @@ def colorbar(
"""
if ax is None:
- ax = getattr(mappable, "axes", self.gca())
+ ax = getattr(mappable, "axes", None)
... | diff --git a/lib/matplotlib/tests/test_colorbar.py b/lib/matplotlib/tests/test_colorbar.py
--- a/lib/matplotlib/tests/test_colorbar.py
+++ b/lib/matplotlib/tests/test_colorbar.py
@@ -315,6 +315,14 @@ def test_colorbarbase():
Colorbar(ax, cmap=plt.cm.bone)
+def test_parentless_mappable():
+ pc = mpl.collecti... | ["lib/matplotlib/tests/test_colorbar.py::test_parentless_mappable"] | ["lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_shape[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_length[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_inverted_axis[min-expected0-horizontal]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_exte... | null | true | 2022-08-25T22:37:47Z | 1 | 8 | 1 | 1,690 | 0 | 0.8 | 1 | 0.85 | 1 | 0.308333 | 89.85 | |
3,063 | swe_bench::dev::108 | swe_bench | dev | 108 | pydicom__pydicom-809 | pydicom/pydicom | pydicom/pydicom | python | 356a51ab4bc54fd18950041ebc44dbfa1a425a10 | "Printing" of certain dicom files fails once, but works the second time
#### Description
"Printing" of certain dicom files (see [example](https://github.com/pydicom/pydicom/files/2865551/dicom_exception.zip)) fails once, but not the second time
#### Steps/Code to Reproduce
```python
from pydicom import read_file
a =... | Occurs because Pixel Representation is in the top level-dataset while the ambiguous element is in a sequence.
Regression test:
```python
from pydicom.dataset import Dataset
ds = Dataset()
ds.PixelRepresentation = 0
ds.ModalityLUTSequence = [Dataset()]
ds.ModalityLUTSequence[0].LUTDescriptor = [0, 0, 16]
ds.... | diff --git a/pydicom/dataset.py b/pydicom/dataset.py
--- a/pydicom/dataset.py
+++ b/pydicom/dataset.py
@@ -197,6 +197,9 @@ def __init__(self, *args, **kwargs):
self.is_little_endian = None
self.is_implicit_VR = None
+ # the parent data set, if this dataset is a sequence item
+ self.par... | diff --git a/pydicom/tests/test_filewriter.py b/pydicom/tests/test_filewriter.py
--- a/pydicom/tests/test_filewriter.py
+++ b/pydicom/tests/test_filewriter.py
@@ -864,6 +864,47 @@ def test_write_new_ambiguous(self):
assert ds[0x00283002].VR == 'US'
assert ds.LUTDescriptor == [1, 0]
+ def test_amb... | ["pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVR::test_ambiguous_element_in_sequence_explicit", "pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVR::test_ambiguous_element_in_sequence_implicit"] | ["pydicom/tests/test_filewriter.py::TestWriteFile::testRTPlan", "pydicom/tests/test_filewriter.py::TestWriteFile::testRTDose", "pydicom/tests/test_filewriter.py::TestWriteFile::testCT", "pydicom/tests/test_filewriter.py::TestWriteFile::testMR", "pydicom/tests/test_filewriter.py::TestWriteFile::testUnicode", "pydicom/te... | null | true | 2019-03-04T20:14:54Z | 3 | 40 | 2 | 1,033 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3055 | 89.8415 | |
3,064 | swe_bench::test::1359 | swe_bench | test | 1,359 | pylint-dev__pylint-7114 | pylint-dev/pylint | pylint-dev/pylint | python | 397c1703e8ae6349d33f7b99f45b2ccaf581e666 | Linting fails if module contains module of the same name
### Steps to reproduce
Given multiple files:
```
.
`-- a/
|-- a.py
`-- b.py
```
Which are all empty, running `pylint a` fails:
```
$ pylint a
************* Module a
a/__init__.py:1:0: F0010: error while code parsing: Unable to load file a/__init__.py:
[... | @iFreilicht thanks for your report.
#4909 was a duplicate. | diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py
--- a/pylint/lint/expand_modules.py
+++ b/pylint/lint/expand_modules.py
@@ -82,8 +82,10 @@ def expand_modules(
continue
module_path = get_python_path(something)
additional_search_path = [".", module_path] + path
- ... | diff --git a/tests/checkers/unittest_imports.py b/tests/checkers/unittest_imports.py
--- a/tests/checkers/unittest_imports.py
+++ b/tests/checkers/unittest_imports.py
@@ -7,6 +7,7 @@
import os
import astroid
+import pytest
from pylint import epylint as lint
from pylint.checkers import imports
@@ -40,6 +41,9 @@ ... | ["tests/lint/unittest_lint.py::test_identically_named_nested_module"] | ["tests/checkers/unittest_imports.py::TestImportsChecker::test_relative_beyond_top_level", "tests/checkers/unittest_imports.py::TestImportsChecker::test_relative_beyond_top_level_three", "tests/checkers/unittest_imports.py::TestImportsChecker::test_relative_beyond_top_level_four", "tests/lint/unittest_lint.py::test_no_... | null | true | 2022-07-03T04:36:40Z | 1 | 10 | 1 | 1,615 | 0 | 0.8 | 1 | 0.85 | 1 | 0.3025 | 89.8325 | |
3,065 | swe_bench::test::1693 | swe_bench | test | 1,693 | scikit-learn__scikit-learn-25672 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 49a937e974190b4ab20c7506052ce8a67c129da1 | NDCG score doesn't work with binary relevance and a list of 1 element
See this code example:
```
>>> t = [[1]]
>>> p = [[0]]
>>> metrics.ndcg_score(t, p)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cbournhonesque/.pyenv/versions/bento/lib/python3.8/site-packages/sklearn/utils... | It doesn't seem like a well-defined problem in the case of a single input to me. I'm not sure what you'd expect to get
I'm skipping the computation if there are 0 relevant documents (any(truths) is False), since the metric is undefined.
For a single input, where truth = [1], I would expect to get 1 if prediction is 1,... | diff --git a/sklearn/metrics/_ranking.py b/sklearn/metrics/_ranking.py
--- a/sklearn/metrics/_ranking.py
+++ b/sklearn/metrics/_ranking.py
@@ -1733,10 +1733,16 @@ def ndcg_score(y_true, y_score, *, k=None, sample_weight=None, ignore_ties=False
if y_true.min() < 0:
# TODO(1.4): Replace warning w/ ValueErro... | diff --git a/sklearn/metrics/tests/test_ranking.py b/sklearn/metrics/tests/test_ranking.py
--- a/sklearn/metrics/tests/test_ranking.py
+++ b/sklearn/metrics/tests/test_ranking.py
@@ -1535,7 +1535,6 @@ def test_lrap_error_raised():
@pytest.mark.parametrize("n_classes", (2, 5, 10))
@pytest.mark.parametrize("random_stat... | ["sklearn/metrics/tests/test_ranking.py::test_ndcg_error_single_document"] | ["sklearn/metrics/tests/test_ranking.py::test_roc_curve[True]", "sklearn/metrics/tests/test_ranking.py::test_roc_curve[False]", "sklearn/metrics/tests/test_ranking.py::test_roc_curve_end_points", "sklearn/metrics/tests/test_ranking.py::test_roc_returns_consistency", "sklearn/metrics/tests/test_ranking.py::test_roc_curv... | null | true | 2023-02-23T19:32:21Z | 1 | 10 | 1 | 1,606 | 0 | 0.8 | 1 | 0.85 | 1 | 0.301 | 89.828 | |
3,066 | swe_bench::test::499 | swe_bench | test | 499 | django__django-13682 | django/django | django/django | python | fcd44b889f36c4be87910745614a0a4c88d7a3d8 | Improve error messages from forgetting to call .as_view() on a CBV
Description
(last modified by Angus Holder)
We can detect early-on that the user has forgotten to call .as_view() on their CBV when passing it into path(). For:
urlpatterns = [
path('home', HomeView)
]
The error currently happens only when you firs... | I agree with the motivation here. As per comments on the PR, I think we need to leverage the System check framework for this, rather than raising runtime errors, but other than that +1.
Would it be worthwhile to change the error message for if the name keyword argument is mistakenly passed as a positional argument? Cur... | diff --git a/django/urls/conf.py b/django/urls/conf.py
--- a/django/urls/conf.py
+++ b/django/urls/conf.py
@@ -55,6 +55,8 @@ def include(arg, namespace=None):
def _path(route, view, kwargs=None, name=None, Pattern=None):
+ from django.views import View
+
if isinstance(view, (list, tuple)):
# For i... | diff --git a/tests/check_framework/test_urls.py b/tests/check_framework/test_urls.py
--- a/tests/check_framework/test_urls.py
+++ b/tests/check_framework/test_urls.py
@@ -134,6 +134,16 @@ def test_check_unique_namespaces(self):
result = check_url_namespaces_unique(None)
self.assertEqual(result, [])
... | ["test_invalid_view_instance (urlpatterns.tests.SimplifiedURLTests)", "test_check_view_not_class (check_framework.test_urls.CheckUrlConfigTests)"] | ["test_allows_non_ascii_but_valid_identifiers (urlpatterns.tests.ParameterRestrictionTests)", "test_integer_parameter_name_causes_exception (urlpatterns.tests.ParameterRestrictionTests)", "test_non_identifier_parameter_name_causes_exception (urlpatterns.tests.ParameterRestrictionTests)", "test_resolve_type_error_propag... | null | true | 2020-11-14T17:37:01Z | 2 | 25 | 2 | 1,302 | 0 | 0.8 | 1 | 0.85 | 1 | 0.300333 | 89.826 | |
3,067 | swe_bench::test::1551 | swe_bench | test | 1,551 | scikit-learn__scikit-learn-12486 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 02dc9ed680e7f53f1b0d410dcdd37341c7958eb1 | ck estimator is classifier & num_classes>=2 in score.py
#### Reference Issues/PRs
#### What does this implement/fix? Explain your changes.
We are fixing this issue: https://github.com/scikit-learn/scikit-learn/issues/7598
We added a test in the scorer.py file that raises a ValueError if the user is either trying to u... | Looks good in general, but you need to add a regression test (you could use the GMM one or just a classification one with a single class maybe)
Thanks for your feedback, will do it soon.
On Sat 29 Sep 2018 at 17:36, Andreas Mueller <notifications@github.com>
wrote:
> Looks good in general, but you need to add a regre... | diff --git a/sklearn/metrics/scorer.py b/sklearn/metrics/scorer.py
--- a/sklearn/metrics/scorer.py
+++ b/sklearn/metrics/scorer.py
@@ -126,7 +126,13 @@ def __call__(self, clf, X, y, sample_weight=None):
y_type = type_of_target(y)
y_pred = clf.predict_proba(X)
if y_type == "binary":
- ... | diff --git a/sklearn/metrics/tests/test_score_objects.py b/sklearn/metrics/tests/test_score_objects.py
--- a/sklearn/metrics/tests/test_score_objects.py
+++ b/sklearn/metrics/tests/test_score_objects.py
@@ -186,10 +186,11 @@ def check_scoring_validator_for_single_metric_usecases(scoring_validator):
def check_multi... | ["sklearn/metrics/tests/test_score_objects.py::test_thresholded_scorers"] | ["sklearn/metrics/tests/test_score_objects.py::test_all_scorers_repr", "sklearn/metrics/tests/test_score_objects.py::test_check_scoring_and_check_multimetric_scoring", "sklearn/metrics/tests/test_score_objects.py::test_check_scoring_gridsearchcv", "sklearn/metrics/tests/test_score_objects.py::test_make_scorer", "sklear... | null | true | 2018-10-30T01:08:40Z | 1 | 17 | 1 | 1,427 | 0 | 0.8 | 1 | 0.85 | 1 | 0.2945 | 89.8085 | |
3,068 | swe_bench::test::1899 | swe_bench | test | 1,899 | sphinx-doc__sphinx-9799 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 2b5c55e45a0fc4e2197a9b8edb482b77c2fa3f85 | Re-opening #8255: hexadecimal default arguments are changed to decimal
### Describe the bug
I am experiencing the exact same problem as described in #8255: hexadecimal default arguments are changed to decimal.
### How to Reproduce
Autodoc the following function:
```python3
def some_function(
param_a,
... | Does `autodoc_preserve_defaults` help you?
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_preserve_defaults
I had already added
```python3
autodoc_preserve_defaults = True
```
to my `conf.py` file but it didn't change the output. So no, it doesn't help. | diff --git a/sphinx/ext/autodoc/preserve_defaults.py b/sphinx/ext/autodoc/preserve_defaults.py
--- a/sphinx/ext/autodoc/preserve_defaults.py
+++ b/sphinx/ext/autodoc/preserve_defaults.py
@@ -11,7 +11,8 @@
import ast
import inspect
-from typing import Any, Dict
+import sys
+from typing import Any, Dict, List, Option... | diff --git a/tests/roots/test-ext-autodoc/target/preserve_defaults.py b/tests/roots/test-ext-autodoc/target/preserve_defaults.py
--- a/tests/roots/test-ext-autodoc/target/preserve_defaults.py
+++ b/tests/roots/test-ext-autodoc/target/preserve_defaults.py
@@ -7,7 +7,8 @@
def foo(name: str = CONSTANT,
sentine... | ["tests/test_ext_autodoc_preserve_defaults.py::test_preserve_defaults"] | [] | null | true | 2021-10-30T15:26:46Z | 1 | 38 | 1 | 1,003 | 0 | 0.8 | 1 | 0.85 | 1 | 0.293833 | 89.8065 | |
3,069 | swe_bench::test::814 | swe_bench | test | 814 | django__django-16067 | django/django | django/django | python | c11336cd990e155371a5185cf3bd6942cad8d9da | DecimalValidator fails to validate 0 in scientific notation (0E+1 or 0E+2)
Description
(last modified by Shiplu Mokaddim)
In 1.11.29 DecimalValidator treats 0E+1 as valid decimal
>>> from django.forms.fields import DecimalField
>>> DecimalField(max_digits=8, decimal_places=7).clean('0E+1')
Decimal('0E+1')
But in 2.... | Thanks for the report. We should fix an edge case with 0, maybe: django/core/validators.py diff --git a/django/core/validators.py b/django/core/validators.py index 473203a67e..446f97af10 100644 a b class DecimalValidator: 487487 ) 488488 if exponent >= 0: 489489 # A positive exponent adds that many trailing zeros. 490 ... | diff --git a/django/core/validators.py b/django/core/validators.py
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -486,8 +486,10 @@ def __call__(self, value):
self.messages["invalid"], code="invalid", params={"value": value}
)
if exponent >= 0:
- # A... | diff --git a/tests/validators/tests.py b/tests/validators/tests.py
--- a/tests/validators/tests.py
+++ b/tests/validators/tests.py
@@ -548,6 +548,7 @@
Decimal("70E-6"),
ValidationError,
),
+ (DecimalValidator(max_digits=2, decimal_places=1), Decimal("0E+1"), None),
# 'Enter a number.' err... | ["test_validators (validators.tests.TestValidators)"] | ["test_basic_equality (validators.tests.TestValidatorEquality)", "test_decimal_equality (validators.tests.TestValidatorEquality)", "test_email_equality (validators.tests.TestValidatorEquality)", "test_file_extension_equality (validators.tests.TestValidatorEquality)", "test_prohibit_null_characters_validator_equality (v... | null | true | 2022-09-16T19:47:22Z | 1 | 6 | 1 | 1,633 | 0 | 0.8 | 1 | 0.85 | 1 | 0.292167 | 89.8015 | |
3,070 | swe_bench::test::1507 | swe_bench | test | 1,507 | scikit-learn__scikit-learn-10508 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | c753b77ac49e72ebc0fe5e3c2369fe628f975017 | LabelEncoder transform fails for empty lists (for certain inputs)
Python 3.6.3, scikit_learn 0.19.1
Depending on which datatypes were used to fit the LabelEncoder, transforming empty lists works or not. Expected behavior would be that empty arrays are returned in both cases.
```python
>>> from sklearn.preprocessing i... | `le.transform([])` will trigger an numpy array of `dtype=np.float64` and you fit something which was some string.
```python
from sklearn.preprocessing import LabelEncoder
import numpy as np
... | diff --git a/sklearn/preprocessing/label.py b/sklearn/preprocessing/label.py
--- a/sklearn/preprocessing/label.py
+++ b/sklearn/preprocessing/label.py
@@ -126,6 +126,9 @@ def transform(self, y):
"""
check_is_fitted(self, 'classes_')
y = column_or_1d(y, warn=True)
+ # transform of empty... | diff --git a/sklearn/preprocessing/tests/test_label.py b/sklearn/preprocessing/tests/test_label.py
--- a/sklearn/preprocessing/tests/test_label.py
+++ b/sklearn/preprocessing/tests/test_label.py
@@ -208,6 +208,21 @@ def test_label_encoder_errors():
assert_raise_message(ValueError, msg, le.inverse_transform, [-2])
... | ["sklearn/preprocessing/tests/test_label.py::test_label_encoder_errors", "sklearn/preprocessing/tests/test_label.py::test_label_encoder_empty_array"] | ["sklearn/preprocessing/tests/test_label.py::test_label_binarizer", "sklearn/preprocessing/tests/test_label.py::test_label_binarizer_unseen_labels", "sklearn/preprocessing/tests/test_label.py::test_label_binarizer_set_label_encoding", "sklearn/preprocessing/tests/test_label.py::test_label_binarizer_errors", "sklearn/pr... | null | true | 2018-01-19T18:00:29Z | 1 | 7 | 2 | 1,613 | 0 | 0.8 | 1 | 0.85 | 1 | 0.292167 | 89.8015 | |
3,071 | swe_bench::test::176 | swe_bench | test | 176 | django__django-11294 | django/django | django/django | python | a9b8898242cf2579ca5727ecab516ab761bce488 | Pluralize filter sometimes returns singular form instead of an empty string for invalid inputs
Description
Filters are documented to return either their input unchanged, or the empty string, whatever makes most sense, when they're used incorrectly. The pluralize filter returns the empty string in such cases, for insta... | I don't agree with the suggested implementation because when you pass a string to a pluralize it should not assume the string can be "pluralized". In your case, if you pass 'one', it would return the plural, and I think that it should return an empty string: it is language dependent whether strings represent singular o... | diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -851,8 +851,8 @@ def filesize_number_format(value):
@register.filter(is_safe=False)
def pluralize(value, arg='s'):
"""
- Return a plural suffix ... | diff --git a/tests/template_tests/filter_tests/test_pluralize.py b/tests/template_tests/filter_tests/test_pluralize.py
--- a/tests/template_tests/filter_tests/test_pluralize.py
+++ b/tests/template_tests/filter_tests/test_pluralize.py
@@ -58,8 +58,9 @@ def test_suffixes(self):
self.assertEqual(pluralize(0, 'y,... | ["test_no_len_type (template_tests.filter_tests.test_pluralize.FunctionTests)", "test_value_error (template_tests.filter_tests.test_pluralize.FunctionTests)"] | ["test_decimals (template_tests.filter_tests.test_pluralize.FunctionTests)", "test_floats (template_tests.filter_tests.test_pluralize.FunctionTests)", "test_integers (template_tests.filter_tests.test_pluralize.FunctionTests)", "test_lists (template_tests.filter_tests.test_pluralize.FunctionTests)", "test_suffixes (temp... | null | true | 2019-04-27T16:11:05Z | 1 | 12 | 2 | 1,485 | 0 | 0.8 | 1 | 0.85 | 1 | 0.2875 | 89.7875 | |
3,072 | swe_bench::test::1149 | swe_bench | test | 1,149 | mwaskom__seaborn-3394 | mwaskom/seaborn | mwaskom/seaborn | python | 9276e22a424fe2c834eff85231d0c916e293d613 | pd.NA reverses axis ordering
## Issue
When plotting with `pd.NA`, axis ordering get reversed into **descending**.
## Workaround
`np.nan` does not produce this issue
## Expected Behavior
NAs should be excluded without reversing axis order
## Reproducible Example
```python
import pandas as pd
import numpy as np
import... | This is a weird one! Let's debug.
First thought, this has something to do with using `FacetGrid` directly (which is discouraged). But no, we can reproduce using `relplot`:
```python
g = sns.relplot(
data=test_data,
col="type",
x="date", y="value",
kind="line", height=3,
marker="o",
... | diff --git a/seaborn/_core/plot.py b/seaborn/_core/plot.py
--- a/seaborn/_core/plot.py
+++ b/seaborn/_core/plot.py
@@ -1392,11 +1392,11 @@ def _setup_scales(
spec_error = PlotSpecError._during("Scaling operation", var)
raise spec_error from err
- # Now the ... | diff --git a/tests/_core/test_rules.py b/tests/_core/test_rules.py
--- a/tests/_core/test_rules.py
+++ b/tests/_core/test_rules.py
@@ -38,6 +38,12 @@ def test_variable_type():
s = pd.Series([pd.NA, pd.NA])
assert variable_type(s) == "numeric"
+ s = pd.Series([1, 2, pd.NA], dtype="Int64")
+ assert vari... | ["tests/_core/test_rules.py::test_variable_type", "tests/test_core.py::TestVectorPlotter::test_comp_data_nullable_dtype"] | ["tests/_core/test_rules.py::test_vartype_object", "tests/_core/test_rules.py::test_categorical_order", "tests/test_core.py::TestSemanticMapping::test_call_lookup", "tests/test_core.py::TestHueMapping::test_init_from_map", "tests/test_core.py::TestHueMapping::test_plotter_default_init", "tests/test_core.py::TestHueMapp... | null | true | 2023-06-19T20:59:52Z | 3 | 16 | 2 | 1,391 | 0 | 0.8 | 1 | 0.85 | 1 | 0.285167 | 89.7805 | |
3,073 | swe_bench::test::281 | swe_bench | test | 281 | django__django-12121 | django/django | django/django | python | ceecd0556dc6f013b5b62fedb12453b8ae3b8067 | Feature/docs: how should url converters decline to match for a named route?
Description
It is sometimes convenient to have multiple instances of a named route, where the correct one is chosen based on whether the URL converters to_url call succeeds. For example, the attached file has routes like this:
path('export/fo... | Single-file Django project demonstrating type-matching based url resolution
Having multiple URLs with the same name is not supported. (You'd need to have a converter that knew how to handle both types, or else two URLs with distinct names.) I think this kind of question is better aimed at support channels. See TicketCl... | diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ -632,11 +632,18 @@ def _reverse_with_prefix(self, lookup_view, _prefix, *args, **kwargs):
candidate_subs = kwargs
# Convert the candidate subs to text u... | diff --git a/tests/urlpatterns/path_same_name_urls.py b/tests/urlpatterns/path_same_name_urls.py
--- a/tests/urlpatterns/path_same_name_urls.py
+++ b/tests/urlpatterns/path_same_name_urls.py
@@ -1,6 +1,8 @@
-from django.urls import path, re_path
+from django.urls import path, re_path, register_converter
-from . impor... | ["test_reverse_value_error_means_no_match (urlpatterns.tests.ConversionExceptionTests)", "test_matching_urls_same_name (urlpatterns.tests.SameNameTests)", "test_converter_resolve (urlpatterns.tests.SimplifiedURLTests)"] | ["test_allows_non_ascii_but_valid_identifiers (urlpatterns.tests.ParameterRestrictionTests)", "test_non_identifier_parameter_name_causes_exception (urlpatterns.tests.ParameterRestrictionTests)", "test_resolve_type_error_propagates (urlpatterns.tests.ConversionExceptionTests)", "test_resolve_value_error_means_no_match (... | null | true | 2019-11-21T19:11:36Z | 1 | 9 | 3 | 1,525 | 0 | 0.8 | 1 | 0.85 | 1 | 0.284167 | 89.7775 | |
3,074 | swe_bench::test::27 | swe_bench | test | 27 | astropy__astropy-13462 | astropy/astropy | astropy/astropy | python | d441bfdbb8e6dc57a52d8c1b117cadd030f0657a | TST: time/tests/test_precision.py failed in pyinstaller (computed error is different depending on the order of the arguments)
First failing log (2022-03-13): https://github.com/astropy/astropy/runs/5525474634
Last successful log (2022-03-12): https://github.com/astropy/astropy/runs/5519547613
Looks like this test was... | At a glance, I don't see any version change in numpy, hypothesis, etc. Is this transient? 🤔 (Restarted the failed job.)
OK passed now. Sorry for the noise.
Looks to me like a genuine failing example, where the computed error is different depending on the order of the arguments:
```python
@example(f1=-3.08978507554... | diff --git a/astropy/time/utils.py b/astropy/time/utils.py
--- a/astropy/time/utils.py
+++ b/astropy/time/utils.py
@@ -60,14 +60,16 @@ def day_frac(val1, val2, factor=None, divisor=None):
# get integer fraction
day = np.round(sum12)
- extra, frac = two_sum(sum12, -day)
- frac += extra + err12
- # O... | diff --git a/astropy/time/tests/test_basic.py b/astropy/time/tests/test_basic.py
--- a/astropy/time/tests/test_basic.py
+++ b/astropy/time/tests/test_basic.py
@@ -2399,7 +2399,7 @@ def test_linspace():
"""
t1 = Time(['2021-01-01 00:00:00', '2021-01-02 00:00:00'])
t2 = Time(['2021-01-01 01:00:00', '2021-1... | ["astropy/time/tests/test_precision.py::test_day_frac_exact"] | ["astropy/time/tests/test_basic.py::TestBasic::test_different_dimensions", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[jd]", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[mjd]", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[decimalyear]", "astropy/time/tests/test_bas... | null | true | 2022-07-16T16:57:17Z | 1 | 16 | 1 | 1,380 | 0 | 0.8 | 1 | 0.85 | 1 | 0.283333 | 89.775 | |
3,075 | swe_bench::dev::200 | swe_bench | dev | 200 | sqlfluff__sqlfluff-3435 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 8e724ef8906eecce7179f4b7c52d4fc0672e4bd9 | L027: outer-level table not found in WHERE clause sub-select
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
Outer-level table/view referenced in sub-select inside `WHERE` clause is not being detected.
This error seem... | Does L027 use `SelectCrawler`? This sounds like an issue where it may be helpful.
Related: Rules that use `SelectCrawler` may be good candidates to benefit from setting `recurse_into` to `False`. (Setting the flag is just a start. This also requires reworking the rule code, hopefully no more than 1-2 hours of work.)... | diff --git a/src/sqlfluff/rules/L027.py b/src/sqlfluff/rules/L027.py
--- a/src/sqlfluff/rules/L027.py
+++ b/src/sqlfluff/rules/L027.py
@@ -99,23 +99,6 @@ def _lint_references_and_aliases(
)
)
- all_table_aliases = [t.ref_str for t in table_aliases] + standalone_aliases... | diff --git a/test/fixtures/rules/std_rule_cases/L027.yml b/test/fixtures/rules/std_rule_cases/L027.yml
--- a/test/fixtures/rules/std_rule_cases/L027.yml
+++ b/test/fixtures/rules/std_rule_cases/L027.yml
@@ -221,43 +221,6 @@ test_pass_rowtype_with_join:
core:
dialect: hive
-test_fail_column_name_not_found_... | ["test/rules/std_test.py::test__rules__std_file[L027-column_references.sql-violations16]"] | ["test/rules/std_test.py::test__rules__std_file[L001-indentation_errors.sql-violations0]", "test/rules/std_test.py::test__rules__std_file[L002-indentation_errors.sql-violations1]", "test/rules/std_test.py::test__rules__std_file[L003-indentation_errors.sql-violations2]", "test/rules/std_test.py::test__rules__std_file[L0... | null | true | 2022-06-07T18:47:03Z | 1 | 17 | 1 | 1,329 | 0 | 0.8 | 1 | 0.85 | 1 | 0.278167 | 89.7595 | |
3,076 | swe_bench::test::70 | swe_bench | test | 70 | astropy__astropy-14966 | astropy/astropy | astropy/astropy | python | f3f3b5def16a5a28ae655f51e08356e5f661ffb6 | QTable: Group keys don't have a unit
### Description
When grouping a QTable with a column that contains a quantity, the keys only contain a float with a value, but not the full quantity:
```Python
>>> from astropy.table import QTable
>>> import astropy.units as u
>>> tbl = QTable({"length": [1., 1., 2., 3., 1., 2.,]*... | @olebole - this should be possible without too much disruption. I have an idea for a lightweight fix, but it might also be done as part of #14942. | diff --git a/astropy/table/groups.py b/astropy/table/groups.py
--- a/astropy/table/groups.py
+++ b/astropy/table/groups.py
@@ -74,10 +74,15 @@ def _table_group_by(table, keys):
)
)
+ # TODO: don't use represent_mixins_as_columns here, but instead ensure that
+ # keys_sort.argsort(kind="sta... | diff --git a/astropy/table/tests/conftest.py b/astropy/table/tests/conftest.py
--- a/astropy/table/tests/conftest.py
+++ b/astropy/table/tests/conftest.py
@@ -204,8 +204,7 @@ def mixin_cols(request):
return cols
-@pytest.fixture(params=[False, True])
-def T1(request):
+def _get_test_table():
T = QTable.re... | ["astropy/table/tests/test_groups.py::test_column_group_by[True]", "astropy/table/tests/test_groups.py::test_column_group_by_no_argsort", "astropy/table/tests/test_groups.py::test_groups_keys_time"] | ["astropy/table/tests/test_groups.py::test_column_group_by[False]", "astropy/table/tests/test_groups.py::test_table_group_by[False]", "astropy/table/tests/test_groups.py::test_table_group_by[True]", "astropy/table/tests/test_groups.py::test_groups_keys[T1m0]", "astropy/table/tests/test_groups.py::test_groups_keys[T1m1]... | null | true | 2023-06-20T15:57:47Z | 1 | 34 | 3 | 975 | 0 | 0.8 | 1 | 0.85 | 1 | 0.275833 | 89.7525 | |
3,077 | swe_bench::test::1082 | swe_bench | test | 1,082 | matplotlib__matplotlib-25498 | matplotlib/matplotlib | matplotlib/matplotlib | python | 78bf53caacbb5ce0dc7aa73f07a74c99f1ed919b | Update colorbar after changing mappable.norm
How can I update a colorbar, after I changed the norm instance of the colorbar?
`colorbar.update_normal(mappable)` has now effect and `colorbar.update_bruteforce(mappable)` throws a `ZeroDivsionError`-Exception.
Consider this example:
``` python
import matplotlib.pyplot a... | You have run into a big bug in imshow, not colorbar. As a workaround, after setting `plot.norm`, call `plot.autoscale()`. Then the `update_bruteforce` will work.
When the norm is changed, it should pick up the vmax, vmin values from the autoscaling; but this is not happening. Actually, it's worse than that; it fails... | diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py
--- a/lib/matplotlib/colorbar.py
+++ b/lib/matplotlib/colorbar.py
@@ -301,11 +301,6 @@ def __init__(self, ax, mappable=None, *, cmap=None,
if mappable is None:
mappable = cm.ScalarMappable(norm=norm, cmap=cmap)
- # Ensur... | diff --git a/lib/matplotlib/tests/test_colorbar.py b/lib/matplotlib/tests/test_colorbar.py
--- a/lib/matplotlib/tests/test_colorbar.py
+++ b/lib/matplotlib/tests/test_colorbar.py
@@ -657,6 +657,12 @@ def test_colorbar_scale_reset():
assert cbar.outline.get_edgecolor() == mcolors.to_rgba('red')
+ # log scale... | ["lib/matplotlib/tests/test_colorbar.py::test_colorbar_scale_reset"] | ["lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_shape[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_length[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_inverted_axis[min-expected0-horizontal]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_exte... | null | true | 2023-03-18T17:01:11Z | 1 | 8 | 1 | 1,472 | 0 | 0.8 | 1 | 0.85 | 1 | 0.272 | 89.741 | |
3,078 | swe_bench::test::1497 | swe_bench | test | 1,497 | scikit-learn__scikit-learn-10382 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 1e1417cab24e5602d2d4db85e218d5277f13aeda | TfidfVectorizer dtype argument ignored
#### Description
TfidfVectorizer's fit/fit_transform output is always np.float64 instead of the specified dtype
#### Steps/Code to Reproduce
```py
from sklearn.feature_extraction.text import TfidfVectorizer
test = TfidfVectorizer(dtype=np.float32)
print(test.fit_transform(["Help ... |
I've attempted to fix it, please check.
| diff --git a/sklearn/exceptions.py b/sklearn/exceptions.py
--- a/sklearn/exceptions.py
+++ b/sklearn/exceptions.py
@@ -119,9 +119,9 @@ class FitFailedWarning(RuntimeWarning):
... pass
... print(repr(w[-1].message))
... # doctest: +NORMALIZE_WHITESPACE
- FitFailedWarning("Classifier fit fai... | diff --git a/sklearn/model_selection/tests/test_validation.py b/sklearn/model_selection/tests/test_validation.py
--- a/sklearn/model_selection/tests/test_validation.py
+++ b/sklearn/model_selection/tests/test_validation.py
@@ -9,6 +9,9 @@
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
+from skle... | ["sklearn/model_selection/tests/test_validation.py::test_fit_and_score"] | ["sklearn/model_selection/tests/test_validation.py::test_cross_val_score", "sklearn/model_selection/tests/test_validation.py::test_cross_validate_invalid_scoring_param", "sklearn/model_selection/tests/test_validation.py::test_cross_validate_return_train_score_warn", "sklearn/model_selection/tests/test_validation.py::te... | null | true | 2017-12-28T07:05:13Z | 2 | 13 | 1 | 1,356 | 0 | 0.8 | 1 | 0.85 | 1 | 0.269333 | 89.733 | |
3,079 | swe_bench::dev::203 | swe_bench | dev | 203 | sqlfluff__sqlfluff-3648 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | e56fc6002dac0fb7eb446d58bd8aa7a839908535 | dbt & JinjaTracer results in passing invalid query to database (was: DBT Call statement() block causes invalid query generated)
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
When using the call statement() to run a q... | This is a curious error. Can you run `dbt compile` and post what dbt expects the compiled form of this statement to be? I worry that while a query is run at compile time, this query otherwise compiles to an empty file - and that could be causing issues.
dbt compile doesn't output the call statement blocks since they're... | diff --git a/src/sqlfluff/core/templaters/slicers/tracer.py b/src/sqlfluff/core/templaters/slicers/tracer.py
--- a/src/sqlfluff/core/templaters/slicers/tracer.py
+++ b/src/sqlfluff/core/templaters/slicers/tracer.py
@@ -206,7 +206,8 @@ def __init__(self, raw_str: str, env: Environment):
# Internal bookkeeping... | diff --git a/test/core/templaters/jinja_test.py b/test/core/templaters/jinja_test.py
--- a/test/core/templaters/jinja_test.py
+++ b/test/core/templaters/jinja_test.py
@@ -697,6 +697,14 @@ def test__templater_jinja_slice_template(test, result):
] == result
+def _statement(*args, **kwargs):
+ return "_stateme... | ["test/core/templaters/jinja_test.py::test__templater_jinja_slice_file[{%"] | ["test/core/templaters/jinja_test.py::test__templater_jinja[simple]", "test/core/templaters/jinja_test.py::test__templater_jinja[unboundlocal_bugfix]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[basic_block]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[strip_left_block]", "... | null | true | 2022-07-21T22:42:19Z | 1 | 73 | 1 | 13,757 | 0 | 0.8 | 1 | 0.8 | 1 | 0.743333 | 89.73 | |
3,080 | swe_bench::test::1775 | swe_bench | test | 1,775 | sphinx-doc__sphinx-7557 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 1f5dab6446ebe7b70d1210689026a649b74a280d | Decorated inherited method has no documentation
**Describe the bug**
If an inherited method has a decorator, it does not inherit the parent's doc.
**To Reproduce**
```python
from abc import ABC, abstractmethod
from functools import lru_cache
class Base(ABC):
@abstractmethod
def my_method(self):
"""D... | Note: Now, Sphinx uses `inspect.getdoc()` to get inherited docstring. But it seems not supporting decorators. We need to add custom code to do that. | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -436,7 +436,8 @@ def get_doc(self, encoding: str = None, ignore: int = 1) -> List[List[str]]:
% self.__class__.__name__,
... | diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py
--- a/tests/test_util_inspect.py
+++ b/tests/test_util_inspect.py
@@ -564,3 +564,18 @@ def func1(a, b, c):
assert inspect.unpartial(func2) is func1
assert inspect.unpartial(func3) is func1
+
+
+def test_getdoc_inherited_decorated_method():... | ["tests/test_util_inspect.py::test_getdoc_inherited_decorated_method"] | ["tests/test_util_inspect.py::test_signature", "tests/test_util_inspect.py::test_signature_partial", "tests/test_util_inspect.py::test_signature_methods", "tests/test_util_inspect.py::test_signature_partialmethod", "tests/test_util_inspect.py::test_signature_annotations", "tests/test_util_inspect.py::test_signature_ann... | null | true | 2020-04-26T02:25:03Z | 2 | 25 | 1 | 1,088 | 0 | 0.8 | 1 | 0.85 | 1 | 0.264667 | 89.719 | |
3,081 | swe_bench::test::387 | swe_bench | test | 387 | django__django-12961 | django/django | django/django | python | 33c365781abbcc1b21a31b31d95d344a174df0d5 | order_by() with expressions crashes on union() querysets.
Description
(last modified by Mariusz Felisiak)
I have read the recent tickets about unions and order_by (#31496, #27995, #30628) , and my bug is slightly different, so I hope it's not a duplicate.
Let's consider two similar models:
class EntityA(models.Mode... | Thanks, yes it is a different issue that is strictly related with using expressions in .order_by(). Potential fix should target these lines. Would you like to try?
Replying to felixxm: Thanks, yes it is a different issue that is strictly related with using expressions in .order_by(). Potential fix should target these... | diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -6,7 +6,7 @@
from django.core.exceptions import EmptyResultSet, FieldError
from django.db import DatabaseError, NotSupportedError
from django.db.models.con... | diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py
--- a/tests/queries/test_qs_combinators.py
+++ b/tests/queries/test_qs_combinators.py
@@ -1,3 +1,5 @@
+import operator
+
from django.db import DatabaseError, NotSupportedError, connection
from django.db.models import Exists, F, I... | ["test_ordering_by_f_expression_and_alias (queries.test_qs_combinators.QuerySetSetOperationTests)"] | ["test_combining_multiple_models (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_difference (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_intersection (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_union (queries.test_qs_combinators.QuerySetSetOperati... | null | true | 2020-05-23T15:19:37Z | 1 | 7 | 1 | 1,438 | 0 | 0.8 | 1 | 0.85 | 1 | 0.263 | 89.714 | |
3,082 | swe_bench::test::1575 | swe_bench | test | 1,575 | scikit-learn__scikit-learn-13017 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | db17f3e2221fb6cec256d2d3501e259c5d5db934 | ColumnTransformer behavior for negative column indexes
#### Description
The behavior of `ColumnTransformer` when negative integers are passed as column indexes is not clear.
#### Steps/Code to Reproduce
```python
import numpy as np
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHo... | I think we should allow negative indices, if only because we are supporting
various other numpy indexing syntaxes and users would expect it. Current
behaviour doesn't look so good!
Can I work on this? My initial thought process is to look at the `ColumnTransformer` class and see how column names are being parsed. The ... | diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py
--- a/sklearn/compose/_column_transformer.py
+++ b/sklearn/compose/_column_transformer.py
@@ -628,14 +628,11 @@ def _get_column_indices(X, key):
"""
n_columns = X.shape[1]
- if _check_key_type(key, int):
- ... | diff --git a/sklearn/compose/tests/test_column_transformer.py b/sklearn/compose/tests/test_column_transformer.py
--- a/sklearn/compose/tests/test_column_transformer.py
+++ b/sklearn/compose/tests/test_column_transformer.py
@@ -1019,3 +1019,15 @@ def func(X):
assert_array_equal(ct.fit(X_df).transform(X_df), X_res_f... | ["sklearn/compose/tests/test_column_transformer.py::test_column_transformer_negative_column_indexes"] | ["sklearn/compose/tests/test_column_transformer.py::test_column_transformer", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_dataframe", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_empty_columns[list-pandas]", "sklearn/compose/tests/test_column_transformer.py::... | null | true | 2019-01-19T15:51:13Z | 1 | 17 | 1 | 1,227 | 0 | 0.8 | 1 | 0.85 | 1 | 0.261167 | 89.7085 | |
3,083 | swe_bench::test::837 | swe_bench | test | 837 | django__django-16281 | django/django | django/django | python | 2848e5d0ce5cf3c31fe87525536093b21d570f69 | Migration changing ManyToManyField target to 'self' doesn't work correctly
Description
Steps to reproduce:
Create Models:
class Bar(models.Model):
pass
class Foo(models.Model):
bar = models.ManyToManyField('Bar', blank=True)
Migrate:
./manage.py makemigrations app
./manage.py migrate
Change type of the ManyToManyFie... | I believe it works correctly as long as the new target model isn't 'self'.
Can I check out what you want? You can use 'self' instead of 'Foo' like this : class Foo(models.Model): bar = models.ManyToManyField('self', blank=True) You meant that we should use 'Foo' rather than 'self', right?
Replying to SShayashi: Can I c... | diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py
--- a/django/db/backends/sqlite3/schema.py
+++ b/django/db/backends/sqlite3/schema.py
@@ -174,7 +174,7 @@ def alter_field(self, model, old_field, new_field, strict=False):
super().alter_field(model, old_field, new_fiel... | diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -1796,6 +1796,43 @@ def test_alter_model_table_m2m(self):
self.assertTableExists(original_m2m_table)
self.assertTableNotExists(n... | ["test_alter_model_table_m2m_field (migrations.test_operations.OperationTests)"] | ["test_references_model_mixin (migrations.test_operations.TestCreateModel)", "test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests)", "test_references_field_by_name (migrations.test_operations.Fiel... | null | true | 2022-11-10T18:52:13Z | 1 | 49 | 1 | 586 | 0 | 0.8 | 1 | 0.85 | 1 | 0.261 | 89.708 | |
3,084 | swe_bench::dev::134 | swe_bench | dev | 134 | pylint-dev__astroid-1333 | pylint-dev/astroid | pylint-dev/astroid | python | d2a5b3c7b1e203fec3c7ca73c30eb1785d3d4d0a | astroid 2.9.1 breaks pylint with missing __init__.py: F0010: error while code parsing: Unable to load file __init__.py
### Steps to reproduce
> Steps provided are for Windows 11, but initial problem found in Ubuntu 20.04
> Update 2022-01-04: Corrected repro steps and added more environment details
1. Set up simple re... | I can't seem to reproduce this in my `virtualenv`. This might be specific to `venv`? Needs some further investigation.
@interifter Which version of `pylint` are you using?
Right, ``pip install pylint astroid==2.9.0``, will keep the local version if you already have one, so I thought it was ``2.12.2`` but that could be ... | diff --git a/astroid/modutils.py b/astroid/modutils.py
--- a/astroid/modutils.py
+++ b/astroid/modutils.py
@@ -297,6 +297,9 @@ def _get_relative_base_path(filename, path_to_check):
if os.path.normcase(real_filename).startswith(path_to_check):
importable_path = real_filename
+ # if "var" in path_to_ch... | diff --git a/tests/unittest_modutils.py b/tests/unittest_modutils.py
--- a/tests/unittest_modutils.py
+++ b/tests/unittest_modutils.py
@@ -30,6 +30,7 @@
import tempfile
import unittest
import xml
+from pathlib import Path
from xml import etree
from xml.etree import ElementTree
@@ -189,6 +190,30 @@ def test_load_... | ["tests/unittest_modutils.py::ModPathFromFileTest::test_load_packages_without_init"] | ["tests/unittest_modutils.py::ModuleFileTest::test_find_egg_module", "tests/unittest_modutils.py::ModuleFileTest::test_find_zipped_module", "tests/unittest_modutils.py::LoadModuleFromNameTest::test_known_values_load_module_from_name_1", "tests/unittest_modutils.py::LoadModuleFromNameTest::test_known_values_load_module_... | null | true | 2022-01-08T19:36:45Z | 1 | 8 | 1 | 1,405 | 0 | 0.8 | 1 | 0.85 | 1 | 0.260833 | 89.7075 | |
3,085 | swe_bench::test::1489 | swe_bench | test | 1,489 | pytest-dev__pytest-9798 | pytest-dev/pytest | pytest-dev/pytest | python | 6a6a32ceca8db2bb8c8385f7fe54dc335f48663a | ModuleNotFoundError for Numpy when pytest.approx fails
### Description of the bug:
When using `pytest.approx` to compare lists in a test, a `ModuleNotFoundError` is raised for Numpy whenever the test fails. If the test succeeds, there is no such error.
It appears that `pytest.approx` does _not_ require Numpy to run, ... | Hi, I am a beginner and I am looking for the first issue to work on. Could I try to work on this one? Is there anyone else who started contributing?
Thank you for the answer in advance.
@dzht19 please go ahead!
The offending line is here:
https://github.com/pytest-dev/pytest/blob/9318b2cb7f81252fec215e1cce4c5d... | diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py
--- a/src/_pytest/python_api.py
+++ b/src/_pytest/python_api.py
@@ -319,7 +319,6 @@ def __repr__(self) -> str:
def _repr_compare(self, other_side: Sequence[float]) -> List[str]:
import math
- import numpy as np
if len(s... | diff --git a/testing/python/approx.py b/testing/python/approx.py
--- a/testing/python/approx.py
+++ b/testing/python/approx.py
@@ -92,9 +92,7 @@ def do_assert(lhs, rhs, expected_message, verbosity_level=0):
class TestApprox:
- def test_error_messages(self, assert_approx_raises_regex):
- np = pytest.impor... | ["testing/python/approx.py::TestApprox::test_error_messages_native_dtypes"] | ["testing/python/approx.py::TestApprox::test_repr_string", "testing/python/approx.py::TestApprox::test_repr_complex_numbers", "testing/python/approx.py::TestApprox::test_bool", "testing/python/approx.py::TestApprox::test_operator_overloading", "testing/python/approx.py::TestApprox::test_exactly_equal", "testing/python/... | null | true | 2022-03-20T14:26:09Z | 1 | 3 | 1 | 2,436 | 0 | 0.8 | 1 | 1 | 0.8 | 0.416 | 89.698 | |
3,086 | swe_bench::test::1546 | swe_bench | test | 1,546 | scikit-learn__scikit-learn-12258 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | a7a834bdb7a51ec260ff005715d50ab6ed01a16b | silhouette_samples gives incorrect result from precomputed distance matrix with diagonal entries
#### Description
silhouette_samples gives incorrect result from precomputed distance matrix with diagonal entries.
When using silhouette_samples and metric='precomputed', if the input distance matrix has non-zero values al... | (Also, hi Stephen!)
Could you explain why you want to handle this case?
I would rather raise an error if the diag is not close to 0.
(Also, upgrading to 0.20 may give you much better performance for silhoette calculations on large samples)
Hi Joel!
I'd like to handle this case because it isn't completely clear fro... | diff --git a/sklearn/metrics/cluster/unsupervised.py b/sklearn/metrics/cluster/unsupervised.py
--- a/sklearn/metrics/cluster/unsupervised.py
+++ b/sklearn/metrics/cluster/unsupervised.py
@@ -185,7 +185,8 @@ def silhouette_samples(X, labels, metric='euclidean', **kwds):
The metric to use when calculating distan... | diff --git a/sklearn/metrics/cluster/tests/test_unsupervised.py b/sklearn/metrics/cluster/tests/test_unsupervised.py
--- a/sklearn/metrics/cluster/tests/test_unsupervised.py
+++ b/sklearn/metrics/cluster/tests/test_unsupervised.py
@@ -168,6 +168,22 @@ def test_non_numpy_labels():
silhouette_score(list(X), list... | ["sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_nonzero_diag"] | ["sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_cluster_size_1", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_paper_example", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_correct_labelsize", "sklearn/m... | null | true | 2018-10-03T12:36:54Z | 1 | 12 | 1 | 1,303 | 0 | 0.8 | 1 | 0.85 | 1 | 0.257167 | 89.6965 | |
3,087 | swe_bench::test::40 | swe_bench | test | 40 | astropy__astropy-13842 | astropy/astropy | astropy/astropy | python | 3b448815e21b117d34fe63007b8ef63ee084fefb | Creating a mixin column in a new table from columns of another table renames columns in original table.
### Description
Consider the following code, where a subset of columns from another table should be included in a new table with new names, prerably without copying the actual payload data:
```python
from astropy.t... | Ouch! Reproduce this. Also
```
table2['new'] is table1['new']
# True
```
so the problem seems to be that the tables hold the same `Quantity` instead of different instances that share the data.
Note that it is not specific to `QTable`, but just to any mixin column (and the behaviour not limited to `dict` either):
... | diff --git a/astropy/table/table.py b/astropy/table/table.py
--- a/astropy/table/table.py
+++ b/astropy/table/table.py
@@ -1264,8 +1264,10 @@ def _convert_data_to_col(self, data, copy=True, default_name=None, dtype=None, n
elif data_is_mixin:
# Copy the mixin column attributes if they exist sinc... | diff --git a/astropy/table/tests/test_mixin.py b/astropy/table/tests/test_mixin.py
--- a/astropy/table/tests/test_mixin.py
+++ b/astropy/table/tests/test_mixin.py
@@ -438,38 +438,76 @@ def init_from_class(c):
assert getattr(m2.info, attr) == original
-def test_add_column(mixin_cols):
+def check_sha... | ["astropy/table/tests/test_mixin.py::test_add_column[arrayswap-False]", "astropy/table/tests/test_mixin.py::test_add_column[arraywrap-False]", "astropy/table/tests/test_mixin.py::test_add_column[cartesianrep-False]", "astropy/table/tests/test_mixin.py::test_add_column[earthlocation-False]", "astropy/table/tests/test_mi... | ["astropy/table/tests/test_mixin.py::test_attributes[arrayswap]", "astropy/table/tests/test_mixin.py::test_attributes[arraywrap]", "astropy/table/tests/test_mixin.py::test_attributes[cartesianrep]", "astropy/table/tests/test_mixin.py::test_attributes[earthlocation]", "astropy/table/tests/test_mixin.py::test_attributes[... | null | true | 2022-10-17T20:14:28Z | 2 | 12 | 16 | 1,295 | 0 | 0.8 | 1 | 0.85 | 1 | 0.255833 | 89.6925 | |
3,088 | swe_bench::test::1891 | swe_bench | test | 1,891 | sphinx-doc__sphinx-9654 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 4a9e015fc6b87fc54c7a01f94d65bcf602fefeaa | Incorrect base class detection
### Describe the bug
I have a chain of subclasses, like A -> B -> C -> D. When I document class D, it lists the base class as A instead of C.
### How to Reproduce
```
$ git clone https://github.com/microsoft/torchgeo.git
$ cd torchgeo/docs
$ pip install -r requirements.txt
$ make html
... | It seems `Landsat.__orig_bases__` is incorrect. It should be `(RasterDataset, abc.ABC)`. But it returns `(Dataset, abc.ABC)` instead. It must be a bug of Python interpreter.
```
$ python
Python 3.8.12 (default, Sep 3 2021, 02:24:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license"... | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1651,7 +1651,7 @@ def add_directive_header(self, sig: str) -> None:
# add inheritance info, if wanted
if not self.doc_as_attr and self.options.sh... | diff --git a/tests/roots/test-ext-autodoc/target/classes.py b/tests/roots/test-ext-autodoc/target/classes.py
--- a/tests/roots/test-ext-autodoc/target/classes.py
+++ b/tests/roots/test-ext-autodoc/target/classes.py
@@ -29,6 +29,10 @@ class Quux(List[Union[int, float]]):
pass
+class Corge(Quux):
+ pass
+
+
... | ["tests/test_ext_autodoc_autoclass.py::test_show_inheritance_for_decendants_of_generic_type"] | ["tests/test_ext_autodoc_autoclass.py::test_classes", "tests/test_ext_autodoc_autoclass.py::test_instance_variable", "tests/test_ext_autodoc_autoclass.py::test_inherited_instance_variable", "tests/test_ext_autodoc_autoclass.py::test_uninitialized_attributes", "tests/test_ext_autodoc_autoclass.py::test_undocumented_unin... | null | true | 2021-09-20T05:02:15Z | 2 | 17 | 1 | 1,166 | 0 | 0.8 | 1 | 0.85 | 1 | 0.251 | 89.678 | |
3,089 | swe_bench::test::1904 | swe_bench | test | 1,904 | sphinx-doc__sphinx-9982 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 8d0fd9e74a6d44ca1a518225d9be030d91917c9b | Different build warnings are colored differently
### Describe the bug
Some types of warnings seem to be different colors than others. An image warning is light red, a transition warning is dark red. This behavior exists regardless of `-W --keep-going` being set.
### How to Reproduce
```
$ git clone https://github.co... | Oops. The labels of dark red messages are wrong. They should be "ERROR:" instead of "WARNING:". This must be a bug. Thank you for reporting. | diff --git a/sphinx/util/logging.py b/sphinx/util/logging.py
--- a/sphinx/util/logging.py
+++ b/sphinx/util/logging.py
@@ -111,7 +111,14 @@ class SphinxInfoLogRecord(SphinxLogRecord):
class SphinxWarningLogRecord(SphinxLogRecord):
"""Warning log record class supporting location"""
- prefix = 'WARNING: '
+ ... | diff --git a/tests/test_util_logging.py b/tests/test_util_logging.py
--- a/tests/test_util_logging.py
+++ b/tests/test_util_logging.py
@@ -41,9 +41,9 @@ def test_info_and_warning(app, status, warning):
assert 'message1' not in warning.getvalue()
assert 'message2' not in warning.getvalue()
- assert 'messa... | ["tests/test_util_logging.py::test_info_and_warning", "tests/test_util_logging.py::test_colored_logs"] | ["tests/test_util_logging.py::test_Exception", "tests/test_util_logging.py::test_verbosity_filter", "tests/test_util_logging.py::test_nonl_info_log", "tests/test_util_logging.py::test_once_warning_log", "tests/test_util_logging.py::test_is_suppressed_warning", "tests/test_util_logging.py::test_suppress_warnings", "test... | null | true | 2021-12-16T16:45:50Z | 1 | 9 | 2 | 1,311 | 0 | 0.8 | 1 | 0.85 | 1 | 0.2485 | 89.6705 | |
3,090 | swe_bench::test::1565 | swe_bench | test | 1,565 | scikit-learn__scikit-learn-12834 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 55a98ab7e3b10966f6d00c3562f3a99896797964 | `predict` fails for multioutput ensemble models with non-numeric DVs
#### Description
Multioutput forest models assume that the dependent variables are numeric. Passing string DVs returns the following error:
`ValueError: could not convert string to float:`
I'm going to take a stab at submitting a fix today, but I w... | Is numeric-only an intentional limitation in this case? There are lines that explicitly cast to double (https://github.com/scikit-learn/scikit-learn/blob/e73acef80de4159722b11e3cd6c20920382b9728/sklearn/ensemble/forest.py#L279). It's not an issue for single-output models, though.
Sorry what do you mean by "DV"?
You're ... | diff --git a/sklearn/ensemble/forest.py b/sklearn/ensemble/forest.py
--- a/sklearn/ensemble/forest.py
+++ b/sklearn/ensemble/forest.py
@@ -547,7 +547,10 @@ def predict(self, X):
else:
n_samples = proba[0].shape[0]
- predictions = np.zeros((n_samples, self.n_outputs_))
+ # a... | diff --git a/sklearn/ensemble/tests/test_forest.py b/sklearn/ensemble/tests/test_forest.py
--- a/sklearn/ensemble/tests/test_forest.py
+++ b/sklearn/ensemble/tests/test_forest.py
@@ -532,14 +532,14 @@ def check_multioutput(name):
if name in FOREST_CLASSIFIERS:
with np.errstate(divide="ignore"):
... | ["sklearn/ensemble/tests/test_forest.py::test_multioutput_string[ExtraTreesClassifier]", "sklearn/ensemble/tests/test_forest.py::test_multioutput_string[RandomForestClassifier]"] | ["sklearn/ensemble/tests/test_forest.py::test_classification_toy[ExtraTreesClassifier]", "sklearn/ensemble/tests/test_forest.py::test_classification_toy[RandomForestClassifier]", "sklearn/ensemble/tests/test_forest.py::test_iris[gini-ExtraTreesClassifier]", "sklearn/ensemble/tests/test_forest.py::test_iris[gini-RandomF... | null | true | 2018-12-19T22:36:36Z | 1 | 5 | 2 | 2,330 | 0 | 0.8 | 1 | 1 | 0.8 | 0.405 | 89.665 | |
3,091 | swe_bench::dev::130 | swe_bench | dev | 130 | pylint-dev__astroid-1164 | pylint-dev/astroid | pylint-dev/astroid | python | 40ea1a3b8e52bbfed43deb1725cde461f4bd8a96 | ImportError: cannot import name 'Statement' from 'astroid.node_classes'
### Steps to reproduce
1. run pylint <some_file>
### Current behavior
```python
exception: Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
... | This is caused by our local plugin.
Has probably nothing to do with upstream.
This is caused by a bad refactor from us, we deprecated `astroid.node_classes` and `astroid.scoped_nodes` in favor of `astroid.nodes` but nothing should break before astroid 3.0.
@Pierre-Sassoulas I see.
Also Statement is not available i... | diff --git a/astroid/nodes/__init__.py b/astroid/nodes/__init__.py
--- a/astroid/nodes/__init__.py
+++ b/astroid/nodes/__init__.py
@@ -89,6 +89,7 @@
Set,
Slice,
Starred,
+ Statement,
Subscript,
TryExcept,
TryFinally,
@@ -116,6 +117,7 @@
SetComp,
builtin_lookup,
function_t... | diff --git a/tests/unittest_brain_ctypes.py b/tests/unittest_brain_ctypes.py
--- a/tests/unittest_brain_ctypes.py
+++ b/tests/unittest_brain_ctypes.py
@@ -2,8 +2,7 @@
import pytest
-from astroid import extract_node
-from astroid.nodes.node_classes import Const
+from astroid import extract_node, nodes
pytestmark... | ["tests/unittest_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup"] | ["tests/unittest_brain_ctypes.py::test_ctypes_redefined_types_members[c_bool-bool-?]", "tests/unittest_brain_ctypes.py::test_ctypes_redefined_types_members[c_byte-int-b]", "tests/unittest_brain_ctypes.py::test_ctypes_redefined_types_members[c_char-bytes-c]", "tests/unittest_brain_ctypes.py::test_ctypes_redefined_types_... | null | true | 2021-09-04T15:03:02Z | 1 | 4 | 1 | 2,335 | 0 | 0.8 | 1 | 1 | 0.8 | 0.4025 | 89.6575 | |
3,092 | swe_bench::test::1022 | swe_bench | test | 1,022 | matplotlib__matplotlib-23562 | matplotlib/matplotlib | matplotlib/matplotlib | python | 29a86636a9c45ab5ac4d80ac76eaee497f460dce | 'Poly3DCollection' object has no attribute '_facecolors2d'
The following minimal example demonstrates the issue:
```
import numpy as np
import matplotlib.tri as mtri
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
y,x = np.ogrid[1:10:100j, 1:10:100j]
z2 = np.cos(x)**3 - np.sin(y)**2
fig = plt.... | Ok, I have a "fix", in the sense that that attribute will be defined upon initialization. However, for your example, the facecolors returned is completely useless ([[0, 0, 1, 1]] -- all blue, which is default). I suspect that there is a deeper problem with ScalarMappables in general in that they don't set their facecol... | diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py
--- a/lib/mpl_toolkits/mplot3d/art3d.py
+++ b/lib/mpl_toolkits/mplot3d/art3d.py
@@ -867,9 +867,19 @@ def set_alpha(self, alpha):
self.stale = True
def get_facecolor(self):
+ # docstring inherited
+ # self._f... | diff --git a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py
--- a/lib/mpl_toolkits/tests/test_mplot3d.py
+++ b/lib/mpl_toolkits/tests/test_mplot3d.py
@@ -1812,6 +1812,28 @@ def test_scatter_spiral():
fig.canvas.draw()
+def test_Poly3DCollection_get_facecolor():
+ # Smoke tes... | ["lib/mpl_toolkits/tests/test_mplot3d.py::test_Poly3DCollection_get_facecolor", "lib/mpl_toolkits/tests/test_mplot3d.py::test_Poly3DCollection_get_edgecolor"] | ["lib/mpl_toolkits/tests/test_mplot3d.py::test_invisible_axes[png]", "lib/mpl_toolkits/tests/test_mplot3d.py::test_aspects[png]", "lib/mpl_toolkits/tests/test_mplot3d.py::test_axes3d_repr", "lib/mpl_toolkits/tests/test_mplot3d.py::test_bar3d[png]", "lib/mpl_toolkits/tests/test_mplot3d.py::test_bar3d_colors", "lib/mpl_t... | null | true | 2022-08-05T13:44:06Z | 1 | 10 | 2 | 1,255 | 0 | 0.8 | 1 | 0.85 | 1 | 0.2425 | 89.6525 | |
3,093 | swe_bench::test::59 | swe_bench | test | 59 | astropy__astropy-14528 | astropy/astropy | astropy/astropy | python | 13b1bef09be51cb875ca665bb2cb14f5e5cf68de | `io.fits` creates a corrupt FITS files if a `ImageHDU` contains zero-dimensional data
### Description
`ImageHDU` accepts a ndarray with shape `()` (zero-dimensional) as a data array. This later causes issues when writing to a file because `io.fits` assumes that the data has at least 1 dimension, resulting in a corrupt... | This seems to have a trivial fix, I will provide a PR soon. | diff --git a/astropy/io/fits/hdu/image.py b/astropy/io/fits/hdu/image.py
--- a/astropy/io/fits/hdu/image.py
+++ b/astropy/io/fits/hdu/image.py
@@ -264,19 +264,16 @@ def data(self, data):
self._data_replaced = True
was_unsigned = False
- if (
- data is not None
- ... | diff --git a/astropy/io/fits/tests/test_hdulist.py b/astropy/io/fits/tests/test_hdulist.py
--- a/astropy/io/fits/tests/test_hdulist.py
+++ b/astropy/io/fits/tests/test_hdulist.py
@@ -547,11 +547,14 @@ def test_new_hdulist_extend_keyword(self):
h0 = fits.Header()
hdu = fits.PrimaryHDU(header=h0)
- ... | ["astropy/io/fits/tests/test_image.py::TestImageFunctions::test_hdu_creation_with_scalar"] | ["astropy/io/fits/tests/test_hdulist.py::TestHDUListFunctions::test_update_name", "astropy/io/fits/tests/test_hdulist.py::TestHDUListFunctions::test_hdu_file_bytes", "astropy/io/fits/tests/test_hdulist.py::TestHDUListFunctions::test_hdulist_file_info", "astropy/io/fits/tests/test_hdulist.py::TestHDUListFunctions::test_... | null | true | 2023-03-14T16:42:42Z | 1 | 23 | 1 | 993 | 0 | 0.8 | 1 | 0.85 | 1 | 0.242167 | 89.6515 | |
3,094 | swe_bench::test::1000 | swe_bench | test | 1,000 | matplotlib__matplotlib-22991 | matplotlib/matplotlib | matplotlib/matplotlib | python | 953790680ac667adb869e1f1cba2f2b534cc6f0b | [Bug]: Can't use `plt.sca()` on axes created using subfigures
### Bug summary
Using `plt.sca()` on an axes created using subfigures result in an error.
### Code for reproduction
```python
import matplotlib.pyplot as plt
fig = plt.figure()
subfigs = fig.subfigures(2, 1)
axarr = subfigs[0].subplots(2, 2)
plt.sca(ax... | The fix for this is likely to relax the type checking in `plt.figure` to accept `FigureBase` and to make sure that top level `Figure` is still the one set as the current figure.
https://github.com/matplotlib/matplotlib/blob/89b21b517df0b2a9c378913bae8e1f184988b554/lib/matplotlib/pyplot.py#L755-L759 is the first plac... | diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py
--- a/lib/matplotlib/pyplot.py
+++ b/lib/matplotlib/pyplot.py
@@ -59,7 +59,7 @@
from matplotlib import cbook
from matplotlib import _docstring
from matplotlib.backend_bases import FigureCanvasBase, MouseButton
-from matplotlib.figure import Figure, fig... | diff --git a/lib/matplotlib/tests/test_pyplot.py b/lib/matplotlib/tests/test_pyplot.py
--- a/lib/matplotlib/tests/test_pyplot.py
+++ b/lib/matplotlib/tests/test_pyplot.py
@@ -343,3 +343,27 @@ def test_fallback_position():
axtest = plt.axes([0.2, 0.2, 0.5, 0.5], position=[0.1, 0.1, 0.8, 0.8])
np.testing.assert... | ["lib/matplotlib/tests/test_pyplot.py::test_set_current_figure_via_subfigure", "lib/matplotlib/tests/test_pyplot.py::test_set_current_axes_on_subfigure"] | ["lib/matplotlib/tests/test_pyplot.py::test_pyplot_up_to_date", "lib/matplotlib/tests/test_pyplot.py::test_copy_docstring_and_deprecators", "lib/matplotlib/tests/test_pyplot.py::test_pyplot_box", "lib/matplotlib/tests/test_pyplot.py::test_stackplot_smoke", "lib/matplotlib/tests/test_pyplot.py::test_nrows_error", "lib/m... | null | true | 2022-05-06T12:35:45Z | 1 | 11 | 2 | 1,215 | 0 | 0.8 | 1 | 0.85 | 1 | 0.239167 | 89.6425 | |
3,095 | swe_bench::test::2005 | swe_bench | test | 2,005 | sympy__sympy-13962 | sympy/sympy | sympy/sympy | python | 84c125972ad535b2dfb245f8d311d347b45e5b8a | Printing should use short representation of quantities.
There is a test that explicitly expects that printing does not use `abbrev` but `name`:
https://github.com/sympy/sympy/blob/8e962a301d7cc2d6fc3fa83deedd82697a809fd6/sympy/physics/units/tests/test_quantities.py#L87
Is there a reason behind this? I find it quite use... | We could add a flag for it. Also I think the pretty printer should be using the shorter form always.
Thanks! I created a PR: https://github.com/sympy/sympy/pull/13310
I don't even see a point of adding a flag for it, as one should not provide `abbrev` to a `Quantity` if one does not want it to be used.
OK, there is l... | diff --git a/sympy/printing/str.py b/sympy/printing/str.py
--- a/sympy/printing/str.py
+++ b/sympy/printing/str.py
@@ -21,6 +21,7 @@ class StrPrinter(Printer):
"order": None,
"full_prec": "auto",
"sympy_integers": False,
+ "abbrev": False,
}
_relationals = dict()
@@ -706,6 ... | diff --git a/sympy/printing/tests/test_str.py b/sympy/printing/tests/test_str.py
--- a/sympy/printing/tests/test_str.py
+++ b/sympy/printing/tests/test_str.py
@@ -593,6 +593,8 @@ def test_Quaternion_str_printer():
def test_Quantity_str():
+ assert sstr(second, abbrev=True) == "s"
+ assert sstr(joule, abbrev=... | ["test_Quantity_str"] | ["test_printmethod", "test_Abs", "test_Catalan", "test_ComplexInfinity", "test_Derivative", "test_dict", "test_Dict", "test_Dummy", "test_EulerGamma", "test_Exp", "test_factorial", "test_Function", "test_Geometry", "test_GoldenRatio", "test_ImaginaryUnit", "test_Infinity", "test_Integer", "test_Integral", "test_Interva... | null | true | 2018-01-19T14:03:54Z | 1 | 6 | 1 | 1,314 | 0 | 0.8 | 1 | 0.85 | 1 | 0.239 | 89.642 | |
3,096 | swe_bench::test::1841 | swe_bench | test | 1,841 | sphinx-doc__sphinx-8627 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 332d80ba8433aea41c3709fa52737ede4405072b | autodoc isn't able to resolve struct.Struct type annotations
**Describe the bug**
If `struct.Struct` is declared in any type annotations, I get `class reference target not found: Struct`
**To Reproduce**
Simple `index.rst`
```
Hello World
===========
code docs
=========
.. automodule:: helloworld.helloworld
```
Sim... | Unfortunately, the `struct.Struct` class does not have the correct module-info. So it is difficult to support.
```
Python 3.8.2 (default, Mar 2 2020, 00:44:41)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.Struct.... | diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -10,6 +10,7 @@
import sys
import typing
+from struct import Struct
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, TypeVar, Union
from docutils import nodes
@@ -94,6 +9... | diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py
--- a/tests/test_util_typing.py
+++ b/tests/test_util_typing.py
@@ -10,6 +10,7 @@
import sys
from numbers import Integral
+from struct import Struct
from typing import (Any, Callable, Dict, Generator, List, NewType, Optional, Tuple, TypeVar,
... | ["tests/test_util_typing.py::test_restify", "tests/test_util_typing.py::test_stringify"] | ["tests/test_util_typing.py::test_restify_type_hints_containers", "tests/test_util_typing.py::test_restify_type_hints_Callable", "tests/test_util_typing.py::test_restify_type_hints_Union", "tests/test_util_typing.py::test_restify_type_hints_typevars", "tests/test_util_typing.py::test_restify_type_hints_custom_class", "... | null | true | 2020-12-31T05:21:06Z | 1 | 7 | 2 | 1,292 | 0 | 0.8 | 1 | 0.85 | 1 | 0.238667 | 89.641 | |
3,097 | swe_bench::test::1123 | swe_bench | test | 1,123 | matplotlib__matplotlib-26399 | matplotlib/matplotlib | matplotlib/matplotlib | python | 00afcc0c6d4d2e4390338127f05b8f4fdb4e7087 | [Bug]: ContourSet.antialiased attribute not present
### Bug summary
The new `ContourSet` does not have an `antialiased` attribute. This causes failures in [Iris, which checks the attribute](https://github.com/SciTools/iris/blob/5b42f47e71fbeb7861a9df59c8bd8c0be9a340e3/lib/iris/plot.py#L1165).
### Code for reproducti... | I'm pretty sure Iris could do without this attribute, as it could just use the return value of `setdefault` [here](https://github.com/SciTools/iris/blob/5b42f47e71fbeb7861a9df59c8bd8c0be9a340e3/lib/iris/plot.py#L1151). I have verified locally that Iris's tests pass with that change. But a deprecation period on the at... | diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py
--- a/lib/matplotlib/collections.py
+++ b/lib/matplotlib/collections.py
@@ -696,6 +696,16 @@ def _bcast_lwls(linewidths, dashes):
return linewidths, dashes
+ def get_antialiased(self):
+ """
+ Get the antialiasing s... | diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -831,3 +831,9 @@ def test_deprecated_apis():
assert_array_equal(cs.tcolors, [c.get_edgecolor() for c in colls])
with pytest.warn... | ["lib/matplotlib/tests/test_contour.py::test_deprecated_apis"] | ["lib/matplotlib/tests/test_contour.py::test_algorithm_name[invalid-None]", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[mpl2005-Mpl2005ContourGenerator]", "lib/matplotlib/tests/test_contour.py::test_algorithm_name[mpl2014-Mpl2014ContourGenerator]", "lib/matplotlib/tests/test_contour.py::test_algorithm_na... | null | true | 2023-07-27T11:32:39Z | 2 | 20 | 1 | 1,002 | 0 | 0.8 | 1 | 0.85 | 1 | 0.233667 | 89.626 | |
3,098 | swe_bench::test::389 | swe_bench | test | 389 | django__django-12973 | django/django | django/django | python | f24b59267be2e5fc5bd1252efda3aed19f860813 | Add hint to the E410 about AuthenticationMiddleware.
Description
Given an empty MIDDLEWARE in your project, you try and run the admin.
The system checks framework kicks in, giving you:
(admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.
(a... | I agree that we can do sth better here, but I'm not sure if maintaining the order of checks is feasible in a long-term. I would add a hint to the E410, e.g. Insert 'django.contrib.sessions.middleware.SessionMiddleware' before 'django.contrib.auth.middleware.AuthenticationMiddleware'. | diff --git a/django/contrib/admin/checks.py b/django/contrib/admin/checks.py
--- a/django/contrib/admin/checks.py
+++ b/django/contrib/admin/checks.py
@@ -132,6 +132,12 @@ def check_dependencies(**kwargs):
errors.append(checks.Error(
"'django.contrib.sessions.middleware.SessionMiddleware' must "
... | diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -214,6 +214,12 @@ def test_middleware_dependencies(self):
checks.Error(
"'django.contrib.sessions.middleware.SessionMiddleware' "
"... | ["test_middleware_dependencies (admin_checks.tests.SystemChecksTestCase)"] | ["test_admin_check_ignores_import_error_in_middleware (admin_checks.tests.SystemChecksTestCase)", "test_allows_checks_relying_on_other_modeladmins (admin_checks.tests.SystemChecksTestCase)", "test_app_label_in_admin_checks (admin_checks.tests.SystemChecksTestCase)", "test_apps_dependencies (admin_checks.tests.SystemChe... | null | true | 2020-05-25T14:42:33Z | 1 | 6 | 1 | 1,282 | 0 | 0.8 | 1 | 0.85 | 1 | 0.233667 | 89.626 | |
3,099 | swe_bench::dev::129 | swe_bench | dev | 129 | pylint-dev__astroid-1092 | pylint-dev/astroid | pylint-dev/astroid | python | c9c498348174b38ce35bfe001353c8ebea262802 | Yield self is inferred to be of a mistaken type
### Steps to reproduce
1. Run the following
```
import astroid
print(list(astroid.parse('''
import contextlib
class A:
@contextlib.contextmanager
def get(self):
yield self
class B(A):
def play():
pass
with B().get() as b:
b.play()
''')... | Possible duplicate of #1008
This problem is due to the fact `_infer_context_manager` takes caller function, using its current context, instead of the original callers context. This may be fixed for example by adding data to `Generator` instance, by `infer_call_result` that signifies its possible value types.
I'm no... | diff --git a/astroid/bases.py b/astroid/bases.py
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -26,7 +26,7 @@
import collections
from astroid import context as contextmod
-from astroid import util
+from astroid import decorators, util
from astroid.const import BUILTINS, PY310_PLUS
from astroid.exceptions impor... | diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py
--- a/tests/unittest_inference.py
+++ b/tests/unittest_inference.py
@@ -6154,5 +6154,26 @@ def test_issue926_binop_referencing_same_name_is_not_uninferable():
assert inferred[0].value == 3
+def test_issue_1090_infer_yield_type_base_class():... | ["tests/unittest_inference.py::test_issue_1090_infer_yield_type_base_class"] | ["tests/unittest_inference.py::InferenceUtilsTest::test_path_wrapper", "tests/unittest_inference.py::InferenceTest::test__new__", "tests/unittest_inference.py::InferenceTest::test__new__bound_methods", "tests/unittest_inference.py::InferenceTest::test_advanced_tupleassign_name_inference1", "tests/unittest_inference.py:... | null | true | 2021-07-10T10:44:32Z | 3 | 42 | 1 | 558 | 0 | 0.8 | 1 | 0.85 | 1 | 0.233 | 89.624 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.