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,400 | swe_bench::test::1444 | swe_bench | test | 1,444 | pytest-dev__pytest-7468 | pytest-dev/pytest | pytest-dev/pytest | python | 678c1a0745f1cf175c442c719906a1f13e496910 | --log-file should create subdirectories
If you provide a path with a subdirectory, which does not exist, it crashes with.
For example execute `pytest --log-file=subtest/test.log` produces something like this:
`INTERNALERROR> FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test/subtest/test.log' `
Maybe s... | I agree, `--junitxml` works the same way. 👍
Would you like to take a stab at this @Hardy7cc?
Sorry ive been busy the past little while, I am doing some work in and around --log-file so I'm happy to build in support here also
Thanks @symonk, and no need to be sorry, we all are busy at times!
Feel free to tackle ... | diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py
--- a/src/_pytest/logging.py
+++ b/src/_pytest/logging.py
@@ -531,11 +531,17 @@ def __init__(self, config: Config) -> None:
# File logging.
self.log_file_level = get_log_level_for_setting(config, "log_file_level")
log_file = get_opt... | diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py
--- a/testing/logging/test_reporting.py
+++ b/testing/logging/test_reporting.py
@@ -5,6 +5,7 @@
import pytest
from _pytest.capture import CaptureManager
+from _pytest.config import ExitCode
from _pytest.pytester import Testdir
from... | ["testing/logging/test_reporting.py::test_log_file_cli_subdirectories_are_successfully_created"] | ["[100%]", "[", "[100%]------------------------------", "testing/logging/test_reporting.py::test_live_logging_suspends_capture[True]", "testing/logging/test_reporting.py::test_live_logging_suspends_capture[False]", "testing/logging/test_reporting.py::test_nothing_logged", "testing/logging/test_reporting.py::test_messag... | null | true | 2020-07-08T23:11:32Z | 1 | 6 | 1 | 683 | 0 | 0.8 | 1 | 0.7 | 1 | 0.133833 | 85.0515 | |
3,401 | swe_bench::test::43 | swe_bench | test | 43 | astropy__astropy-14042 | astropy/astropy | astropy/astropy | python | 6720a70d8dd9108317e21e8577caccecdde781f3 | Degrees Celsius should be supported by FITS units
### Description
The FITS standards says that units should follow IAU recommendations. These note that:
> The degree Celsius (`°C` in the original PDF, `oC` in the web page???) is used in specifying temperature for meteorological purposes, but otherwise the kelvin (K)... | This should be relatively straightforward: add a special case to `_generate_unit_names` in `units.format.fits` - main annoyance of course is tests, including actually using the value for, say, a conversion to `AltAz` or so (where temperature is actually used).
The question is what is the correct symbol? Is there any pr... | diff --git a/astropy/units/format/fits.py b/astropy/units/format/fits.py
--- a/astropy/units/format/fits.py
+++ b/astropy/units/format/fits.py
@@ -28,7 +28,12 @@ class Fits(generic.Generic):
def _generate_unit_names():
from astropy import units as u
- names = {}
+ # add some units up-front... | diff --git a/astropy/units/tests/test_format.py b/astropy/units/tests/test_format.py
--- a/astropy/units/tests/test_format.py
+++ b/astropy/units/tests/test_format.py
@@ -788,3 +788,13 @@ def test_parse_error_message_for_output_only_format(format_):
def test_unknown_parser():
with pytest.raises(ValueError, match=... | ["astropy/units/tests/test_format.py::TestRoundtripFITS::test_roundtrip[unit68]", "astropy/units/tests/test_format.py::TestRoundtripFITS::test_roundtrip[unit69]", "astropy/units/tests/test_format.py::test_celsius_fits"] | ["astropy/units/tests/test_format.py::test_unit_grammar[strings0-unit0]", "astropy/units/tests/test_format.py::test_unit_grammar[strings1-unit1]", "astropy/units/tests/test_format.py::test_unit_grammar[strings2-unit2]", "astropy/units/tests/test_format.py::test_unit_grammar[strings3-unit3]", "astropy/units/tests/test_f... | null | true | 2022-11-24T14:24:15Z | 2 | 9 | 3 | 615 | 0 | 0.8 | 1 | 0.7 | 1 | 0.1325 | 85.0475 | |
3,402 | swe_bench::test::1993 | swe_bench | test | 1,993 | sympy__sympy-13773 | sympy/sympy | sympy/sympy | python | 7121bdf1facdd90d05b6994b4c2e5b2865a4638a | @ (__matmul__) should fail if one argument is not a matrix
```
>>> A = Matrix([[1, 2], [3, 4]])
>>> B = Matrix([[2, 3], [1, 2]])
>>> A@B
Matrix([
[ 4, 7],
[10, 17]])
>>> 2@B
Matrix([
[4, 6],
[2, 4]])
```
Right now `@` (`__matmul__`) just copies `__mul__`, but it should actually only work if the multiplication is actu... | Note to anyone fixing this: `@`/`__matmul__` only works in Python 3.5+.
I would like to work on this issue. | diff --git a/sympy/matrices/common.py b/sympy/matrices/common.py
--- a/sympy/matrices/common.py
+++ b/sympy/matrices/common.py
@@ -1973,6 +1973,10 @@ def __div__(self, other):
@call_highest_priority('__rmatmul__')
def __matmul__(self, other):
+ other = _matrixify(other)
+ if not getattr(other,... | diff --git a/sympy/matrices/tests/test_commonmatrix.py b/sympy/matrices/tests/test_commonmatrix.py
--- a/sympy/matrices/tests/test_commonmatrix.py
+++ b/sympy/matrices/tests/test_commonmatrix.py
@@ -674,6 +674,30 @@ def test_multiplication():
assert c[1, 0] == 3*5
assert c[1, 1] == 0
+def test_matmu... | ["test_matmul"] | ["test__MinimalMatrix", "test_vec", "test_tolist", "test_row_col_del", "test_get_diag_blocks1", "test_get_diag_blocks2", "test_shape", "test_reshape", "test_row_col", "test_row_join", "test_col_join", "test_row_insert", "test_col_insert", "test_extract", "test_hstack", "test_vstack", "test_atoms", "test_free_symbols", ... | null | true | 2017-12-19T10:44:38Z | 1 | 8 | 1 | 627 | 0 | 0.8 | 1 | 0.7 | 1 | 0.131167 | 85.0435 | |
3,403 | swe_bench::test::2293 | swe_bench | test | 2,293 | sympy__sympy-24909 | sympy/sympy | sympy/sympy | python | d3b4158dea271485e3daa11bf82e69b8dab348ce | Bug with milli prefix
What happened:
```
In [1]: from sympy.physics.units import milli, W
In [2]: milli*W == 1
Out[2]: True
In [3]: W*milli
Out[3]: watt*Prefix(milli, m, -3, 10)
```
What I expected to happen: milli*W should evaluate to milli watts / mW
`milli*W` or more generally `milli` times some unit evaluates to t... | I get a 1 for all of the following (and some are redundant like "V" and "volt"):
```python
W, joule, ohm, newton, volt, V, v, volts, henrys, pa, kilogram, ohms, kilograms, Pa, weber, tesla, Wb, H, wb, newtons, kilometers, webers, pascals, kilometer, watt, T, km, kg, joules, pascal, watts, J, henry, kilo, teslas
```
... | diff --git a/sympy/physics/units/prefixes.py b/sympy/physics/units/prefixes.py
--- a/sympy/physics/units/prefixes.py
+++ b/sympy/physics/units/prefixes.py
@@ -6,7 +6,7 @@
"""
from sympy.core.expr import Expr
from sympy.core.sympify import sympify
-
+from sympy.core.singleton import S
class Prefix(Expr):
"""
... | diff --git a/sympy/physics/units/tests/test_prefixes.py b/sympy/physics/units/tests/test_prefixes.py
--- a/sympy/physics/units/tests/test_prefixes.py
+++ b/sympy/physics/units/tests/test_prefixes.py
@@ -2,7 +2,7 @@
from sympy.core.numbers import Rational
from sympy.core.singleton import S
from sympy.core.symbol impo... | ["test_prefix_operations"] | ["test_prefix_unit", "test_bases"] | null | true | 2023-03-13T14:24:25Z | 1 | 10 | 1 | 548 | 0 | 0.8 | 1 | 0.7 | 1 | 0.124667 | 85.024 | |
3,404 | swe_bench::test::1639 | swe_bench | test | 1,639 | scikit-learn__scikit-learn-14450 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 68044b061d7abc0c16f632890939438033306161 | PLS reports "array must not contain nan" if a feature is constant
Originally reported at https://github.com/scikit-learn/scikit-learn/issues/2089#issuecomment-152753095 by @Franck-Dernoncourt. Reproduce with:
```py
import numpy as np
import sklearn.cross_decomposition
pls2 = sklearn.cross_decomposition.PLSRegression()... | What would you like to see instead? An assertion when the `fit` method is called that checks that no feature is constant, and returns a clear error if the assertion fails?
Already we raise an error. Better that we actually do the pls but disregard
the 0-variance column. See some of the comments at the original post.
A... | diff --git a/sklearn/cross_decomposition/pls_.py b/sklearn/cross_decomposition/pls_.py
--- a/sklearn/cross_decomposition/pls_.py
+++ b/sklearn/cross_decomposition/pls_.py
@@ -31,7 +31,11 @@ def _nipals_twoblocks_inner_loop(X, Y, mode="A", max_iter=500, tol=1e-06,
similar to the Power method for determining the eig... | diff --git a/sklearn/cross_decomposition/tests/test_pls.py b/sklearn/cross_decomposition/tests/test_pls.py
--- a/sklearn/cross_decomposition/tests/test_pls.py
+++ b/sklearn/cross_decomposition/tests/test_pls.py
@@ -261,6 +261,47 @@ def check_ortho(M, err_msg):
check_ortho(pls_ca.x_scores_, "x scores are not orthog... | ["sklearn/cross_decomposition/tests/test_pls.py::test_pls"] | ["sklearn/cross_decomposition/tests/test_pls.py::test_convergence_fail", "sklearn/cross_decomposition/tests/test_pls.py::test_PLSSVD", "sklearn/cross_decomposition/tests/test_pls.py::test_univariate_pls_regression", "sklearn/cross_decomposition/tests/test_pls.py::test_predict_transform_copy", "sklearn/cross_decompositi... | null | true | 2019-07-23T19:31:07Z | 1 | 6 | 1 | 606 | 0 | 0.8 | 1 | 0.7 | 1 | 0.121 | 85.013 | |
3,405 | swe_bench::test::31 | swe_bench | test | 31 | astropy__astropy-13572 | astropy/astropy | astropy/astropy | python | 986123f73ce94d4511f453dbdd4470c72f47402a | Problem in function nutation_matrix in earth_orientation.py
Recently, when I try to call function nutation_matrix in astropy.coordinates.earth_orientation, error occurs with following info:
astropy.units.core.UnitTypeError: Angle instances require units equivalent to 'rad', so cannot set it to '0'.
Then, I checked th... | `git blame` points out that @eteq or @mhvk might be able to clarify.
Yes, logically, those `False` ones should be replaced by `u.radian` (or, perhaps better, `nutation_components200B` should just return values in angular units, and the `False` can be removed altogether).
What I am surprised about, though, is that th... | diff --git a/astropy/coordinates/earth_orientation.py b/astropy/coordinates/earth_orientation.py
--- a/astropy/coordinates/earth_orientation.py
+++ b/astropy/coordinates/earth_orientation.py
@@ -10,15 +10,15 @@
import numpy as np
+import erfa
from astropy.time import Time
-from astropy import units as u
+from .... | diff --git a/astropy/coordinates/tests/test_earth_orientation.py b/astropy/coordinates/tests/test_earth_orientation.py
new file mode 100644
--- /dev/null
+++ b/astropy/coordinates/tests/test_earth_orientation.py
@@ -0,0 +1,42 @@
+import numpy as np
+import pytest
+from numpy.testing import assert_allclose
+
+import ast... | ["astropy/coordinates/tests/test_earth_orientation.py::test_nutation_matrix"] | ["astropy/coordinates/tests/test_earth_orientation.py::test_obliquity[2006-23.43633313804873]", "astropy/coordinates/tests/test_earth_orientation.py::test_obliquity[2000-23.43634457995851]", "astropy/coordinates/tests/test_earth_orientation.py::test_obliquity[1980-23.436346167704045]", "astropy/coordinates/tests/test_e... | null | true | 2022-08-25T03:49:28Z | 1 | 270 | 1 | 1,026 | 0 | 0.8 | 1 | 0.85 | 0.75 | 0.671 | 85.0005 | |
3,406 | swe_bench::test::1083 | swe_bench | test | 1,083 | matplotlib__matplotlib-25499 | matplotlib/matplotlib | matplotlib/matplotlib | python | 738ead81fce08e582452ef30665ae1071d45092a | [Bug]: Setting bbox_inches to a Bbox in fig.savefig resizes colorbar
### Bug summary
Setting bbox_inches in fig.savefig to a specified Bbox rather than "tight" resizes the colorbar relative to when bbox_inches is not set—the resulting colorbar is a lot larger than it should be.
### Code for reproduction
```python
im... | Do you know if this ever worked? We changed some colorbar things recently, but not sure what would have caused this to happen. Thanks
Not sure. This is the first time I've tried to set bbox_inches to anything other than "tight". | diff --git a/lib/matplotlib/_tight_bbox.py b/lib/matplotlib/_tight_bbox.py
--- a/lib/matplotlib/_tight_bbox.py
+++ b/lib/matplotlib/_tight_bbox.py
@@ -23,7 +23,10 @@ def adjust_bbox(fig, bbox_inches, fixed_dpi=None):
locator_list = []
sentinel = object()
for ax in fig.axes:
- locator_list.append(a... | 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
@@ -546,13 +546,24 @@ def test_savefig_pixel_ratio(backend):
assert ratio1 == ratio2
-def test_savefig_preserve_layout_engine(tmp_path):
+de... | ["lib/matplotlib/tests/test_figure.py::test_savefig_locate_colorbar"] | ["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 | 2023-03-18T18:33:30Z | 1 | 5 | 1 | 1,548 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.274667 | 84.999 | |
3,407 | swe_bench::dev::183 | swe_bench | dev | 183 | sqlfluff__sqlfluff-2419 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | f1dba0e1dd764ae72d67c3d5e1471cf14d3db030 | Rule L060 could give a specific error message
At the moment rule L060 flags something like this:
```
L: 21 | P: 9 | L060 | Use 'COALESCE' instead of 'IFNULL' or 'NVL'.
```
Since we likely know the wrong word, it might be nice to actually flag that instead of both `IFNULL` and `NVL` - like most of the other rules d... | @tunetheweb Yeah definitely, should be a pretty quick change 😊 | diff --git a/src/sqlfluff/rules/L060.py b/src/sqlfluff/rules/L060.py
--- a/src/sqlfluff/rules/L060.py
+++ b/src/sqlfluff/rules/L060.py
@@ -59,4 +59,8 @@ def _eval(self, context: RuleContext) -> Optional[LintResult]:
],
)
- return LintResult(context.segment, [fix])
+ return LintResu... | diff --git a/test/rules/std_L060_test.py b/test/rules/std_L060_test.py
new file mode 100644
--- /dev/null
+++ b/test/rules/std_L060_test.py
@@ -0,0 +1,12 @@
+"""Tests the python routines within L060."""
+import sqlfluff
+
+
+def test__rules__std_L060_raised() -> None:
+ """L060 is raised for use of ``IFNULL`` or ``N... | ["test/rules/std_L060_test.py::test__rules__std_L060_raised"] | [] | null | true | 2022-01-22T12:21:52Z | 1 | 6 | 1 | 546 | 0 | 0.8 | 1 | 0.7 | 1 | 0.111 | 84.983 | |
3,408 | swe_bench::test::1648 | swe_bench | test | 1,648 | scikit-learn__scikit-learn-14706 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 2812bb151fa03f8e5cc0785fbcd5845252d3a477 | kernel_approximation.Nystroem does not support precomputed kernel
The documentation says that precomputed kernels are supported in Nystroem, but in reality it does not seem to be the case: https://scikit-learn.org/stable/modules/kernel_approximation.html
> By default Nystroem uses the rbf kernel, but it can use any ke... | Indeed, `Nystroem` uses the kernel parameter in two ways:
- in `sklearn.metrics.pairwise.pairwise_kernels`, which does accept `metric='precomputed'`
- in `sklearn.metrics.pairwise.KERNEL_PARAMS`, which does not contain a "precomputed" key.
This is a bug, "precomputed" should be added in `KERNEL_PARAMS`, and we als... | diff --git a/sklearn/kernel_approximation.py b/sklearn/kernel_approximation.py
--- a/sklearn/kernel_approximation.py
+++ b/sklearn/kernel_approximation.py
@@ -518,6 +518,7 @@ class Nystroem(BaseEstimator, TransformerMixin):
sklearn.metrics.pairwise.kernel_metrics : List of built-in kernels.
"""
+
def _... | diff --git a/sklearn/tests/test_kernel_approximation.py b/sklearn/tests/test_kernel_approximation.py
--- a/sklearn/tests/test_kernel_approximation.py
+++ b/sklearn/tests/test_kernel_approximation.py
@@ -254,3 +254,24 @@ def linear_kernel(X, Y):
ny = Nystroem(kernel=linear_kernel, **param)
with pytest.... | ["sklearn/tests/test_kernel_approximation.py::test_nystroem_precomputed_kernel"] | ["sklearn/tests/test_kernel_approximation.py::test_additive_chi2_sampler", "sklearn/tests/test_kernel_approximation.py::test_skewed_chi2_sampler", "sklearn/tests/test_kernel_approximation.py::test_rbf_sampler", "sklearn/tests/test_kernel_approximation.py::test_input_validation", "sklearn/tests/test_kernel_approximation... | null | true | 2019-08-21T12:29:34Z | 1 | 6 | 1 | 537 | 0 | 0.8 | 1 | 0.7 | 1 | 0.1095 | 84.9785 | |
3,409 | r2e_gym::train::776 | r2e_gym | train | 776 | sympy__c7c831dbbb85661524780dcf33632843814582b9 | sympy | sympy/sympy | python | c7c831dbbb85661524780dcf33632843814582b9 | Title: Incorrect Handling of Assumptions in check_assumptions and failing_assumptions
Description:
When using expressions with specific assumptions, the functions check_assumptions and failing_assumptions do not behave as expected. For example, when extra assumption arguments are supplied to check_assumptions, an erro... | diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py
--- a/sympy/solvers/solvers.py
+++ b/sympy/solvers/solvers.py
@@ -361,48 +361,36 @@
# TODO: improve solution testing
-def failing_assumptions(expr, against=None, **assumptions):
- """
- Helper for ``check_assumptions``.
-
- Returns empty... | diff --git a/sympy/solvers/tests/test_solvers.py b/sympy/solvers/tests/test_solvers.py
--- a/sympy/solvers/tests/test_solvers.py
+++ b/sympy/solvers/tests/test_solvers.py
@@ -1301,15 +1301,16 @@
x = symbols('x', positive=True)
assert solve(x**2 - 1) == [1]
assert check_assumptions(1, x) == True
+ rais... | null | null | namanjain12/sympy_final:c7c831dbbb85661524780dcf33632843814582b9 | true | null | 1 | 76 | null | 2,154 | 0 | 0.75 | 1 | 0.75 | 1 | 0.612333 | 84.962 | ||
3,410 | swe_bench::test::1838 | swe_bench | test | 1,838 | sphinx-doc__sphinx-8611 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 3f560cd67239f75840cc7a439ab54d8509c855f6 | Attribute undocumented error for an inherited attribute
**Describe the bug**
Sphinx complains about missing documentation for an attribute of an inherited class (`staticMetaObject` is an attribute of `QObject`, `Reenter` inherits from `QObject`). This showed up with Sphinx 3.4.0 and continues with 3.4.1. I thought t... | AFAIK, Sphinx does not emit such a warning. I guess the warning came from 3rd party extensions.
It seems your conf.py emits the warning.
https://github.com/altendky/qtrio/blob/bf3bcc41e8d63216153bbc42709550429bcf38ff/docs/source/conf.py#L99-L102
Thanks for taking a look and for pointing out that my own code is generat... | 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
@@ -2092,18 +2092,36 @@ class NonDataDescriptorMixin(DataDocumenterMixinBase):
and :value: header will be suppressed unexpectedly.
"""
+ def imp... | diff --git a/tests/test_ext_autodoc_events.py b/tests/test_ext_autodoc_events.py
--- a/tests/test_ext_autodoc_events.py
+++ b/tests/test_ext_autodoc_events.py
@@ -34,6 +34,23 @@ def on_process_docstring(app, what, name, obj, options, lines):
]
+@pytest.mark.sphinx('html', testroot='ext-autodoc')
+def test_proc... | ["tests/test_ext_autodoc_events.py::test_process_docstring_for_nondatadescriptor"] | ["tests/test_ext_autodoc_events.py::test_process_docstring", "tests/test_ext_autodoc_events.py::test_cut_lines", "tests/test_ext_autodoc_events.py::test_between", "tests/test_ext_autodoc_events.py::test_between_exclude", "tests/test_ext_autodoc_events.py::test_skip_module_member"] | null | true | 2020-12-29T09:24:36Z | 1 | 22 | 1 | 11,927 | 0 | 0.8 | 1 | 0.65 | 1 | 0.573333 | 84.945 | |
3,411 | r2e_gym::train::1971 | r2e_gym | train | 1,971 | sympy__54b2220314545fb37181afe4015c184f14eb3241 | sympy | sympy/sympy | python | 54b2220314545fb37181afe4015c184f14eb3241 | Title: New "abaco2_similar" hint not recognized in infinitesimals calculation
Description:
When using the newly added "abaco2_similar" hint for calculating infinitesimals, the code fails to recognize the heuristic. For example, consider the following minimal code:
```
from sympy import symbols, Function, sin
from sym... | diff --git a/doc/src/modules/solvers/ode.rst b/doc/src/modules/solvers/ode.rst
--- a/doc/src/modules/solvers/ode.rst
+++ b/doc/src/modules/solvers/ode.rst
@@ -146,6 +146,15 @@
^^^^^^^^^^
.. autofunction:: sympy.solvers.ode.lie_heuristic_chi
+:obj:`abaco2_similar`
+^^^^^^^^^^^^^^^^^^^^^
+.. autofunction:: sympy.solv... | diff --git a/sympy/solvers/tests/test_ode.py b/sympy/solvers/tests/test_ode.py
--- a/sympy/solvers/tests/test_ode.py
+++ b/sympy/solvers/tests/test_ode.py
@@ -1652,7 +1652,7 @@
assert checkinfsol(eq, i)[0]
-def test_heuristic__function_sum():
+def test_heuristic_function_sum():
xi = Function('xi')
et... | null | null | namanjain12/sympy_final:54b2220314545fb37181afe4015c184f14eb3241 | true | null | 2 | 115 | null | 1,326 | 0 | 0.75 | 1 | 0.75 | 1 | 0.604333 | 84.938 | ||
3,412 | swe_bench::test::1321 | swe_bench | test | 1,321 | pylint-dev__pylint-4492 | pylint-dev/pylint | pylint-dev/pylint | python | 5ebbc30afbaa1a3c1e04fc86c3525edf9f579640 | Allow parseable output in parallel of human-readable output
### Current behavior
Currently, when selecting a format like JSON using the `-f` argument, it will replace the "normal" output.
### Expected behavior
It would be nice to have it generate an output-file instead so the normal human-readable output is still th... | I'm not sure I understand the use case. For what would the parseable one (e.g JSON) will be used for in CI?
We are currently in the process of setting up a pipeline for checking a project for "sanity". I though having a job evaluating the pylint score given in the final report. Having the job emit a warning when the va... | diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py
--- a/pylint/lint/pylinter.py
+++ b/pylint/lint/pylinter.py
@@ -43,6 +43,14 @@ def _read_stdin():
return sys.stdin.read()
+def _load_reporter_by_class(reporter_class: str) -> type:
+ qname = reporter_class
+ module_part = astroid.modutils.get... | diff --git a/tests/unittest_reporting.py b/tests/unittest_reporting.py
--- a/tests/unittest_reporting.py
+++ b/tests/unittest_reporting.py
@@ -15,12 +15,16 @@
# pylint: disable=redefined-outer-name
import warnings
+from contextlib import redirect_stdout
from io import StringIO
+from json import dumps
import pyt... | ["tests/unittest_reporting.py::test_multi_format_output"] | ["tests/unittest_reporting.py::test_template_option", "tests/unittest_reporting.py::test_parseable_output_deprecated", "tests/unittest_reporting.py::test_parseable_output_regression", "tests/unittest_reporting.py::test_display_results_is_renamed"] | null | true | 2021-05-23T15:13:26Z | 3 | 185 | 1 | 887 | 0 | 0.8 | 1 | 0.85 | 0.75 | 0.647833 | 84.931 | |
3,413 | r2e_gym::train::342 | r2e_gym | train | 342 | orange3__efe08f3c0f678645798e6a51b6430238f2a83eec | orange3 | biolab/orange3 | python | efe08f3c0f678645798e6a51b6430238f2a83eec | **Title:** `plsi` Function Raises IndexError with Insufficient Plural Forms
**Description:**
When using the `plsi` function with fewer plural forms than expected, it raises an `IndexError`. Additionally, attempting to use the `plsi_sz` function results in a `NameError` because it is not defined.
**Buggy Code Example:... | diff --git a/Orange/widgets/utils/localization.py b/Orange/widgets/utils/localization.py
--- a/Orange/widgets/utils/localization.py
+++ b/Orange/widgets/utils/localization.py
@@ -1,19 +1,119 @@
-__all__ = ["pl", "plsi"]
+__all__ = ["pl", "plsi", "plsi_sz"]
-def pl(n, forms):
+def pl(n: int, forms: str) -> str:
+ ... | diff --git a/Orange/widgets/utils/tests/test_localization.py b/Orange/widgets/utils/tests/test_localization.py
--- a/Orange/widgets/utils/tests/test_localization.py
+++ b/Orange/widgets/utils/tests/test_localization.py
@@ -0,0 +1,74 @@
+import unittest
+from Orange.widgets.utils.localization import *
+
+
+class TestEn(... | null | null | namanjain12/orange3_final:efe08f3c0f678645798e6a51b6430238f2a83eec | true | null | 1 | 122 | null | 1,170 | 0 | 0.75 | 1 | 0.75 | 1 | 0.601667 | 84.93 | ||
3,414 | swe_bench::test::1236 | swe_bench | test | 1,236 | pydata__xarray-4184 | pydata/xarray | pydata/xarray | python | 65ca92a5c0a4143d00dd7a822bcb1d49738717f1 | Stack + to_array before to_xarray is much faster that a simple to_xarray
I was seeing some slow performance around `to_xarray()` on MultiIndexed series, and found that unstacking one of the dimensions before running `to_xarray()`, and then restacking with `to_array()` was ~30x faster. This time difference is consistent... | Here are the top entries I see with `%prun cropped.to_xarray()`:
```
308597 function calls (308454 primitive calls) in 0.651 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
100000 0.255 0.000 0.275 0.000 datetimes.py:606(<lamb... | diff --git a/asv_bench/benchmarks/pandas.py b/asv_bench/benchmarks/pandas.py
new file mode 100644
--- /dev/null
+++ b/asv_bench/benchmarks/pandas.py
@@ -0,0 +1,24 @@
+import numpy as np
+import pandas as pd
+
+from . import parameterized
+
+
+class MultiIndexSeries:
+ def setup(self, dtype, subset):
+ data = ... | 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
@@ -4013,6 +4013,49 @@ def test_to_and_from_empty_dataframe(self):
assert len(actual) == 0
assert expected.equals(actual)
+ def test_from_dataframe_multii... | ["xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_unsorted_levels"] | ["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 | 2020-06-26T07:39:14Z | 3 | 104 | 2 | 5,878 | 0 | 0.8 | 1 | 0.62 | 1 | 0.846667 | 84.91 | |
3,415 | swe_bench::test::1085 | swe_bench | test | 1,085 | matplotlib__matplotlib-25547 | matplotlib/matplotlib | matplotlib/matplotlib | python | e8101f17d8a7d2d7eccff7452162c02a27980800 | UserWarning thrown when all values are "bad", but not when only some are
### Bug report
**Bug summary**
If all values passed as colors are "bad" (`np.nan`), a warning is thrown from numpy about converting masked values to null. If some of the values are "bad", this does not happen.
**Code for reproduction**
```pyt... | The warning comes from NumPy, so not sure there is much Matplotlib can do? I'll close this, but feel free to reopen if you have another opinion (and sorry for letting this go unnoticed for so long).
@oscargus, could matplotlib just catch the warning at plot time?
I figure if the behavior is intentional from matplotl... | 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
@@ -2208,19 +2208,11 @@ def _convert_dx(dx, x0, xconv, convert):
x0 = cbook._safe_first_finite(x0)
except (TypeError, IndexError, KeyError):
... | diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py
--- a/lib/matplotlib/tests/test_cbook.py
+++ b/lib/matplotlib/tests/test_cbook.py
@@ -608,6 +608,18 @@ def test_flatiter():
assert 1 == next(it)
+def test__safe_first_finite_all_nan():
+ arr = np.full(2, np.nan)
+ ret = ... | ["lib/matplotlib/tests/test_cbook.py::test__safe_first_finite_all_nan", "lib/matplotlib/tests/test_cbook.py::test__safe_first_finite_all_inf"] | ["lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_bad_first_arg", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_string_seq", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_datetime", "lib/matplotlib/tests/test_cbook.py::Test_delete_masked_points::test_rgb... | null | true | 2023-03-25T15:54:49Z | 2 | 18 | 2 | 9,716 | 0 | 0.8 | 1 | 0.65 | 1 | 0.56 | 84.905 | |
3,416 | swe_bench::test::1405 | swe_bench | test | 1,405 | pytest-dev__pytest-5479 | pytest-dev/pytest | pytest-dev/pytest | python | 2301fa61dee4e3724efdfd8cbf3a93af143aef4c | cannot make unicode match assertions with pytest.raises python2 pytest
```
def test_u():
with pytest.raises(AssertionError, match=u"\u2603"):
> assert False, u"\u2603"
E UnicodeEncodeError: 'ascii' codec can't encode character u'\u2603' in position 0: ordinal not in range(128)
``` | Hi @graingert,
~~I actually fail to reproduce the issue:~~
...
OK nevermind, my bad, I do reproduce your issue. | 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
@@ -572,8 +572,13 @@ def match(self, regexp):
raised.
"""
__tracebackhide__ = True
- if not re.search(regexp, str(self.value)):
- assert 0, "Pat... | diff --git a/testing/python/raises.py b/testing/python/raises.py
--- a/testing/python/raises.py
+++ b/testing/python/raises.py
@@ -4,6 +4,7 @@
import six
import pytest
+from _pytest.compat import dummy_context_manager
from _pytest.outcomes import Failed
from _pytest.warning_types import PytestDeprecationWarning
... | ["testing/python/raises.py::TestRaises::test_raises_match"] | ["testing/python/raises.py::TestRaises::test_raises", "testing/python/raises.py::TestRaises::test_raises_exec", "testing/python/raises.py::TestRaises::test_raises_exec_correct_filename", "testing/python/raises.py::TestRaises::test_raises_syntax_error", "testing/python/raises.py::TestRaises::test_raises_function", "test... | null | true | 2019-06-24T10:23:23Z | 1 | 9 | 1 | 313 | 0 | 0.8 | 1 | 0.7 | 1 | 0.082167 | 84.8965 | |
3,417 | swe_bench::test::1209 | swe_bench | test | 1,209 | pydata__xarray-3114 | pydata/xarray | pydata/xarray | python | b3ba4ba5f9508e4b601d9cf5dbcd9024993adf37 | expand_dims() modifies numpy.ndarray.flags to write only, upon manually reverting this flag back, attempting to set a single inner value using .loc will instead set all of the inner array values
I am using the newly updated **expand_dims** API that was recently updated with this PR [https://github.com/pydata/xarray/pul... | As you've noticed, these arrays are "read only" because otherwise indexing can modify more than the original values, e.g., consider:
```python
original = xr.DataArray(np.zeros(3), dims='x')
result = original.expand_dims(y=2)
result.data.flags.writeable = True
result[0, 0] = 1
print(result)
```
Both "y" values w... | diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py
--- a/xarray/core/dataarray.py
+++ b/xarray/core/dataarray.py
@@ -1272,7 +1272,9 @@ def expand_dims(self, dim: Union[None, Hashable, Sequence[Hashable],
Mapping[Hashable, Any]] = None,
axis=None, ... | diff --git a/xarray/tests/test_indexing.py b/xarray/tests/test_indexing.py
--- a/xarray/tests/test_indexing.py
+++ b/xarray/tests/test_indexing.py
@@ -144,6 +144,16 @@ def test_indexer(data, x, expected_pos, expected_idx=None):
[True, True, True, True, False, False, False, False],
... | ["xarray/tests/test_indexing.py::TestIndexers::test_read_only_view"] | ["xarray/tests/test_indexing.py::TestIndexers::test_expanded_indexer", "xarray/tests/test_indexing.py::TestIndexers::test_asarray_tuplesafe", "xarray/tests/test_indexing.py::TestIndexers::test_stacked_multiindex_min_max", "xarray/tests/test_indexing.py::TestIndexers::test_convert_label_indexer", "xarray/tests/test_inde... | null | true | 2019-07-13T21:13:45Z | 3 | 17 | 1 | 8,919 | 0 | 0.8 | 1 | 0.65 | 1 | 0.556667 | 84.895 | |
3,418 | swe_bench::test::2043 | swe_bench | test | 2,043 | sympy__sympy-15231 | sympy/sympy | sympy/sympy | python | 115dd821a4b9ec94ca1bd339a8c0d63f31a12167 | autowrap fortran fails with expression containing Mod function twice
Minimal example:
```
from sympy import Matrix, Mod, symbols
from sympy.utilities.autowrap import autowrap
x, y = symbols(['x', 'y'])
expr = Mod(x, 2)- Mod(y, 2)
expr = (x % 2) - (y % 2) # Same error
f = autowrap(expr, args=[x, y])
```
Error:
```
C... | The first step to fixing this is to define a print method for `Mod` in `sympy/printing/fscode.py`. There is no `_print_Mod()` method.
You can see it not working here:
```
Python 3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:43)
Type 'copyright', 'credits' or 'license' for more information
IPy... | diff --git a/sympy/printing/fcode.py b/sympy/printing/fcode.py
--- a/sympy/printing/fcode.py
+++ b/sympy/printing/fcode.py
@@ -59,7 +59,7 @@
"Abs": "abs",
"conjugate": "conjg",
"Max": "max",
- "Min": "min"
+ "Min": "min",
}
@@ -304,6 +304,19 @@ def _print_Function(self, expr):
else:
... | diff --git a/sympy/external/tests/test_autowrap.py b/sympy/external/tests/test_autowrap.py
--- a/sympy/external/tests/test_autowrap.py
+++ b/sympy/external/tests/test_autowrap.py
@@ -2,7 +2,7 @@
import tempfile
import os
import warnings
-from sympy import symbols, Eq
+from sympy import symbols, Eq, Mod
from sympy.e... | ["test_fcode_functions"] | ["test_printmethod", "test_fcode_sign", "test_fcode_Pow", "test_fcode_Rational", "test_fcode_Integer", "test_fcode_Float", "test_case", "test_fcode_functions_with_integers", "test_fcode_NumberSymbol", "test_fcode_complex", "test_implicit", "test_not_fortran", "test_user_functions", "test_inline_function", "test_assign_... | null | true | 2018-09-13T15:42:47Z | 2 | 17 | 1 | 7,717 | 0 | 0.8 | 1 | 0.65 | 1 | 0.556667 | 84.895 | |
3,419 | swe_bench::test::2150 | swe_bench | test | 2,150 | sympy__sympy-18137 | sympy/sympy | sympy/sympy | python | 0bffa281e62b4d29fbe3cd22faa4d612a4b1ca76 | Range(1).intersect(FiniteSet(n)) raises TypeError: cannot determine truth value of Relational
```
n = Symbol('n', integer=True)
Range(1).intersect(FiniteSet(n))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipytho... | diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py
--- a/sympy/sets/fancysets.py
+++ b/sympy/sets/fancysets.py
@@ -683,11 +683,17 @@ def _contains(self, other):
ref = self.start
elif self.stop.is_finite:
ref = self.stop
- else:
- return other.is_Integer
-... | diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py
--- a/sympy/sets/tests/test_fancysets.py
+++ b/sympy/sets/tests/test_fancysets.py
@@ -333,11 +333,14 @@ def test_Range_set():
assert Range(1, 4).as_relational(x) == (x >= 1) & (x <= 3) & Eq(x, floor(x))
assert Range(oo, 1, -2... | ["test_Range_symbolic", "test_is_subset"] | ["test_naturals", "test_naturals0", "test_integers", "test_ImageSet", "test_image_is_ImageSet", "test_halfcircle", "test_ImageSet_iterator_not_injective", "test_inf_Range_len", "test_Range_set", "test_range_range_intersection", "test_range_interval_intersection", "test_Integers_eval_imageset", "test_Range_eval_imageset... | null | true | 2019-12-26T21:41:22Z | 3 | 80 | 2 | 2,882 | 0 | 0.8 | 1 | 0.7 | 1 | 0.747 | 84.891 | ||
3,420 | swe_bench::test::1517 | swe_bench | test | 1,517 | scikit-learn__scikit-learn-10881 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 4989a9503753a92089f39e154a2bb5d160b5d276 | No warning when LogisticRegression does not converge
#### Description
I've run LogisticRegressionCV on the Wisconsin Breast Cancer data, and the output of clf.n_iter_ was 100 for all but 1 of the variables. The default of 100 iterations was probably not sufficient in this case. Should there not be some kind of warnin... | If you use verbose=1 in your snippet, you'll get plenty of ConvergenceWarning.
```py
from sklearn.datasets import load_breast_cancer
from sklearn.linear_model import LogisticRegressionCV
data = load_breast_cancer()
y = data.target
X = data.data
clf = LogisticRegressionCV(verbose=1)
clf.fit(X, y)
print(cl... | diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py
--- a/sklearn/linear_model/logistic.py
+++ b/sklearn/linear_model/logistic.py
@@ -707,7 +707,7 @@ def logistic_regression_path(X, y, pos_class=None, Cs=10, fit_intercept=True,
func, w0, fprime=None,
args=(... | diff --git a/sklearn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py
--- a/sklearn/linear_model/tests/test_logistic.py
+++ b/sklearn/linear_model/tests/test_logistic.py
@@ -800,15 +800,6 @@ def test_logistic_regression_class_weights():
assert_array_almost_equal(clf1.coef_, clf... | ["sklearn/linear_model/tests/test_logistic.py::test_max_iter", "sklearn/svm/tests/test_svm.py::test_linear_svm_convergence_warnings"] | ["sklearn/linear_model/tests/test_logistic.py::test_predict_2_classes", "sklearn/linear_model/tests/test_logistic.py::test_error", "sklearn/linear_model/tests/test_logistic.py::test_lr_liblinear_warning", "sklearn/linear_model/tests/test_logistic.py::test_predict_3_classes", "sklearn/linear_model/tests/test_logistic.py... | null | true | 2018-03-28T12:36:45Z | 2 | 4 | 2 | 1,329 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.234833 | 84.8795 | |
3,421 | swe_bench::test::1791 | swe_bench | test | 1,791 | sphinx-doc__sphinx-7859 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | da395b413245e8001f576e547614dc6baa7d5575 | autodoc_typehints = 'descriptions' throws KeyError: 'module'
**Describe the bug**
autodoc_typehints = 'description' does not work, results in `KeyError: 'module'`
**To Reproduce**
```bash
git clone https://github.com/gymreklab/TRTools .
git checkout 157a332b49f2be0b12c2d5ae38312d83a175a851
cd doc
# add the line
# auto... | I happened to fix my problem - seems that this occurs when there are both `attribute` and `py:attribute` in the same class with the same name (that occurs because of an unrelated issue with napoleon). I can understand that's not a use case that needs to be supported, but the error thrown should help describe what's goi... | diff --git a/sphinx/ext/autodoc/typehints.py b/sphinx/ext/autodoc/typehints.py
--- a/sphinx/ext/autodoc/typehints.py
+++ b/sphinx/ext/autodoc/typehints.py
@@ -46,11 +46,16 @@ def merge_typehints(app: Sphinx, domain: str, objtype: str, contentnode: Element
if objtype == 'class' and app.config.autoclass_content not ... | diff --git a/tests/test_ext_autodoc_configs.py b/tests/test_ext_autodoc_configs.py
--- a/tests/test_ext_autodoc_configs.py
+++ b/tests/test_ext_autodoc_configs.py
@@ -13,6 +13,8 @@
import pytest
+from sphinx.testing import restructuredtext
+
from test_ext_autodoc import do_autodoc
IS_PYPY = platform.python_imp... | ["tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_for_invalid_node"] | ["tests/test_ext_autodoc_configs.py::test_autoclass_content_class", "tests/test_ext_autodoc_configs.py::test_autoclass_content_init", "tests/test_ext_autodoc_configs.py::test_autoclass_content_both", "tests/test_ext_autodoc_configs.py::test_autodoc_inherit_docstrings", "tests/test_ext_autodoc_configs.py::test_autodoc_d... | null | true | 2020-06-21T08:53:31Z | 1 | 15 | 1 | 12,638 | 0 | 0.8 | 1 | 0.65 | 1 | 0.55 | 84.875 | |
3,422 | swe_bench::test::2049 | swe_bench | test | 2,049 | sympy__sympy-15308 | sympy/sympy | sympy/sympy | python | fb59d703e6863ed803c98177b59197b5513332e9 | LaTeX printing for Matrix Expression
```py
>>> A = MatrixSymbol("A", n, n)
>>> latex(trace(A**2))
'Trace(A**2)'
```
The bad part is not only is Trace not recognized, but whatever printer is being used doesn't fallback to the LaTeX printer for the inner expression (it should be `A^2`). | What is the correct way to print the trace? AFAIK there isn't one built in to Latex. One option is ```\mathrm{Tr}```. Or ```\operatorname{Tr}```.
What's the difference between the two. It looks like we use both in different parts of the latex printer.
\operatorname puts a thin space after the operator. | diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -289,6 +289,10 @@ def _do_exponent(self, expr, exp):
else:
return expr
+ def _print_Basic(self, expr):
+ l = [self._print(o) for o in expr.args]
+ return... | diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -1866,3 +1866,35 @@ def test_latex_printer_tensor():
expr = TensorElement(K(i,j,-k,-l), {i:3})
assert latex(expr) == 'K{}^{i=3,j}{}_{kl}'
... | ["test_trace"] | ["test_printmethod", "test_latex_basic", "test_latex_builtins", "test_latex_SingularityFunction", "test_latex_cycle", "test_latex_permutation", "test_latex_Float", "test_latex_vector_expressions", "test_latex_symbols", "test_latex_functions", "test_function_subclass_different_name", "test_hyper_printing", "test_latex_b... | null | true | 2018-09-28T16:42:11Z | 1 | 8 | 1 | 286 | 0 | 0.8 | 1 | 0.7 | 1 | 0.074333 | 84.873 | |
3,423 | r2e_gym::train::959 | r2e_gym | train | 959 | sympy__d20fcb2086345d9bef7c7651f6b36d7e49b4a804 | sympy | sympy/sympy | python | d20fcb2086345d9bef7c7651f6b36d7e49b4a804 | Title: Incorrect log series expansion for specific inputs causing ValueError and wrong coefficients
Description:
When expanding logarithmic expressions around non-zero centers, the series expansion does not behave as expected. For example, using an expression like:
```
from sympy import symbols, log, O, S
x, w = sym... | diff --git a/sympy/functions/elementary/exponential.py b/sympy/functions/elementary/exponential.py
--- a/sympy/functions/elementary/exponential.py
+++ b/sympy/functions/elementary/exponential.py
@@ -919,6 +919,7 @@
# NOTE Please see the comment at the beginning of this file, labelled
# IMPORTANT.... | diff --git a/sympy/series/tests/test_nseries.py b/sympy/series/tests/test_nseries.py
--- a/sympy/series/tests/test_nseries.py
+++ b/sympy/series/tests/test_nseries.py
@@ -277,8 +277,8 @@
r = log(5)/log(3)
p = w**(-1 + r)
e = 1/x*(-log(w**(1 + r)) + log(w + w**r))
- e_ser = -r*log(w)/x + p/x - p**2/(2*... | null | null | namanjain12/sympy_final:d20fcb2086345d9bef7c7651f6b36d7e49b4a804 | true | null | 1 | 58 | null | 2,325 | 0 | 0.75 | 1 | 0.75 | 1 | 0.580833 | 84.8675 | ||
3,424 | swe_bench::test::1923 | swe_bench | test | 1,923 | sympy__sympy-11919 | sympy/sympy | sympy/sympy | python | 8d181f4bf6d415bb424f7577b274f53694c9bdb4 | Function('gamma') pretty prints as Γ
```
In [13]: from sympy import *
In [14]: t = symbols('t')
In [15]: init_printing()
In [16]: gamma = symbols('gamma', cls=Function)(t)
In [17]: gamma
Out[17]: Γ(t)
```
This should not create the [Gamma Function](https://en.wikipedia.org/wiki/Gamma_function). | I would like to work on this, @moorepants could you explain how to start.
The issue is the printing I guess.
This is also somewhat related to https://github.com/sympy/sympy/issues/6938.
I updated the issue title. The function itself is distinct from `gamma`. The problem is that the printer is hardcoded to print ga... | diff --git a/sympy/printing/pretty/pretty.py b/sympy/printing/pretty/pretty.py
--- a/sympy/printing/pretty/pretty.py
+++ b/sympy/printing/pretty/pretty.py
@@ -1193,10 +1193,14 @@ def _print_SingularityFunction(self, e):
return base**n
def _print_gamma(self, e):
+ from sympy.functions import g... | diff --git a/sympy/printing/pretty/tests/test_pretty.py b/sympy/printing/pretty/tests/test_pretty.py
--- a/sympy/printing/pretty/tests/test_pretty.py
+++ b/sympy/printing/pretty/tests/test_pretty.py
@@ -12,7 +12,7 @@
from sympy.functions import (Abs, Chi, Ci, Ei, KroneckerDelta,
Piecewise, Shi, Si, atan2, binom... | ["test_gammas"] | ["test_pretty_ascii_str", "test_pretty_unicode_str", "test_upretty_greek", "test_upretty_multiindex", "test_upretty_sub_super", "test_upretty_subs_missing_in_24", "test_upretty_modifiers", "test_pretty_Cycle", "test_pretty_basic", "test_negative_fractions", "test_issue_5524", "test_EulerGamma", "test_GoldenRatio", "tes... | null | true | 2016-12-08T19:11:02Z | 1 | 6 | 1 | 300 | 0 | 0.8 | 1 | 0.7 | 1 | 0.07 | 84.86 | |
3,425 | swe_bench::test::1445 | swe_bench | test | 1,445 | pytest-dev__pytest-7481 | pytest-dev/pytest | pytest-dev/pytest | python | d466cc25a78b442cd4ccaafae4adef9a7f1e4012 | pytest 6 (?): UnicodeEncodeError in terminalwriter on Windows
Just got this on GitHub Actions with the pytest 6 rc:
```
__________ test_crash_when_pasting_emoji_into_the_command_line_2007 ___________
request = <FixtureRequest for <Function test_crash_when_pasting_emoji_into_the_command_line_2007>>
@pytest.mark.u... | Hmmm at first glance doesn't seem related to pytest 6 and this is a bug which has always been there, but I might be wrong of course.
Can you try to make a test which always fails and outputs that emoji? Also would help if you can try with and without instafail.
Will do so, but might be next week until I get to it, ... | diff --git a/src/_pytest/_io/terminalwriter.py b/src/_pytest/_io/terminalwriter.py
--- a/src/_pytest/_io/terminalwriter.py
+++ b/src/_pytest/_io/terminalwriter.py
@@ -149,7 +149,18 @@ def write(self, msg: str, *, flush: bool = False, **markup: bool) -> None:
msg = self.markup(msg, **markup)
- ... | diff --git a/testing/io/test_terminalwriter.py b/testing/io/test_terminalwriter.py
--- a/testing/io/test_terminalwriter.py
+++ b/testing/io/test_terminalwriter.py
@@ -49,6 +49,15 @@ def isatty(self):
assert not tw.hasmarkup
+def test_terminalwriter_not_unicode() -> None:
+ """If the file doesn't support... | ["testing/io/test_terminalwriter.py::test_terminalwriter_not_unicode"] | ["testing/io/test_terminalwriter.py::test_terminal_width_COLUMNS", "testing/io/test_terminalwriter.py::test_terminalwriter_width_bogus", "testing/io/test_terminalwriter.py::test_terminalwriter_computes_width", "testing/io/test_terminalwriter.py::test_terminalwriter_dumb_term_no_markup", "testing/io/test_terminalwriter.... | null | true | 2020-07-11T16:00:30Z | 1 | 13 | 1 | 8,733 | 0 | 0.8 | 1 | 0.65 | 1 | 0.543333 | 84.855 | |
3,426 | swe_bench::test::1103 | swe_bench | test | 1,103 | matplotlib__matplotlib-26020 | matplotlib/matplotlib | matplotlib/matplotlib | python | f6a781f77f5ddf1204c60ca7c544809407d4a807 | Error creating AxisGrid with non-default axis class
### Bug report
**Bug summary**
Creating `AxesGrid` using cartopy `GeoAxes` as `axis_class` raises `TypeError: 'method' object is not subscriptable`. Seems to be due to different behaviour of `axis` attr. for `mpl_toolkits.axes_grid1.mpl_axes.Axes` and other axes in... | This could probably be made to work by:
a) renaming the `axis` property on `.mpl_axes.Axes` to something that does not collide with an existing method
b) doing on-the-fly multiple inheritance in AxesGrid if the input axes class does not already inherit from the said Axes extension
Ok. It this begs the question of... | diff --git a/lib/mpl_toolkits/axes_grid1/axes_grid.py b/lib/mpl_toolkits/axes_grid1/axes_grid.py
--- a/lib/mpl_toolkits/axes_grid1/axes_grid.py
+++ b/lib/mpl_toolkits/axes_grid1/axes_grid.py
@@ -1,5 +1,6 @@
from numbers import Number
import functools
+from types import MethodType
import numpy as np
@@ -7,14 +8,2... | diff --git a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py
--- a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py
+++ b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py
@@ -767,3 +767,7 @@ def test_anchored_locator_base_call():
axins.set(xticks=... | ["lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_with_axes_class_not_overriding_axis"] | ["lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_divider_append_axes", "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_twin_axes_empty_and_removed[png]", "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_axesgrid_colorbar_log_smoketest", "lib/mpl_toolkits/axes_grid1/tests/test_axes_gri... | null | true | 2023-05-31T21:36:23Z | 1 | 13 | 1 | 18,017 | 0 | 0.8 | 1 | 0.65 | 1 | 0.543333 | 84.855 | |
3,427 | swe_bench::test::2013 | swe_bench | test | 2,013 | sympy__sympy-14070 | sympy/sympy | sympy/sympy | python | 888f16155784747383083a8cd48a7f0089780899 | logcombine(log(3) - log(2)) does nothing
```
logcombine(log(3) - log(2)) should return log(3/2) but it doesn't. This used to work in 0.6.7.
```
Original issue for #5950: http://code.google.com/p/sympy/issues/detail?id=2851
Original author: https://code.google.com/u/101272611947379421629/ | ```
Bisected to:
commit 9dc1d111d489624eef3b0c9481c3e6d99cd869e0
Author: Chris Smith <smichr@gmail.com>
Date: Fri May 20 00:11:41 2011 +0545
2397: log expansion changes
Expansion of a log was being done in an as_numer_denom method;
it should be done in _eval_expand_log where rules are followed
... | diff --git a/sympy/simplify/simplify.py b/sympy/simplify/simplify.py
--- a/sympy/simplify/simplify.py
+++ b/sympy/simplify/simplify.py
@@ -982,7 +982,7 @@ def goodlog(l):
for k in list(log1.keys()):
log1[Mul(*k)] = log(logcombine(Mul(*[
l.args[0]**Mul(*c) for c, l in log1.pop(k)])... | diff --git a/sympy/simplify/tests/test_simplify.py b/sympy/simplify/tests/test_simplify.py
--- a/sympy/simplify/tests/test_simplify.py
+++ b/sympy/simplify/tests/test_simplify.py
@@ -470,6 +470,14 @@ def test_logcombine_complex_coeff():
i + log(x**2)
+def test_issue_5950():
+ x, y = symbols("x,y", posit... | ["test_issue_5950"] | ["test_issue_3557", "test_simplify_complex", "test_simplify_ratio", "test_simplify_measure", "test_simplify_rational", "test_simplify_issue_1308", "test_issue_5652", "test_simplify_fail1", "test_nthroot", "test_separatevars", "test_separatevars_advanced_factor", "test_hypersimp", "test_nsimplify", "test_issue_9448", "t... | null | true | 2018-02-03T12:14:13Z | 1 | 6 | 1 | 289 | 0 | 0.8 | 1 | 0.7 | 1 | 0.068167 | 84.8545 | |
3,428 | swe_bench::test::1211 | swe_bench | test | 1,211 | pydata__xarray-3156 | pydata/xarray | pydata/xarray | python | 118f4d996e7711c9aced916e6049af9f28d5ec66 | groupby on empty DataArray raises StopIteration
This seems similar to #1764 and #2240 so apologies if it is a duplicate, but I have a minimal example where it happens on an empty DataArray:
#### Code Sample
```python
import xarray as xr
xr.DataArray([], dims='dim').groupby('dim').mean() # raises StopIteration
```
... | Agreed, this is definitely a bug. I'm not sure if we can define meaningful behavior for this case, but at the least we should raise a better error.
@shoyer I would like to work on this issue (hopefully my first contribution).
I believe the error should indicate that we cannot groupby an empty group. This would be c... | diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py
--- a/xarray/core/groupby.py
+++ b/xarray/core/groupby.py
@@ -232,6 +232,9 @@ def __init__(self, obj, group, squeeze=False, grouper=None, bins=None,
raise TypeError('`group` must be an xarray.DataArray or the '
... | diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py
--- a/xarray/tests/test_groupby.py
+++ b/xarray/tests/test_groupby.py
@@ -105,6 +105,14 @@ def func(arg1, arg2, arg3=0):
assert_identical(expected, actual)
+def test_da_groupby_empty():
+
+ empty_array = xr.DataArray([], dims='dim')
+
... | ["xarray/tests/test_groupby.py::test_da_groupby_empty"] | ["xarray/tests/test_groupby.py::test_consolidate_slices", "xarray/tests/test_groupby.py::test_multi_index_groupby_apply", "xarray/tests/test_groupby.py::test_multi_index_groupby_sum", "xarray/tests/test_groupby.py::test_groupby_da_datetime", "xarray/tests/test_groupby.py::test_groupby_duplicate_coordinate_labels", "xar... | null | true | 2019-07-21T11:27:25Z | 1 | 3 | 1 | 1,294 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.225667 | 84.852 | |
3,429 | swe_bench::test::1897 | swe_bench | test | 1,897 | sphinx-doc__sphinx-9797 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 4c91c038b220d07bbdfe0c1680af42fe897f342c | Overridden classmethod documentation not inherited with autodoc
### Describe the bug
The documentation for a classmethod in a parent class is not inherited by the method re-defined (without documentation) in a child class
### How to Reproduce
Module `src/spam.py`:
```python
class Parent:
@classmethod
def met... | By default, autodoc searches the docstring from the parent class. Please disable `autodoc_inherit_docstrings`.
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_inherit_docstrings
Setting `autodoc_inherit_docstrings = False` didn't fix it. As a matter of fact, it (as the name suggests)... | diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -866,7 +866,9 @@ def getdoc(obj: Any, attrgetter: Callable = safe_getattr,
for basecls in getmro(cls):
meth = basecls.__dict__.get(name)
if meth and hasattr(meth, ... | 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
@@ -677,6 +677,25 @@ def func1(a, b, c):
assert inspect.unpartial(func3) is func1
+def test_getdoc_inherited_classmethod():
+ class Foo:
+ @classmethod
+ def m... | ["tests/test_util_inspect.py::test_getdoc_inherited_classmethod"] | ["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-10-29T17:02:29Z | 1 | 4 | 1 | 1,263 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.223833 | 84.8465 | |
3,430 | swe_bench::dev::41 | swe_bench | dev | 41 | pvlib__pvlib-python-1448 | pvlib/pvlib-python | pvlib/pvlib-python | python | 8d0f863da92739669e01ac4da4145e4547638b50 | Output of solarposition.sun_rise_set_transit_ephem depends on installed ephem version
**Describe the bug**
`pvlib.solarposition.sun_rise_set_transit_ephem` returns a different answer depending on what version of `ephem` is installed. I think the problem is that our wrapper assumes that ephem doesn't pay attention to ti... | diff --git a/pvlib/iotools/crn.py b/pvlib/iotools/crn.py
--- a/pvlib/iotools/crn.py
+++ b/pvlib/iotools/crn.py
@@ -2,6 +2,7 @@
"""
import pandas as pd
+import numpy as np
HEADERS = [
@@ -107,13 +108,24 @@ def read_crn(filename, map_variables=True):
"""
# read in data
+ # TODO: instead of parsing... | diff --git a/pvlib/tests/iotools/test_crn.py b/pvlib/tests/iotools/test_crn.py
--- a/pvlib/tests/iotools/test_crn.py
+++ b/pvlib/tests/iotools/test_crn.py
@@ -83,7 +83,7 @@ def test_read_crn_problems(testfile_problems, columns_mapped, dtypes):
'2020-07-06 13:10:00'],
... | ["pvlib/tests/iotools/test_crn.py::test_read_crn_problems"] | ["pvlib/tests/iotools/test_crn.py::test_read_crn", "pvlib/tests/iotools/test_crn.py::test_read_crn_map_variables", "pvlib/tests/iotools/test_psm3.py::test_parse_psm3", "pvlib/tests/iotools/test_psm3.py::test_read_psm3", "pvlib/tests/iotools/test_psm3.py::test_read_psm3_map_variables", "pvlib/tests/test_conftest.py::tes... | null | true | 2022-04-22T23:54:20Z | 4 | 31 | 1 | 2,322 | 0 | 0.8 | 1 | 0.85 | 0.85 | 0.490333 | 84.8335 | ||
3,431 | swe_bench::test::1472 | swe_bench | test | 1,472 | pytest-dev__pytest-8861 | pytest-dev/pytest | pytest-dev/pytest | python | 6740fb9da6dd21b3f1d2f6c3980605f4f7c9e81d | Internal error when adding a skip mark to a doctest inside a contextmanager
To reproduce:
```py
# conftest.py
import pytest
from _pytest.doctest import DoctestItem
def pytest_collection_modifyitems(config, items):
skip_marker = pytest.mark.skip(reason='Skipping doctests')
for item in items:
if isinst... | Taking a look at this issue 👍 | diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py
--- a/src/_pytest/doctest.py
+++ b/src/_pytest/doctest.py
@@ -500,12 +500,18 @@ class MockAwareDocTestFinder(doctest.DocTestFinder):
def _find_lineno(self, obj, source_lines):
"""Doctest code does not take into account `@proper... | diff --git a/testing/test_doctest.py b/testing/test_doctest.py
--- a/testing/test_doctest.py
+++ b/testing/test_doctest.py
@@ -1164,6 +1164,41 @@ def test_continue_on_failure(self, pytester: Pytester):
["*4: UnexpectedException*", "*5: DocTestFailure*", "*8: DocTestFailure*"]
)
+ def test_ski... | ["testing/test_doctest.py::TestDoctestSkips::test_skipping_wrapped_test"] | ["testing/test_doctest.py::TestLiterals::test_number_re", "testing/test_doctest.py::test_warning_on_unwrap_of_broken_object[None]", "testing/test_doctest.py::test_warning_on_unwrap_of_broken_object[_is_mocked]", "testing/test_doctest.py::test_warning_on_unwrap_of_broken_object[<lambda>0]", "testing/test_doctest.py::tes... | null | true | 2021-07-06T16:29:51Z | 1 | 10 | 1 | 7,869 | 0 | 0.8 | 1 | 0.65 | 1 | 0.533333 | 84.825 | |
3,432 | swe_bench::test::1432 | swe_bench | test | 1,432 | pytest-dev__pytest-7186 | pytest-dev/pytest | pytest-dev/pytest | python | de556f895febd89d14db0a0828e5c8555c75f44e | _pytest.doctest._is_setup_py raises with LC_ALL=C and UTF-8 chars in setup.py
`pytest` runs into an exception when collecting tests from a repository where `setup.py` contains UTF-8 characters, but the locale is set to `C`.
Minimal example: `setup.py`:
```
# -*- coding: utf-8 -*-
from setuptools import setup, find_pa... | Seems reasonable to me to change this line:
```
/***/lib64/python3.6/site-packages/_pytest/doctest.py:123: in _is_setup_py
contents = path.read()
```
to `path.read_text(encoding="utf-8")`.
Using the `locale.getpreferredencoding()` for reading Python files is probably wrong -- in Python 3, python files a... | diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py
--- a/src/_pytest/doctest.py
+++ b/src/_pytest/doctest.py
@@ -108,20 +108,20 @@ def pytest_unconfigure():
RUNNER_CLASS = None
-def pytest_collect_file(path, parent):
+def pytest_collect_file(path: py.path.local, parent):
config = parent.config
... | diff --git a/testing/test_doctest.py b/testing/test_doctest.py
--- a/testing/test_doctest.py
+++ b/testing/test_doctest.py
@@ -5,6 +5,7 @@
from _pytest.compat import MODULE_NOT_FOUND_ERROR
from _pytest.doctest import _get_checker
from _pytest.doctest import _is_mocked
+from _pytest.doctest import _is_setup_py
from ... | ["testing/test_doctest.py::test_is_setup_py_not_named_setup_py", "testing/test_doctest.py::test_is_setup_py_is_a_setup_py[setuptools]", "testing/test_doctest.py::test_is_setup_py_is_a_setup_py[distutils.core]", "testing/test_doctest.py::test_is_setup_py_different_encoding[setuptools]", "testing/test_doctest.py::test_is... | ["testing/test_doctest.py::TestLiterals::test_number_re", "testing/test_doctest.py::test_warning_on_unwrap_of_broken_object[None]", "testing/test_doctest.py::test_warning_on_unwrap_of_broken_object[_is_mocked]", "testing/test_doctest.py::test_warning_on_unwrap_of_broken_object[<lambda>0]", "testing/test_doctest.py::tes... | null | true | 2020-05-07T20:18:57Z | 1 | 10 | 5 | 7,888 | 0 | 0.8 | 1 | 0.65 | 1 | 0.533333 | 84.825 | |
3,433 | swe_bench::test::1484 | swe_bench | test | 1,484 | pytest-dev__pytest-9624 | pytest-dev/pytest | pytest-dev/pytest | python | bc33ba0be95a1b66038a17329573aaa1666c1a0f | INTERNALERROR> TypeError: __init__() missing 1 required positional argument: 'test_method'
- [ ] a detailed description of the bug or problem you are having
https://github.com/skupperproject/skupper-router/runs/5072757996?check_suite_focus=true#step:27:362
```
2022-02-04T21:28:51.9670147Z ::StreamingMessageTest::test... | pytest generally requires that test classes can be instantiated without arguments e.g. `TestClass()`. Can you explain what the `test_method` stuff does?
@bluetech I haven't realized that `test_method` is something coming from my own code! This error appeared right after pytest 7.0.0 was released, in previous versions n... | diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py
--- a/src/_pytest/unittest.py
+++ b/src/_pytest/unittest.py
@@ -185,6 +185,15 @@ class TestCaseFunction(Function):
_excinfo: Optional[List[_pytest._code.ExceptionInfo[BaseException]]] = None
_testcase: Optional["unittest.TestCase"] = None
+ d... | diff --git a/testing/test_unittest.py b/testing/test_unittest.py
--- a/testing/test_unittest.py
+++ b/testing/test_unittest.py
@@ -1472,3 +1472,29 @@ def test_cleanup_called_the_right_number_of_times():
passed, skipped, failed = reprec.countoutcomes()
assert failed == 2
assert passed == 1
+
+
+def test_t... | ["testing/test_unittest.py::test_traceback_pruning"] | ["testing/test_unittest.py::test_simple_unittest", "testing/test_unittest.py::test_runTest_method", "testing/test_unittest.py::test_isclasscheck_issue53", "testing/test_unittest.py::test_setup", "testing/test_unittest.py::test_setUpModule", "testing/test_unittest.py::test_setUpModule_failing_no_teardown", "testing/test... | null | true | 2022-02-06T22:43:15Z | 1 | 9 | 1 | 11,315 | 0 | 0.8 | 1 | 0.65 | 1 | 0.53 | 84.815 | |
3,434 | swe_bench::test::1430 | swe_bench | test | 1,430 | pytest-dev__pytest-7158 | pytest-dev/pytest | pytest-dev/pytest | python | 80e509840813cb5da45fbe830718ea3707c02b25 | Wrong relative path in skip report when tested file is upper than invocation directory
The problem is if tested file is upper than invocation directory . It occurs in skip report.
Example:
path of tested file is:`/home/xyz/my_tests/test1.py`
and `pytest` is called in location: `/home/xyz/pytest`.
```bash
xyz@ubuntu:~... | Seems related : https://github.com/pytest-dev/pytest/issues/4677
@tirkarthi Yes, it seems similar, but doesn't apply to the same. In [#4677](https://github.com/pytest-dev/pytest/issues/4677) we want to change absolute paths to relative. Solved #4677 will leave already relative paths unchanged and will not fix this issu... | diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py
--- a/src/_pytest/skipping.py
+++ b/src/_pytest/skipping.py
@@ -168,8 +168,8 @@ def pytest_runtest_makereport(item, call):
# to point to the item definition, otherwise it will display
# the location of where the skip exception was raised w... | diff --git a/testing/test_skipping.py b/testing/test_skipping.py
--- a/testing/test_skipping.py
+++ b/testing/test_skipping.py
@@ -1176,3 +1176,20 @@ def test_importorskip():
match="^could not import 'doesnotexist': No module named .*",
):
pytest.importorskip("doesnotexist")
+
+
+def test_relpath... | ["testing/test_skipping.py::test_relpath_rootdir"] | ["testing/test_skipping.py::test_importorskip", "testing/test_skipping.py::TestEvaluator::test_no_marker", "testing/test_skipping.py::TestEvaluator::test_marked_no_args", "testing/test_skipping.py::TestEvaluator::test_marked_one_arg", "testing/test_skipping.py::TestEvaluator::test_marked_one_arg_with_reason", "testing/... | null | true | 2020-05-03T22:18:31Z | 1 | 4 | 1 | 1,188 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.211333 | 84.809 | |
3,435 | r2e_gym::train::559 | r2e_gym | train | 559 | sympy__9f2505f338142599192a5d1300d55e86b3ba463b | sympy | sympy/sympy | python | 9f2505f338142599192a5d1300d55e86b3ba463b | Title: piecewise_exclusive() Fails When Using the 'deep' Keyword
Description:
When invoking the piecewise_exclusive() function with the 'deep' keyword argument, it fails with a TypeError. In our computation, we expect to have control over whether subexpressions are recursively rewritten, but using 'deep' triggers an e... | diff --git a/sympy/functions/elementary/piecewise.py b/sympy/functions/elementary/piecewise.py
--- a/sympy/functions/elementary/piecewise.py
+++ b/sympy/functions/elementary/piecewise.py
@@ -117,7 +117,10 @@
See Also
========
- piecewise_fold, ITE
+
+ piecewise_fold
+ piecewise_exclusive
+ ITE
... | diff --git a/sympy/functions/elementary/tests/test_piecewise.py b/sympy/functions/elementary/tests/test_piecewise.py
--- a/sympy/functions/elementary/tests/test_piecewise.py
+++ b/sympy/functions/elementary/tests/test_piecewise.py
@@ -714,6 +714,18 @@
e... | null | null | namanjain12/sympy_final:9f2505f338142599192a5d1300d55e86b3ba463b | true | null | 1 | 101 | null | 1,339 | 0 | 0.75 | 1 | 0.75 | 1 | 0.559833 | 84.8045 | ||
3,436 | r2e_gym::train::1034 | r2e_gym | train | 1,034 | sympy__4bb8bc30d9430913f08cfa520836b23287d508fc | sympy | sympy/sympy | python | 4bb8bc30d9430913f08cfa520836b23287d508fc | Title: _dict_list Incorrectly Raises IndexError on Invalid 'num' Argument
Description:
When trying to obtain a connecting list of reference frames using the _dict_list method, passing an invalid value for the second argument leads to an uninformative IndexError instead of a ValueError. For example, when calling _dict_... | diff --git a/sympy/physics/vector/frame.py b/sympy/physics/vector/frame.py
--- a/sympy/physics/vector/frame.py
+++ b/sympy/physics/vector/frame.py
@@ -250,26 +250,76 @@
__repr__ = __str__
def _dict_list(self, other, num):
- """Creates a list from self to other using _dcm_dict. """
- outlist = ... | diff --git a/sympy/physics/vector/tests/test_frame.py b/sympy/physics/vector/tests/test_frame.py
--- a/sympy/physics/vector/tests/test_frame.py
+++ b/sympy/physics/vector/tests/test_frame.py
@@ -8,6 +8,32 @@
from sympy.testing.pytest import raises
Vector.simp = True
+
+
+def test_dict_list():
+
+ A = ReferenceFr... | null | null | namanjain12/sympy_final:4bb8bc30d9430913f08cfa520836b23287d508fc | true | null | 1 | 90 | null | 1,544 | 0 | 0.75 | 1 | 0.75 | 1 | 0.557333 | 84.797 | ||
3,437 | swe_bench::dev::196 | swe_bench | dev | 196 | sqlfluff__sqlfluff-3220 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 262010b91cf5616de242dad504c788e9cd33ac58 | Config for fix_even_unparsable not being applied
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
When setting the any config file to `fix_even_unparsable = True` the config get's overriden by the default (or lack there... | I believe the fix would be to just add a `default=None,` to the @click.option decorator.
This is simple enough for me to create a PR but I don't know how to create tests (or if just adding it is enough) for it as required on the PR template.
> I believe the fix would be to just add a `default=None,` to the @click.opti... | diff --git a/src/sqlfluff/cli/commands.py b/src/sqlfluff/cli/commands.py
--- a/src/sqlfluff/cli/commands.py
+++ b/src/sqlfluff/cli/commands.py
@@ -674,6 +674,7 @@ def do_fixes(lnt, result, formatter=None, **kwargs):
@click.option(
"--FIX-EVEN-UNPARSABLE",
is_flag=True,
+ default=None,
help=(
... | diff --git a/test/cli/commands_test.py b/test/cli/commands_test.py
--- a/test/cli/commands_test.py
+++ b/test/cli/commands_test.py
@@ -687,6 +687,70 @@ def test__cli__fix_error_handling_behavior(sql, fix_args, fixed, exit_code, tmpd
assert not fixed_path.is_file()
+@pytest.mark.parametrize(
+ "metho... | ["test/cli/commands_test.py::test_cli_fix_even_unparsable[config-file-True]"] | ["test/cli/commands_test.py::test__cli__command_directed", "test/cli/commands_test.py::test__cli__command_dialect", "test/cli/commands_test.py::test__cli__command_dialect_legacy", "test/cli/commands_test.py::test__cli__command_extra_config_fail", "test/cli/commands_test.py::test__cli__command_lint_stdin[command0]", "te... | null | true | 2022-04-28T19:13:54Z | 1 | 3 | 1 | 1,175 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.205833 | 84.7925 | |
3,438 | swe_bench::dev::178 | swe_bench | dev | 178 | sqlfluff__sqlfluff-1733 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | a1579a16b1d8913d9d7c7d12add374a290bcc78c | Extra space when first field moved to new line in a WITH statement
Note, the query below uses a `WITH` statement. If I just try to fix the SQL within the CTE, this works fine.
Given the following SQL:
```sql
WITH example AS (
SELECT my_id,
other_thing,
one_more
FROM
my_table
)
SELECT ... | Does running `sqlfluff fix` again correct the SQL?
@tunetheweb yes, yes it does. Is that something that the user is supposed to do (run it multiple times) or is this indeed a bug?
Ideally not, but there are some circumstances where it’s understandable that would happen. This however seems an easy enough example where i... | diff --git a/src/sqlfluff/rules/L039.py b/src/sqlfluff/rules/L039.py
--- a/src/sqlfluff/rules/L039.py
+++ b/src/sqlfluff/rules/L039.py
@@ -44,7 +44,9 @@ def _eval(self, context: RuleContext) -> Optional[List[LintResult]]:
# This is to avoid indents
if not prev_newline:
... | diff --git a/test/rules/std_L003_L036_L039_combo_test.py b/test/rules/std_L003_L036_L039_combo_test.py
new file mode 100644
--- /dev/null
+++ b/test/rules/std_L003_L036_L039_combo_test.py
@@ -0,0 +1,36 @@
+"""Tests issue #1373 doesn't reoccur.
+
+The combination of L003 (incorrect indentation), L036 (select targets),
+... | ["test/rules/std_L003_L036_L039_combo_test.py::test__rules__std_L003_L036_L039"] | ["test/rules/std_L016_L36_combo_test.py::test__rules__std_L016_L036_long_line_lint", "test/rules/std_L016_L36_combo_test.py::test__rules__std_L016_L036_long_line_fix", "test/rules/std_L016_L36_combo_test.py::test__rules__std_L016_L036_long_line_fix2"] | null | true | 2021-10-22T18:23:33Z | 1 | 4 | 1 | 1,154 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.205667 | 84.792 | |
3,439 | swe_bench::test::1732 | swe_bench | test | 1,732 | sphinx-doc__sphinx-10353 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 9236b4247ee8e00ed89eb3ccc456236cdd8eaaea | Reference targets not found when using `autodoc_typehints = "both"`
### Describe the bug
When using the above directive in my `conf.py` for sphinx, I suddenly get the following output:
```
(hondana-epKOD00U-py3.9) π hondana/docs docs/fixup ✗ ❯ poe docs
Poe => poetry run sphinx-build -a -E -n -T -W --keep-going docs/... | It seems some objects are described manually via `class` directive. For example, `hondana.enums.ReadingStatus` is described as following:
```
.. currentmdoule:: hondana
(snip)
.. class:: ReadingStatus
Specifies the current reading status for this manga
```
But autodoc generates a reference `hondana.... | diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -487,6 +487,12 @@ def __call__(self) -> None:
def __eq__(self, other: Any) -> bool:
return self.name == other
+ def __hash__(self) -> int:
+ return hash(self.name)
+
+ d... | diff --git a/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py b/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py
--- a/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py
+++ b/tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py
@@ -1,7 +1,7 @@
from __future__ import annotations
... | ["tests/test_util_inspect.py::test_TypeAliasForwardRef"] | ["tests/test_ext_autodoc_configs.py::test_autoclass_content_class", "tests/test_ext_autodoc_configs.py::test_autoclass_content_init", "tests/test_ext_autodoc_configs.py::test_autodoc_class_signature_mixed", "tests/test_ext_autodoc_configs.py::test_autodoc_class_signature_separated_init", "tests/test_ext_autodoc_configs... | null | true | 2022-04-16T18:11:35Z | 1 | 6 | 1 | 8,295 | 0 | 0.8 | 1 | 0.65 | 1 | 0.52 | 84.785 | |
3,440 | r2e_gym::train::563 | r2e_gym | train | 563 | sympy__1a2b0a73312ba7e5e9818a158c65b87fe5f8386b | sympy | sympy/sympy | python | 1a2b0a73312ba7e5e9818a158c65b87fe5f8386b | Title: Inconsistent Handling of Logarithmic Singularity in Formal Series Expansion
Description:
When working with formal power series that involve a logarithmic singularity, the expected behavior is not met. In particular, generating the expansion for expressions like log(1 + x) now produces an output that differs fro... | diff --git a/sympy/series/formal.py b/sympy/series/formal.py
--- a/sympy/series/formal.py
+++ b/sympy/series/formal.py
@@ -16,6 +16,7 @@
from sympy.core.singleton import S
from sympy.core.symbol import Wild, Dummy, symbols, Symbol
from sympy.core.sympify import sympify
+from sympy.discrete.convolutions import convol... | diff --git a/sympy/series/tests/test_formal.py b/sympy/series/tests/test_formal.py
--- a/sympy/series/tests/test_formal.py
+++ b/sympy/series/tests/test_formal.py
@@ -508,9 +508,26 @@
assert fi.function == sin(x)
assert fi.truncate() == x - x**3/6 + x**5/120 + O(x**6)
-def test_fps__convolutions():
+def tes... | null | null | namanjain12/sympy_final:1a2b0a73312ba7e5e9818a158c65b87fe5f8386b | true | null | 1 | 84 | null | 1,633 | 0 | 0.75 | 1 | 0.75 | 1 | 0.552167 | 84.7815 | ||
3,441 | swe_bench::test::2165 | swe_bench | test | 2,165 | sympy__sympy-18605 | sympy/sympy | sympy/sympy | python | c0a02c3c928dbbc42c008ed460bb662fc602f9d4 | Idx object can accepts non-integer bounds
It is my understanding that this code should not work: the lower and upper bounds should be integers. Instead it runs without any errors:
```
import sympy as sp
m, n = sp.symbols("m, n", real=True)
i = sp.Idx("i", (m, n))
```
Note however that:
```
sp.Idx("i", m)
```
produc... | I think it should be okay to use something that is possibly an integer like a plain `Symbol('n')`. So this is correct:
```julia
In [4]: x = Symbol('x', integer=False)
In [5]: Idx('i', (x, y)) ... | diff --git a/sympy/tensor/indexed.py b/sympy/tensor/indexed.py
--- a/sympy/tensor/indexed.py
+++ b/sympy/tensor/indexed.py
@@ -111,7 +111,7 @@
from sympy.core.symbol import _filter_assumptions, Symbol
from sympy.core.compatibility import (is_sequence, NotIterable,
Iterable)
-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
@@ -422,6 +422,14 @@ def test_issue_12780():
raises(TypeError, lambda: i.subs(n, 1.5))
+def test_issue_18604():
+ m = symbols("m")
+ asser... | ["test_issue_18604"] | ["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_IndexedBase_assumptions", "test_IndexedBase_assumptions_inheritance", "test_issu... | null | true | 2020-02-08T18:04:45Z | 1 | 4 | 1 | 1,127 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.201167 | 84.7785 | |
3,442 | swe_bench::test::1886 | swe_bench | test | 1,886 | sphinx-doc__sphinx-9464 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 810a1e2988b14f4d139b5ef328a91967f5ed7a08 | PEP 585 type hints not rendered correctly
### Describe the bug
If you use a PEP 585 generic as an annotation i.e. `list[str]`, autodoc renders the annotation as `list` rather than `list[str]`, this behaviour differs from using `typing.List[str]` which renders as expected.
Fixing this is quite simple as far as I can t... | Hi @Gobot1234 , would you please upload your project to GitHub instead? Google Drive is not very convenient to read code.
https://github.com/Gobot1234/sphinx-test
@astrojuanlu Should I open a PR to fix this?
@Gobot1234 Yes, please! | diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -310,7 +310,10 @@ def stringify(annotation: Any) -> str:
return INVALID_BUILTIN_CLASSES[annotation]
elif (getattr(annotation, '__module__', None) == 'builtins' and
hasattr(annot... | 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
@@ -175,6 +175,18 @@ def test_stringify_type_hints_containers():
assert stringify(Generator[None, None, None]) == "Generator[None, None, None]"
+@pytest.mark.skipif(sys.version_inf... | ["tests/test_util_typing.py::test_stringify_type_hints_pep_585"] | ["tests/test_util_typing.py::test_restify", "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.p... | null | true | 2021-07-17T17:02:31Z | 1 | 5 | 1 | 1,080 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.196667 | 84.765 | |
3,443 | swe_bench::test::1690 | swe_bench | test | 1,690 | scikit-learn__scikit-learn-25589 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 53e0d95cb10cba5827751657e487f792afd94329 | OneHotEncoder `drop_idx_` attribute description in presence of infrequent categories
### Describe the issue linked to the documentation
### Issue summary
In the OneHotEncoder documentation both for [v1.2](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.... | Thank you for opening the issue! In this case, API-wise I think `drop_idx` is defined incorrectly and should be `1` point to `b`, because it is the categorical that is actually dropped.
There seems to be a bigger issue with how `drop_idx` is defined when there are any infrequent categories. I am looking into a fix. | diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py
--- a/sklearn/preprocessing/_encoders.py
+++ b/sklearn/preprocessing/_encoders.py
@@ -270,6 +270,10 @@ class OneHotEncoder(_BaseEncoder):
- array : ``drop[i]`` is the category in feature ``X[:, i]`` that
should be d... | diff --git a/sklearn/preprocessing/tests/test_encoders.py b/sklearn/preprocessing/tests/test_encoders.py
--- a/sklearn/preprocessing/tests/test_encoders.py
+++ b/sklearn/preprocessing/tests/test_encoders.py
@@ -929,7 +929,7 @@ def test_ohe_infrequent_two_levels_drop_frequent(drop):
max_categories=2,
d... | ["sklearn/preprocessing/tests/test_encoders.py::test_ohe_infrequent_two_levels_drop_frequent[if_binary]", "sklearn/preprocessing/tests/test_encoders.py::test_ohe_infrequent_two_levels_drop_frequent[first]", "sklearn/preprocessing/tests/test_encoders.py::test_ohe_infrequent_two_levels_drop_frequent[drop2]", "sklearn/pre... | ["sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_sparse_dense", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_handle_unknown[ignore]", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_handle_unknown[infrequent_if_exist]", "sklearn/preprocessing/tests/test_enc... | null | true | 2023-02-10T17:30:04Z | 1 | 89 | 4 | 3,771 | 0 | 0.8 | 1 | 0.62 | 1 | 0.796667 | 84.76 | |
3,444 | r2e_gym::train::2165 | r2e_gym | train | 2,165 | sympy__b95a36e9051293ff897849d6c70c9883d23008f4 | sympy | sympy/sympy | python | b95a36e9051293ff897849d6c70c9883d23008f4 | Title: Missing analytic_func Method on Matrix Causes AttributeError
Description:
In the previous version, attempts to use the new analytic function on a Matrix instance result in an AttributeError since the method is not available. For instance, the following example:
```
from sympy import Matrix, sin, Symbol
x = Sy... | diff --git a/sympy/matrices/matrices.py b/sympy/matrices/matrices.py
--- a/sympy/matrices/matrices.py
+++ b/sympy/matrices/matrices.py
@@ -1491,7 +1491,99 @@
from .sparsetools import banded
return self.__class__(banded(size, bands))
+
+ def analytic_func(self, f, x):
+ """
+ Compute... | diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py
--- a/sympy/matrices/tests/test_matrices.py
+++ b/sympy/matrices/tests/test_matrices.py
@@ -3,7 +3,7 @@
from sympy import (
Abs, Add, E, Float, I, Integer, Max, Min, N, Poly, Pow, PurePoly, Rational,
S, Symbol, cos, ex... | null | null | namanjain12/sympy_final:b95a36e9051293ff897849d6c70c9883d23008f4 | true | null | 1 | 92 | null | 1,371 | 0 | 0.75 | 1 | 0.75 | 1 | 0.535167 | 84.7305 | ||
3,445 | r2e_gym::train::858 | r2e_gym | train | 858 | sympy__af999e44413db9a35482f5a686a73c44b62c0610 | sympy | sympy/sympy | python | af999e44413db9a35482f5a686a73c44b62c0610 | Title: PartialDerivative.replace_with_arrays fails with Symbol indices
Description:
When calling replace_with_arrays with an index order specified using plain Symbol objects rather than tensor index objects, the function crashes. For example, passing [Symbol("i"), -Symbol("j")] as the index order causes an AttributeEr... | diff --git a/sympy/tensor/tensor.py b/sympy/tensor/tensor.py
--- a/sympy/tensor/tensor.py
+++ b/sympy/tensor/tensor.py
@@ -2337,6 +2337,14 @@
from .array import Array
indices = indices or []
+ remap = {k.args[0] if k.is_up else -k.args[0]: k for k in self.get_free_indices()}
+ for i, i... | diff --git a/sympy/tensor/tests/test_tensor.py b/sympy/tensor/tests/test_tensor.py
--- a/sympy/tensor/tests/test_tensor.py
+++ b/sympy/tensor/tests/test_tensor.py
@@ -1827,6 +1827,7 @@
assert expr.replace_with_arrays(repl) == Array([[1, -2], [3, -4]])
assert expr.replace_with_arrays(repl, [i, j]) == Array([[1... | null | null | namanjain12/sympy_final:af999e44413db9a35482f5a686a73c44b62c0610 | true | null | 2 | 70 | null | 1,793 | 0 | 0.75 | 1 | 0.75 | 1 | 0.532167 | 84.7215 | ||
3,446 | r2e_gym::train::5383 | r2e_gym | train | 5,383 | aiohttp__5269480e0f4f93786434065c858b966402a4bf6f | aiohttp | aio-libs/aiohttp | python | 5269480e0f4f93786434065c858b966402a4bf6f | **Title:** Unable to Register Routes with Regex Patterns Containing Slashes or Nested Braces
**Description:**
When trying to add a route that includes a regex pattern with slashes or nested braces, the UrlDispatcher raises a `ValueError`, preventing the route from being registered.
**Example:**
```python
# Attempting... | diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1,33 +1,34 @@
-*~
-bin
-parts
-coverage
-eggs
-sources
-build
-dist
-venv
-.installed.cfg
-develop-eggs
-var/*
-*.egg-info
-*.pyc
-*.pyo
*.bak
*.egg
+*.egg-info
*.eggs
+*.pyc
+*.pyd
+*.pyo
+*.so
*.tar.gz
-*.so
-*.pyd
-.tox
+*~
.DS_Store
.c... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -112,11 +112,6 @@
with self.assertRaises(ValueError):
self.router.add_route('post', '/post/{id"}', handler)
- def test_add_url_invalid5(self):
- handler... | null | null | namanjain12/aiohttp_final:5269480e0f4f93786434065c858b966402a4bf6f | true | null | 2 | 119 | null | 808 | 0 | 0.75 | 1 | 0.75 | 1 | 0.531333 | 84.719 | ||
3,447 | r2e_gym::train::2238 | r2e_gym | train | 2,238 | sympy__96fab933bd27c8ed011cc461f37a00b27e528c2e | sympy | sympy/sympy | python | 96fab933bd27c8ed011cc461f37a00b27e528c2e | Title: nT Function Returns Plain int Instead of sympy Integer
Description:
The combinatorial partition counting functionality built into the nT function now returns a plain Python int when both arguments are integers. This behavior causes issues when symbolic properties are expected. For example, downstream code that ... | diff --git a/sympy/functions/combinatorial/numbers.py b/sympy/functions/combinatorial/numbers.py
--- a/sympy/functions/combinatorial/numbers.py
+++ b/sympy/functions/combinatorial/numbers.py
@@ -39,7 +39,6 @@
# Dummy symbol used for computing polynomial sequences
_sym = Symbol('x')
-_symbols = Function('x')
#-... | diff --git a/sympy/functions/combinatorial/tests/test_comb_numbers.py b/sympy/functions/combinatorial/tests/test_comb_numbers.py
--- a/sympy/functions/combinatorial/tests/test_comb_numbers.py
+++ b/sympy/functions/combinatorial/tests/test_comb_numbers.py
@@ -7,6 +7,7 @@
bernoulli, harmonic, bell, fibonacci, tribon... | null | null | namanjain12/sympy_final:96fab933bd27c8ed011cc461f37a00b27e528c2e | true | null | 1 | 91 | null | 1,349 | 0 | 0.75 | 1 | 0.75 | 1 | 0.528167 | 84.7095 | ||
3,448 | swe_bench::test::1887 | swe_bench | test | 1,887 | sphinx-doc__sphinx-9467 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 9a2c3c4a1559e37e95fdee88c128bb116642c897 | github linkcheck anchor change in 4.1.0 break some usage
### Describe the bug
Given a link like:
```rst
.. _`OpenSSL's test vectors`: https://github.com/openssl/openssl/blob/97cf1f6c2854a3a955fd7dd3a1f113deba00c9ef/crypto/evp/evptests.txt#L232
```
in a github doc, with release 4.1.0 this will fail with linkcheck, wh... | A simple fix here would be for the linkcheck logic to simply exclude links of the form `L\d+`.
But of course really the current logic is broken for _any_ link that's generated by github itself and thus doesn't have this prefix.
> But of course really the current logic is broken for any link that's generated by githu... | diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -714,7 +714,10 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.add_event('linkcheck-process-uri')
app.connect('config-inited', compile_linkcheck_allowed_redirect... | diff --git a/tests/roots/test-linkcheck/links.txt b/tests/roots/test-linkcheck/links.txt
--- a/tests/roots/test-linkcheck/links.txt
+++ b/tests/roots/test-linkcheck/links.txt
@@ -13,8 +13,7 @@ Some additional anchors to exercise ignore code
* `Complete nonsense <https://localhost:7777/doesnotexist>`_
* `Example valid... | ["tests/test_build_linkcheck.py::test_connect_to_selfsigned_with_tls_verify_false", "tests/test_build_linkcheck.py::test_TooManyRedirects_on_HEAD", "tests/test_build_linkcheck.py::test_too_many_requests_retry_after_int_delay", "tests/test_build_linkcheck.py::test_get_after_head_raises_connection_error"] | ["tests/test_build_linkcheck.py::test_defaults_json", "tests/test_build_linkcheck.py::test_raises_for_invalid_status", "tests/test_build_linkcheck.py::test_auth_header_uses_first_match", "tests/test_build_linkcheck.py::test_auth_header_no_match", "tests/test_build_linkcheck.py::test_linkcheck_request_headers", "tests/t... | null | true | 2021-07-18T04:10:10Z | 1 | 5 | 4 | 944 | 0 | 0.8 | 1 | 0.85 | 0.8 | 0.174 | 84.697 | |
3,449 | r2e_gym::train::1387 | r2e_gym | train | 1,387 | sympy__a7694c1e18962798b6ed73541e3c815b93e123fa | sympy | sympy/sympy | python | a7694c1e18962798b6ed73541e3c815b93e123fa | Title: Float casting fails to detect significant rounding errors in Type.cast_check
Description:
When converting floating point values using Type.cast_check for float types, some cases where rounding should be significant do not raise an error. For example, using a float32 type with a value that when cast should devia... | diff --git a/sympy/codegen/ast.py b/sympy/codegen/ast.py
--- a/sympy/codegen/ast.py
+++ b/sympy/codegen/ast.py
@@ -426,13 +426,13 @@
>>> v6 = 0.123456
>>> f32.cast_check(v6)
0.123456
- >>> v10 = 0.1234567895
+ >>> v10 = 12345.67894
>>> f32.cast_check(v10) # doctest: +ELLIPSIS
Traceback (... | diff --git a/sympy/codegen/tests/test_ast.py b/sympy/codegen/tests/test_ast.py
--- a/sympy/codegen/tests/test_ast.py
+++ b/sympy/codegen/tests/test_ast.py
@@ -192,24 +192,33 @@
# Range
int8 = Type('int8')
- assert int8.cast_check(127.0) is 127
+ assert int8.cast_check(127.0) == 127
raises(ValueEr... | null | null | namanjain12/sympy_final:a7694c1e18962798b6ed73541e3c815b93e123fa | true | null | 1 | 82 | null | 1,415 | 0 | 0.75 | 1 | 0.75 | 1 | 0.509167 | 84.6525 | ||
3,450 | swe_bench::test::1753 | swe_bench | test | 1,753 | sphinx-doc__sphinx-11312 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 5cf3dce36ec35c429724bf1312ece9faa0c8db39 | util.inspect.object_description: does not emit reliable ordering for a set nested within another collection
### Describe the bug
### Summary
Differences appear in some `sphinx` v5.3.0 generated `set` object descriptions for `alembic` v1.8.1, as demonstrated by [recent results visible on the Reproducible Builds diffosc... | diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -350,38 +350,64 @@ def safe_getattr(obj: Any, name: str, *defargs: Any) -> Any:
raise AttributeError(name) from exc
-def object_description(object: Any) -> str:
- """A repr() impleme... | 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
@@ -503,10 +503,32 @@ def test_set_sorting():
assert description == "{'a', 'b', 'c', 'd', 'e', 'f', 'g'}"
+def test_set_sorting_enum():
+ class MyEnum(enum.Enum):
+ a... | ["tests/test_util_inspect.py::test_set_sorting_enum", "tests/test_util_inspect.py::test_deterministic_nested_collection_descriptions", "tests/test_util_inspect.py::test_nested_tuple_sorting", "tests/test_util_inspect.py::test_recursive_collection_description"] | ["tests/test_util_inspect.py::test_TypeAliasForwardRef", "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_partialmet... | null | true | 2023-04-10T15:35:57Z | 1 | 76 | 4 | 2,475 | 0 | 0.8 | 1 | 0.7 | 1 | 0.665833 | 84.6475 | ||
3,451 | r2e_gym::train::4934 | r2e_gym | train | 4,934 | datalad__1d9f07f9154ec0510d4bdddced9d388f1f9bdf80 | datalad | datalad/datalad | python | 1d9f07f9154ec0510d4bdddced9d388f1f9bdf80 | **Title:** Metadata Arguments Not Handled Correctly in `addurls` Plugin Causing Test Failures
**Description:**
When using the `addurls` plugin to set metadata, the functions responsible for processing metadata arguments are either missing or not accepting the required parameters. This leads to errors during testing, p... | diff --git a/datalad/plugin/addurls.py b/datalad/plugin/addurls.py
--- a/datalad/plugin/addurls.py
+++ b/datalad/plugin/addurls.py
@@ -61,7 +61,36 @@
key, args, kwargs)
-def extract(stream, input_type, filename_format, url_format):
+def clean_meta_args(args):
+ """Prepare formatted metadata argu... | diff --git a/datalad/plugin/tests/test_addurls.py b/datalad/plugin/tests/test_addurls.py
--- a/datalad/plugin/tests/test_addurls.py
+++ b/datalad/plugin/tests/test_addurls.py
@@ -62,6 +62,18 @@
fmt.format, "{key:<5}", {"key:<5": "value0"})
+def test_clean_meta_args():
+ for args, expect in [([... | null | null | namanjain12/datalad_final:1d9f07f9154ec0510d4bdddced9d388f1f9bdf80 | true | null | 1 | 78 | null | 1,478 | 0 | 0.75 | 1 | 0.75 | 1 | 0.506333 | 84.644 | ||
3,452 | r2e_gym::train::4890 | r2e_gym | train | 4,890 | numpy__156cd054e007b05d4ac4829e10a369d19dd2b0b1 | numpy | numpy/numpy | python | 156cd054e007b05d4ac4829e10a369d19dd2b0b1 | **[ISSUE]**
**Title:** `np.cov` and `np.corrcoef` Do Not Accept `dtype` Parameter, Raising TypeError
**Description:**
When attempting to specify the `dtype` parameter in `numpy.cov` and `numpy.corrcoef`, a `TypeError` is raised. This prevents users from defining the data type of the output arrays, limiting flexibilit... | diff --git a/doc/release/upcoming_changes/17456.new_feature.rst b/doc/release/upcoming_changes/17456.new_feature.rst
--- a/doc/release/upcoming_changes/17456.new_feature.rst
+++ b/doc/release/upcoming_changes/17456.new_feature.rst
@@ -0,0 +1,5 @@
+``dtype`` option for `cov` and `corrcoef`
+-----------------------------... | diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -2023,6 +2023,12 @@
assert_array_almost_equal(c, np.array([[1., -1.], [-1., 1.]]))
assert_(np.all(np.abs(c) <= 1.0))
+... | null | null | namanjain12/numpy_final:156cd054e007b05d4ac4829e10a369d19dd2b0b1 | true | null | 2 | 38 | null | 2,258 | 0 | 0.75 | 1 | 0.75 | 1 | 0.503 | 84.634 | ||
3,453 | r2e_gym::train::2183 | r2e_gym | train | 2,183 | sympy__445c65818837faf61bb1e2d820baa079b6efb7fd | sympy | sympy/sympy | python | 445c65818837faf61bb1e2d820baa079b6efb7fd | Title: IndexError and transformation mismatch in matrix derivative and indexed summation expressions
Description:
When evaluating matrix derivative or transforming indexed summation expressions, an unexpected error occurs due to a missing expression in the replacement logic. For example, computing the derivative of a ... | diff --git a/sympy/matrices/expressions/matexpr.py b/sympy/matrices/expressions/matexpr.py
--- a/sympy/matrices/expressions/matexpr.py
+++ b/sympy/matrices/expressions/matexpr.py
@@ -218,13 +218,13 @@
repl = {}
if self.shape[0] == 1:
- repl[i] = 1
+ repl[i] = 0
if self... | diff --git a/sympy/matrices/expressions/tests/test_derivatives.py b/sympy/matrices/expressions/tests/test_derivatives.py
--- a/sympy/matrices/expressions/tests/test_derivatives.py
+++ b/sympy/matrices/expressions/tests/test_derivatives.py
@@ -60,9 +60,7 @@
# Cookbook example 83:
expr = (X*b + c).T*D*(X*b + ... | null | null | namanjain12/sympy_final:445c65818837faf61bb1e2d820baa079b6efb7fd | true | null | 1 | 32 | null | 2,361 | 0 | 0.75 | 1 | 0.75 | 1 | 0.500167 | 84.6255 | ||
3,454 | r2e_gym::train::4635 | r2e_gym | train | 4,635 | numpy__2c617599340fb4cd08618b8c396a735909c0789e | numpy | numpy/numpy | python | 2c617599340fb4cd08618b8c396a735909c0789e | **Analysis**
- **Key Parts from Commit Details and Test Results:**
- **Commit Purpose:** Ensure that the `linspace` function respects `ndarray` subclasses when provided with subclass instances for `start` and `stop`.
- **Test Addition:** A new test `test_subclass` was added to verify that `linspace` returns an ins... | diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py
--- a/numpy/core/function_base.py
+++ b/numpy/core/function_base.py
@@ -96,18 +96,23 @@
y = _nx.arange(0, num, dtype=dt)
+ delta = stop - start
if num > 1:
- delta = stop - start
step = delta / div
if step =... | diff --git a/numpy/core/tests/test_function_base.py b/numpy/core/tests/test_function_base.py
--- a/numpy/core/tests/test_function_base.py
+++ b/numpy/core/tests/test_function_base.py
@@ -1,7 +1,7 @@
from __future__ import division, absolute_import, print_function
from numpy import (logspace, linspace, dtype, array,... | null | null | namanjain12/numpy_final:2c617599340fb4cd08618b8c396a735909c0789e | true | null | 1 | 11 | null | 2,746 | 0 | 0.75 | 1 | 0.75 | 1 | 0.494333 | 84.608 | ||
3,455 | r2e_gym::train::96 | r2e_gym | train | 96 | orange3__659130d3cb87fa9aec1eddbb5636b2c646fc1542 | orange3 | biolab/orange3 | python | 659130d3cb87fa9aec1eddbb5636b2c646fc1542 | **Analysis:**
- **Key Parts from Commit Details:**
- **Commit Message:** `owtsne: Warn if PCA disabled and large number of features.`
- **Change:** Added a warning message when PCA preprocessing is disabled and the input data has a large number of features.
- **Test Results:** Previously, the test `test_pca_prep... | diff --git a/Orange/widgets/unsupervised/owtsne.py b/Orange/widgets/unsupervised/owtsne.py
--- a/Orange/widgets/unsupervised/owtsne.py
+++ b/Orange/widgets/unsupervised/owtsne.py
@@ -305,6 +305,12 @@
modified = Msg("The parameter settings have been changed. Press "
"\"Start\" to rerun w... | diff --git a/Orange/widgets/unsupervised/tests/test_owtsne.py b/Orange/widgets/unsupervised/tests/test_owtsne.py
--- a/Orange/widgets/unsupervised/tests/test_owtsne.py
+++ b/Orange/widgets/unsupervised/tests/test_owtsne.py
@@ -295,6 +295,14 @@
self.assertFalse(
self.widget.Information.modified.is_... | null | null | namanjain12/orange3_final:659130d3cb87fa9aec1eddbb5636b2c646fc1542 | true | null | 1 | 12 | null | 2,712 | 0 | 0.75 | 1 | 0.75 | 1 | 0.492 | 84.601 | ||
3,456 | r2e_gym::train::6245 | r2e_gym | train | 6,245 | pillow__b346ed36f17d25ff6f83cee9e773ac98ff1c0633 | pillow | python-pillow/pillow | python | b346ed36f17d25ff6f83cee9e773ac98ff1c0633 | **Title:** GifImagePlugin Fails to Handle `append_images` Parameter Correctly
**Description:**
When attempting to save an animated GIF using the `append_images` parameter, the resulting GIF does not include the appended frames, and errors occur during the saving process.
**Example:**
```python
from PIL import Image, ... | diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py
--- a/PIL/GifImagePlugin.py
+++ b/PIL/GifImagePlugin.py
@@ -351,35 +351,38 @@
previous = None
first_frame = None
- for im_frame in ImageSequence.Iterator(im):
- im_frame = _convert_mode(im_frame)
-
- # To specify... | diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py
--- a/Tests/test_file_gif.py
+++ b/Tests/test_file_gif.py
@@ -306,6 +306,24 @@
reread = Image.open(out)
self.assertEqual(reread.info["version"], b"GIF87a")
+ def test_append_images(self):
+ out = self.tempfile('temp.gif')
+
+ ... | null | null | namanjain12/pillow_final:b346ed36f17d25ff6f83cee9e773ac98ff1c0633 | true | null | 2 | 63 | null | 1,680 | 0 | 0.75 | 1 | 0.75 | 1 | 0.49 | 84.595 | ||
3,457 | r2e_gym::train::1054 | r2e_gym | train | 1,054 | sympy__6ebec9263f50082a65cce272c490eaf40aa04610 | sympy | sympy/sympy | python | 6ebec9263f50082a65cce272c490eaf40aa04610 | Title: Incorrect handling of zero and rational inputs in perfect_power
Description:
When calling perfect_power with zero or non-integer rational inputs, the function does not behave as expected. For example, passing 0 should return False, but it instead raises a ValueError ("expecting positive n"). Additionally, the f... | diff --git a/sympy/ntheory/factor_.py b/sympy/ntheory/factor_.py
--- a/sympy/ntheory/factor_.py
+++ b/sympy/ntheory/factor_.py
@@ -399,9 +399,9 @@
def perfect_power(n, candidates=None, big=True, factor=True):
"""
- Return ``(b, e)`` such that ``n`` == ``b**e`` if ``n`` is a
- perfect power with ``e > 1``,... | diff --git a/sympy/ntheory/tests/test_factor_.py b/sympy/ntheory/tests/test_factor_.py
--- a/sympy/ntheory/tests/test_factor_.py
+++ b/sympy/ntheory/tests/test_factor_.py
@@ -116,8 +116,8 @@
def test_perfect_power():
- raises(ValueError, lambda: perfect_power(0))
- raises(ValueError, lambda: perfect_power(Ra... | null | null | namanjain12/sympy_final:6ebec9263f50082a65cce272c490eaf40aa04610 | true | null | 1 | 52 | null | 1,832 | 0 | 0.75 | 1 | 0.75 | 1 | 0.478667 | 84.561 | ||
3,458 | r2e_gym::train::513 | r2e_gym | train | 513 | sympy__2a1c9aa29f431c9c09421795467f61ac81ef4af4 | sympy | sympy/sympy | python | 2a1c9aa29f431c9c09421795467f61ac81ef4af4 | Title: lens_makers_formula Unexpected Keyword Arguments Causing Type Errors
Description:
When calling lens_makers_formula with additional parameters for thick and plano lenses (using keywords "d" and "lens"), the function raises a TypeError indicating that these keyword arguments are not expected. This behavior was ob... | diff --git a/sympy/physics/optics/utils.py b/sympy/physics/optics/utils.py
--- a/sympy/physics/optics/utils.py
+++ b/sympy/physics/optics/utils.py
@@ -444,9 +444,9 @@
-def lens_makers_formula(n_lens, n_surr, r1, r2):
- """
- This function calculates focal length of a thin lens.
+def lens_makers_formula(n_le... | diff --git a/sympy/physics/optics/tests/test_utils.py b/sympy/physics/optics/tests/test_utils.py
--- a/sympy/physics/optics/tests/test_utils.py
+++ b/sympy/physics/optics/tests/test_utils.py
@@ -178,3 +178,26 @@
si, so = symbols('si, so')
assert transverse_magnification(si, so) == -si/so
assert transvers... | null | null | namanjain12/sympy_final:2a1c9aa29f431c9c09421795467f61ac81ef4af4 | true | null | 1 | 53 | null | 1,804 | 0 | 0.75 | 1 | 0.75 | 1 | 0.477333 | 84.557 | ||
3,459 | r2e_gym::train::1063 | r2e_gym | train | 1,063 | sympy__c2641c05ea14309ff382d511e7d7a304078193b7 | sympy | sympy/sympy | python | c2641c05ea14309ff382d511e7d7a304078193b7 | Title: Inconsistent Handling of Negative Exponents for Singular Matrices
Description:
There appears to be an inconsistency when evaluating matrix powers with negative exponents. For example, when using the exponential operator (**) or evaluating the equivalent MatPow expression, the behavior is not uniform. In particu... | diff --git a/sympy/matrices/common.py b/sympy/matrices/common.py
--- a/sympy/matrices/common.py
+++ b/sympy/matrices/common.py
@@ -2218,37 +2218,39 @@
return self._eval_scalar_mul(-1)
@call_highest_priority('__rpow__')
- def __pow__(self, num):
+ def __pow__(self, exp):
if self.rows != se... | diff --git a/sympy/matrices/expressions/tests/test_matpow.py b/sympy/matrices/expressions/tests/test_matpow.py
--- a/sympy/matrices/expressions/tests/test_matpow.py
+++ b/sympy/matrices/expressions/tests/test_matpow.py
@@ -77,6 +77,9 @@
assert MatPow(X, -2).doit() == (X.inv())**2
# less expensive than testing... | null | null | namanjain12/sympy_final:c2641c05ea14309ff382d511e7d7a304078193b7 | true | null | 2 | 44 | null | 1,976 | 0 | 0.75 | 1 | 0.75 | 1 | 0.476 | 84.553 | ||
3,460 | r2e_gym::train::4758 | r2e_gym | train | 4,758 | numpy__1122303c1834eff71f9441901d1e85e74f200f93 | numpy | numpy/numpy | python | 1122303c1834eff71f9441901d1e85e74f200f93 | **Analysis:**
- **Key Parts of Commit Details and Test Results:**
- **Commit Message:** Fixes crashes when using float32 values in uniform histograms.
- **Test Results:** Previously, the test `TestHistogram.test_precision` failed with a `ValueError: 'list' argument must have no negative elements`. After the commit... | diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py
--- a/numpy/lib/histograms.py
+++ b/numpy/lib/histograms.py
@@ -318,9 +318,17 @@
raise ValueError('`bins` must be 1d, when an array')
if n_equal_bins is not None:
+ # gh-10322 means that type resolution rules are dependent on array
+ ... | diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py
--- a/numpy/lib/tests/test_histograms.py
+++ b/numpy/lib/tests/test_histograms.py
@@ -298,6 +298,53 @@
assert_equal(d_edge.dtype, dates.dtype)
assert_equal(t_edge.dtype, td)
+
+ def do_precision_lower_bound(self,... | null | null | namanjain12/numpy_final:1122303c1834eff71f9441901d1e85e74f200f93 | true | null | 1 | 25 | null | 2,345 | 0 | 0.75 | 1 | 0.75 | 1 | 0.474167 | 84.5475 | ||
3,461 | swe_bench::test::2230 | swe_bench | test | 2,230 | sympy__sympy-21370 | sympy/sympy | sympy/sympy | python | e5e0bfa9d08de736055f338f926327157149b019 | minpoly fails for complicated algebraic number
Given
```python
res = Add(Mul(Integer(-1), Integer(180561807339168676696180573852937120123827201075968945871075967679148461189459480842956689723484024031016208588658753107), Pow(Add(Mul(Integer(-1), Integer(593580071096365628510350049928028125135750199371262728965698560909... | I don't think that `minpoly` can be expected to work reliably with expressions that contain Floats (`RR` is not "exact"). They could be first replaced by Rationals`. Maybe `minpoly` should do that automatically.
It isn't supposed to have floats. I messed up getting the srepr. This is it:
```
res = Add(Mul(Integer(-1)... | diff --git a/sympy/core/exprtools.py b/sympy/core/exprtools.py
--- a/sympy/core/exprtools.py
+++ b/sympy/core/exprtools.py
@@ -363,7 +363,7 @@ def __init__(self, factors=None): # Factors
factors[q] = (factors[q] if q in factors else S.Zero) - factors[f]
factors.pop(f)
... | diff --git a/sympy/core/tests/test_exprtools.py b/sympy/core/tests/test_exprtools.py
--- a/sympy/core/tests/test_exprtools.py
+++ b/sympy/core/tests/test_exprtools.py
@@ -56,6 +56,8 @@ def test_Factors():
assert Factors(-I)*I == Factors()
assert Factors({S.NegativeOne: S(3)})*Factors({S.NegativeOne: S.One, I:... | ["test_Factors", "test_minimal_polynomial", "test_minimal_polynomial_issue_19732"] | ["test_decompose_power", "test_Term", "test_gcd_terms", "test_factor_terms", "test_xreplace", "test_factor_nc", "test_issue_6360", "test_issue_7903", "test_issue_8263", "test_monotonic_sign", "test_minimal_polynomial_hi_prec", "test_minimal_polynomial_sq", "test_minpoly_compose", "test_minpoly_issue_7113", "test_minpol... | null | true | 2021-04-22T23:42:22Z | 2 | 65 | 3 | 4,472 | 0 | 0.8 | 1 | 0.62 | 1 | 0.716667 | 84.52 | |
3,462 | r2e_gym::train::6513 | r2e_gym | train | 6,513 | pillow__0a432541aee6ee8918b9513ca543746107c39ab7 | pillow | python-pillow/pillow | python | 0a432541aee6ee8918b9513ca543746107c39ab7 | **Issue Title:** `AttributeError: module 'PIL.EpsImagePlugin' has no attribute 'gs_binary'` causes test failures
**Description:**
When attempting to verify the presence of Ghostscript in `EpsImagePlugin`, accessing the `gs_binary` attribute results in an `AttributeError`. This prevents tests that rely on this attribu... | diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst
--- a/docs/handbook/image-file-formats.rst
+++ b/docs/handbook/image-file-formats.rst
@@ -115,8 +115,13 @@
Loading
~~~~~~~
+To use Ghostscript, Pillow searches for the "gs" executable. On Windows, it
+also searches for "gswin32... | diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py
--- a/Tests/test_file_eps.py
+++ b/Tests/test_file_eps.py
@@ -8,6 +8,7 @@
assert_image_similar,
assert_image_similar_tofile,
hopper,
+ is_win32,
mark_if_feature_version,
skip_unless_feature,
)
@@ -98,6 +99,20 @@
assert im... | null | null | namanjain12/pillow_final:0a432541aee6ee8918b9513ca543746107c39ab7 | true | null | 2 | 66 | null | 1,439 | 0 | 0.75 | 1 | 0.75 | 1 | 0.459833 | 84.5045 | ||
3,463 | r2e_gym::train::2260 | r2e_gym | train | 2,260 | sympy__a21fa616de0f831c4750e93b7eae702124820745 | sympy | sympy/sympy | python | a21fa616de0f831c4750e93b7eae702124820745 | Title: LUdecomposition fails with unexpected keyword "decomposerankdeficient"
Description:
After the recent changes to move the LU decomposition logic into a new wrapper function, calls to use the "decomposerankdeficient" option now cause an error in some cases. For example, when a matrix with more rows than its rank ... | diff --git a/sympy/matrices/matrices.py b/sympy/matrices/matrices.py
--- a/sympy/matrices/matrices.py
+++ b/sympy/matrices/matrices.py
@@ -3887,8 +3887,9 @@
raise ValueError("Matrix must be lower triangular.")
return self._lower_triangular_solve(rhs)
- def LUdecomposition(self, iszerofunc=_is... | diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py
--- a/sympy/matrices/tests/test_matrices.py
+++ b/sympy/matrices/tests/test_matrices.py
@@ -608,7 +608,7 @@
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]])
- L, U, p = ... | null | null | namanjain12/sympy_final:a21fa616de0f831c4750e93b7eae702124820745 | true | null | 1 | 39 | null | 1,942 | 0 | 0.75 | 1 | 0.75 | 1 | 0.453667 | 84.486 | ||
3,464 | r2e_gym::train::4299 | r2e_gym | train | 4,299 | numpy__bce6492ba7b6e5d3c88eedbb0ea3e81174e5dc23 | numpy | numpy/numpy | python | bce6492ba7b6e5d3c88eedbb0ea3e81174e5dc23 | **Title:** Incorrect Handling of NaT Values in `np.median` and `np.percentile`
**Description:**
When calculating the median or percentile of an array containing `NaT` (Not a Time) values using `numpy`, the functions do not handle `NaT` correctly. Instead of recognizing and appropriately processing `NaT` entries, the f... | diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -3943,8 +3943,10 @@
kth = [szh - 1, szh]
else:
kth = [(sz - 1) // 2]
- # Check if the array contains any nan's
- if np.issubdtype(a.dtype, np.inexact):
+... | diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -3536,6 +3536,25 @@
q[0] = np.nan
with pytest.raises(ValueError, match="Percentiles must be in"):
np.percen... | null | null | namanjain12/numpy_final:bce6492ba7b6e5d3c88eedbb0ea3e81174e5dc23 | true | null | 2 | 65 | null | 1,421 | 0 | 0.75 | 1 | 0.75 | 1 | 0.4535 | 84.4855 | ||
3,465 | r2e_gym::train::4513 | r2e_gym | train | 4,513 | numpy__37ece45df248ec514b08bd8d2164a1b68eea6bc8 | numpy | numpy/numpy | python | 37ece45df248ec514b08bd8d2164a1b68eea6bc8 | **[ISSUE]**
**Title:** `numpy.gradient` Raises TypeError When Using `axis` Keyword Argument
**Description:**
When attempting to calculate the gradient of an array along specific axes using the `axis` keyword argument, the `numpy.gradient` function raises a `TypeError`. This prevents users from computing gradients ove... | diff --git a/doc/release/1.11.0-notes.rst b/doc/release/1.11.0-notes.rst
--- a/doc/release/1.11.0-notes.rst
+++ b/doc/release/1.11.0-notes.rst
@@ -36,6 +36,10 @@
Improvements
============
+*np.gradient* now supports an ``axis`` argument
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The ``axis`` para... | diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -600,6 +600,31 @@
analytical = 6 * x ** 2 + 8 * x + 2
num_error = np.abs((np.gradient(y, dx, edge_order=2) / analytical)... | null | null | namanjain12/numpy_final:37ece45df248ec514b08bd8d2164a1b68eea6bc8 | true | null | 2 | 54 | null | 1,635 | 0 | 0.75 | 1 | 0.75 | 1 | 0.4525 | 84.4825 | ||
3,466 | swe_bench::test::1624 | swe_bench | test | 1,624 | scikit-learn__scikit-learn-13960 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 4a6264db68b28a2e65efdecc459233911c9aee95 | IncrementalPCA should accept sparse input
#### Description
`IncrementalPCA` is by design suited to application to sparse data in a way that most PCA classes are not. However, it is not written to accept this by default.
#### Steps/Code to Reproduce
```
import numpy as np
from sklearn.decomposition import IncrementalP... | Yeah feel free to open a PR. | diff --git a/sklearn/decomposition/incremental_pca.py b/sklearn/decomposition/incremental_pca.py
--- a/sklearn/decomposition/incremental_pca.py
+++ b/sklearn/decomposition/incremental_pca.py
@@ -5,7 +5,7 @@
# License: BSD 3 clause
import numpy as np
-from scipy import linalg
+from scipy import linalg, sparse
fro... | diff --git a/sklearn/decomposition/tests/test_incremental_pca.py b/sklearn/decomposition/tests/test_incremental_pca.py
--- a/sklearn/decomposition/tests/test_incremental_pca.py
+++ b/sklearn/decomposition/tests/test_incremental_pca.py
@@ -1,5 +1,6 @@
"""Tests for Incremental PCA."""
import numpy as np
+import pytest
... | ["sklearn/decomposition/tests/test_incremental_pca.py::test_incremental_pca_sparse[csc_matrix]", "sklearn/decomposition/tests/test_incremental_pca.py::test_incremental_pca_sparse[csr_matrix]", "sklearn/decomposition/tests/test_incremental_pca.py::test_incremental_pca_sparse[lil_matrix]"] | ["sklearn/decomposition/tests/test_incremental_pca.py::test_incremental_pca", "sklearn/decomposition/tests/test_incremental_pca.py::test_incremental_pca_check_projection", "sklearn/decomposition/tests/test_incremental_pca.py::test_incremental_pca_inverse", "sklearn/decomposition/tests/test_incremental_pca.py::test_incr... | null | true | 2019-05-27T23:17:57Z | 1 | 70 | 3 | 5,287 | 0.138889 | 0.8 | 1 | 0.92 | 1 | 0.733333 | 84.475 | |
3,467 | r2e_gym::train::2631 | r2e_gym | train | 2,631 | sympy__837a67d74781a026e31e461ff4684ce2c949b92d | sympy | sympy/sympy | python | 837a67d74781a026e31e461ff4684ce2c949b92d | Title: Missing create_new Method on CoordSys3D Causes AttributeError
Description:
When initializing a new coordinate system using a transformation, invoking create_new on an existing CoordSys3D instance results in an error. For example:
```
from sympy.vector import CoordSys3D
a = CoordSys3D('a')
c = a.create_new('c',... | diff --git a/doc/src/modules/vector/coordsys.rst b/doc/src/modules/vector/coordsys.rst
--- a/doc/src/modules/vector/coordsys.rst
+++ b/doc/src/modules/vector/coordsys.rst
@@ -3,7 +3,7 @@
=============================
We will now look at how we can initialize new coordinate systems in
-:mod:`sympy.vector`, positione... | diff --git a/sympy/vector/tests/test_coordsysrect.py b/sympy/vector/tests/test_coordsysrect.py
--- a/sympy/vector/tests/test_coordsysrect.py
+++ b/sympy/vector/tests/test_coordsysrect.py
@@ -249,6 +249,7 @@
assert C.j.cross(A.i) == (sin(q2))*A.j + (-cos(q2))*A.k
assert express(C.k.cross(A.i), C).trigsimp() ==... | null | null | namanjain12/sympy_final:837a67d74781a026e31e461ff4684ce2c949b92d | true | null | 2 | 68 | null | 1,340 | 0 | 0.75 | 1 | 0.75 | 1 | 0.45 | 84.475 | ||
3,468 | r2e_gym::train::2226 | r2e_gym | train | 2,226 | sympy__7f6921db3017d25f556473b83205e85741b79053 | sympy | sympy/sympy | python | 7f6921db3017d25f556473b83205e85741b79053 | Title: polytope_integrate Fails with max_degree Parameter Leading to Missing Monomials
Description:
When using the max_degree parameter with polytope_integrate to limit the highest degree of monomials, some expected monomials seem to be missing from the computed integral. For example, when integrating a list of polyno... | 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
@@ -151,6 +151,14 @@
assert result_dict[expr1] == Rational(615780107, 594)
assert result_dict[expr2] == Rational(13062161, 27)
... | null | null | namanjain12/sympy_final:7f6921db3017d25f556473b83205e85741b79053 | true | null | 1 | 59 | null | 1,512 | 0 | 0.75 | 1 | 0.75 | 1 | 0.448667 | 84.471 | ||
3,469 | r2e_gym::train::2076 | r2e_gym | train | 2,076 | sympy__070762450411d63e164a3722dc4e6a00fd7c126b | sympy | sympy/sympy | python | 070762450411d63e164a3722dc4e6a00fd7c126b | Title: TypeError when using heurisch flag in integrate()
Description:
When calling integrate() with the heurisch flag set, an unexpected keyword error is raised. For example, the following code:
```
from sympy import integrate, exp, x
# Attempt to integrate using only the heurisch method
integrate(exp(x**2), x, heur... | diff --git a/sympy/integrals/integrals.py b/sympy/integrals/integrals.py
--- a/sympy/integrals/integrals.py
+++ b/sympy/integrals/integrals.py
@@ -384,16 +384,19 @@
meijerg = hints.get('meijerg', None)
conds = hints.get('conds', 'piecewise')
risch = hints.get('risch', None)
+ heurisch ... | diff --git a/sympy/integrals/tests/test_integrals.py b/sympy/integrals/tests/test_integrals.py
--- a/sympy/integrals/tests/test_integrals.py
+++ b/sympy/integrals/tests/test_integrals.py
@@ -1205,6 +1205,19 @@
assert integrate(erf(x), x, risch=True) == Integral(erf(x), x)
# TODO: How to test risch=False?
+
... | null | null | namanjain12/sympy_final:070762450411d63e164a3722dc4e6a00fd7c126b | true | null | 1 | 46 | null | 1,763 | 0 | 0.75 | 1 | 0.75 | 1 | 0.447167 | 84.4665 | ||
3,470 | swe_bench::test::1287 | swe_bench | test | 1,287 | pydata__xarray-6798 | pydata/xarray | pydata/xarray | python | 9f8d47c8acfaa925b3499e824a0807d7f20424c7 | Dropping a MultiIndex variable raises an error after explicit indexes refactor
### What happened?
With the latest released version of Xarray, it is possible to delete all variables corresponding to a MultiIndex by simply deleting the name of the MultiIndex.
After the explicit indexes refactor (i.e,. using the "main" ... | I agree a depreciation warning is a bit nicer than an error message for this specific case.
If we agree on eventually removing the pandas multi-index dimension coordinate, perhaps this issue should be addressed in that wider context as it will be directly impacted? It would make our plans clear to users if we issue ... | diff --git a/xarray/core/coordinates.py b/xarray/core/coordinates.py
--- a/xarray/core/coordinates.py
+++ b/xarray/core/coordinates.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import warnings
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, Hashable, Iterator, Mapping, Sequen... | diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py
--- a/xarray/tests/test_dataarray.py
+++ b/xarray/tests/test_dataarray.py
@@ -1499,6 +1499,13 @@ def test_assign_coords(self) -> None:
with pytest.raises(ValueError):
da.coords["x"] = ("y", [1, 2, 3]) # no new dimension ... | ["xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords_existing_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords_existing_multiindex"] | ["xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray... | null | true | 2022-07-16T21:13:05Z | 3 | 59 | 2 | 5,032 | 0 | 0.8 | 1 | 0.62 | 1 | 0.696667 | 84.46 | |
3,471 | r2e_gym::train::2686 | r2e_gym | train | 2,686 | sympy__a6717d9341250d13efc928307782d56dc8a120ca | sympy | sympy/sympy | python | a6717d9341250d13efc928307782d56dc8a120ca | Title: Broadcasting Mismatch in Array Conversion Fails with "indices must be the same" Error
Description:
When converting expressions that involve arrays with different explicit indices, the conversion function fails due to mismatched index sets. For example, when combining two indexed arrays such as A[i, j] and B[k, ... | diff --git a/sympy/tensor/array/expressions/conv_indexed_to_array.py b/sympy/tensor/array/expressions/conv_indexed_to_array.py
--- a/sympy/tensor/array/expressions/conv_indexed_to_array.py
+++ b/sympy/tensor/array/expressions/conv_indexed_to_array.py
@@ -1,5 +1,6 @@
from collections import defaultdict
+from sympy.co... | diff --git a/sympy/tensor/array/expressions/tests/test_convert_index_to_array.py b/sympy/tensor/array/expressions/tests/test_convert_index_to_array.py
--- a/sympy/tensor/array/expressions/tests/test_convert_index_to_array.py
+++ b/sympy/tensor/array/expressions/tests/test_convert_index_to_array.py
@@ -7,7 +7,7 @@
from... | null | null | namanjain12/sympy_final:a6717d9341250d13efc928307782d56dc8a120ca | true | null | 1 | 33 | null | 1,989 | 0 | 0.75 | 1 | 0.75 | 1 | 0.4415 | 84.4495 | ||
3,472 | swe_bench::test::1539 | swe_bench | test | 1,539 | scikit-learn__scikit-learn-11496 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | cb0140017740d985960911c4f34820beea915846 | BUG: SimpleImputer gives wrong result on sparse matrix with explicit zeros
The current implementation of the `SimpleImputer` can't deal with zeros stored explicitly in sparse matrix.
Even when stored explicitly, we'd expect that all zeros are treating equally, right ?
See for example the code below:
```python
import nu... | diff --git a/sklearn/impute.py b/sklearn/impute.py
--- a/sklearn/impute.py
+++ b/sklearn/impute.py
@@ -133,7 +133,6 @@ class SimpleImputer(BaseEstimator, TransformerMixin):
a new copy will always be made, even if `copy=False`:
- If X is not an array of floating values;
- - If X is sparse and ... | 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
@@ -97,6 +97,23 @@ def test_imputation_deletion_warning(strategy):
imputer.fit_transform(X)
+@pytest.mark.parametrize("strategy", ["mean", "median",
+ ... | ["sklearn/tests/test_impute.py::test_imputation_error_sparse_0[mean]", "sklearn/tests/test_impute.py::test_imputation_error_sparse_0[median]", "sklearn/tests/test_impute.py::test_imputation_error_sparse_0[most_frequent]", "sklearn/tests/test_impute.py::test_imputation_error_sparse_0[constant]"] | ["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 | 2018-07-12T17:05:58Z | 1 | 139 | 4 | 806 | 0 | 0.8 | 1 | 0.7 | 1 | 0.597667 | 84.443 | ||
3,473 | r2e_gym::train::4673 | r2e_gym | train | 4,673 | numpy__612caca61f82e3e20117ec5917d71fd0f48c42ea | numpy | numpy/numpy | python | 612caca61f82e3e20117ec5917d71fd0f48c42ea | **Title:** `np.roll` Raises TypeError When Rolling Multiple Axes Simultaneously
**Description:**
When attempting to roll a NumPy array along multiple axes by passing a tuple for the `axis` parameter, `np.roll` raises a `TypeError`. This prevents users from shifting elements across multiple dimensions in a single opera... | diff --git a/doc/release/1.12.0-notes.rst b/doc/release/1.12.0-notes.rst
--- a/doc/release/1.12.0-notes.rst
+++ b/doc/release/1.12.0-notes.rst
@@ -159,6 +159,10 @@
Generalized Ufuncs, including most of the linalg module, will now unlock
the Python global interpreter lock.
+np.roll can now roll multiple axes at the ... | diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -2145,6 +2145,42 @@
x2r = np.roll(x2, 1, axis=1)
assert_equal(x2r, np.array([[4, 0, 1, 2, 3], [9, 5, 6, 7, 8]]))
+ # Roll multiple ... | null | null | namanjain12/numpy_final:612caca61f82e3e20117ec5917d71fd0f48c42ea | true | null | 2 | 72 | null | 1,192 | 0 | 0.75 | 1 | 0.75 | 1 | 0.438667 | 84.441 | ||
3,474 | r2e_gym::train::595 | r2e_gym | train | 595 | sympy__8e9b21ffdcad035e4741231f8d439fd055a336bf | sympy | sympy/sympy | python | 8e9b21ffdcad035e4741231f8d439fd055a336bf | Title: Incorrect Handling of Non-Quaternion Operands in Quaternion Addition and Multiplication
Description:
When using quaternion arithmetic, non-quaternion inputs such as complex numbers or scalars are sometimes not handled correctly. For example, adding a complex expression to a quaternion or using scalar values in ... | diff --git a/sympy/algebras/quaternion.py b/sympy/algebras/quaternion.py
--- a/sympy/algebras/quaternion.py
+++ b/sympy/algebras/quaternion.py
@@ -254,9 +254,8 @@
# If q2 is a number or a sympy expression instead of a quaternion
if not isinstance(q2, Quaternion):
- if q1.real_field:
- ... | diff --git a/sympy/algebras/tests/test_quaternion.py b/sympy/algebras/tests/test_quaternion.py
--- a/sympy/algebras/tests/test_quaternion.py
+++ b/sympy/algebras/tests/test_quaternion.py
@@ -170,5 +170,7 @@
z_quat = Quaternion(re(z), im(z), 0, 0)
q = Quaternion(*symbols('q:4', real=True))
- assert z * q ... | null | null | namanjain12/sympy_final:8e9b21ffdcad035e4741231f8d439fd055a336bf | true | null | 1 | 17 | null | 2,276 | 0 | 0.75 | 1 | 0.75 | 1 | 0.436 | 84.433 | ||
3,475 | r2e_gym::train::1661 | r2e_gym | train | 1,661 | sympy__025dfa630d696a519bcc3570e3547b50965ed4c2 | sympy | sympy/sympy | python | 025dfa630d696a519bcc3570e3547b50965ed4c2 | Title: cut_section Fails When the Cutting Line Coincides with a Polygon Edge
Description:
When using the cut_section method on a polygon with a cutting line that exactly coincides with one of its edges, the method fails by attempting to create a polygon with no vertices. For example, consider a rectangle defined by th... | diff --git a/sympy/geometry/polygon.py b/sympy/geometry/polygon.py
--- a/sympy/geometry/polygon.py
+++ b/sympy/geometry/polygon.py
@@ -788,6 +788,22 @@
Returns a tuple of two polygon segments that lie above and below
the intersecting line respectively.
+ Parameters
+ ==========
+
+ ... | diff --git a/sympy/geometry/tests/test_polygon.py b/sympy/geometry/tests/test_polygon.py
--- a/sympy/geometry/tests/test_polygon.py
+++ b/sympy/geometry/tests/test_polygon.py
@@ -545,3 +545,15 @@
Point2D(-3, 3*sqrt(3)), Point2D(-6, 0), Point2D(-9 + 3*sqrt(3), -9 + 3*sqrt(3)))
assert s[1] == Polygon(Point2... | null | null | namanjain12/sympy_final:025dfa630d696a519bcc3570e3547b50965ed4c2 | true | null | 1 | 28 | null | 2,051 | 0 | 0.75 | 1 | 0.75 | 1 | 0.435167 | 84.4305 | ||
3,476 | r2e_gym::train::859 | r2e_gym | train | 859 | sympy__6ffac25d1cb1e65b154a47b695375858844cfbdc | sympy | sympy/sympy | python | 6ffac25d1cb1e65b154a47b695375858844cfbdc | Title: Incorrect Parameter Handling in GMVLG Causes TypeError for Matrix Inputs
Description:
When creating a GeneralizedMultivariateLogGamma distribution with a matrix input, the function incorrectly interprets the matrix parameter. For example, passing a square matrix as the correlation input results in a type error ... | diff --git a/sympy/stats/joint_rv_types.py b/sympy/stats/joint_rv_types.py
--- a/sympy/stats/joint_rv_types.py
+++ b/sympy/stats/joint_rv_types.py
@@ -1,7 +1,7 @@
from sympy import (sympify, S, pi, sqrt, exp, Lambda, Indexed, Gt, IndexedBase,
besselk, gamma, Interval, Range, factorial, Mul, Intege... | diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py
--- a/sympy/core/tests/test_args.py
+++ b/sympy/core/tests/test_args.py
@@ -1509,7 +1509,7 @@
[0.5, 0.5, 1, 0.5],
[0.5, 0.5, 0.5, 1]])
v, l, mu = (4, [1, 2, 3, 4], [1, 2, 3, 4])
- assert _test_... | null | null | namanjain12/sympy_final:6ffac25d1cb1e65b154a47b695375858844cfbdc | true | null | 1 | 53 | null | 1,542 | 0 | 0.75 | 1 | 0.75 | 1 | 0.433667 | 84.426 | ||
3,477 | r2e_gym::train::670 | r2e_gym | train | 670 | sympy__3b1c03b02fd485af5cd16bcb5ecc36ed4f45da72 | sympy | sympy/sympy | python | 3b1c03b02fd485af5cd16bcb5ecc36ed4f45da72 | Title: Incorrect evalf Results for Sums Leading to Huge Values and Symbolic Boolean Errors
Description:
When evaluating summation expressions using evalf(), some sums produce unexpected numeric and symbolic results. For example, evaluating a numeric sum like the reciprocal sum over a small interval returns an astronom... | diff --git a/sympy/concrete/summations.py b/sympy/concrete/summations.py
--- a/sympy/concrete/summations.py
+++ b/sympy/concrete/summations.py
@@ -362,15 +362,35 @@
assert len(self.limits) == 1
i, a, b = self.limits[0]
if (a > b) is True:
+ if a - b == 1:
+ return S.... | diff --git a/sympy/concrete/tests/test_sums_products.py b/sympy/concrete/tests/test_sums_products.py
--- a/sympy/concrete/tests/test_sums_products.py
+++ b/sympy/concrete/tests/test_sums_products.py
@@ -369,6 +369,13 @@
50) == '0.69314793056000780941723211364567656807940638436025'
+def test_evalf_sym... | null | null | namanjain12/sympy_final:3b1c03b02fd485af5cd16bcb5ecc36ed4f45da72 | true | null | 1 | 28 | null | 1,995 | 0 | 0.75 | 1 | 0.75 | 1 | 0.425833 | 84.4025 | ||
3,478 | r2e_gym::train::2749 | r2e_gym | train | 2,749 | sympy__25020beed8843035d8c0ea6bd29fae8d1d46c4fc | sympy | sympy/sympy | python | 25020beed8843035d8c0ea6bd29fae8d1d46c4fc | Title: Error in Convergence Evaluation of Piecewise Sums with Infinite Limits
Description:
When checking convergence for sums with a piecewise function, an unexpected error occurs due to invalid comparisons. For instance, consider the following example:
```
from sympy import Sum, Piecewise, S, symbols, oo
n = symbols... | diff --git a/sympy/concrete/summations.py b/sympy/concrete/summations.py
--- a/sympy/concrete/summations.py
+++ b/sympy/concrete/summations.py
@@ -260,10 +260,10 @@
def is_convergent(self):
"""
Convergence tests are used for checking the convergence of
- a series. There are various tests e... | diff --git a/sympy/concrete/tests/test_sums_products.py b/sympy/concrete/tests/test_sums_products.py
--- a/sympy/concrete/tests/test_sums_products.py
+++ b/sympy/concrete/tests/test_sums_products.py
@@ -896,12 +896,17 @@
assert Sum(1/(n - 1), (n, -oo, -1)).is_convergent() == S.false
assert Sum(1/(n**2 - 1), (... | null | null | namanjain12/sympy_final:25020beed8843035d8c0ea6bd29fae8d1d46c4fc | true | null | 1 | 59 | null | 1,354 | 0 | 0.75 | 1 | 0.75 | 1 | 0.422333 | 84.392 | ||
3,479 | r2e_gym::train::4986 | r2e_gym | train | 4,986 | datalad__b58be9eb232eac9a0006c675ff6332f3c05990d6 | datalad | datalad/datalad | python | b58be9eb232eac9a0006c675ff6332f3c05990d6 | **Title:** `split_ext` Function Missing, Causing AttributeError in Filename Parsing
**Description:**
After implementing the new extension splitting heuristic based on git-annex's `splitShortExtensions`, attempts to use the `split_ext` function result in an `AttributeError`. This prevents the proper parsing of filename... | diff --git a/datalad/plugin/addurls.py b/datalad/plugin/addurls.py
--- a/datalad/plugin/addurls.py
+++ b/datalad/plugin/addurls.py
@@ -11,6 +11,7 @@
from collections import defaultdict, Mapping
from functools import partial
+from itertools import dropwhile
import logging
import os
import re
@@ -271,6 +272,40 @@
... | diff --git a/datalad/plugin/tests/test_addurls.py b/datalad/plugin/tests/test_addurls.py
--- a/datalad/plugin/tests/test_addurls.py
+++ b/datalad/plugin/tests/test_addurls.py
@@ -151,13 +151,27 @@
assert_false(addurls.fmt_to_name("{}", {}))
+def test_split_ext():
+ eq_(addurls.split_ext("file"), ("file", ""... | null | null | namanjain12/datalad_final:b58be9eb232eac9a0006c675ff6332f3c05990d6 | true | null | 1 | 62 | null | 1,286 | 0 | 0.75 | 1 | 0.75 | 1 | 0.421 | 84.388 | ||
3,480 | r2e_gym::train::1763 | r2e_gym | train | 1,763 | sympy__055feedab48e12de6765918474011e46c83769d0 | sympy | sympy/sympy | python | 055feedab48e12de6765918474011e46c83769d0 | Title: Unexpected Errors When Solving Certain Quadratic Diophantine Equations
Description:
When invoking the diophantine solver on quadratic equations with non-perfect square discriminants or unusual coefficient configurations, the solver raises unexpected errors (such as a ValueError or an xpass error) instead of ret... | diff --git a/sympy/solvers/diophantine.py b/sympy/solvers/diophantine.py
--- a/sympy/solvers/diophantine.py
+++ b/sympy/solvers/diophantine.py
@@ -33,7 +33,7 @@
if eq_type in ["univariable", "linear", "ternary_quadratic"]:
sols.add(merge_solution(var, var_t, solution))
- elif eq_type == "... | diff --git a/sympy/solvers/tests/test_diophantine.py b/sympy/solvers/tests/test_diophantine.py
--- a/sympy/solvers/tests/test_diophantine.py
+++ b/sympy/solvers/tests/test_diophantine.py
@@ -31,6 +31,7 @@
def test_quadratic_simple_hyperbolic_case():
+
# Simple Hyperbolic case: A = C = 0 and B != 0
assert... | null | null | namanjain12/sympy_final:055feedab48e12de6765918474011e46c83769d0 | true | null | 1 | 31 | null | 1,904 | 0 | 0.75 | 1 | 0.75 | 1 | 0.420667 | 84.387 | ||
3,481 | r2e_gym::train::1777 | r2e_gym | train | 1,777 | sympy__01a25577c8acda8f50a7d35eb0971fc0a1e17344 | sympy | sympy/sympy | python | 01a25577c8acda8f50a7d35eb0971fc0a1e17344 | Title: Inconsistent Handling of Undefined Functions in Limit Evaluation
Description:
There appears to be a discrepancy in how limits of undefined functions are handled. When computing the limit of an undefined function using the general limit routine, the result is now returned as an unevaluated Limit object. However,... | diff --git a/sympy/series/gruntz.py b/sympy/series/gruntz.py
--- a/sympy/series/gruntz.py
+++ b/sympy/series/gruntz.py
@@ -120,6 +120,7 @@
from sympy.core import Basic, S, Mul, PoleError
from sympy.core.cache import cacheit
+from sympy.core.function import AppliedUndef
from sympy.core.intfunc import ilcm
from sym... | diff --git a/sympy/calculus/tests/test_finite_diff.py b/sympy/calculus/tests/test_finite_diff.py
--- a/sympy/calculus/tests/test_finite_diff.py
+++ b/sympy/calculus/tests/test_finite_diff.py
@@ -162,7 +162,3 @@
+ 3*g(h + x)/(2*h))/(2*h) - (2*f(x)/h - 3*f(-h + x)/(2*h) - \
f(h + x)/(2*h))*(2*g(x)... | null | null | namanjain12/sympy_final:01a25577c8acda8f50a7d35eb0971fc0a1e17344 | true | null | 2 | 6 | null | 2,356 | 0 | 0.75 | 1 | 0.75 | 1 | 0.412667 | 84.363 | ||
3,482 | r2e_gym::train::1077 | r2e_gym | train | 1,077 | sympy__f0f38841b208d574ad0f27c3cb61837635bed42e | sympy | sympy/sympy | python | f0f38841b208d574ad0f27c3cb61837635bed42e | Title: Inequalities in Piecewise Not Raising ValueError in Complex Domain
Description:
When solving equations with Piecewise functions that include inequality conditions in the complex domain, a ValueError should be raised. The recent changes intend to restrict the use of inequalities to the real domain only. For exam... | diff --git a/sympy/functions/elementary/piecewise.py b/sympy/functions/elementary/piecewise.py
--- a/sympy/functions/elementary/piecewise.py
+++ b/sympy/functions/elementary/piecewise.py
@@ -3,7 +3,8 @@
from sympy.core import Basic, S, Function, diff, Tuple, Dummy, Number
from sympy.core.basic import as_Basic
from s... | diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -676,8 +676,11 @@
f = Piecewise(((x - 2)**2, x >= 0), (0, True))
assert solveset(f, x, domain=S.Reals) == Union(FiniteSet(2), Interv... | null | null | namanjain12/sympy_final:f0f38841b208d574ad0f27c3cb61837635bed42e | true | null | 2 | 15 | null | 2,148 | 0 | 0.75 | 1 | 0.75 | 1 | 0.408 | 84.349 | ||
3,483 | r2e_gym::train::4546 | r2e_gym | train | 4,546 | numpy__27e85997067da402a2c2e64b50290bdc0ef4cb48 | numpy | numpy/numpy | python | 27e85997067da402a2c2e64b50290bdc0ef4cb48 | **Analysis:**
- **Key Parts from Commit Details and Test Results:**
- **Commit Message:** BUG: fix handling of right edge of final bin.
- **Test Failure in Old Commit:**
- **Test Name:** `test_last_bin_inclusive_range`
- **Error Message:** `ValueError: operands could not be broadcast together with shapes (... | diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -667,14 +667,14 @@
# Compute the bin indices, and for values that lie exactly on mx we
# need to subtract one
indices = tmp_a.astype(np.intp)
-... | diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1417,6 +1417,11 @@
for x, left, right in zip(arr, left_edges, right_edges):
self.assertGreaterEqual(x, left)
... | null | null | namanjain12/numpy_final:27e85997067da402a2c2e64b50290bdc0ef4cb48 | true | null | 1 | 6 | null | 2,318 | 0 | 0.75 | 1 | 0.75 | 1 | 0.406333 | 84.344 | ||
3,484 | r2e_gym::train::1051 | r2e_gym | train | 1,051 | sympy__d7a74c8e4cbd27a9ff348169935f50897cac6541 | sympy | sympy/sympy | python | d7a74c8e4cbd27a9ff348169935f50897cac6541 | Title: NonlinearError in Symbolic State-Space Computations with Symbolic Inputs
Description:
When using symbolic initial conditions and system parameters in state‐space functions, a NonlinearError is raised. For example, the following code snippet attempts to compute the state and output vectors when some matrices con... | diff --git a/sympy/physics/control/lti.py b/sympy/physics/control/lti.py
--- a/sympy/physics/control/lti.py
+++ b/sympy/physics/control/lti.py
@@ -3840,7 +3840,7 @@
"""
return self._D.rows
- def state_vector(self, initial_conditions=None, input_vector=None, var=None):
+ def state_vector(self, ... | diff --git a/sympy/physics/control/tests/test_lti.py b/sympy/physics/control/tests/test_lti.py
--- a/sympy/physics/control/tests/test_lti.py
+++ b/sympy/physics/control/tests/test_lti.py
@@ -6,6 +6,7 @@
from sympy.core.singleton import S
from sympy.core.symbol import symbols
from sympy.functions.elementary.exponenti... | null | null | namanjain12/sympy_final:d7a74c8e4cbd27a9ff348169935f50897cac6541 | true | null | 1 | 18 | null | 2,069 | 0 | 0.75 | 1 | 0.75 | 1 | 0.404833 | 84.3395 | ||
3,485 | r2e_gym::train::2798 | r2e_gym | train | 2,798 | sympy__71447363ccbf85cf5de97779e83e18a3143ec673 | sympy | sympy/sympy | python | 71447363ccbf85cf5de97779e83e18a3143ec673 | Title: Risch Integration Fails on Degenerate Case in PRDE with Matrix Dimension Mismatch
Description:
When integrating certain functions using the Risch algorithm, the calculation fails when all auxiliary polynomials vanish. During the parameterization step (PRDE), an empty matrix is created and later concatenated wit... | diff --git a/sympy/integrals/prde.py b/sympy/integrals/prde.py
--- a/sympy/integrals/prde.py
+++ b/sympy/integrals/prde.py
@@ -344,10 +344,9 @@
if all(qi.is_zero for qi in Q):
dc = -1
- M = zeros(0, 2, DE.t)
else:
dc = max([qi.degree(DE.t) for qi in Q])
- M = Matrix(dc + 1, m... | diff --git a/sympy/integrals/tests/test_risch.py b/sympy/integrals/tests/test_risch.py
--- a/sympy/integrals/tests/test_risch.py
+++ b/sympy/integrals/tests/test_risch.py
@@ -374,12 +374,14 @@
# TODO: Add a test where two different parts of the extension use a
# Piecewise, like y**x + z**x.
+
def test_issu... | null | null | namanjain12/sympy_final:71447363ccbf85cf5de97779e83e18a3143ec673 | true | null | 1 | 6 | null | 2,286 | 0 | 0.75 | 1 | 0.75 | 1 | 0.401 | 84.328 | ||
3,486 | swe_bench::test::1260 | swe_bench | test | 1,260 | pydata__xarray-4940 | pydata/xarray | pydata/xarray | python | 48378c4b11c5c2672ff91396d4284743165b4fbe | Calling Dataset.mean() drops coordinates
This is a similar issue to bug #1470.
#### MCVE Code Sample
```python
import xarray as xr
import numpy as np
x = np.linspace(0,1,5)
y = np.linspace(-1,0,5)
t = np.linspace(0,10,10)
dataArray1 = xr.DataArray(np.random.random((5,5,10)),
dims=('x','y... | Thanks for the issue and clear example @kjfergu . Agree that's not robust.
Is this specific case fixed by passing `dim=` rather than `axis=`?
`dim` gives you all the advantages of xarray. Is there a reason the example passes `axis`?
That said, we should be consistent, or raise on passing `axis`...
@max-sixty ... | diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py
--- a/xarray/core/dataset.py
+++ b/xarray/core/dataset.py
@@ -4665,6 +4665,12 @@ def reduce(
Dataset with this object's DataArrays replaced with new DataArrays
of summarized data and the indicated dimension(s) removed.
"""
+... | 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
@@ -4746,6 +4746,9 @@ def test_reduce(self):
assert_equal(data.mean(dim=[]), data)
+ with pytest.raises(ValueError):
+ data.mean(axis=0)
+
de... | ["xarray/tests/test_dataset.py::TestDataset::test_reduce"] | ["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 | 2021-02-21T22:36:56Z | 1 | 45 | 1 | 4,837 | 0 | 0.8 | 1 | 0.62 | 1 | 0.65 | 84.32 | |
3,487 | r2e_gym::train::1035 | r2e_gym | train | 1,035 | sympy__15f95455fd3f8334862e4456b7c257aba0def034 | sympy | sympy/sympy | python | 15f95455fd3f8334862e4456b7c257aba0def034 | Title: evalf(chop=True) for log Raises TypeError When Evaluating Logarithm of a Small Value
Description:
When using evalf with chop=True for log, the library may return None for the evaluated argument, leading to a TypeError during further processing. For example, evaluating a logarithm of a value that essentially rep... | diff --git a/sympy/core/evalf.py b/sympy/core/evalf.py
--- a/sympy/core/evalf.py
+++ b/sympy/core/evalf.py
@@ -848,6 +848,17 @@
workprec = prec + 10
xre, xim, xacc, _ = evalf(arg, workprec, options)
+ # evalf can return NoneTypes if chop=True
+ # issue 18516, 19623
+ if xre is xim is None:
+ ... | diff --git a/sympy/core/tests/test_evalf.py b/sympy/core/tests/test_evalf.py
--- a/sympy/core/tests/test_evalf.py
+++ b/sympy/core/tests/test_evalf.py
@@ -234,6 +234,9 @@
#issue 13076
assert NS(Mul(Max(0, y), x, evaluate=False).evalf()) == 'x*Max(0, y)'
+ #issue 18516
+ assert NS(log(S(327339060789614... | null | null | namanjain12/sympy_final:15f95455fd3f8334862e4456b7c257aba0def034 | true | null | 1 | 41 | null | 1,565 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3975 | 84.3175 | ||
3,488 | r2e_gym::train::1125 | r2e_gym | train | 1,125 | sympy__a004b3242bf0ee9ca4f6838154df117c135244bc | sympy | sympy/sympy | python | a004b3242bf0ee9ca4f6838154df117c135244bc | Title: TypeErrors when calling orthogonalize and vec_project with multiple arguments
Description:
When attempting to use the orthogonalize and vec_project functions with extra flexible argument signatures, TypeErrors are raised. For example, providing separate vectors to orthogonalize causes an iteration error, and pa... | diff --git a/sympy/vector/functions.py b/sympy/vector/functions.py
--- a/sympy/vector/functions.py
+++ b/sympy/vector/functions.py
@@ -475,10 +475,10 @@
i -= 1
return index, from_path
-def orthogonalize(vlist, orthonormal=False):
- """
- Takes a set of independent vectors and orthogonalizes them
-... | diff --git a/sympy/vector/tests/test_functions.py b/sympy/vector/tests/test_functions.py
--- a/sympy/vector/tests/test_functions.py
+++ b/sympy/vector/tests/test_functions.py
@@ -168,8 +168,8 @@
v3 = 3*i + 5*j
v4 = 3*i + j
v5 = 2*i + 2*j
- assert orthogonalize([v1, v2]) == [C.i + 2*C.j, 2*C.i/5 + -C.j... | null | null | namanjain12/sympy_final:a004b3242bf0ee9ca4f6838154df117c135244bc | true | null | 2 | 27 | null | 1,842 | 0 | 0.75 | 1 | 0.75 | 1 | 0.397 | 84.316 | ||
3,489 | r2e_gym::train::1536 | r2e_gym | train | 1,536 | sympy__98f272f076928410163240062d2c197e98b8ad0e | sympy | sympy/sympy | python | 98f272f076928410163240062d2c197e98b8ad0e | Title: simplify_logic Returns None for Valid Boolean Expressions
Description:
When calling simplify_logic on a valid boolean expression, the function returns None instead of producing a simplified result. For example, using an expression like "A & (B | C)" (or its equivalent Boolean structure) is expected to yield a s... | diff --git a/sympy/logic/__init__.py b/sympy/logic/__init__.py
--- a/sympy/logic/__init__.py
+++ b/sympy/logic/__init__.py
@@ -1,3 +1,4 @@
-from .boolalg import (to_cnf, And, Or, Not, Xor, Nand, Nor, Implies, Equivalent,
- ITE, POSform, SOPform, simplify_logic, bool_equal)
+from .boolalg import (to_cnf, to_dnf, And,... | diff --git a/sympy/logic/tests/test_boolalg.py b/sympy/logic/tests/test_boolalg.py
--- a/sympy/logic/tests/test_boolalg.py
+++ b/sympy/logic/tests/test_boolalg.py
@@ -178,7 +178,7 @@
assert simplify_logic(Or(And(Equality(A, 3), B), And(Equality(A, 3), C))) \
== And(Equality(A, 3), Or(B, C))
assert... | null | null | namanjain12/sympy_final:98f272f076928410163240062d2c197e98b8ad0e | true | null | 2 | 31 | null | 1,761 | 0 | 0.75 | 1 | 0.75 | 1 | 0.396833 | 84.3155 | ||
3,490 | swe_bench::test::1535 | swe_bench | test | 1,535 | scikit-learn__scikit-learn-11315 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | bb5110b8e0b70d98eae2f7f8b6d4deaa5d2de038 | _BaseCompostion._set_params broken where there are no estimators
`_BaseCompostion._set_params` raises an error when the composition has no estimators.
This is a marginal case, but it might be interesting to support alongside #11315.
```py
>>> from sklearn.compose import ColumnTransformer
>>> ColumnTransformer([]).set... | 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
@@ -6,7 +6,7 @@
# Author: Andreas Mueller
# Joris Van den Bossche
# License: BSD
-
+from itertools import chain
import nump... | 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
@@ -37,6 +37,14 @@ def transform(self, X, y=None):
return X
+class DoubleTrans(BaseE... | ["sklearn/compose/tests/test_column_transformer.py::test_column_transformer_dataframe", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_remainder", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_remainder_numpy[key0]", "sklearn/compose/tests/test_column_transformer... | ["sklearn/compose/tests/test_column_transformer.py::test_column_transformer", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_sparse_array", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_sparse_stacking", "sklearn/compose/tests/test_column_transformer.py::test_col... | null | true | 2018-06-18T19:56:04Z | 2 | 127 | 25 | 764 | 0 | 0.8 | 1 | 0.7 | 1 | 0.550667 | 84.302 | ||
3,491 | swe_bench::test::1673 | swe_bench | test | 1,673 | scikit-learn__scikit-learn-15524 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 0aab6213948926f8e5990f8e878d57f2a899e876 | Nested Cross Validation for precomputed KNN
#### Description
A nested cross validation prediction using a knn with precomputed metric raised an error
#### Code to Reproduce
```python
from sklearn import datasets
from sklearn.model_selection import cross_val_predict, GridSearchCV
from sklearn.neighbors import KNeighbor... | This seems to be because BaseSearchCV doesn't define the _pairwise property. It should, as should other meta-estimators.
Thanks for the report. A patch is welcome.
@Jeanselme are you working on a fix for this? I've been looking for a good first issue and happen to have done a couple projects with meta-estimators rece... | diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py
--- a/sklearn/model_selection/_search.py
+++ b/sklearn/model_selection/_search.py
@@ -414,6 +414,11 @@ def __init__(self, estimator, scoring=None, n_jobs=None, iid='deprecated',
def _estimator_type(self):
return self.esti... | diff --git a/sklearn/model_selection/tests/test_search.py b/sklearn/model_selection/tests/test_search.py
--- a/sklearn/model_selection/tests/test_search.py
+++ b/sklearn/model_selection/tests/test_search.py
@@ -56,11 +56,13 @@
from sklearn.tree import DecisionTreeClassifier
from sklearn.cluster import KMeans
from sk... | ["sklearn/model_selection/tests/test_search.py::test_search_cv__pairwise_property_delegated_to_base_estimator"] | ["sklearn/model_selection/tests/test_search.py::test_validate_parameter_input[0-TypeError-Parameter", "sklearn/model_selection/tests/test_search.py::test_validate_parameter_input[input1-TypeError-Parameter", "sklearn/model_selection/tests/test_search.py::test_validate_parameter_input[input2-TypeError-Parameter.*", "skl... | null | true | 2019-11-03T00:40:19Z | 1 | 5 | 1 | 8,075 | 0 | 0.8 | 1 | 0.8 | 0.8 | 0.516667 | 84.3 | |
3,492 | swe_bench::test::1161 | swe_bench | test | 1,161 | pallets__flask-5063 | pallets/flask | pallets/flask | python | 182ce3dd15dfa3537391c3efaf9c3ff407d134d4 | Flask routes to return domain/sub-domains information
Currently when checking **flask routes** it provides all routes but **it is no way to see which routes are assigned to which subdomain**.
**Default server name:**
SERVER_NAME: 'test.local'
**Domains (sub-domains):**
test.test.local
admin.test.local
test.local
**A... | diff --git a/src/flask/cli.py b/src/flask/cli.py
--- a/src/flask/cli.py
+++ b/src/flask/cli.py
@@ -9,7 +9,7 @@
import traceback
import typing as t
from functools import update_wrapper
-from operator import attrgetter
+from operator import itemgetter
import click
from click.core import ParameterSource
@@ -989,49 ... | diff --git a/tests/test_cli.py b/tests/test_cli.py
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -433,16 +433,12 @@ class TestRoutes:
@pytest.fixture
def app(self):
app = Flask(__name__)
- app.testing = True
-
- @app.route("/get_post/<int:x>/<int:y>", methods=["GET", "POST"])
- ... | ["tests/test_cli.py::TestRoutes::test_subdomain", "tests/test_cli.py::TestRoutes::test_host"] | ["tests/test_cli.py::test_cli_name", "tests/test_cli.py::test_find_best_app", "tests/test_cli.py::test_prepare_import[test-path0-test]", "tests/test_cli.py::test_prepare_import[test.py-path1-test]", "tests/test_cli.py::test_prepare_import[a/test-path2-test]", "tests/test_cli.py::test_prepare_import[test/__init__.py-pat... | null | true | 2023-04-14T16:36:54Z | 1 | 65 | 2 | 1,993 | 0 | 0.8 | 1 | 0.7 | 1 | 0.548833 | 84.2965 | ||
3,493 | r2e_gym::train::4466 | r2e_gym | train | 4,466 | numpy__bdbac02b0bddb265840cc00cc5dec0590c09b093 | numpy | numpy/numpy | python | bdbac02b0bddb265840cc00cc5dec0590c09b093 | **Title:** `recfunctions.join_by` Fails with TypeError When Key is a Subdtype
**Description:**
When using `recfunctions.join_by` with a key that is a subdtype, the function raises a `TypeError` instead of successfully joining the arrays.
**Buggy Code Example:**
```python
import numpy as np
from numpy.lib import recfu... | diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -68,6 +68,42 @@
else:
output[field][:len(current)] = current
return output
+
+
+def get_fieldspec(dtype):
+ """
+ Produce a list of name/dtype pairs corr... | diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py
--- a/numpy/lib/tests/test_recfunctions.py
+++ b/numpy/lib/tests/test_recfunctions.py
@@ -669,6 +669,20 @@
assert_equal(res.dtype, expected_dtype)
+ def test_subarray_key(self):
+ a_dtype = np.dtype([('pos', ... | null | null | namanjain12/numpy_final:bdbac02b0bddb265840cc00cc5dec0590c09b093 | true | null | 1 | 60 | null | 1,141 | 0 | 0.75 | 1 | 0.75 | 1 | 0.390167 | 84.2955 | ||
3,494 | r2e_gym::train::1330 | r2e_gym | train | 1,330 | sympy__ae095cf7bb40b62bc441fdb2c9156cf2123c71f4 | sympy | sympy/sympy | python | ae095cf7bb40b62bc441fdb2c9156cf2123c71f4 | Title: Incorrect Polynomial Result in Small Cancellation Routine
Description:
When processing certain integrals that require the “small cancellation” step, the algorithm produces an unexpected polynomial result. For example, in a situation where the cancellation procedure should simplify an expression to something lik... | diff --git a/sympy/integrals/prde.py b/sympy/integrals/prde.py
--- a/sympy/integrals/prde.py
+++ b/sympy/integrals/prde.py
@@ -444,15 +444,6 @@
def prde_cancel_liouvillian(b, Q, n, DE):
"""
Pg, 237.
- Examples of this are:
- Elementary
- ==========
- log(x) - log(x - 1)
-
- Non-elementary
- ... | diff --git a/sympy/integrals/tests/test_prde.py b/sympy/integrals/tests/test_prde.py
--- a/sympy/integrals/tests/test_prde.py
+++ b/sympy/integrals/tests/test_prde.py
@@ -1,6 +1,6 @@
"""Most of these tests come from the examples in Bronstein's book."""
-from sympy import Poly, S, symbols
-from sympy.integrals.risch im... | null | null | namanjain12/sympy_final:ae095cf7bb40b62bc441fdb2c9156cf2123c71f4 | true | null | 2 | 30 | null | 1,726 | 0 | 0.75 | 1 | 0.75 | 1 | 0.387667 | 84.288 | ||
3,495 | r2e_gym::train::545 | r2e_gym | train | 545 | sympy__4b230ac208b45c2b72bff1a6f51c746001777d3d | sympy | sympy/sympy | python | 4b230ac208b45c2b72bff1a6f51c746001777d3d | Title: Incorrect Handling of Zero Polynomial Degree (-oo) Leads to Generator and Index Errors
Description:
When processing certain polynomial expressions, the conversion routines related to hyperexponential integration and polynomial degree computation run into unexpected behavior due to degree(0) returning negative i... | diff --git a/sympy/integrals/risch.py b/sympy/integrals/risch.py
--- a/sympy/integrals/risch.py
+++ b/sympy/integrals/risch.py
@@ -28,7 +28,7 @@
from sympy import real_roots
from sympy.abc import z
from sympy.core.function import Lambda
-from sympy.core.numbers import ilcm
+from sympy.core.numbers import ilcm, oo
f... | diff --git a/sympy/integrals/tests/test_risch.py b/sympy/integrals/tests/test_risch.py
--- a/sympy/integrals/tests/test_risch.py
+++ b/sympy/integrals/tests/test_risch.py
@@ -42,6 +42,7 @@
Poly(2/(exp(2) + 1)*z, t, z), Poly(2/(exp(2) + 1)*z, z, t)]
assert as_poly_1t(2/((exp(2) + 1)*t) + t, t, z) in [
... | null | null | namanjain12/sympy_final:4b230ac208b45c2b72bff1a6f51c746001777d3d | true | null | 2 | 16 | null | 1,999 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3865 | 84.2845 | ||
3,496 | r2e_gym::train::6545 | r2e_gym | train | 6,545 | pillow__a606fd85a3cf5b72c42e876364e74e6157202b98 | pillow | python-pillow/pillow | python | a606fd85a3cf5b72c42e876364e74e6157202b98 | **Title:** Encoder cleanup not invoked when encoding errors occur
**Description:**
When an error happens during the image encoding process, the encoder's cleanup method is not called. This omission can lead to resource leaks or inconsistent internal states, potentially affecting subsequent operations.
**Example:**
``... | diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -503,36 +503,40 @@
# compress to Python file-compatible object
for e, b, o, a in tile:
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
- if o > 0:
- ... | diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py
--- a/Tests/test_imagefile.py
+++ b/Tests/test_imagefile.py
@@ -200,6 +200,9 @@
def encode(self, buffer):
return 1, 1, b""
+ def cleanup(self):
+ self.cleanup_called = True
+
xoff, yoff, xsize, ysize = 10, 20, 100, 100
@@ -327... | null | null | namanjain12/pillow_final:a606fd85a3cf5b72c42e876364e74e6157202b98 | true | null | 1 | 56 | null | 1,193 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3855 | 84.2815 | ||
3,497 | swe_bench::test::1095 | swe_bench | test | 1,095 | matplotlib__matplotlib-25772 | matplotlib/matplotlib | matplotlib/matplotlib | python | 558f111d6f112fde91431be9f222e9359d4291ae | [Bug]: VSCode matplotlib interactive mode cannot import Qt bindings
### Bug summary
Running in VS Code interactive mode, `%matplotlib qt` throws an exception `ImportError: Failed to import any of the following Qt binding modules: PyQt6, PySide6, PyQt5, PySide2`. However, PySide6 is installed.
<details>
<summary>Error... | Are you sure that pyside6 is installed in the environment that is being used for the terminal.
Yes. In the same interactive shell, I can run the following cell
```python
# %%
import PySide6
print(PySide6.__version__) # Prints 6.5.0
```
When I start python from the command line and try to plot things, interactiv... | diff --git a/lib/matplotlib/backends/qt_compat.py b/lib/matplotlib/backends/qt_compat.py
--- a/lib/matplotlib/backends/qt_compat.py
+++ b/lib/matplotlib/backends/qt_compat.py
@@ -133,7 +133,8 @@ def _isdeleted(obj):
else:
raise ImportError(
"Failed to import any of the following Qt binding mo... | diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py
--- a/lib/matplotlib/tests/test_backends_interactive.py
+++ b/lib/matplotlib/tests/test_backends_interactive.py
@@ -343,6 +343,26 @@ def test_qt5backends_uses_qt5():
_run_helper(_implcore, timeout=_te... | ["lib/matplotlib/tests/test_backends_interactive.py::test_qt_missing"] | ["lib/matplotlib/tests/test_backends_interactive.py::test_lazy_auto_backend_selection"] | null | true | 2023-04-26T16:12:12Z | 1 | 3 | 1 | 12,498 | 0 | 0.8 | 1 | 0.8 | 0.8 | 0.51 | 84.28 | |
3,498 | r2e_gym::train::1253 | r2e_gym | train | 1,253 | sympy__d24cd25c666286925b29e053ec246b05d4350526 | sympy | sympy/sympy | python | d24cd25c666286925b29e053ec246b05d4350526 | Title: Duplicate Symbol Error in Beam Support Application
Description:
When applying supports on a beam using types “pin” and “roller”, the returned reaction load symbols are causing a duplicate symbol error during subsequent load solving. In the current behavior, calling the support application for these types return... | diff --git a/sympy/physics/continuum_mechanics/beam.py b/sympy/physics/continuum_mechanics/beam.py
--- a/sympy/physics/continuum_mechanics/beam.py
+++ b/sympy/physics/continuum_mechanics/beam.py
@@ -420,7 +420,8 @@
def apply_support(self, loc, type="fixed"):
"""
- This method applies support to a... | diff --git a/sympy/physics/continuum_mechanics/tests/test_beam.py b/sympy/physics/continuum_mechanics/tests/test_beam.py
--- a/sympy/physics/continuum_mechanics/tests/test_beam.py
+++ b/sympy/physics/continuum_mechanics/tests/test_beam.py
@@ -470,16 +470,20 @@
+ 10*SingularityFunction(x, 4, 3)/3)/(E*I)... | null | null | namanjain12/sympy_final:d24cd25c666286925b29e053ec246b05d4350526 | true | null | 1 | 41 | null | 1,472 | 0 | 0.75 | 1 | 0.75 | 1 | 0.382 | 84.271 | ||
3,499 | r2e_gym::train::517 | r2e_gym | train | 517 | sympy__315d933f06ceb4da56582e9d6171405e66dbb43a | sympy | sympy/sympy | python | 315d933f06ceb4da56582e9d6171405e66dbb43a | Title: Logarithmic Derivative Heuristic: Return None Instead of Raising Exception
Description:
When handling integrals that require the logarithmic derivative heuristic in the parametric Risch algorithm, the process previously raised a NotImplementedError if a specific condition was met (when the computed factor z did... | diff --git a/sympy/integrals/prde.py b/sympy/integrals/prde.py
--- a/sympy/integrals/prde.py
+++ b/sympy/integrals/prde.py
@@ -697,16 +697,14 @@
# y = p/gamma of the initial equation with ci = Sum(dj*aji).
try:
- # Similar to rischDE(), we try oo, even though it might lead to
- # non-terminati... | diff --git a/sympy/integrals/tests/test_prde.py b/sympy/integrals/tests/test_prde.py
--- a/sympy/integrals/tests/test_prde.py
+++ b/sympy/integrals/tests/test_prde.py
@@ -224,23 +224,18 @@
y = -p[0] + p[1] + 0*p[2] # x
assert y.diff(x) - y/x**2 == 1 - 1/x # Dy + f*y == -G0 + G1 + 0*G2
+ # the below tes... | null | null | namanjain12/sympy_final:315d933f06ceb4da56582e9d6171405e66dbb43a | true | null | 1 | 15 | null | 1,959 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3765 | 84.2545 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.