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,300
swe_bench::test::1086
swe_bench
test
1,086
matplotlib__matplotlib-25551
matplotlib/matplotlib
matplotlib/matplotlib
python
5b85655c84fb2e149a548374d7259230577b6181
handling of zeros in log-scale changes irreversibly after user zoom matplotlib 2.0b1 (but also present before that) Call e.g. ``` plt.plot(np.arange(10), np.arange(10)[::-1]) ``` and type "k" and "l" to switch both axes to log scale. The points at the two ends, where one of the coordinate is zero, are cropped out. ...
This seems to have improved; "back" or "h" both work reasonably well. Uh, no? To me the same issue remains? It took me a while to understand the issue. The main point seems to be that after messing around with zooming and linear/log changes you *can* press "home" and you will be back at the original view for linear sc...
diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3985,35 +3985,30 @@ def _get_view(self): """ Save information required to reproduce the current view. - Called before a view is changed, such as d...
diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -280,6 +280,36 @@ def test_toolbar_zoompan(): assert ax.get_navigate_mode() == "PAN" +def test_toolbar_home_r...
["lib/matplotlib/tests/test_backend_bases.py::test_toolbar_home_restores_autoscale"]
["lib/matplotlib/tests/test_backend_bases.py::test_uses_per_path", "lib/matplotlib/tests/test_backend_bases.py::test_canvas_ctor", "lib/matplotlib/tests/test_backend_bases.py::test_get_default_filename", "lib/matplotlib/tests/test_backend_bases.py::test_canvas_change", "lib/matplotlib/tests/test_backend_bases.py::test_...
null
true
2023-03-26T13:51:14Z
2
46
1
1,125
0
0.8
1
0.7
1
0.340833
85.6725
3,301
swe_bench::test::1153
swe_bench
test
1,153
pallets__flask-4160
pallets/flask
pallets/flask
python
06cf349bb8b69d9946c3a6a64d32eb552cc7c28b
handle Decimal in json encoder The `simplejson` removal (#3555) decreased the flask encoding capabilities as the built-in `json` doesn't cover cases like `Decimal` types. The solution seems to be: overwrite the flask app encoder with `JSONEnconder` from `simplejson`, but this incorporates a problem for users that relie...
hey, I'd like to work on this issue.
diff --git a/src/flask/json/__init__.py b/src/flask/json/__init__.py --- a/src/flask/json/__init__.py +++ b/src/flask/json/__init__.py @@ -1,3 +1,4 @@ +import decimal import io import json as _json import typing as t @@ -47,7 +48,7 @@ def default(self, o: t.Any) -> t.Any: """ if isinstance(o, date)...
diff --git a/tests/test_json.py b/tests/test_json.py --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1,4 +1,5 @@ import datetime +import decimal import io import uuid @@ -187,6 +188,11 @@ def test_jsonify_uuid_types(app, client): assert rv_uuid == test_uuid +def test_json_decimal(): + rv = flask....
["tests/test_json.py::test_json_decimal"]
["tests/test_json.py::test_json_as_unicode[True-\"\\\\u2603\"]", "tests/test_json.py::test_json_as_unicode[False-\"\\u2603\"]", "tests/test_json.py::test_json_dump_to_file", "tests/test_json.py::test_jsonify_aware_datetimes[tz0]", "tests/test_json.py::test_jsonify_aware_datetimes[tz1]", "tests/test_json.py::test_jsonif...
null
true
2021-06-19T12:01:43Z
1
9
1
1,843
0
0.8
1
0.7
1
0.337167
85.6615
3,302
swe_bench::test::1743
swe_bench
test
1,743
sphinx-doc__sphinx-10551
sphinx-doc/sphinx
sphinx-doc/sphinx
python
571b55328d401a6e1d50e37407df56586065a7be
Spurious space in default parameter values that are negative numbers in HTML output. ### Describe the bug For several projects, I've noticed a problem in the HTML output of functions that have a parameter with a default value that is a negative number. In the rendered HTML, there is a spurious space between the minus...
Please provide a minimal reproducer project, and additionally test with 'basic' or 'alabaster' to ensure it is not a bug in the pydata theme. A @AA-Turner, sorry the bug report is not more thorough. I probably won't be able to dig into this any further. Perhaps some of the PyData theme maintainers could take a look ...
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -141,6 +141,9 @@ def visit_Attribute(self, node: ast.Attribute) -> str: return "%s.%s" % (self.visit(node.value), node.attr) def visit_BinOp(self, node: ast.BinOp) -> str: + # Special...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -452,6 +452,33 @@ def test_pyfunction_signature_full(app): [desc_sig_name, pending_xref, "str"])])]) +def test_pyfunction_with_unary_...
["tests/test_domain_py.py::test_pyfunction_with_unary_operators", "tests/test_domain_py.py::test_pyfunction_with_binary_operators", "tests/test_pycode_ast.py::test_unparse[~1-~1]", "tests/test_pycode_ast.py::test_unparse[a**b-a**b]", "tests/test_pycode_ast.py::test_unparse[+a-+a]", "tests/test_pycode_ast.py::test_unpar...
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f...
null
true
2022-06-14T09:27:19Z
1
9
7
1,811
0
0.8
1
0.7
1
0.331833
85.6455
3,303
swe_bench::test::2138
swe_bench
test
2,138
sympy__sympy-17809
sympy/sympy
sympy/sympy
python
21183076095704d7844a832d2e7f387555934f0c
Modified is_positive for cosh function Fixes #11721. `cosh(x).is_positive` returns `True` if x is real. Also modified the `Abs` function to return the function itself or its negative if the function is positive or negative. Example: ``` In [1]: r=symbols('r',real=True) In [2]: abs(cosh(x)) Out[2]: │cosh(x)│ In [3]:...
I think to make it work in general `cosh(x).is_positive` should be True. It's strange that simplify works. It must be attempting some rewrites that cause it to reduce (like `rewrite(exp)`).
diff --git a/sympy/functions/elementary/hyperbolic.py b/sympy/functions/elementary/hyperbolic.py --- a/sympy/functions/elementary/hyperbolic.py +++ b/sympy/functions/elementary/hyperbolic.py @@ -8,6 +8,11 @@ from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.elementary.integers import floo...
diff --git a/sympy/functions/elementary/tests/test_hyperbolic.py b/sympy/functions/elementary/tests/test_hyperbolic.py --- a/sympy/functions/elementary/tests/test_hyperbolic.py +++ b/sympy/functions/elementary/tests/test_hyperbolic.py @@ -1097,6 +1097,29 @@ def test_cosh_expansion(): assert cosh(3*x).expand(trig=T...
["test_cosh_positive", "test_cosh_nonnegative"]
["test_sinh", "test_sinh_series", "test_sinh_fdiff", "test_cosh", "test_cosh_series", "test_cosh_fdiff", "test_tanh", "test_tanh_series", "test_tanh_fdiff", "test_coth", "test_coth_series", "test_coth_fdiff", "test_csch", "test_csch_series", "test_csch_fdiff", "test_sech", "test_sech_series", "test_sech_fdiff", "test_a...
null
true
2019-10-27T18:14:04Z
1
56
2
871
0
0.8
1
0.7
1
0.331833
85.6455
3,304
swe_bench::test::1737
swe_bench
test
1,737
sphinx-doc__sphinx-10451
sphinx-doc/sphinx
sphinx-doc/sphinx
python
195e911f1dab04b8ddeacbe04b7d214aaf81bb0b
Fix duplicated *args and **kwargs with autodoc_typehints Fix duplicated *args and **kwargs with autodoc_typehints ### Bugfix - Bugfix ### Detail Consider this ```python class _ClassWithDocumentedInitAndStarArgs: """Class docstring.""" def __init__(self, x: int, *args: int, **kwargs: int) -> None: """...
I noticed this docstring causes warnings because `*` and `**` are considered as mark-up symbols: ``` def __init__(self, x: int, *args: int, **kwargs: int) -> None: """Init docstring. :param x: Some integer :param *args: Some integer :param **kwargs: Some integer ""...
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 @@ -115,7 +115,15 @@ def modify_field_list(node: nodes.field_list, annotations: Dict[str, str], if name == 'return': continue - arg = ...
diff --git a/tests/roots/test-ext-autodoc/target/typehints.py b/tests/roots/test-ext-autodoc/target/typehints.py --- a/tests/roots/test-ext-autodoc/target/typehints.py +++ b/tests/roots/test-ext-autodoc/target/typehints.py @@ -94,8 +94,10 @@ def missing_attr(c, class _ClassWithDocumentedInit: """Class docstring."...
["tests/test_ext_napoleon_docstring.py::test_napoleon_and_autodoc_typehints_description_all", "tests/test_ext_napoleon_docstring.py::test_napoleon_and_autodoc_typehints_description_documented_params"]
["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-05-15T11:49:39Z
1
20
2
1,570
0
0.8
1
0.7
1
0.328333
85.635
3,305
swe_bench::test::956
swe_bench
test
956
matplotlib__matplotlib-17810
matplotlib/matplotlib
matplotlib/matplotlib
python
d29056c492dbf8067f2a60b0d920e18c4a892116
animation.save and fig.savefig interfere with each other and raise StopIteration The following code snippet raises StopIteration: ``` python import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation fig, ax = plt.subplots() plt.plot([1,2,3],[2,4,3]) def update(frame): return [] animation = FuncAn...
Looks like this basically comes from trying to re-draw() a figure hosting an non-repeating animation, after the animation has finished running (tbh it's not clear to me what the semantics should be). In the OP's example this comes from savefig() returning to the event loop, but this can be triggered with a single figu...
diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -1666,8 +1666,21 @@ def _init_draw(self): # For blitting, the init_func should return a sequence of modified # artists. if self._init_func is None: - ...
diff --git a/lib/matplotlib/tests/test_animation.py b/lib/matplotlib/tests/test_animation.py --- a/lib/matplotlib/tests/test_animation.py +++ b/lib/matplotlib/tests/test_animation.py @@ -359,3 +359,36 @@ def animate(i): with pytest.raises(RuntimeError): animation.FuncAnimation(fig, animate, blit=True) +...
["lib/matplotlib/tests/test_animation.py::test_exhausted_animation", "lib/matplotlib/tests/test_animation.py::test_no_frame_warning"]
["lib/matplotlib/tests/test_animation.py::test_null_movie_writer", "lib/matplotlib/tests/test_animation.py::test_animation_delete[anim0]", "lib/matplotlib/tests/test_animation.py::test_movie_writer_dpi_default", "lib/matplotlib/tests/test_animation.py::test_animation_repr_html[anim0-none-None-ffmpeg]", "lib/matplotlib/...
null
true
2020-07-01T02:07:46Z
1
17
2
1,614
0
0.8
1
0.7
1
0.325667
85.627
3,306
swe_bench::dev::211
swe_bench
dev
211
sqlfluff__sqlfluff-4151
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
dc59c2a5672aacedaf91f0e6129b467eefad331b
--disable_progress_bar Flag Broken for Fix ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened I ran `sqlfluff fix ${target} --dialect ansi --disable_progress_bar --force` on version 1.4.0 and got an error with exit code 2...
Looks like #3904 made `lint` work with both but updated `fix` to only accept `--disable-progress-bar`. I assume that was by accident. Should be relatively straightforward to fix by updating to match `lint`. Looks like #3904 made `lint` work with both but updated `fix` to only accept `--disable-progress-bar`. I assume ...
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 @@ -680,7 +680,7 @@ def do_fixes(lnt, result, formatter=None, **kwargs): return False # pragma: no cover -@cli.command() +@cli.command(cls=DeprecatedOptionsCommand) @...
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 @@ -1775,6 +1775,46 @@ def test_cli_lint_enabled_progress_bar_multiple_files( assert r"\rrule L001:" in raw_output assert r"\rrule L049:" in raw_output + def test_cli...
["test/cli/commands_test.py::TestProgressBars::test_cli_fix_disabled_progress_bar_deprecated_option"]
["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_no_dialect", "test/cli/commands_test.py::test__cli__command_parse_error_dialect_explicit_warning", "test/cli/commands_test.py::test__cli__command_parse_error...
null
true
2022-12-11T16:33:31Z
1
5
1
2,802
0
0.8
1
0.85
0.8
0.483667
85.626
3,307
swe_bench::test::1722
swe_bench
test
1,722
sphinx-doc__sphinx-10048
sphinx-doc/sphinx
sphinx-doc/sphinx
python
d417b0ab8399810079cdafddc6ebaa46a6a85036
Change "Permalink to this headline" to use "heading" instead ### Describe the bug Sphinx-generated tooltips for headings use "Headline" instead of "Heading". Picking out of https://ell.stackexchange.com/questions/196585/headline-vs-heading-vs-header: > "Headline" is normally used when an article appears as one of a ...
FWIW, "Link to this heading" would be a better name IMO -- even though it's a more "drastic" rephrasing. :) +1; Reasonable. Could you make a PR, please? Then I'll merge this into the master branch. Note: To keep the message translated, it would be better to change it in the major release. > FWIW, "Link to this hea...
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -434,12 +434,12 @@ def depart_title(self, node: Element) -> None: node.parent.hasattr('ids') and node.parent['ids']): # add permalink anchor if close_tag.starts...
diff --git a/tests/test_build_html.py b/tests/test_build_html.py --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1664,7 +1664,7 @@ def test_html_permalink_icon(app): assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" ' 'href="#the-basic-sphinx-documentatio...
["tests/test_build_html.py::test_html_permalink_icon"]
["tests/test_build_html.py::test_html_warnings", "tests/test_build_html.py::test_html4_output", "tests/test_build_html.py::test_html5_output[images.html-expect0]", "tests/test_build_html.py::test_html5_output[images.html-expect1]", "tests/test_build_html.py::test_html5_output[images.html-expect2]", "tests/test_build_ht...
null
true
2022-01-02T13:03:00Z
2
8
1
1,784
0
0.8
1
0.7
1
0.324
85.622
3,308
swe_bench::test::1098
swe_bench
test
1,098
matplotlib__matplotlib-25785
matplotlib/matplotlib
matplotlib/matplotlib
python
950d0db55ac04e663d523144882af0ec2d172420
automatic papersize selection by ps backend is almost certainly broken No minimal example, but the relevant chunk (`backend_ps.py`) is ```python papersize = {'letter': (8.5,11), 'legal': (8.5,14), 'ledger': (11,17), 'a0': (33.11,46.81), 'a1': (23.39,33.11), ...
Currently the code looks like: https://github.com/matplotlib/matplotlib/blob/9caa261595267001d75334a00698da500b0e4eef/lib/matplotlib/backends/backend_ps.py#L80-L85 so slightly different sorting. I guess that `sorted(papersize.items(), key=lambda v: v[1])` will be better as it gives: ``` {'a10': (1.02, 1.46), 'b1...
diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -867,18 +867,24 @@ def _print_figure( # find the appropriate papertype width, height = self.figure.get_size_inches() ...
diff --git a/lib/matplotlib/tests/test_backend_ps.py b/lib/matplotlib/tests/test_backend_ps.py --- a/lib/matplotlib/tests/test_backend_ps.py +++ b/lib/matplotlib/tests/test_backend_ps.py @@ -336,3 +336,12 @@ def test_colorbar_shift(tmp_path): norm = mcolors.BoundaryNorm([-1, -0.5, 0.5, 1], cmap.N) plt.scatter...
["lib/matplotlib/tests/test_backend_ps.py::test_auto_papersize_deprecation"]
["lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps-portrait]", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps-landscape]", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[eps-portrait]",...
null
true
2023-04-28T02:15:05Z
2
48
1
981
0
0.8
1
0.7
1
0.3235
85.6205
3,309
swe_bench::test::1092
swe_bench
test
1,092
matplotlib__matplotlib-25667
matplotlib/matplotlib
matplotlib/matplotlib
python
7d7f6da20ef11afb8eed37bce32286ad4ec43431
[Bug]: bar/barh don't trigger datetime units ### Bug summary `bar/h` doesn't check the units of bottom/left parameters to see if the axis needs a different converter. ### Code for reproduction ```python import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots() start = np.array([np.datetime64('2012...
The unit conversion is done here: https://github.com/matplotlib/matplotlib/blob/bff46815c9b6b2300add1ed25f18b3d788b816de/lib/matplotlib/axes/_axes.py#L2392-L2401 However, this seems to be checking the units for width/length which doesn't seem correct - I suspect it should be checking the units for *bottom*/*left*, o...
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 @@ -2285,12 +2285,21 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", height : float or array-like The height(s) of the bars. + ...
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1909,6 +1909,22 @@ def test_bar_timedelta(): (10, 20)) +def test_bar_datetime_start(): + """test that tickers are correct for ...
["lib/matplotlib/tests/test_axes.py::test_bar_datetime_start"]
["lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/test...
null
true
2023-04-12T04:03:44Z
1
28
1
1,373
0
0.8
1
0.7
1
0.322167
85.6165
3,310
swe_bench::test::1384
swe_bench
test
1,384
pytest-dev__pytest-10893
pytest-dev/pytest
pytest-dev/pytest
python
22524046cff84c66f128da9e3cdb993082445c75
Use of `rmtree` causes `DeprecationWarning` on Python 3.12 alpha The current Python 3.12 alpha has made a change to `rmtree` https://github.com/python/cpython/issues/102828, deprecating the `onerror` parameter and replacing it with an `onexc` parameter. Something in Pytest's temp path fixtures calls an `rm_rf` function...
Thanks @masklinn, appreciate the report.
diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -6,6 +6,7 @@ import os import shutil import sys +import types import uuid import warnings from enum import Enum @@ -28,6 +29,8 @@ from typing import Iterator from typing import Optional fro...
diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -512,20 +512,20 @@ def test_on_rm_rf_error(self, tmp_path: Path) -> None: # unknown exception with pytest.warns(pytest.PytestWarning): - exc_info1 = (None, RuntimeErro...
["testing/test_tmpdir.py::TestRmRf::test_on_rm_rf_error"]
["testing/test_tmpdir.py::TestTmpPathHandler::test_mktemp", "testing/test_tmpdir.py::TestTmpPathHandler::test_tmppath_relative_basetemp_absolute", "testing/test_tmpdir.py::test_get_user_uid_not_found", "testing/test_tmpdir.py::TestNumberedDir::test_make", "testing/test_tmpdir.py::TestNumberedDir::test_cleanup_lock_crea...
null
true
2023-04-11T10:10:51Z
2
35
1
1,220
0
0.8
1
0.7
1
0.32
85.61
3,311
swe_bench::dev::98
swe_bench
dev
98
pydicom__pydicom-1555
pydicom/pydicom
pydicom/pydicom
python
9db89e1d8f5e82dc617f9c8cbf303fe23a0632b9
Converting Dicom image to Png **Describe the issue** hi, i am trying to convert Dicom image to png but in case of some particular file i am getting this "list out of range error". **Expected behavior** dicom image converted to png pne **Steps To Reproduce** How to reproduce the issue. Please include: 1. A minimum wor...
``` Traceback (most recent call last): File "pyd1554.py", line 29, in <module> img = read_xray('datasets/pyd1554.dcm') File "...pyd1554.py", line 14, in read_xray data = apply_voi_lut(dicom.pixel_array, dicom) File ".../pydicom/pixel_data_handlers/util.py", line 348, in apply_voi_lut ds.VOILUTS...
diff --git a/pydicom/dataset.py b/pydicom/dataset.py --- a/pydicom/dataset.py +++ b/pydicom/dataset.py @@ -1488,7 +1488,7 @@ def _convert_pixel_data_without_handler(self) -> None: possible_handlers = [ hh for hh in pydicom.config.pixel_data_handlers if hh is not None - and ...
diff --git a/pydicom/tests/test_handler_util.py b/pydicom/tests/test_handler_util.py --- a/pydicom/tests/test_handler_util.py +++ b/pydicom/tests/test_handler_util.py @@ -890,6 +890,10 @@ def test_unchanged(self): out = apply_modality_lut(arr, ds) assert arr is out + ds.ModalityLUTSequence = ...
["pydicom/tests/test_handler_util.py::TestNumpy_ModalityLUT::test_unchanged", "pydicom/tests/test_handler_util.py::TestNumpy_ApplyVOI::test_unchanged", "pydicom/tests/test_handler_util.py::TestNumpy_ApplyVOILUT::test_unchanged"]
["pydicom/tests/test_handler_util.py::TestNumpy_PixelDtype::test_unknown_pixel_representation_raises", "pydicom/tests/test_handler_util.py::TestNumpy_PixelDtype::test_unknown_bits_allocated_raises", "pydicom/tests/test_handler_util.py::TestNumpy_PixelDtype::test_unsupported_dtypes", "pydicom/tests/test_handler_util.py:...
null
true
2021-12-29T08:49:15Z
7
58
3
2,652
0
0.8
1
1
0.6
0.635333
85.606
3,312
swe_bench::test::2151
swe_bench
test
2,151
sympy__sympy-18168
sympy/sympy
sympy/sympy
python
80a00842e7164f7865d0933306a94d33ad7ca602
Are `is_closed, is_open` of `S.Rationals`'s properties valid? currently, there properties `is_closed, is_open` aren't initialized . ```python from sympy import S S.Rationals.is_closed, S.Rationals.is_open > True, None ``` if there properties are thought wheather Q(S.Rationals) is open or closed set in R (S.Reals), s...
Generally in SymPy `is_` properties return fuzzy-bools which use 3-way logic: True, False or None. None means that the the answer to the question is not known. Often that is because the code to answer the question has not been written/implemented. Right now the `is_closed` property returns `self.boundary.is_subset(s...
diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py --- a/sympy/sets/fancysets.py +++ b/sympy/sets/fancysets.py @@ -66,7 +66,7 @@ def __iter__(self): @property def _boundary(self): - return self + return S.Reals class Naturals(with_metaclass(Singleton, Set)): diff --git a/sympy...
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 @@ -29,6 +29,8 @@ def test_naturals(): assert N.intersect(Interval(-5, 5, True, True)) == Range(1, 5) assert N.boundary == N + assert N.is...
["test_naturals", "test_integers", "test_Rationals", "test_NZQRC_unions", "test_is_open"]
["test_naturals0", "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", "test_fun", "test_Reals", "test...
null
true
2019-12-29T16:55:35Z
3
48
5
924
0
0.8
1
0.7
1
0.314
85.592
3,313
swe_bench::test::2181
swe_bench
test
2,181
sympy__sympy-18961
sympy/sympy
sympy/sympy
python
d6417fbb2972861e7f472537bb9cd55ed01afd00
give `digits` a `bits` argument Like `ibin`, I think a `bits` argument could be added to `digits` so the length would be padded with 0s if necessary to reach the given bit length: ```diff diff --git a/sympy/ntheory/digits.py b/sympy/ntheory/digits.py index 43d4333..20eb630 100644 --- a/sympy/ntheory/digits.py +++ b/sym...
I don't think that it is necessarily needed because zero padding can be completely done after getting the digits. If it introduces more efficiency of doing this, it can be fine, but I don't think that your given example is different than just padding posteriori. Though if this makes it more convenient or consistent ...
diff --git a/sympy/ntheory/digits.py b/sympy/ntheory/digits.py --- a/sympy/ntheory/digits.py +++ b/sympy/ntheory/digits.py @@ -6,7 +6,7 @@ from sympy.utilities.iterables import multiset, is_palindromic as _palindromic -def digits(n, b=10): +def digits(n, b=10, digits=None): """ Return a list of the digit...
diff --git a/sympy/ntheory/tests/test_digits.py b/sympy/ntheory/tests/test_digits.py --- a/sympy/ntheory/tests/test_digits.py +++ b/sympy/ntheory/tests/test_digits.py @@ -1,5 +1,7 @@ from sympy.ntheory import count_digits, digits, is_palindromic +from sympy.testing.pytest import raises + def test_digits(): a...
["test_digits"]
["test_count_digits"]
null
true
2020-03-26T05:54:21Z
1
47
1
913
0
0.8
1
0.7
1
0.308833
85.5765
3,314
swe_bench::test::1707
swe_bench
test
1,707
scikit-learn__scikit-learn-26289
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
8521819eecbacb93deb87fce28842680ab1a5301
sklearn.tree.export_text failing when feature_names supplied folks, I'm not sure why this works for ```py import sklearn.tree print(my_feature_names) ['0' '0 trump' '0 trump versus' ... 'zur' 'zur ckhalten' 'zur ckhalten muss'] tree.export_graphviz(clf, out_file=None, max_depth=4, feature_names=my_feature_names) ``` b...
Could you please post a minimal reproducible? (something we can copy paste in its entirety to produce the issue). @NickKanellos From the error message, it seems that the feature names you passed in is an array, but as [documented](https://scikit-learn.org/stable/modules/generated/sklearn.tree.export_graphviz.html), `fe...
diff --git a/sklearn/tree/_export.py b/sklearn/tree/_export.py --- a/sklearn/tree/_export.py +++ b/sklearn/tree/_export.py @@ -16,7 +16,7 @@ import numpy as np -from ..utils.validation import check_is_fitted +from ..utils.validation import check_is_fitted, check_array from ..utils._param_validation import Interva...
diff --git a/sklearn/tree/tests/test_export.py b/sklearn/tree/tests/test_export.py --- a/sklearn/tree/tests/test_export.py +++ b/sklearn/tree/tests/test_export.py @@ -4,6 +4,7 @@ from re import finditer, search from textwrap import dedent +import numpy as np from numpy.random import RandomState import pytest @@...
["sklearn/tree/tests/test_export.py::test_export_text_errors", "sklearn/tree/tests/test_export.py::test_export_text_feature_class_names_array_support[array]"]
["sklearn/tree/tests/test_export.py::test_graphviz_toy", "sklearn/tree/tests/test_export.py::test_graphviz_feature_class_names_array_support[list]", "sklearn/tree/tests/test_export.py::test_graphviz_feature_class_names_array_support[array]", "sklearn/tree/tests/test_export.py::test_graphviz_errors", "sklearn/tree/tests...
null
true
2023-04-27T13:39:27Z
1
43
2
971
0
0.8
1
0.7
1
0.305167
85.5655
3,315
swe_bench::test::1137
swe_bench
test
1,137
mwaskom__seaborn-2946
mwaskom/seaborn
mwaskom/seaborn
python
a1ede5eb82fa09164aff65da03136b7382fd5041
Regression: `pointplot` and `barplot` raise when using a custom estimator This may be related to #2866 . According to `pointplot` (and `barplot`) documentation, the `estimator` can be any callable that maps vector to scalar. However, the following example raises with `'0.12.0.dev0'` on my Windows and Mac machines (and ...
Thanks for reporting, I can reproduce. This is a weird one! I think this is the fundamental issue, and I do not understand what pandas as doing here: ```python def custom_min_asarray(x): return np.asarray(x).min() tips["tip"].agg(custom_min_asarray) ``` ``` 0 1.01 1 1.66 2 3.50 3 3.3...
diff --git a/seaborn/_statistics.py b/seaborn/_statistics.py --- a/seaborn/_statistics.py +++ b/seaborn/_statistics.py @@ -478,7 +478,12 @@ def __init__(self, estimator, errorbar=None, **boot_kws): def __call__(self, data, var): """Aggregate over `var` column of `data` with estimate and error interval."""...
diff --git a/tests/test_statistics.py b/tests/test_statistics.py --- a/tests/test_statistics.py +++ b/tests/test_statistics.py @@ -499,6 +499,15 @@ def test_name_estimator(self, long_df): out = agg(long_df, "x") assert out["x"] == long_df["x"].mean() + def test_custom_func_estimator(self, long_df...
["tests/test_statistics.py::TestEstimateAggregator::test_custom_func_estimator"]
["tests/test_statistics.py::TestKDE::test_gridsize", "tests/test_statistics.py::TestKDE::test_cut", "tests/test_statistics.py::TestKDE::test_clip", "tests/test_statistics.py::TestKDE::test_density_normalization", "tests/test_statistics.py::TestKDE::test_cumulative", "tests/test_statistics.py::TestKDE::test_cached_suppo...
null
true
2022-08-08T10:48:52Z
1
7
1
1,681
0
0.8
1
0.7
1
0.3035
85.5605
3,316
swe_bench::test::1935
swe_bench
test
1,935
sympy__sympy-12270
sympy/sympy
sympy/sympy
python
a79801c044c2b0ed74176e4abc18f4ca2b38ac58
cannot extract_multiplicatively(-2) from (-2*x - 2*y) I think this might be a bug. ```` >>> (2+4*I).extract_multiplicatively(2) # yes 1 + 2*I >>> (-2-4*I).extract_multiplicatively(-1) # yes 2 + 4*I >>> (-2-4*I).extract_multiplicatively(-2) # bug? ```` similarly: ```` >>> (2*x + 4*y + 8).extract_multiplicatively(...
I would like to work on this issue. Please help me to start with it! I do not understand why do we need `elif self.is_positive and quotient.is_negative: return None` in line 1975-76 of `sympy/core/expr.py` ?? As mentioned in the doc of the function `extract_multiplicatively`, If it is to prese...
diff --git a/sympy/core/expr.py b/sympy/core/expr.py --- a/sympy/core/expr.py +++ b/sympy/core/expr.py @@ -11,7 +11,6 @@ from collections import defaultdict - class Expr(Basic, EvalfMixin): """ Base class for algebraic expressions. @@ -1940,6 +1939,8 @@ def extract_multiplicatively(self, c): ...
diff --git a/sympy/core/tests/test_expr.py b/sympy/core/tests/test_expr.py --- a/sympy/core/tests/test_expr.py +++ b/sympy/core/tests/test_expr.py @@ -1012,6 +1012,12 @@ def test_extractions(): assert (sqrt(x)).extract_multiplicatively(x) is None assert (sqrt(x)).extract_multiplicatively(1/x) is None ass...
["test_extractions"]
["test_basic", "test_ibasic", "test_relational_assumptions", "test_relational_noncommutative", "test_basic_nostr", "test_atoms", "test_is_polynomial", "test_is_rational_function", "test_is_algebraic_expr", "test_SAGE1", "test_SAGE2", "test_SAGE3", "test_len", "test_doit", "test_attribute_error", "test_args", "test_nonc...
null
true
2017-03-09T06:53:11Z
1
37
1
1,080
0
0.8
1
0.7
1
0.303333
85.56
3,317
swe_bench::test::1033
swe_bench
test
1,033
matplotlib__matplotlib-24111
matplotlib/matplotlib
matplotlib/matplotlib
python
239386650a2c3a537d36de9cd85d09bd0f6796cf
[ENH]: Default `matplotlib.colormaps[None]` to call `matplotlib.colormaps[matplotlib.rcParams['image.cmap']]`? ### Problem While addressing the `matplotlib.cm.get_cmap` deprecation in 3.6: ``` PendingDeprecationWarning: The get_cmap function will be deprecated in a future version. Use ``matplotlib.colormaps[name]`` i...
If folks agree it's a regression error (& I think it kinda is) the fix is I think add something like ```python if item is None: item = mpl.rcParams['image.cmap'] ``` which is a direct port of the `get_cmap` code https://github.com/matplotlib/matplotlib/blob/a152851669b9df06302d3a133c7413b863f00283/lib/...
diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -61,12 +61,6 @@ class ColormapRegistry(Mapping): r""" Container for colormaps that are known to Matplotlib by name. - .. admonition:: Experimental - - While we expect the API to be fina...
diff --git a/lib/matplotlib/tests/test_colors.py b/lib/matplotlib/tests/test_colors.py --- a/lib/matplotlib/tests/test_colors.py +++ b/lib/matplotlib/tests/test_colors.py @@ -109,6 +109,26 @@ def test_register_cmap(): cm.register_cmap('nome', cmap='not a cmap') +def test_colormaps_get_cmap(): + cr =...
["lib/matplotlib/tests/test_colors.py::test_colormaps_get_cmap"]
["lib/matplotlib/tests/test_colors.py::test_create_lookup_table[5-result0]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[2-result1]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[1-result2]", "lib/matplotlib/tests/test_colors.py::test_resampled", "lib/matplotlib/tests/test_colors.py...
null
true
2022-10-06T22:09:31Z
1
48
1
848
0
0.8
1
0.7
1
0.301333
85.554
3,318
swe_bench::test::1500
swe_bench
test
1,500
scikit-learn__scikit-learn-10428
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
db127bd9693068a5b187d49d08738e690c5c7d98
Add common test to ensure all(predict(X[mask]) == predict(X)[mask]) I don't think we currently test that estimator predictions/transformations are invariant whether performed in batch or on subsets of a dataset. For some fitted estimator `est`, data `X` and any boolean mask `mask` of length `X.shape[0]`, we need: ```p...
Hi, could I take this issue ? sure, it seems right up your alley. thanks!
diff --git a/sklearn/utils/estimator_checks.py b/sklearn/utils/estimator_checks.py --- a/sklearn/utils/estimator_checks.py +++ b/sklearn/utils/estimator_checks.py @@ -226,6 +226,7 @@ def _yield_all_checks(name, estimator): for check in _yield_clustering_checks(name, estimator): yield check yi...
diff --git a/sklearn/utils/tests/test_estimator_checks.py b/sklearn/utils/tests/test_estimator_checks.py --- a/sklearn/utils/tests/test_estimator_checks.py +++ b/sklearn/utils/tests/test_estimator_checks.py @@ -134,6 +134,23 @@ def predict(self, X): return np.ones(X.shape[0]) +class NotInvariantPredict(Bas...
["sklearn/utils/tests/test_estimator_checks.py::test_check_estimator"]
["sklearn/utils/tests/test_estimator_checks.py::test_check_estimator_clones", "sklearn/utils/tests/test_estimator_checks.py::test_check_estimators_unfitted", "sklearn/utils/tests/test_estimator_checks.py::test_check_no_attributes_set_in_init", "sklearn/utils/tests/test_estimator_checks.py::test_check_estimator_pairwise...
null
true
2018-01-08T21:07:00Z
1
53
1
747
0
0.8
1
0.7
1
0.301167
85.5535
3,319
swe_bench::test::1967
swe_bench
test
1,967
sympy__sympy-13286
sympy/sympy
sympy/sympy
python
42136729bb7252803b0b52a8326a33d6e9b1e06a
periodicity(Abs(sin(x)),x) return 2*pi periodicity(Abs(sin(x)),x) returns 2*pi instead of pi ``` >>> from sympy import * >>> x=Symbol('x') >>> periodicity(Abs(sin(x)),x,check=True) 2*pi >>> periodicity(Abs(sin(x)),x) 2*pi ``` #13205 periodicity(x > 2, x) give recursion error and #13207 It fixes issue #13205 it will st...
Can I have this issue ? Note by the docstring we are not guaranteed to get the fundamental period. But of course it would be good to improve the answer if possible. @souravghosh97 Can you add few tests that could justify your changes. @smichr I don't know why this test fails.But the test runs locally [https://travis...
diff --git a/sympy/calculus/util.py b/sympy/calculus/util.py --- a/sympy/calculus/util.py +++ b/sympy/calculus/util.py @@ -328,22 +328,66 @@ def periodicity(f, symbol, check=False): """ from sympy import simplify, lcm_list - from sympy.functions.elementary.trigonometric import TrigonometricFunction + ...
diff --git a/sympy/calculus/tests/test_util.py b/sympy/calculus/tests/test_util.py --- a/sympy/calculus/tests/test_util.py +++ b/sympy/calculus/tests/test_util.py @@ -94,6 +94,14 @@ def test_periodicity(): assert periodicity(exp(x)**sin(x), x) is None assert periodicity(sin(x)**y, y) is None + assert per...
["test_periodicity_check", "test_decompogen"]
["test_continuous_domain", "test_not_empty_in", "test_lcim", "test_AccumBounds", "test_AccumBounds_mul", "test_AccumBounds_div", "test_AccumBounds_func", "test_AccumBounds_pow", "test_comparison_AccumBounds", "test_decompogen_poly"]
null
true
2017-09-09T16:46:34Z
2
66
2
478
0
0.8
1
0.7
1
0.299667
85.549
3,320
swe_bench::test::87
swe_bench
test
87
astropy__astropy-8263
astropy/astropy
astropy/astropy
python
e4bee4aa1b393d128e3df419d3ff91f8de626f37
units: 's / m' and 's / m' are not convertible To paraphrase from https://github.com/PlasmaPy/PlasmaPy/issues/587, exceptions like `astropy.units.core.UnitConversionError: 's / m' and 's / m' are not convertible` (and a few other cases with first, second and third powers of second over meter, curiously) started popping...
Thanks for the details. That commit was part of #7649 . cc @mhvk Here's a more detailed traceback done from 3a478ca2: ```python plasmapy/physics/tests/test_distribution.py:21 (test_astropy) def test_astropy(): v=1*u.m/u.s > Maxwellian_1D(v=v, T=30000 * u.K, particle='e', v_drift=0 * u.m / u.s) ...
diff --git a/astropy/units/core.py b/astropy/units/core.py --- a/astropy/units/core.py +++ b/astropy/units/core.py @@ -2022,8 +2022,10 @@ def __init__(self, scale, bases, powers, decompose=False, "bases must be sequence of UnitBase instances") powers = [validate_power(p) for p in p...
diff --git a/astropy/units/tests/test_units.py b/astropy/units/tests/test_units.py --- a/astropy/units/tests/test_units.py +++ b/astropy/units/tests/test_units.py @@ -807,3 +807,15 @@ def test_unit_summary_prefixes(): assert prefixes == 'No' elif unit.name == 'vox': assert prefixes ==...
["astropy/units/tests/test_units.py::test_raise_to_negative_power"]
["astropy/units/tests/test_units.py::test_getting_started", "astropy/units/tests/test_units.py::test_initialisation", "astropy/units/tests/test_units.py::test_invalid_power", "astropy/units/tests/test_units.py::test_invalid_compare", "astropy/units/tests/test_units.py::test_convert", "astropy/units/tests/test_units.py:...
null
true
2018-12-11T20:02:50Z
1
7
1
1,656
0
0.8
1
0.7
1
0.299333
85.548
3,321
swe_bench::test::1585
swe_bench
test
1,585
scikit-learn__scikit-learn-13221
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
d19a5dcb0444146f0e4c8c444f410b290dcd9b41
gamma='scale' in SVC I believe that setting `gamma='scale'` in `SVC` is not meeting its intended purpose of being invariant to the scale of `X`. Currently, `gamma` is set to `1 / (n_features * X.std())`. However, I believe it should be `1 / (n_features * X.var())`. Rationale: if you scale `X` by 10 you need to scale `...
@amueller proposed std, perhaps in error. Do we need to add another option and make scale disappear? Yes, my bad (I think). I think we can make this a bugfix as this was clearly an error.
diff --git a/sklearn/svm/base.py b/sklearn/svm/base.py --- a/sklearn/svm/base.py +++ b/sklearn/svm/base.py @@ -169,19 +169,19 @@ def fit(self, X, y, sample_weight=None): if self.gamma in ('scale', 'auto_deprecated'): if sparse: - # std = sqrt(E[X^2] - E[X]^2) - X_st...
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 @@ -1710,19 +1710,23 @@ def test_deprecated_grid_search_iid(): depr_message = ("The default of the `iid` par...
["sklearn/svm/tests/test_svm.py::test_oneclass", "sklearn/svm/tests/test_svm.py::test_gamma_scale"]
["sklearn/model_selection/tests/test_search.py::test_validate_parameter_grid_input[0-TypeError-Parameter", "sklearn/model_selection/tests/test_search.py::test_validate_parameter_grid_input[input1-TypeError-Parameter", "sklearn/model_selection/tests/test_search.py::test_validate_parameter_grid_input[input2-TypeError-Par...
null
true
2019-02-22T11:41:40Z
2
22
2
1,342
0
0.8
1
0.7
1
0.297
85.541
3,322
swe_bench::test::1382
swe_bench
test
1,382
pytest-dev__pytest-10624
pytest-dev/pytest
pytest-dev/pytest
python
7421f3bb94df80ff2d131e932223b190f9b6d7b6
`assert a == approx(b)` when `b` is dict containing zero value results in ZeroDivisionError Pytest behaves differently when comparing dictionaries containing zero values compared to lists containing same values pytest==7.2.0 Ubuntu 22.04 ```python import pytest def test_foo_dict(): a = {'foo': 42.0} b = {'fo...
I think I might have figured out what the problem is. Here is a snippet from `def _repr_compare` function of `class ApproxNumpy`, there is a check for when the `other_value` (which is the divisor) is 0.0 https://github.com/pytest-dev/pytest/blob/857e34ef8555c48cb5c44f143a0d6692efb6c60f/src/_pytest/python_api.py#L18...
diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -269,10 +269,16 @@ def _repr_compare(self, other_side: Mapping[object, float]) -> List[str]: max_abs_diff = max( max_abs_diff, abs(approx_value.expe...
diff --git a/testing/python/approx.py b/testing/python/approx.py --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -630,6 +630,19 @@ def test_dict_nonnumeric(self): def test_dict_vs_other(self): assert 1 != approx({"a": 0}) + def test_dict_for_div_by_zero(self, assert_approx_raises_reg...
["testing/python/approx.py::TestApprox::test_dict_for_div_by_zero"]
["testing/python/approx.py::TestApprox::test_error_messages_native_dtypes", "testing/python/approx.py::TestApprox::test_repr_string", "testing/python/approx.py::TestApprox::test_repr_complex_numbers", "testing/python/approx.py::TestApprox::test_bool", "testing/python/approx.py::TestApprox::test_operator_overloading", "...
null
true
2023-01-01T10:54:40Z
1
14
1
1,486
0
0.8
1
0.7
1
0.294333
85.533
3,323
swe_bench::test::2101
swe_bench
test
2,101
sympy__sympy-16862
sympy/sympy
sympy/sympy
python
8ee7fbdc9710d7843c87d22ceab9c8c245654005
Bug in ImageSet I think we should not use `args[0]` [here](https://github.com/sympy/sympy/blob/master/sympy/sets/fancysets.py#L240). Reason : It works fine when `linsolve` returns a non-empty set. But when it returns an empty set, an error is raised. As calling `args[0]` on an empty set raises an `IndexError`. This is...
Ping @aktech > As calling args[0] on an empty set raises an IndexError. A try catch should be used there. > Also, why are we type-casting the set to a list ? It doesn't looks like we should, we are typecasting the first argument of `FiniteSet` returned by `linsolve` which is a `tuple`, & it's unneccesary to typeca...
diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py --- a/sympy/sets/fancysets.py +++ b/sympy/sets/fancysets.py @@ -272,6 +272,7 @@ def _is_multivariate(self): def _contains(self, other): from sympy.matrices import Matrix from sympy.solvers.solveset import solveset, linsolve + f...
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 @@ -101,7 +101,6 @@ def test_image_is_ImageSet(): assert isinstance(imageset(x, sqrt(sin(x)), Range(5)), ImageSet) -@XFAIL def test_halfcircle(...
["test_halfcircle", "test_Range_set"]
["test_naturals", "test_naturals0", "test_integers", "test_ImageSet", "test_image_is_ImageSet", "test_ImageSet_iterator_not_injective", "test_inf_Range_len", "test_range_range_intersection", "test_range_interval_intersection", "test_Integers_eval_imageset", "test_Range_eval_imageset", "test_fun", "test_Reals", "test_Co...
null
true
2019-05-20T05:19:42Z
1
57
2
598
0
0.8
1
0.7
1
0.289667
85.519
3,324
swe_bench::test::1229
swe_bench
test
1,229
pydata__xarray-3976
pydata/xarray
pydata/xarray
python
2c77eb531b6689f9f1d2adbde0d8bf852f1f7362
In-place addition of arrays with the same coords but in a different order I have two DataArrays with the same dimension, but the index is in a different order. Adding them with `A + B` works fine, but the in-place addition fails. #### MCVE Code Sample ```python import numpy as np import xarray as xr n = 5 d1 = np.ar...
Yes, this is unfortunate. The reasoning: https://github.com/pydata/xarray/blob/732b6cd6248ce715da74f3cd7a0e211eaa1d0aa2/xarray/core/dataarray.py#L2618-L2621 It may be possible to at align in some cases (e.g. if the indexes are bijective / one-to-one, or the values are already floats). Or a better error message; even...
diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -54,7 +54,7 @@ from .formatting import format_item from .indexes import Indexes, default_indexes, propagate_indexes from .indexing import is_fancy_indexer -from .merge import PANDAS_TYPES...
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 @@ -1921,9 +1921,9 @@ def test_inplace_math_basics(self): def test_inplace_math_automatic_alignment(self): a = DataArray(range(5), [("x", range(5))]) ...
["xarray/tests/test_dataarray.py::TestDataArray::test_inplace_math_automatic_alignment"]
["xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_get...
null
true
2020-04-16T15:46:56Z
1
13
1
2,616
0.142857
0.8
1
1
1
0.479333
85.518
3,325
swe_bench::dev::107
swe_bench
dev
107
pydicom__pydicom-800
pydicom/pydicom
pydicom/pydicom
python
2f3586b6f67383b1ec0c24c4772e65119c3f5261
The function generate_uid() generates non-conforming “2.25 .” DICOM UIDs #### Description It seems there was already a discussion about this function in the past (#125), but the current implementation generates non-conforming DICOM UIDs when called with prefix ‘none’ to trigger that the function generate_uid() should ...
Thanks for pointing this out - I wasn't aware of that section of the standard. Do you know of a solution that respects the privacy issues pointed out in #125? > By not following the DICOM formatting rule, receiving systems that are processing DICOM instances created with this library are not capable of converting ...
diff --git a/pydicom/uid.py b/pydicom/uid.py --- a/pydicom/uid.py +++ b/pydicom/uid.py @@ -250,19 +250,19 @@ def generate_uid(prefix=PYDICOM_ROOT_UID, entropy_srcs=None): ---------- prefix : str or None The UID prefix to use when creating the UID. Default is the pydicom - root UID '1.2.826.0.1...
diff --git a/pydicom/tests/test_uid.py b/pydicom/tests/test_uid.py --- a/pydicom/tests/test_uid.py +++ b/pydicom/tests/test_uid.py @@ -1,6 +1,8 @@ # Copyright 2008-2018 pydicom authors. See LICENSE file for details. """Test suite for uid.py""" +import uuid + import pytest from pydicom.uid import UID, generate_u...
["pydicom/tests/test_uid.py::TestGenerateUID::test_none"]
["pydicom/tests/test_uid.py::TestGenerateUID::test_generate_uid", "pydicom/tests/test_uid.py::TestGenerateUID::test_entropy_src", "pydicom/tests/test_uid.py::TestGenerateUID::test_entropy_src_custom", "pydicom/tests/test_uid.py::TestGenerateUID::test_none_iterate", "pydicom/tests/test_uid.py::TestUID::test_equality", "...
null
true
2019-02-01T07:12:27Z
1
24
1
1,240
0
0.8
1
0.7
1
0.286667
85.51
3,326
swe_bench::test::2064
swe_bench
test
2,064
sympy__sympy-15635
sympy/sympy
sympy/sympy
python
e2fbe231f48ec768bee63fb4fc54bdf9f31c3bd1
Sets printing issues Some issues with str and srepr printing in sets. Some notes: - The `str` printer should always generate valid Python, which recreates the expression (but may require some variables to be defined). - The `srepr` printer should generate an expression that recreates the expression exactly, using only...
I would like to work on this. @asmeurer Regarding the issue 1 . I find it outputs something else on the sympy live shell . Kindly have a look . > > > str(Interval(0, 1, False)) > > > [0,1] > > > > > > str(Interval(0, 1, True)) > > > (0,1] Also, > > > type(str(Interval(0, 1, False))) > > > <type′str′> > > > > >...
diff --git a/sympy/printing/repr.py b/sympy/printing/repr.py --- a/sympy/printing/repr.py +++ b/sympy/printing/repr.py @@ -82,6 +82,18 @@ def _print_NumberSymbol(self, expr): def _print_Integer(self, expr): return 'Integer(%i)' % expr.p + def _print_Integers(self, expr): + return 'Integers' + ...
diff --git a/sympy/printing/tests/test_repr.py b/sympy/printing/tests/test_repr.py --- a/sympy/printing/tests/test_repr.py +++ b/sympy/printing/tests/test_repr.py @@ -243,15 +243,34 @@ def test_DMP(): assert srepr(ZZ.old_poly_ring(x)([1, 2])) == \ "DMP([1, 2], ZZ, ring=GlobalPolynomialRing(ZZ, Symbol('x')...
["test_Integers", "test_Naturals", "test_Naturals0"]
["test_printmethod", "test_Add", "test_more_than_255_args_issue_10259", "test_Function", "test_Geometry", "test_Singletons", "test_Integer", "test_list", "test_Matrix", "test_empty_Matrix", "test_Rational", "test_Float", "test_Symbol", "test_Symbol_two_assumptions", "test_Symbol_no_special_commutative_treatment", "test...
null
true
2018-12-14T12:14:55Z
1
12
3
1,469
0
0.8
1
0.7
1
0.284833
85.5045
3,327
swe_bench::dev::186
swe_bench
dev
186
sqlfluff__sqlfluff-2625
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
d44c83e7cee923869e3ca6149da4e6d1ad0286eb
Suppress dbt logs and warnings when using --format github-annotation Sometimes, running: ``` sqlfluff lint --format github-annotation --annotation-level failure --nofail ``` Can result in the first couple of output lines being logs which break the annotations, for example: ``` 14:21:42 Partial parse save file not fou...
my workaround was to add `sed -i '/^\[/!d' annotations.json` to the git actions command to delete the extra lines from dbt that were not part of the annotations beginning with `[` Perhaps the better solution here is to add an ability for SQLFluff to write an annotations.json file itself with a command like ``` sqlflu...
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 @@ -6,13 +6,7 @@ import logging import time from logging import LogRecord -from typing import ( - Callable, - Tuple, - NoReturn, - Optional, - List, -) +from t...
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 @@ -798,19 +798,35 @@ def test__cli__command__fix_no_force(rule, fname, prompt, exit_code, fix_exit_co @pytest.mark.parametrize("serialize", ["yaml", "json"]) -def test__cli__command_p...
["test/cli/commands_test.py::test__cli__command_parse_serialize_from_stdin[outfile-yaml]", "test/cli/commands_test.py::test__cli__command_parse_serialize_from_stdin[outfile-json]", "test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-yaml]", "test/cli/commands_test.py::test__cli__command...
["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-02-13T13:24:21Z
1
59
5
529
0
0.8
1
0.7
1
0.284833
85.5045
3,328
swe_bench::test::1606
swe_bench
test
1,606
scikit-learn__scikit-learn-13536
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
c863ed3d57e3b5ceeb4e7e8001c96aad7110c605
improve error message when passing sample_weight to Pipeline Many estimators take a parameter named `sample_weight`. `Pipeline` does not, since it wants its `fit` parameters to be prefixed by the step name with a `__` delimiter: ```pytb >>> from sklearn.pipeline import make_pipeline >>> from sklearn.linear_model impor...
There is some code in gradient boosting that checks for the current error message, so that should be updated to reflect a changed error message too. (Arguably, this should be a TypeError, not a ValueError, since the user has passed the wrong parameter names, but I'm ambivalent to whether we fix that.) I'd like to ta...
diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -1489,7 +1489,9 @@ def fit(self, X, y, sample_weight=None, monitor=None): except TypeError: # regular estimator with...
diff --git a/sklearn/tests/test_pipeline.py b/sklearn/tests/test_pipeline.py --- a/sklearn/tests/test_pipeline.py +++ b/sklearn/tests/test_pipeline.py @@ -1072,3 +1072,10 @@ def test_make_pipeline_memory(): assert len(pipeline) == 2 shutil.rmtree(cachedir) + + +def test_pipeline_param_error(): + clf = ma...
["sklearn/tests/test_pipeline.py::test_pipeline_param_error"]
["sklearn/tests/test_pipeline.py::test_pipeline_init", "sklearn/tests/test_pipeline.py::test_pipeline_init_tuple", "sklearn/tests/test_pipeline.py::test_pipeline_methods_anova", "sklearn/tests/test_pipeline.py::test_pipeline_fit_params", "sklearn/tests/test_pipeline.py::test_pipeline_sample_weight_supported", "sklearn/...
null
true
2019-03-28T08:05:48Z
2
11
1
1,453
0
0.8
1
0.7
1
0.278833
85.4865
3,329
swe_bench::test::2267
swe_bench
test
2,267
sympy__sympy-23117
sympy/sympy
sympy/sympy
python
c5cef2499d6eed024b0db5c792d6ec7c53baa470
sympy.Array([]) fails, while sympy.Matrix([]) works SymPy 1.4 does not allow to construct empty Array (see code below). Is this the intended behavior? ``` >>> import sympy KeyboardInterrupt >>> import sympy >>> from sympy import Array >>> sympy.__version__ '1.4' >>> a = Array([]) Traceback (most recent call last): F...
Technically, `Array([], shape=(0,))` works. It is just unable to understand the shape of `[]`.
diff --git a/sympy/tensor/array/ndim_array.py b/sympy/tensor/array/ndim_array.py --- a/sympy/tensor/array/ndim_array.py +++ b/sympy/tensor/array/ndim_array.py @@ -145,10 +145,12 @@ def __new__(cls, iterable, shape=None, **kwargs): def _parse_index(self, index): if isinstance(index, (SYMPY_INTS, Integer)...
diff --git a/sympy/tensor/array/tests/test_ndim_array.py b/sympy/tensor/array/tests/test_ndim_array.py --- a/sympy/tensor/array/tests/test_ndim_array.py +++ b/sympy/tensor/array/tests/test_ndim_array.py @@ -10,6 +10,11 @@ from sympy.abc import x, y +mutable_array_types = [ + MutableDenseNDimArray, + MutableS...
["test_issue_17851"]
["test_array_negative_indices", "test_issue_18361", "test_issue_20222"]
null
true
2022-02-19T13:15:18Z
1
15
1
1,348
0
0.8
1
0.7
1
0.274667
85.474
3,330
swe_bench::test::1369
swe_bench
test
1,369
pylint-dev__pylint-8799
pylint-dev/pylint
pylint-dev/pylint
python
b9ed113e31c9c938eb5dfb378e8c5b9dea2ff31b
Short circuit if all checks disabled ### Bug description Running "pylint test.py --disable=all" takes more than 3s! ```sh $ touch test.py $ time pylint test.py --disable=all real 0m3.684s user 0m0.000s sys 0m0.015s ``` Running pylint without "disable=all" on a little project (150-lines telegram bot) takes m...
Hello, are you using any particular libraries or code construct ? As it is it's going to be impossible to reproduce. The gpt4free repository was cloned in this project, I added it to ignore in the .pylintrc file. This reduced the running time by only 2 seconds. Checking the file with "\n": ```sh $ echo "\n" > test....
diff --git a/pylint/lint/run.py b/pylint/lint/run.py --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -175,9 +175,11 @@ def __init__( sys.exit(code) return - # Display help messages if there are no files to lint - if not args: - print(linter.help()) + ...
diff --git a/tests/test_self.py b/tests/test_self.py --- a/tests/test_self.py +++ b/tests/test_self.py @@ -212,6 +212,11 @@ def test_nonexistent_config_file(self) -> None: def test_error_missing_arguments(self) -> None: self._runtest([], code=32) + def test_disable_all(self) -> None: + out = S...
["tests/test_self.py::TestRunTC::test_disable_all"]
["tests/test_self.py::TestRunTC::test_pkginfo", "tests/test_self.py::TestRunTC::test_all", "tests/test_self.py::TestRunTC::test_no_ext_file", "tests/test_self.py::TestRunTC::test_w0704_ignored", "tests/test_self.py::TestRunTC::test_exit_zero", "tests/test_self.py::TestRunTC::test_nonexistent_config_file", "tests/test_s...
null
true
2023-06-26T13:57:28Z
1
8
1
1,429
0
0.8
1
0.7
1
0.264833
85.4445
3,331
swe_bench::test::1212
swe_bench
test
1,212
pydata__xarray-3159
pydata/xarray
pydata/xarray
python
e3b3bed2c2e27eb74adc2b7f80c365c2928cd78b
Allow passing a default value (instead of ndarray) for data argument for DataArray Hi, First of all, thanks a lot for the amazing module. It seems when I create a DataArray, I have to pass a numpy.ndarray with a correct size for the `data` argument. It works well when I already have some data, but sometimes I want to ...
Something similar has been mentioned before (https://github.com/pydata/xarray/issues/277). I agree, this would useful. We would definitely welcome contributions if you want to give this a try. +1 on this. Somewhat related to something I started a while back (I cant find the issue): https://github.com/pydata/xarray/blo...
diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -158,6 +158,24 @@ def _infer_coords_and_dims( return new_coords, dims +def _check_data_shape(data, coords, dims): + if data is dtypes.NA: + data = np.nan + if coords is...
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 @@ -1446,6 +1446,32 @@ def test_rename(self): renamed_kwargs = self.dv.x.rename(x="z").rename("z") assert_identical(renamed, renamed_kwargs) + def...
["xarray/tests/test_dataarray.py::TestDataArray::test_init_value"]
["xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_get...
null
true
2019-07-24T06:21:50Z
2
33
1
915
0
0.8
1
0.7
1
0.2625
85.4375
3,332
swe_bench::test::1354
swe_bench
test
1,354
pylint-dev__pylint-6820
pylint-dev/pylint
pylint-dev/pylint
python
b3523ae86eb68467dca536122bc4034639887a63
Using ``--load-plugin`` instead of ``--load-plugins`` in CLI silently fail to load the plugin ### Bug description See [this comment](https://github.com/PyCQA/pylint/issues/6803#issuecomment-1145152401) ``pylint b.py --load-plugins=pylint.extensions.redefined_loop_name`` ``` ************* Module b b.py:5:8: W2901: Red...
Not sure what the best approach is here. We allow abbreviations of arguments as `argparse` behaves differently on <3.8 (I think, but don't pin me on the version) if you don't allow abbreviations. However, `load-plugins` is handled by an `if "load-plugins"` check. So while `argparse` recognises it as the abbreviation o...
diff --git a/pylint/config/utils.py b/pylint/config/utils.py --- a/pylint/config/utils.py +++ b/pylint/config/utils.py @@ -201,16 +201,30 @@ def _enable_all_extensions(run: Run, value: str | None) -> None: PREPROCESSABLE_OPTIONS: dict[ - str, tuple[bool, Callable[[Run, str | None], None]] + str, tuple[bool, ...
diff --git a/tests/config/test_find_default_config_files.py b/tests/config/test_find_default_config_files.py --- a/tests/config/test_find_default_config_files.py +++ b/tests/config/test_find_default_config_files.py @@ -165,6 +165,21 @@ def test_verbose_output_no_config(capsys: CaptureFixture) -> None: asse...
["tests/config/test_find_default_config_files.py::test_verbose_abbreviation"]
["tests/config/test_find_default_config_files.py::test_pylintrc", "tests/config/test_find_default_config_files.py::test_pylintrc_parentdir", "tests/config/test_find_default_config_files.py::test_pylintrc_parentdir_no_package", "tests/config/test_find_default_config_files.py::test_verbose_output_no_config", "tests/confi...
null
true
2022-06-03T07:58:00Z
1
43
1
685
0
0.8
1
0.7
1
0.2575
85.4225
3,333
swe_bench::test::2066
swe_bench
test
2,066
sympy__sympy-15685
sympy/sympy
sympy/sympy
python
9ac430347eb80809a1dd89bbf5dad7ca593bbe63
Make .scale_factor private in the units module * sympy version: 1.3 * Python version: 3.6.6 * Operating System: Win10 ### Description Dividing a Quantity with dimension voltage by a Quantity with dimension current yields ohm/1000 when I expected ohm. In the SI system, 1 V/ 1 A = 1 Ω. ### What I Did ``` >>> from sym...
@asmeurer I want to work on this issue, can you please help? I am understanding the issue but not sure how to fix it. I would like to work on this issue. You are not setting the scale factors of the quantities you define.
diff --git a/sympy/physics/units/definitions.py b/sympy/physics/units/definitions.py --- a/sympy/physics/units/definitions.py +++ b/sympy/physics/units/definitions.py @@ -50,22 +50,13 @@ meter.set_dimension(length) meter.set_scale_factor(One) -# gram; used to define its prefixed units -g = gram = grams = Quantity("...
diff --git a/sympy/physics/units/tests/test_unitsystem.py b/sympy/physics/units/tests/test_unitsystem.py --- a/sympy/physics/units/tests/test_unitsystem.py +++ b/sympy/physics/units/tests/test_unitsystem.py @@ -53,7 +53,7 @@ def test_print_unit_base(): mksa = UnitSystem((m, kg, s, A), (Js,)) with warns_depr...
["test_print_unit_base"]
["test_definition", "test_error_definition", "test_str_repr", "test_extend", "test_dim"]
null
true
2018-12-23T07:13:37Z
1
18
1
1,181
0
0.8
1
0.7
1
0.256833
85.4205
3,334
swe_bench::test::1146
swe_bench
test
1,146
mwaskom__seaborn-3216
mwaskom/seaborn
mwaskom/seaborn
python
557b0d29cdeae9703576f4bb0eb73dd997a1e4a4
Figure title being removed by seaborn objects API when plotting on subfigures I recently came across an odd behaviour with the seaborn objects API when using subfigures. Here is a minimal example : ``` import seaborn as sns import seaborn.objects as so import matplotlib.pyplot as plt fig = plt.figure(constrained_layou...
I can replicate but am a little confused about what's happening. Is there a reason you think that the line you called out is the culprit, or were you just poking around? If you move the suptitle text over to a coordinate like (.98, 1) you can see that it's actually still there is something being plotted over it. And ye...
diff --git a/seaborn/_compat.py b/seaborn/_compat.py --- a/seaborn/_compat.py +++ b/seaborn/_compat.py @@ -149,10 +149,14 @@ def set_layout_engine(fig, engine): if hasattr(fig, "set_layout_engine"): fig.set_layout_engine(engine) else: + # _version_predates(mpl, 3.6) if engine == "tigh...
diff --git a/tests/_core/test_plot.py b/tests/_core/test_plot.py --- a/tests/_core/test_plot.py +++ b/tests/_core/test_plot.py @@ -1133,11 +1133,30 @@ def test_on_axes_with_subplots_error(self): with pytest.raises(RuntimeError, match="Cannot create multiple subplots"): p2.plot() - def test_on...
["tests/_core/test_plot.py::TestPlotting::test_on_layout_algo_default"]
["tests/_core/test_plot.py::TestInit::test_empty", "tests/_core/test_plot.py::TestInit::test_data_only", "tests/_core/test_plot.py::TestInit::test_df_and_named_variables", "tests/_core/test_plot.py::TestInit::test_df_and_mixed_variables", "tests/_core/test_plot.py::TestInit::test_vector_variables_only", "tests/_core/te...
null
true
2023-01-08T23:34:46Z
2
15
1
1,237
0
0.8
1
0.7
1
0.256167
85.4185
3,335
swe_bench::test::1581
swe_bench
test
1,581
scikit-learn__scikit-learn-13143
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
fc65d9ff6ba79c9fb7651a1a690059dc9538e4bc
precision_score shows incorrect value #### Description precision_score shows incorrect value #### Steps/Code to Reproduce >>> A=np.array([[0,0,1],[0,1,0],[0,0,1]]) >>> B=A >>> precision_score(A,B, average=None) array([ 0., 1., 1.]) #### Expected Results array([ 1., 1., 1.]) #### Actual Results array([ 0., 1., ...
You might have expected [nan, 1, 1,] too. We raise a warning to tell you that we will set it to 0. I think the problem is that we do not raise a warning when there's only negative labels. E.g. ```python precision_score([0, 0, 0], [0, 0, 0]) ``` I vote for a warning to tell users that we set precision, recall, fbeta...
diff --git a/sklearn/metrics/classification.py b/sklearn/metrics/classification.py --- a/sklearn/metrics/classification.py +++ b/sklearn/metrics/classification.py @@ -922,6 +922,11 @@ def f1_score(y_true, y_pred, labels=None, pos_label=1, average='binary', >>> f1_score(y_true, y_pred, average=None) array([0.8...
diff --git a/sklearn/metrics/tests/test_classification.py b/sklearn/metrics/tests/test_classification.py --- a/sklearn/metrics/tests/test_classification.py +++ b/sklearn/metrics/tests/test_classification.py @@ -198,6 +198,7 @@ def test_precision_recall_f1_score_binary(): (1 + 2 ** 2) * ps *...
["sklearn/metrics/tests/test_classification.py::test_prf_warnings", "sklearn/metrics/tests/test_classification.py::test_recall_warnings", "sklearn/metrics/tests/test_classification.py::test_precision_warnings", "sklearn/metrics/tests/test_classification.py::test_fscore_warnings"]
["sklearn/metrics/tests/test_classification.py::test_classification_report_dictionary_output", "sklearn/metrics/tests/test_classification.py::test_multilabel_accuracy_score_subset_accuracy", "sklearn/metrics/tests/test_classification.py::test_precision_recall_f1_score_binary", "sklearn/metrics/tests/test_classification...
null
true
2019-02-12T14:41:41Z
1
36
4
808
0
0.8
1
0.7
1
0.254667
85.414
3,336
swe_bench::test::1588
swe_bench
test
1,588
scikit-learn__scikit-learn-13280
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
face9daf045846bb0a39bfb396432c8685570cdd
partial_fit does not account for unobserved target values when fitting priors to data My understanding is that priors should be fitted to the data using observed target frequencies **and a variant of [Laplace smoothing](https://en.wikipedia.org/wiki/Additive_smoothing) to avoid assigning 0 probability to targets not y...
I can reproduce the bug. Thanks for reporting. I will work on the fix.
diff --git a/sklearn/naive_bayes.py b/sklearn/naive_bayes.py --- a/sklearn/naive_bayes.py +++ b/sklearn/naive_bayes.py @@ -460,8 +460,14 @@ def _update_class_log_prior(self, class_prior=None): " classes.") self.class_log_prior_ = np.log(class_prior) elif self.fit_...
diff --git a/sklearn/tests/test_naive_bayes.py b/sklearn/tests/test_naive_bayes.py --- a/sklearn/tests/test_naive_bayes.py +++ b/sklearn/tests/test_naive_bayes.py @@ -18,6 +18,7 @@ from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_greater from sklearn.utils.testing impor...
["sklearn/tests/test_naive_bayes.py::test_mnb_prior_unobserved_targets"]
["sklearn/tests/test_naive_bayes.py::test_gnb", "sklearn/tests/test_naive_bayes.py::test_gnb_prior", "sklearn/tests/test_naive_bayes.py::test_gnb_sample_weight", "sklearn/tests/test_naive_bayes.py::test_gnb_neg_priors", "sklearn/tests/test_naive_bayes.py::test_gnb_priors", "sklearn/tests/test_naive_bayes.py::test_gnb_p...
null
true
2019-02-26T14:08:41Z
1
8
1
1,338
0
0.8
1
0.7
1
0.249667
85.399
3,337
swe_bench::test::1948
swe_bench
test
1,948
sympy__sympy-12881
sympy/sympy
sympy/sympy
python
d2c3800fd3aaa226c0d37da84086530dd3e5abaf
Poly(x,x,y).free_symbols -> {x, y} instead of just {x} No free symbols of generators that don't appear in the expression of the polynomial should appear in the set of free symbols. ``` def free_symbols(poly): free = set() for i in range(len(poly.gens)): for m in poly.monoms(): if i in m: free...
```diff diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py index 9c12741..92e7ca6 100644 --- a/sympy/polys/polytools.py +++ b/sympy/polys/polytools.py @@ -255,7 +255,7 @@ def free_symbols(self): ======== >>> from sympy import Poly - >>> from sympy.abc import x, y + ...
diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py --- a/sympy/polys/polytools.py +++ b/sympy/polys/polytools.py @@ -255,7 +255,7 @@ def free_symbols(self): ======== >>> from sympy import Poly - >>> from sympy.abc import x, y + >>> from sympy.abc import x, y, z ...
diff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py --- a/sympy/polys/tests/test_polytools.py +++ b/sympy/polys/tests/test_polytools.py @@ -468,6 +468,8 @@ def test_Poly_free_symbols(): assert Poly(x**2 + sin(y*z)).free_symbols == {x, y, z} assert Poly(x**2 + sin(y*z), x).fr...
["test_Poly_free_symbols", "test_Poly_ltrim"]
["test_Poly_from_dict", "test_Poly_from_list", "test_Poly_from_poly", "test_Poly_from_expr", "test_Poly__new__", "test_Poly__args", "test_Poly__gens", "test_Poly_zero", "test_Poly_one", "test_Poly__unify", "test_PurePoly_free_symbols", "test_Poly__eq__", "test_PurePoly__eq__", "test_PurePoly_Poly", "test_Poly_get_domai...
null
true
2017-07-03T15:25:50Z
2
51
2
452
0
0.8
1
0.7
1
0.245333
85.386
3,338
swe_bench::test::1728
swe_bench
test
1,728
sphinx-doc__sphinx-10320
sphinx-doc/sphinx
sphinx-doc/sphinx
python
33610201dc7a69859b05381845ae1a11be8f9136
Overridden, overloaded class docstring return type rendered as None ### Describe the bug Some overloaded class definitions show ``None`` as a return type, when there shouldn't be any return type. This seems to happen when the overloaded functions are overridden in the final docstring. A class without this problem is...
This is not related to overloaded constructors. Autodoc automatically fills return value annotation to the signature definitions in the docstring excluding the first entry unexpectedly. So I reproduced this with this class: ``` class Foo: """Foo() Foo(x: int) Foo(x: int, y: int) docstring "...
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 @@ -1580,6 +1580,20 @@ def format_args(self, **kwargs: Any) -> str: return stringify_signature(sig, show_return_annotation=False, **kwargs) + def _find_s...
diff --git a/tests/roots/test-ext-autodoc/target/docstring_signature.py b/tests/roots/test-ext-autodoc/target/docstring_signature.py --- a/tests/roots/test-ext-autodoc/target/docstring_signature.py +++ b/tests/roots/test-ext-autodoc/target/docstring_signature.py @@ -22,10 +22,12 @@ def __init__(self): class E: de...
["tests/test_ext_autodoc_configs.py::test_autoclass_content_and_docstring_signature_init", "tests/test_ext_autodoc_configs.py::test_autoclass_content_and_docstring_signature_both"]
["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-02T05:48:38Z
1
14
2
1,149
0
0.8
1
0.7
1
0.238167
85.3645
3,339
swe_bench::test::1441
swe_bench
test
1,441
pytest-dev__pytest-7373
pytest-dev/pytest
pytest-dev/pytest
python
7b77fc086aab8b3a8ebc890200371884555eea1e
Incorrect caching of skipif/xfail string condition evaluation Version: pytest 5.4.3, current master pytest caches the evaluation of the string in e.g. `@pytest.mark.skipif("sys.platform == 'win32'")`. The caching key is only the string itself (see `cached_eval` in `_pytest/mark/evaluate.py`). However, the evaluation a...
> I think the most appropriate fix is to simply remove the caching, which I don't think is necessary really, and inline cached_eval into MarkEvaluator._istrue. I agree: * While it might have some performance impact with very large test suites which use marks with eval, the simple workaround is to not use the eval...
diff --git a/src/_pytest/mark/evaluate.py b/src/_pytest/mark/evaluate.py --- a/src/_pytest/mark/evaluate.py +++ b/src/_pytest/mark/evaluate.py @@ -10,25 +10,14 @@ from ..outcomes import fail from ..outcomes import TEST_OUTCOME from .structures import Mark -from _pytest.config import Config from _pytest.nodes import...
diff --git a/testing/test_mark.py b/testing/test_mark.py --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -706,6 +706,36 @@ def test_1(parameter): reprec = testdir.inline_run() reprec.assertoutcome(skipped=1) + def test_reevaluate_dynamic_expr(self, testdir): + """#7360""" + ...
["testing/test_mark.py::TestFunctional::test_reevaluate_dynamic_expr"]
["testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[py.test-mark]", "testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[py.test-param]", "testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[pytest-mark]", "testing/test_mark.py::TestMark::test_pytest_exists_in_namespace...
null
true
2020-06-15T17:12:08Z
1
21
1
997
0
0.8
1
0.7
1
0.236167
85.3585
3,340
swe_bench::test::2056
swe_bench
test
2,056
sympy__sympy-15542
sympy/sympy
sympy/sympy
python
495e749818bbcd55dc0d9ee7101cb36646e4277a
Should Point.distance(Line) return distance? In Geometry module, `Line.distance(Point)` can be used to compute distance, but `Point.distance(Line)` cannot. Should this be made symmetric? ``` >>> L = Line((1, 1), (2, 2)) >>> P = Point(1, 0) >>> L.distance(P) sqrt(2)/2 >>> P.distance(L) Traceback (most recent call last):...
It would be natural that `distance` be symmetric. That is not even hard to implement. I think it is right for `distance` to be symmetric . I would like to give this a try .
diff --git a/sympy/geometry/point.py b/sympy/geometry/point.py --- a/sympy/geometry/point.py +++ b/sympy/geometry/point.py @@ -380,19 +380,20 @@ def are_coplanar(cls, *points): points = list(uniq(points)) return Point.affine_rank(*points) <= 2 - def distance(self, p): - """The Euclidean di...
diff --git a/sympy/geometry/tests/test_point.py b/sympy/geometry/tests/test_point.py --- a/sympy/geometry/tests/test_point.py +++ b/sympy/geometry/tests/test_point.py @@ -33,6 +33,7 @@ def test_point(): p3 = Point(0, 0) p4 = Point(1, 1) p5 = Point(0, 1) + line = Line(Point(1,0), slope = 1) asse...
["test_point"]
["test_point3D", "test_Point2D", "test_issue_9214", "test_issue_11617", "test_transform", "test_concyclic_doctest_bug", "test_arguments", "test_unit", "test_dot", "test__normalize_dimension"]
null
true
2018-11-24T07:31:00Z
1
38
1
649
0
0.8
1
0.7
1
0.234833
85.3545
3,341
swe_bench::test::1796
swe_bench
test
1,796
sphinx-doc__sphinx-7930
sphinx-doc/sphinx
sphinx-doc/sphinx
python
2feb0b43b64012ac982a9d07af85002b43b59226
Regression: autodoc Dataclass variables reference target not found **Describe the bug** When I use `sphinx.ext.autodoc` and `nitpicky = True` with my code which includes a dataclass with a variable of a custom type, I get a warning. **To Reproduce** Open the attached project [sphinx-example.zip](https://github.com/s...
Thank you for reporting. Note: Internally, the autodoc generates the following code: ``` .. py:module:: example .. py:class:: Report(status: example.Statuses) :module: example .. py:attribute:: Report.status :module: example :type: Statuses .. py:class:: Statuses() :module...
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -77,18 +77,24 @@ ('deprecated', bool)]) -def type_to_xref(text: str) -> addnodes.pending_xref: +def type_to_xref(text: str, env: BuildEnvironmen...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -236,18 +236,18 @@ def test_get_full_qualified_name(): assert domain.get_full_qualified_name(node) == 'module1.Class.func' -def test_parse_annotation(): - doctree = _parse_annotation...
["tests/test_domain_py.py::test_parse_annotation", "tests/test_domain_py.py::test_pydata", "tests/test_domain_py.py::test_pyattribute"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam...
null
true
2020-07-08T16:50:21Z
1
32
3
761
0
0.8
1
0.7
1
0.2335
85.3505
3,342
swe_bench::test::1776
swe_bench
test
1,776
sphinx-doc__sphinx-7578
sphinx-doc/sphinx
sphinx-doc/sphinx
python
d59584f4096c75af4a94fb2bf70974039f7af0bb
BUG: Autosummary links broken in master As of commit e5192ba48b45576e636e7dce82ad9183051443ed (according to `git bisect`) sphinx-gallery builds of a [simple test](https://github.com/sphinx-gallery/sphinx-gallery/tree/master/sphinx_gallery/tests/tinybuild) are failing where references to objects are no longer usable: ``...
I have reconfirmed that e5192ba48b45576e636e7dce82ad9183051443ed causes the bug. Before that commit I get no warnings and: ![Screenshot from 2020-04-27 11-01-04](https://user-images.githubusercontent.com/2365790/80387480-b0af0500-8876-11ea-8b98-01a76fe425f9.png) After that commit: ![Screenshot from 2020-04-27 ...
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -156,22 +156,19 @@ def exists(self, template_name: str) -> bool: except TemplateNotFound: return False - def render(self, o...
diff --git a/tests/roots/test-ext-autosummary-template/_templates/empty.rst b/tests/roots/test-ext-autosummary-template/_templates/empty.rst new file mode 100644 --- /dev/null +++ b/tests/roots/test-ext-autosummary-template/_templates/empty.rst @@ -0,0 +1 @@ +EMPTY diff --git a/tests/roots/test-ext-autosummary-template...
["tests/test_ext_autosummary.py::test_autosummary_template"]
["tests/test_ext_autosummary.py::test_mangle_signature", "tests/test_ext_autosummary.py::test_escaping", "tests/test_ext_autosummary.py::test_autosummary_generate", "tests/test_ext_autosummary.py::test_autosummary_generate_overwrite1", "tests/test_ext_autosummary.py::test_autosummary_generate_overwrite2", "tests/test_e...
null
true
2020-04-29T15:02:50Z
1
20
1
995
0
0.8
1
0.7
1
0.2325
85.3475
3,343
swe_bench::test::2135
swe_bench
test
2,135
sympy__sympy-17696
sympy/sympy
sympy/sympy
python
fed3bb83dec834bd75fd8bcd68fc0c31387f394a
Refine with sign Consider the following code: ``` from sympy import * x = Symbol('x', real = True) expr = sign(x) expr2 = refine(expr, Q.positive(x)) expr3 = refine(expr, Q.positive(x) & Q.nonzero(x)) expr4 = refine(expr, Q.positive(x + 1)) ``` All the returned expression are `sign(x)`. However, at least for `expr3` a...
I would like to work on this issue. Can someone guide me on exactly what has to be done? @kmm555 you can write a function in `refine.py` similar to `refine_abs()`, which returns `0` if the argument is equal to `0`, `1` if positive and so on (see the possible output of `sign` in `complexes.py`
diff --git a/sympy/assumptions/refine.py b/sympy/assumptions/refine.py --- a/sympy/assumptions/refine.py +++ b/sympy/assumptions/refine.py @@ -291,6 +291,47 @@ def _refine_reim(expr, assumptions): return None +def refine_sign(expr, assumptions): + """ + Handler for sign + + Examples + ======== + + ...
diff --git a/sympy/assumptions/tests/test_refine.py b/sympy/assumptions/tests/test_refine.py --- a/sympy/assumptions/tests/test_refine.py +++ b/sympy/assumptions/tests/test_refine.py @@ -1,8 +1,10 @@ from sympy import (Abs, exp, Expr, I, pi, Q, Rational, refine, S, sqrt, - atan, atan2, nan, Symbol, r...
["test_sign"]
["test_Abs", "test_pow1", "test_pow2", "test_exp", "test_Relational", "test_Piecewise", "test_atan2", "test_re", "test_im", "test_complex", "test_func_args", "test_eval_refine"]
null
true
2019-10-03T22:21:40Z
1
44
1
506
0
0.8
1
0.7
1
0.231
85.343
3,344
swe_bench::test::1038
swe_bench
test
1,038
matplotlib__matplotlib-24250
matplotlib/matplotlib
matplotlib/matplotlib
python
f6e75121e11b6ba918c5f6e5c2cc1b9f4fccc8b0
[Bug]: pick events do not forward mouseevent-key on Linux ### Bug summary Somehow on `CentOS Linux 7` keyboard-buttons are not forwarded with `pick_events`... on `Windows 10` everything works as expected. ### Code for reproduction ```python import matplotlib.pyplot as plt f, ax = plt.subplots() s = ax.scatter([1,2,...
(As I have some issues with my Qt install, I tried it with tk and wx and get None for both types of events... Also on CentOS 7.) @oscargus Thanks for the response! That's even worse 😅 Do you have any idea what's going on here? (as far as I know this is the correct way of determining if a key is pressed while a mou...
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2445,10 +2445,6 @@ def __init__(self, # pickling. self._canvas_callbacks = cbook.CallbackRegistry( signals=FigureCanvasBase.events) - self._button_pick...
diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -2,7 +2,7 @@ from matplotlib import path, transforms from matplotlib.backend_bases import ( - FigureCanvasBase,...
["lib/matplotlib/tests/test_backend_bases.py::test_pick"]
["lib/matplotlib/tests/test_backend_bases.py::test_uses_per_path", "lib/matplotlib/tests/test_backend_bases.py::test_canvas_ctor", "lib/matplotlib/tests/test_backend_bases.py::test_get_default_filename", "lib/matplotlib/tests/test_backend_bases.py::test_canvas_change", "lib/matplotlib/tests/test_backend_bases.py::test_...
null
true
2022-10-22T09:52:56Z
1
6
1
1,263
0
0.8
1
0.7
1
0.2305
85.3415
3,345
swe_bench::test::1972
swe_bench
test
1,972
sympy__sympy-13364
sympy/sympy
sympy/sympy
python
d11087e1faa1296c8cdac5dfff0e28879534ffcc
Ternary pow() ``` According to http://docs.python.org/release/2.5.2/ref/numeric-types.html , __pow__ should define a third, optional argument to work with ternary pow(). We should do that for at least Integer, though it would be cool to do it for arbitrary expressions (this will require Mod from issue 5589 , and also ...
``` Issue 2728 has been merged into this issue. ``` Original comment: http://code.google.com/p/sympy/issues/detail?id=2616#c1 Original author: https://code.google.com/u/101069955704897915480/ ``` **Status:** Valid ``` Original comment: http://code.google.com/p/sympy/issues/detail?id=2616#c2 Original author: https...
diff --git a/sympy/core/expr.py b/sympy/core/expr.py --- a/sympy/core/expr.py +++ b/sympy/core/expr.py @@ -146,9 +146,26 @@ def __rmul__(self, other): @_sympifyit('other', NotImplemented) @call_highest_priority('__rpow__') - def __pow__(self, other): + def _pow(self, other): return Pow(self, ...
diff --git a/sympy/core/tests/test_arit.py b/sympy/core/tests/test_arit.py --- a/sympy/core/tests/test_arit.py +++ b/sympy/core/tests/test_arit.py @@ -187,6 +187,19 @@ def test_pow3(): assert sqrt(2)**3 == sqrt(8) +def test_mod_pow(): + for s, t, u, v in [(4, 13, 497, 445), (4, -3, 497, 365), + (...
["test_mod_pow"]
["test_bug1", "test_Symbol", "test_arit0", "test_div", "test_pow", "test_pow2", "test_pow3", "test_pow_E", "test_pow_issue_3516", "test_pow_im", "test_real_mul", "test_ncmul", "test_ncpow", "test_powerbug", "test_Mul_doesnt_expand_exp", "test_Add_Mul_is_integer", "test_Add_Mul_is_finite", "test_Mul_is_even_odd", "test_...
null
true
2017-09-28T14:14:40Z
1
19
1
999
0
0.8
1
0.7
1
0.229833
85.3395
3,346
swe_bench::test::17
swe_bench
test
17
astropy__astropy-13162
astropy/astropy
astropy/astropy
python
78c4ac119a182eee14cb3761e0dc9ea0e59b291f
Angle bug for (d, m, s) tuple input (deprecate dms_to_degrees) `Angle` does not handle the sign correctly for a `(d, m, s)` tuple input if `d=0`: ```python >>> from astropy.coordinates import Angle >>> ang = Angle((-0, -42, -17), unit='deg') >>> print(ang) 0d42m17s >>> print(ang.dms) dms_tuple(d=0.0, m=42.0, s=16.9999...
Hi @larrybradley and others, I am recently working on this issue. In the process.. I cannot find the definition of namedtuple() I don't know yet whether it is a class or function. Please help me here. I came to know that the namedtuple is from python collections module.
diff --git a/astropy/coordinates/angle_formats.py b/astropy/coordinates/angle_formats.py --- a/astropy/coordinates/angle_formats.py +++ b/astropy/coordinates/angle_formats.py @@ -27,6 +27,7 @@ IllegalMinuteWarning, IllegalMinuteError, IllegalSecondWarning, IllegalSecondError)...
diff --git a/astropy/coordinates/tests/test_angles.py b/astropy/coordinates/tests/test_angles.py --- a/astropy/coordinates/tests/test_angles.py +++ b/astropy/coordinates/tests/test_angles.py @@ -36,19 +36,18 @@ def test_create_angles(): a4 = Angle("54.12412 deg") a5 = Angle("54.12412 degrees") a6 = Angle...
["astropy/coordinates/tests/test_angles.py::test_create_angles", "astropy/coordinates/tests/test_angles.py::test_radec", "astropy/coordinates/tests/test_angles.py::test_create_tuple", "astropy/coordinates/tests/test_arrays.py::test_hms"]
["astropy/coordinates/tests/test_angles.py::test_angle_from_view", "astropy/coordinates/tests/test_angles.py::test_angle_ops", "astropy/coordinates/tests/test_angles.py::test_angle_methods", "astropy/coordinates/tests/test_angles.py::test_angle_convert", "astropy/coordinates/tests/test_angles.py::test_angle_formatting"...
null
true
2022-04-22T18:22:32Z
2
24
4
893
0
0.8
1
0.7
1
0.228833
85.3365
3,347
swe_bench::test::2203
swe_bench
test
2,203
sympy__sympy-20134
sympy/sympy
sympy/sympy
python
a24d96d03eccee7f0bdb3d97017d5bebc79f9b47
lambdify does not evaluate integrals ``` from master at 9. November: In [5]: expr = integrate(1/sqrt(x**2+x), (x, 1, y)) In [6]: func = lambdify([y], expr) In [7]: func(2) ValueError: Symbolic value, can't compute See also issue 4470 and issue 4471 ``` Original issue for #5932: http://code.google.com/p/sympy/issu...
``` Would just adding _print_Integral to LambdaPrinter be enough? ``` Original comment: http://code.google.com/p/sympy/issues/detail?id=2833#c1 Original author: https://code.google.com/u/100157245271348669141/ ``` I think that would fix it for sympy (mpmath) evaluation. As for making it work with other packages (sci...
diff --git a/sympy/printing/pycode.py b/sympy/printing/pycode.py --- a/sympy/printing/pycode.py +++ b/sympy/printing/pycode.py @@ -516,6 +516,25 @@ def pycode(expr, **settings): } +def _unpack_integral_limits(integral_expr): + """ helper function for _print_Integral that + - accepts an Integral expressio...
diff --git a/sympy/printing/tests/test_pycode.py b/sympy/printing/tests/test_pycode.py --- a/sympy/printing/tests/test_pycode.py +++ b/sympy/printing/tests/test_pycode.py @@ -250,6 +250,27 @@ def test_issue_16535_16536(): assert prntr.doprint(expr2) == ' # Not supported in Python:\n # uppergamma\nuppergamma(a, x...
["test_Integral", "test_issue_6408_integral", "test_integral", "test_double_integral"]
["test_PythonCodePrinter", "test_PythonCodePrinter_standard", "test_MpmathPrinter", "test_NumPyPrinter", "test_SciPyPrinter", "test_pycode_reserved_words", "test_sqrt", "test_printmethod", "test_codegen_ast_nodes", "test_issue_14283", "test_NumPyPrinter_print_seq", "test_issue_16535_16536", "test_fresnel_integrals", "t...
null
true
2020-09-22T16:36:48Z
1
46
4
435
0
0.8
1
0.7
1
0.225833
85.3275
3,348
swe_bench::test::1072
swe_bench
test
1,072
matplotlib__matplotlib-25334
matplotlib/matplotlib
matplotlib/matplotlib
python
07c43e4a87130880b5a01eca16de492bb800c26e
plt.contour with all NaNs fails assertion in _contour.cpp ### Bug report **Bug summary** Passing an array with all NaN values into `pyplot.contour()` causes the following assertion to fail in `QuadContourGenerator::init_cache_levels`: https://github.com/matplotlib/matplotlib/blob/v3.0.3/src/_contour.cpp#L1317-L1318 ...
@ianthomas23 would you like to look at this? It sounds like maybe more early-stage argument checking is needed. The assertions in `_contour.cpp` are to help with debugging, in particularly to identify when the C++ code is called with strange arguments. In this example a C++ `QuadContourGenerator` object is created for...
diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1447,12 +1447,12 @@ def _contour_args(self, args, kwargs): else: raise _api.nargs_error(fn, takes="from 1 to 4", given=nargs) z = ma.masked_invalid(z, cop...
diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py --- a/lib/matplotlib/tests/test_contour.py +++ b/lib/matplotlib/tests/test_contour.py @@ -715,3 +715,10 @@ def test_bool_autolevel(): assert plt.tricontour(x, y, z).levels.tolist() == [.5] assert plt.tricontourf(x, y, z.t...
["lib/matplotlib/tests/test_contour.py::test_all_nan"]
["lib/matplotlib/tests/test_contour.py::test_contour_shape_1d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_2d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args0-Length", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args1-Length", "lib/matplotlib/tests/t...
null
true
2023-02-26T22:03:38Z
1
6
1
1,228
0
0.8
1
0.7
1
0.224667
85.324
3,349
swe_bench::test::1159
swe_bench
test
1,159
pallets__flask-4992
pallets/flask
pallets/flask
python
4c288bc97ea371817199908d0d9b12de9dae327e
Add a file mode parameter to flask.Config.from_file() Python 3.11 introduced native TOML support with the `tomllib` package. This could work nicely with the `flask.Config.from_file()` method as an easy way to load TOML config files: ```python app.config.from_file("config.toml", tomllib.load) ``` However, `tomllib.loa...
You can also use: ```python app.config.from_file("config.toml", lambda f: tomllib.load(f.buffer)) ``` Thanks - I was looking for another way to do it. I'm happy with that for now, although it's worth noting this about `io.TextIOBase.buffer` from the docs: > This is not part of the [TextIOBase](https://docs.pyth...
diff --git a/src/flask/config.py b/src/flask/config.py --- a/src/flask/config.py +++ b/src/flask/config.py @@ -234,6 +234,7 @@ def from_file( filename: str, load: t.Callable[[t.IO[t.Any]], t.Mapping], silent: bool = False, + text: bool = True, ) -> bool: """Update the val...
diff --git a/tests/static/config.toml b/tests/static/config.toml new file mode 100644 --- /dev/null +++ b/tests/static/config.toml @@ -0,0 +1,2 @@ +TEST_KEY="foo" +SECRET_KEY="config" diff --git a/tests/test_config.py b/tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -6,7 +6,6 @@ import...
["tests/test_config.py::test_config_from_file_toml"]
["tests/test_config.py::test_config_from_pyfile", "tests/test_config.py::test_config_from_object", "tests/test_config.py::test_config_from_file_json", "tests/test_config.py::test_from_prefixed_env", "tests/test_config.py::test_from_prefixed_env_custom_prefix", "tests/test_config.py::test_from_prefixed_env_nested", "tes...
null
true
2023-02-22T14:00:17Z
1
11
1
1,108
0
0.8
1
0.7
1
0.221333
85.314
3,350
swe_bench::test::2120
swe_bench
test
2,120
sympy__sympy-17194
sympy/sympy
sympy/sympy
python
fec5dc5fd0d9a04cf974f733bc375bd8db853d4c
printingMathML erroneous I believe I found some mathML printing errors, and noted below what I think it should be ``` sympy.printing.mathml(sympy.acoth(x)) >>> '<apply><acoth/><ci>x</ci></apply>' ``` should be: `'<apply><arccoth/><ci>x</ci></apply>'` ``` sympy.printing.mathml(sympy.acsc(x)) >>> '<apply><acsc/><ci>x<...
and a more serious issue regarding the introduction of underscores when writing to mathml ``` sympy.sympify('x1') == sympy.sympify('x_1') >>> False sympy.mathml(sympy.sympify('x1')) == sympy.mathml(sympy.sympify('x_1')) >>> True ``` CC @oscargus
diff --git a/sympy/printing/mathml.py b/sympy/printing/mathml.py --- a/sympy/printing/mathml.py +++ b/sympy/printing/mathml.py @@ -15,6 +15,7 @@ import mpmath.libmp as mlib from mpmath.libmp import prec_to_dps + class MathMLPrinterBase(Printer): """Contains common code required for MathMLContentPrinter and ...
diff --git a/sympy/printing/tests/test_mathml.py b/sympy/printing/tests/test_mathml.py --- a/sympy/printing/tests/test_mathml.py +++ b/sympy/printing/tests/test_mathml.py @@ -5,7 +5,8 @@ Lambda, IndexedBase, symbols, zoo, elliptic_f, elliptic_e, elliptic_pi, Ei, \ expint, jacobi, gegenbauer, chebyshevt, cheby...
["test_content_mathml_constants", "test_content_mathml_trig", "test_content_mathml_logic"]
["test_mathml_printer", "test_content_printmethod", "test_content_mathml_core", "test_content_mathml_functions", "test_content_mathml_limits", "test_content_mathml_integrals", "test_content_mathml_matrices", "test_content_mathml_sums", "test_content_mathml_tuples", "test_content_mathml_add", "test_content_mathml_Ration...
null
true
2019-07-14T09:53:26Z
1
40
3
522
0
0.8
1
0.7
1
0.220333
85.311
3,351
swe_bench::test::90
swe_bench
test
90
astropy__astropy-8519
astropy/astropy
astropy/astropy
python
0e1d299f8f7084b8cb6286caed92e3169317027f
Adding/subtracting ABmag Quantities loses the "type" of magnitude The following code raises a `UnitConversionError`, because it appears the math operation lost track of the "type" of magnitude. `fluxMag` and `color` are both `ABmag`, so I would expect their difference to also be an ABmag. ```python import numpy as np ...
For the record, what are the Python, Astropy, and Numpy versions used? Sorry about that! python 3.6.6 numpy 1.14.5 astropy 3.0.3 @mhvk ? @parejkoj - this behaviour is as expected: if you add two magnitudes with a unit, you are effectively multiplying the physical quantities and thus their units, while if you subst...
diff --git a/astropy/units/function/core.py b/astropy/units/function/core.py --- a/astropy/units/function/core.py +++ b/astropy/units/function/core.py @@ -6,7 +6,7 @@ import numpy as np -from astropy.units import (Unit, UnitBase, UnitsError, UnitTypeError, +from astropy.units import (Unit, UnitBase, UnitsError, Un...
diff --git a/astropy/units/tests/test_logarithmic.py b/astropy/units/tests/test_logarithmic.py --- a/astropy/units/tests/test_logarithmic.py +++ b/astropy/units/tests/test_logarithmic.py @@ -235,6 +235,14 @@ def test_unit_multiple_possible_equivalencies(self): lu = u.mag(u.Jy) assert lu.is_equivalent(...
["astropy/units/tests/test_logarithmic.py::TestLogUnitConversion::test_magnitude_conversion_fails_message"]
["astropy/units/tests/test_logarithmic.py::TestLogUnitCreation::test_logarithmic_units", "astropy/units/tests/test_logarithmic.py::TestLogUnitCreation::test_callable_units[lu_unit0-DexUnit]", "astropy/units/tests/test_logarithmic.py::TestLogUnitCreation::test_callable_units[lu_unit1-MagUnit]", "astropy/units/tests/test...
null
true
2019-03-21T17:59:36Z
1
18
1
953
0
0.8
1
0.7
1
0.218833
85.3065
3,352
swe_bench::test::2213
swe_bench
test
2,213
sympy__sympy-20476
sympy/sympy
sympy/sympy
python
dbd720ac7d0070f005e66002314b5edce77b6bba
simplify() returns wrong result when applied to a certain trigonometric expression The `simplify()` function from sympy returns a wrong result when applied to the following trigonometric expression: <img src="https://render.githubusercontent.com/render/math?math=\cos\left(\frac{\beta}{2}\right) \sin\left(\frac{\beta}{...
TRmorrie is ignoring the power on the `cos(g)` factor. The fix might be ```diff diff --git a/sympy/simplify/fu.py b/sympy/simplify/fu.py index 7fce72d38a..b9f0e39a75 100644 --- a/sympy/simplify/fu.py +++ b/sympy/simplify/fu.py @@ -1206,8 +1206,8 @@ def f(rv, first=True): c.remove(cc)...
diff --git a/sympy/simplify/fu.py b/sympy/simplify/fu.py --- a/sympy/simplify/fu.py +++ b/sympy/simplify/fu.py @@ -1180,7 +1180,6 @@ def f(rv, first=True): for a in args: c = args[a] c.sort() - no = [] while c: k = 0 cc = ci = ...
diff --git a/sympy/simplify/tests/test_fu.py b/sympy/simplify/tests/test_fu.py --- a/sympy/simplify/tests/test_fu.py +++ b/sympy/simplify/tests/test_fu.py @@ -352,6 +352,9 @@ def test_TRmorrie(): # issue 17063 eq = cos(x)/cos(x/2) assert TRmorrie(eq) == eq + # issue #20430 + eq = cos(x/2)*sin(x/2)*...
["test_TRmorrie"]
["test_TR1", "test_TR2", "test_TR2i", "test_TR3", "test__TR56", "test_TR5", "test_TR6", "test_TR7", "test_TR8", "test_TR9", "test_TR10", "test_TR10i", "test_TR11", "test__TR11", "test_TR12", "test_TR13", "test_L", "test_fu", "test_objective", "test_process_common_addends", "test_trig_split", "test_TRpower", "test_hyper...
null
true
2020-11-23T06:24:43Z
1
5
1
2,152
0
0.8
1
0.85
0.8
0.375333
85.301
3,353
swe_bench::test::1491
swe_bench
test
1,491
pytest-dev__pytest-9956
pytest-dev/pytest
pytest-dev/pytest
python
cc0fbbefa0f8a6b390e89ef0d4d64dd78783a5c1
Test functions that return non-None should raise a warning/error Consider this test: ```python # The function we're testing def foo(a: int, b: int) -> int: return a * 3 + b @pytest.mark.parametrize(['a', 'b', 'result'], [ [1, 2, 5], [2, 3, 8], [5, 3, 18], ]) def test_foo(a, b, result): return foo(a, b) == r...
Hi @maxrothman, Thanks for the suggestion. I appreciate where you are coming from, but I don't think this is a good idea: * It is somewhat implicit to me that returning `False` from a test function would cause the test to fail. Also, it would fail with what message? `assert` statements are the bread and butter of...
diff --git a/src/_pytest/python.py b/src/_pytest/python.py --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -77,10 +77,12 @@ from _pytest.pathlib import visit from _pytest.scope import Scope from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestReturnNotNoneWarn...
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1292,3 +1292,14 @@ def test_no_brokenpipeerror_message(pytester: Pytester) -> None: # Cleanup. popen.stderr.close() + + +def test_function_return_non_none_warning(testdi...
["testing/acceptance_test.py::test_function_return_non_none_warning"]
["testing/acceptance_test.py::TestGeneralUsage::test_docstring_on_hookspec", "testing/acceptance_test.py::TestInvocationVariants::test_invoke_with_invalid_type", "testing/acceptance_test.py::TestInvocationVariants::test_invoke_plugin_api", "testing/acceptance_test.py::TestInvocationVariants::test_core_backward_compatib...
null
true
2022-05-13T20:51:44Z
3
18
1
936
0
0.8
1
0.7
1
0.216
85.298
3,354
swe_bench::test::2050
swe_bench
test
2,050
sympy__sympy-15320
sympy/sympy
sympy/sympy
python
ddcf91eef02de6e8de18ff49eb4967ddc98a96f1
RootOf might ignore generator This is related to #8551 but a little different. I'm not sure of all the ramifications but just want to document this. Note how feeding RootOf an expression in terms of a new generator might ignore that generator if the form of the polynomial is the same ``` >>> RootOf(x**3+x-1,0) RootOf...
Here's a place where the presence of the non-symbol generator creates problems: checking of the solution to the following equation: ``` >>> eq=737280.0*exp(-t)**24 - 576000.0*exp(-t)**15 + 46080.0*exp(-t)**6 >>> var('t', real=1);sol=solve(eq) t Traceback (most recent call last): File "<stdin>", line 1, in <module> ...
diff --git a/sympy/polys/rootoftools.py b/sympy/polys/rootoftools.py --- a/sympy/polys/rootoftools.py +++ b/sympy/polys/rootoftools.py @@ -176,7 +176,8 @@ class ComplexRootOf(RootOf): Roots of a univariate polynomial separated into disjoint real or complex intervals and indexed in a fixed order. Currentl...
diff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py --- a/sympy/polys/tests/test_polytools.py +++ b/sympy/polys/tests/test_polytools.py @@ -2500,10 +2500,9 @@ def test_factor_large(): x**6 - x**5 + x**4 - x**3 + x**2 - x + 1, 1)]) -@XFAIL def test_factor_noeval(): - ...
["test_CRootOf___new__"]
["test_Poly_from_dict", "test_Poly_from_list", "test_Poly_from_poly", "test_Poly_from_expr", "test_Poly__new__", "test_Poly__args", "test_Poly__gens", "test_Poly_zero", "test_Poly_one", "test_Poly__unify", "test_Poly_free_symbols", "test_PurePoly_free_symbols", "test_Poly__eq__", "test_PurePoly__eq__", "test_PurePoly_P...
null
true
2018-10-02T12:32:41Z
1
25
1
794
0
0.8
1
0.7
1
0.215667
85.297
3,355
swe_bench::dev::120
swe_bench
dev
120
pydicom__pydicom-938
pydicom/pydicom
pydicom/pydicom
python
6d8ef0bfcec983e5f8bd8a2e359ff318fe9fcf65
[python 3.8] failing tests: various issues but "max recursion depth reached" seems to be one #### Description Fedora is beginning to test python packages against python 3.8. Pydicom builds but tests fail with errors. #### Steps/Code to Reproduce ``` python setup.py build python setup.py install pytest ``` The comple...
Thanks, @sanjayankur31, we'll look into it. Looks like the [culprit](https://docs.python.org/3.8/whatsnew/3.8.html#changes-in-python-behavior) might be: > Removed `__str__` implementations from builtin types bool, int, float, complex and few classes from the standard library. They now inherit `__str__()` from object...
diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py --- a/pydicom/valuerep.py +++ b/pydicom/valuerep.py @@ -346,11 +346,12 @@ def __init__(self, val): def __str__(self): if hasattr(self, 'original_string'): return self.original_string - else: - return super(DSfloat, self)...
diff --git a/pydicom/tests/test_valuerep.py b/pydicom/tests/test_valuerep.py --- a/pydicom/tests/test_valuerep.py +++ b/pydicom/tests/test_valuerep.py @@ -90,7 +90,6 @@ def test_pickling(self): class TestDS(object): """Unit tests for DS values""" - def test_empty_value(self): assert DS(None) is No...
["pydicom/tests/test_valuerep.py::TestDSfloat::test_str", "pydicom/tests/test_valuerep.py::TestDSfloat::test_repr", "pydicom/tests/test_valuerep.py::TestIS::test_str", "pydicom/tests/test_valuerep.py::TestIS::test_repr"]
["pydicom/tests/test_valuerep.py::TestTM::test_pickling", "pydicom/tests/test_valuerep.py::TestDT::test_pickling", "pydicom/tests/test_valuerep.py::TestDA::test_pickling", "pydicom/tests/test_valuerep.py::TestDS::test_empty_value", "pydicom/tests/test_valuerep.py::TestDS::test_float_values", "pydicom/tests/test_valuere...
null
true
2019-08-22T05:03:01Z
1
19
4
908
0
0.8
1
0.7
1
0.214667
85.294
3,356
swe_bench::test::1750
swe_bench
test
1,750
sphinx-doc__sphinx-11192
sphinx-doc/sphinx
sphinx-doc/sphinx
python
c17300aa7a8aafb57eac91e1e3b15a4061ff2440
Smaller/wrong search index with sphinx-build -j auto ### Describe the bug Using the latest version and building with ````-j auto```` results in a considerably smaller searchindex,js and as a result most searches returning nothing. If I leave out ````-j```` then the searchindex is considerably larger and searches wor...
im also hitting this and can confirm that downgrading to 6.0.1 resolves
diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -655,10 +655,6 @@ def get_doc_context(self, docname: str, body: str, metatags: str) -> dict[str, A } def write_doc(self, docname: str, doctree...
diff --git a/tests/test_search.py b/tests/test_search.py --- a/tests/test_search.py +++ b/tests/test_search.py @@ -286,3 +286,10 @@ def test_nosearch(app): assert 'latex' not in index['terms'] assert 'zfs' in index['terms'] assert index['terms']['zfs'] == [] # zfs on nosearch.rst is not registered to in...
["tests/test_search.py::test_parallel"]
["tests/test_search.py::test_objects_are_escaped", "tests/test_search.py::test_meta_keys_are_handled_for_language_en", "tests/test_search.py::test_meta_keys_are_handled_for_language_de", "tests/test_search.py::test_stemmer_does_not_remove_short_words", "tests/test_search.py::test_stemmer", "tests/test_search.py::test_t...
null
true
2023-02-12T03:52:14Z
1
7
1
1,136
0
0.8
1
0.7
1
0.212667
85.288
3,357
swe_bench::test::62
swe_bench
test
62
astropy__astropy-14578
astropy/astropy
astropy/astropy
python
c748299218dcbd9e15caef558722cc04aa658fad
Writing a Table to FITS fails if the table contains objects The following works fine: ``` Python from astropy.table import Table Table([{'col1': None}]).write('/tmp/tmp.txt', format='ascii') ``` whereas the following fails: ``` Python Table([{'col1': None}]).write('/tmp/tmp.fits', format='fits') ``` with ``` /home...
Hm. I wonder if there's a place in the I/O registry for readers/writers to provide some means of listing what data formats they can accept--or at least rejecting formats that they don't accept. Maybe something to think about as part of #962 ? I should add--I think the current behavior is "correct"--any convention for...
diff --git a/astropy/io/fits/column.py b/astropy/io/fits/column.py --- a/astropy/io/fits/column.py +++ b/astropy/io/fits/column.py @@ -1528,7 +1528,19 @@ def _init_from_array(self, array): for idx in range(len(array.dtype)): cname = array.dtype.names[idx] ftype = array.dtype.fields[cn...
diff --git a/astropy/io/fits/tests/test_connect.py b/astropy/io/fits/tests/test_connect.py --- a/astropy/io/fits/tests/test_connect.py +++ b/astropy/io/fits/tests/test_connect.py @@ -414,6 +414,61 @@ def test_mask_str_on_read(self, tmp_path): tab = Table.read(filename, mask_invalid=False) assert tab.m...
["astropy/io/fits/tests/test_connect.py::TestSingleTable::test_heterogeneous_VLA_tables", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_write_object_tables_with_unified", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_write_VLA_tables_with_unified"]
["astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple_pathlib", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple_meta", "astropy/io/fits/tests/test_connect.py::TestSingleTable::test_simple_meta_conflicting", "astr...
null
true
2023-03-24T20:31:26Z
1
14
3
981
0
0.8
1
0.7
1
0.210167
85.2805
3,358
swe_bench::test::1913
swe_bench
test
1,913
sympy__sympy-11787
sympy/sympy
sympy/sympy
python
a53c4ad94a9657702764e9b5dc4a3eaa01c0f54d
nsolve wrong result ``` py >>> print(E.subs(sols[0]).diff(t)) -0.0243197537608033*(-0.636658291554981*t + 0.561884537092944)/(-0.0243197537608033*t + 1)**2 + (-2*(t + 1)/(2*t - 2)**2 + 1/(2*t - 2))*exp((t + 1)/(2*t - 2)) + 0.636658291554981/(-0.0243197537608033*t + 1) >>> nsolve(diff(E.subs(sols[0]), t), .9) mpf('0.999...
Using a different solver gives the right answer: ``` py >>> nsolve(diff(E.subs(sols[0]), t), (.5, 0.9), solver='bisect') mpf('0.70295119676297064') ``` `nsolve` only uses the numerator of the expression...and the numerator is close to zero at the reported root so it fools the solver. So we should probably make it no...
diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py --- a/sympy/solvers/solvers.py +++ b/sympy/solvers/solvers.py @@ -2683,13 +2683,12 @@ def nsolve(*args, **kwargs): >>> cos(_) 0.73908513321516064165531208767387340401341175890076 - mpmath.findroot is used, you can find there more extensive ...
diff --git a/sympy/solvers/tests/test_numeric.py b/sympy/solvers/tests/test_numeric.py --- a/sympy/solvers/tests/test_numeric.py +++ b/sympy/solvers/tests/test_numeric.py @@ -6,6 +6,23 @@ from sympy.utilities.pytest import raises, XFAIL from sympy.utilities.decorator import conserve_mpmath_dps +@XFAIL +def test_nso...
["test_nsolve_denominator"]
["test_nsolve", "test_issue_6408", "test_increased_dps"]
null
true
2016-10-29T21:33:05Z
1
31
1
640
0
0.8
1
0.7
1
0.21
85.28
3,359
swe_bench::test::1764
swe_bench
test
1,764
sphinx-doc__sphinx-7305
sphinx-doc/sphinx
sphinx-doc/sphinx
python
f85b870ad59f39c8637160a4cd4d865ce1e1628e
"Could not parse arglist" with operator pow **Describe the bug** With the rst ```rst .. py:method:: f(*, a=2**4) .. py:method:: g(a=2**4) ``` I get the errors ``` WARNING: could not parse arglist ('*, a=2**4'): Unable to parse BinOp object WARNING: could not parse arglist ('a=2**4'): Unable to parse BinOp object ``` *...
Thank you for reporting. At present, the parser for python signature does not support expression syntax. I'll try to support them from now on.
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -9,7 +9,7 @@ """ import sys -from typing import List +from typing import Dict, List, Type if sys.version_info > (3, 8): import ast @@ -21,6 +21,29 @@ import ast # type: ignore +OPE...
diff --git a/tests/test_pycode_ast.py b/tests/test_pycode_ast.py --- a/tests/test_pycode_ast.py +++ b/tests/test_pycode_ast.py @@ -16,21 +16,43 @@ @pytest.mark.parametrize('source,expected', [ + ("a + b", "a + b"), # Add + ("a and b", "a and b"), # And ("os.pa...
["tests/test_pycode_ast.py::test_unparse[a", "tests/test_pycode_ast.py::test_unparse[1", "tests/test_pycode_ast.py::test_unparse[~", "tests/test_pycode_ast.py::test_unparse[not", "tests/test_pycode_ast.py::test_unparse[+", "tests/test_pycode_ast.py::test_unparse[-"]
["tests/test_pycode_ast.py::test_unparse[os.path-os.path]", "tests/test_pycode_ast.py::test_unparse[b'bytes'-b'bytes']", "tests/test_pycode_ast.py::test_unparse[object()-object()]", "tests/test_pycode_ast.py::test_unparse[1234-1234_0]", "tests/test_pycode_ast.py::test_unparse[{'key1':", "tests/test_pycode_ast.py::test_...
null
true
2020-03-14T04:52:36Z
1
34
6
571
0
0.8
1
0.7
1
0.2085
85.2755
3,360
swe_bench::dev::112
swe_bench
dev
112
pydicom__pydicom-863
pydicom/pydicom
pydicom/pydicom
python
b4b44acbf1ddcaf03df16210aac46cb3a8acd6b9
Wrong encoding occurs if the value 1 of SpecificCharacterSets is ISO 2022 IR 13. #### Description All Japanese characters are encoded into shift_jis if the value 1 of SpecificCharacterSets (0x0008, 0x0005) is ISO 2022 IR 13. #### Steps/Code to Reproduce The japanese_pn and expect_encoded in the following code came f...
In my opinion, this issue is caused by encoding to shift_jis doesn't raise UnicodeError when characters which are out of JIS X 0201 are given. So I guess that this is fixed by encoding to jis correctly. If you don't mind, please assign this issue to me. I will make a PR for this issue. Thanks for the report - of c...
diff --git a/pydicom/charset.py b/pydicom/charset.py --- a/pydicom/charset.py +++ b/pydicom/charset.py @@ -86,6 +86,7 @@ } ENCODINGS_TO_CODES = {v: k for k, v in CODES_TO_ENCODINGS.items()} +ENCODINGS_TO_CODES['shift_jis'] = ESC + b')I' # Multi-byte character sets except Korean are handled by Python. # To decod...
diff --git a/pydicom/tests/test_charset.py b/pydicom/tests/test_charset.py --- a/pydicom/tests/test_charset.py +++ b/pydicom/tests/test_charset.py @@ -404,3 +404,36 @@ def test_invalid_second_encoding(self): u"- using default encoding instead"): pydicom.charset.decode( ...
["pydicom/tests/test_charset.py::TestCharset::test_japanese_multi_byte_personname", "pydicom/tests/test_charset.py::TestCharset::test_japanese_multi_byte_encoding", "pydicom/tests/test_charset.py::TestCharset::test_bad_japanese_encoding"]
["pydicom/tests/test_charset.py::TestCharset::test_encodings", "pydicom/tests/test_charset.py::TestCharset::test_nested_character_sets", "pydicom/tests/test_charset.py::TestCharset::test_inherited_character_set_in_sequence", "pydicom/tests/test_charset.py::TestCharset::test_standard_file", "pydicom/tests/test_charset.p...
null
true
2019-06-15T15:09:57Z
1
216
3
1,576
0
0.8
1
0.85
0.75
0.762667
85.2755
3,361
swe_bench::test::962
swe_bench
test
962
matplotlib__matplotlib-20470
matplotlib/matplotlib
matplotlib/matplotlib
python
f0632c0fc7339f68e992ed63ae4cfac76cd41aad
Handle and label not created for Text with label ### Bug report **Bug summary** Text accepts a `label` keyword argument but neither its handle nor its label is created and added to the legend. **Code for reproduction** ```python import matplotlib.pyplot as plt x = [0, 10] y = [0, 10] fig = plt.figure() ax = fig.a...
This is an imprecision in the API. Technically, every `Artist` can have a label. But note every `Artist` has a legend handler (which creates the handle to show in the legend, see also https://matplotlib.org/3.3.3/api/legend_handler_api.html#module-matplotlib.legend_handler). In particular `Text` does not have a lege...
diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -38,6 +38,7 @@ from matplotlib.collections import ( Collection, CircleCollection, LineCollection, PathCollection, PolyCollection, RegularPolyCollection) +from matplotlib.text impo...
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -493,6 +493,15 @@ def test_handler_numpoints(): ax.legend(numpoints=0.5) +def test_text_nohandler_warning(): + """Test that Text artis...
["lib/matplotlib/tests/test_legend.py::test_text_nohandler_warning"]
["lib/matplotlib/tests/test_legend.py::test_legend_ordereddict", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[png]", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[png]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[pdf]", "li...
null
true
2021-06-19T22:21:18Z
2
28
1
683
0
0.8
1
0.7
1
0.207167
85.2715
3,362
swe_bench::test::2028
swe_bench
test
2,028
sympy__sympy-14575
sympy/sympy
sympy/sympy
python
e2757bc8de0179cf4b4a917242125172e6da6bb2
Incorrect binomial documentation The [documentation](https://github.com/sympy/sympy/blob/bf02a32c7f9741c269c8ecf6353359d36c6ca766/sympy/functions/combinatorial/factorials.py#L719-L720) for `binomial` states: > For the sake of convenience for negative 'k' this function will return zero no matter what valued is the othe...
The treatment of binomial was recently changed in #14019, it seems the docstring is out of date. If I understand the discussion in #14019, `binomial` now uses Wolfram's gamma-limit rewrite, with some logic to handle edge-cases in the limit. In that case, shouldn't `binomial(n, k)` evaluate to 0 for negative integer `k`...
diff --git a/sympy/functions/combinatorial/factorials.py b/sympy/functions/combinatorial/factorials.py --- a/sympy/functions/combinatorial/factorials.py +++ b/sympy/functions/combinatorial/factorials.py @@ -851,20 +851,18 @@ def _eval(self, n, k): @classmethod def eval(cls, n, k): n, k = map(sympify,...
diff --git a/sympy/functions/combinatorial/tests/test_comb_factorials.py b/sympy/functions/combinatorial/tests/test_comb_factorials.py --- a/sympy/functions/combinatorial/tests/test_comb_factorials.py +++ b/sympy/functions/combinatorial/tests/test_comb_factorials.py @@ -291,13 +291,14 @@ def test_binomial(): asser...
["test_binomial"]
["test_rf_eval_apply", "test_ff_eval_apply", "test_factorial", "test_factorial_diff", "test_factorial_series", "test_factorial_rewrite", "test_factorial2", "test_factorial2_rewrite", "test_binomial_diff", "test_binomial_rewrite"]
null
true
2018-03-29T04:54:45Z
1
12
1
994
0
0.8
1
0.7
1
0.205667
85.267
3,363
swe_bench::test::1769
swe_bench
test
1,769
sphinx-doc__sphinx-7380
sphinx-doc/sphinx
sphinx-doc/sphinx
python
6deb592a2fadbf88b7a00a332837a81a3198a830
cpp domain parens in template parameter packs fails **Describe the bug** I have C++ code with parentheses in the template parameter list documented as: ``` .. cpp:class:: template <std::integer_sequence<bool, (static_cast<void>(Bs), false)>> foo Broken because of parentheses around `static_cast<void>(Bs), false` `...
Thanks for reporting! Parsing expressions in template parameter and argument lists is quite icky, and it looks to me that with the 3.x branch the nature of the errors is slightly different, but still present. I'll try to dig into it as soon as possible. Sorry, previous comment was on wrong issue by accident... I'm ...
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -1505,8 +1505,38 @@ def describe_signature(self, signode: TextElement, mode: str, self.exprs[i].describe_signature(signode, mode, env, symbol) +class ASTBracedInitList(ASTBase): + de...
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -274,6 +274,9 @@ class Config: exprCheck('a xor_eq 5', 'eO1aL5E') exprCheck('a |= 5', 'oR1aL5E') exprCheck('a or_eq 5', 'oR1aL5E') + exprCheck('a = {1, 2, 3}', 'aS1ailL1EL2...
["tests/test_domain_cpp.py::test_expressions", "tests/test_domain_cpp.py::test_class_definitions"]
["tests/test_domain_cpp.py::test_fundamental_types", "tests/test_domain_cpp.py::test_type_definitions", "tests/test_domain_cpp.py::test_concept_definitions", "tests/test_domain_cpp.py::test_member_definitions", "tests/test_domain_cpp.py::test_function_definitions", "tests/test_domain_cpp.py::test_operators", "tests/tes...
null
true
2020-03-25T13:08:37Z
1
260
2
1,556
0
0.8
1
0.85
0.75
0.759333
85.2655
3,364
swe_bench::test::1119
swe_bench
test
1,119
matplotlib__matplotlib-26300
matplotlib/matplotlib
matplotlib/matplotlib
python
e8bfdcb3c153806ffd5391239c1640d5238bcbe2
[Bug]: calling fig.tight_layout multiple times ### Bug summary Calling `fig.tight_layout()` multiple times warns. ### Code for reproduction ```python import matplotlib.pyplot as plt fig = plt.figure() fig.tight_layout() fig.tight_layout() ``` ### Actual outcome ``` <ipython-input-9-0981ef8afcc1>:5: UserWarning: T...
likely related to https://github.com/rstudio/py-shiny/issues/611
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -3522,14 +3522,14 @@ def tight_layout(self, *, pad=1.08, h_pad=None, w_pad=None, rect=None): # note that here we do not permanently set the figures engine to # tight_layout...
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 @@ -701,6 +701,14 @@ def test_layout_change_warning(layout): plt.tight_layout() +def test_repeated_tightlayout(): + fig = Figure() + ...
["lib/matplotlib/tests/test_figure.py::test_repeated_tightlayout"]
["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-07-12T21:58:28Z
1
8
1
1,068
0
0.8
1
0.7
1
0.204667
85.264
3,365
swe_bench::test::1107
swe_bench
test
1,107
matplotlib__matplotlib-26101
matplotlib/matplotlib
matplotlib/matplotlib
python
7ad3bc2d06fb8d000716e5be027d893d5bc06486
[Bug]: Star marker (using mathtext) is not center-aligned ### Bug summary Is there any other way to center-align mathtext markers? ![image](https://github.com/matplotlib/matplotlib/assets/16134605/1ae4f802-763a-4db1-b284-63854081bf84) ### Code for reproduction ```python from matplotlib import pyplot as plt plt.plot(...
Unfortunately, We are kind of at the mercy of the text rendering and the bounding box that gives us for things going through `mathtext`, and I'm not sure there is any way around that. Since the symbols are designed to be incorporated into text rather than displayed independently, many of them are offset (though not ...
diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -509,14 +509,12 @@ def _set_mathtext_path(self): if len(text.vertices) == 0: return - xmin, ymin = text.vertices.min(axis=0) - xmax, ymax = text.ver...
diff --git a/lib/matplotlib/tests/test_marker.py b/lib/matplotlib/tests/test_marker.py --- a/lib/matplotlib/tests/test_marker.py +++ b/lib/matplotlib/tests/test_marker.py @@ -156,6 +156,18 @@ def draw_ref_marker(y, style, size): ax_ref.set(xlim=(-0.5, 1.5), ylim=(-0.5, 1.5)) +# The bullet mathtext marker is no...
["lib/matplotlib/tests/test_marker.py::test_text_marker[png]"]
["lib/matplotlib/tests/test_marker.py::test_marker_fillstyle", "lib/matplotlib/tests/test_marker.py::test_markers_valid[o]", "lib/matplotlib/tests/test_marker.py::test_markers_valid[x]", "lib/matplotlib/tests/test_marker.py::test_markers_valid[]", "lib/matplotlib/tests/test_marker.py::test_markers_valid[None]", "lib/ma...
null
true
2023-06-10T02:46:30Z
1
14
1
899
0
0.8
1
0.7
1
0.1965
85.2395
3,366
swe_bench::test::1765
swe_bench
test
1,765
sphinx-doc__sphinx-7350
sphinx-doc/sphinx
sphinx-doc/sphinx
python
c75470f9b79046f6d32344be5eacf60a4e1c1b7d
Napoleon's Attributes directive ignores :noindex: option. **Description of the bug** Sphinxcontrib-napoleon's `Attributes:` directive appears to ignore the `:noindex:` option. The following reST code produces an index that includes the `Attributes:` directives found in `example_google.py` but leaves out all other dire...
I'm hitting this bug as well, but I believe this bug is in `autodoc` not `napoleon`, since all `napoleon` does is convert Google/Numpy style docstrings to valid reST. As far as I can tell from the code, it doesn't set `:noindex:` for any other option so I don't see how Attributes is handled any differently.
diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -583,7 +583,11 @@ def _parse_attributes_section(self, section: str) -> List[str]: if _type: lines.append(':vartype %s: %...
diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py --- a/tests/test_ext_napoleon_docstring.py +++ b/tests/test_ext_napoleon_docstring.py @@ -1020,6 +1020,34 @@ def test_custom_generic_sections(self): actual = str(GoogleDocstring(docstring, testConfig)) sel...
["tests/test_ext_napoleon_docstring.py::GoogleDocstringTest::test_noindex"]
["tests/test_ext_napoleon_docstring.py::NamedtupleSubclassTest::test_attributes_docstring", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member_inline", "tests/test_ext_napoleon_docstring.py::GoogleDocstr...
null
true
2020-03-21T09:55:42Z
1
8
1
1,018
0
0.8
1
0.7
1
0.196333
85.239
3,367
swe_bench::test::2177
swe_bench
test
2,177
sympy__sympy-18835
sympy/sympy
sympy/sympy
python
516fa83e69caf1e68306cfc912a13f36c434d51c
uniq modifies list argument When you iterate over a dictionary or set and try to modify it while doing so you get an error from Python: ```python >>> multiset('THISTLE') {'T': 2, 'H': 1, 'I': 1, 'S': 1, 'L': 1, 'E': 1} >>> for i in _: ... _.pop(i) ... 2 Traceback (most recent call last): File "<stdin>", line 1, in ...
I'm not sure there is a need to handle this case. Users should know not to mutate something while iterating over it. With regards to the above discussion, I believe it would indeed be helpful if modifying a passed list to ``uniq`` raises an error while iterating over it, because it does not immediately follow that ``un...
diff --git a/sympy/utilities/iterables.py b/sympy/utilities/iterables.py --- a/sympy/utilities/iterables.py +++ b/sympy/utilities/iterables.py @@ -2088,8 +2088,13 @@ def has_variety(seq): def uniq(seq, result=None): """ Yield unique elements from ``seq`` as an iterator. The second - parameter ``result`` ...
diff --git a/sympy/utilities/tests/test_iterables.py b/sympy/utilities/tests/test_iterables.py --- a/sympy/utilities/tests/test_iterables.py +++ b/sympy/utilities/tests/test_iterables.py @@ -703,6 +703,10 @@ def test_uniq(): [([1], 2, 2), (2, [1], 2), (2, 2, [1])] assert list(uniq([2, 3, 2, 4, [2], [1], [...
["test_uniq"]
["test_is_palindromic", "test_postorder_traversal", "test_flatten", "test_iproduct", "test_group", "test_subsets", "test_variations", "test_cartes", "test_filter_symbols", "test_numbered_symbols", "test_sift", "test_take", "test_dict_merge", "test_prefixes", "test_postfixes", "test_topological_sort", "test_strongly_con...
null
true
2020-03-11T23:39:56Z
1
21
1
756
0
0.8
1
0.7
1
0.196
85.238
3,368
swe_bench::test::1154
swe_bench
test
1,154
pallets__flask-4169
pallets/flask
pallets/flask
python
66d9d4fa8d07dd50e4cb3036a9ae5f92c4693b84
Exceptions are sometimes replaced with "TypeError: exceptions must derive from BaseException" ```python # a.py def create_app(): raise RuntimeError() ``` ``` $ FLASK_APP=a.py flask run --lazy-loading $ curl http://127.0.0.1:5000 [...] Traceback (most recent call last): File "[...]/lib/python3.9/site-packages/flask/cl...
I am seeing this too. I just started a new flask project. for me it was because i had the same function names for the same endpoint
diff --git a/src/flask/cli.py b/src/flask/cli.py --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -312,7 +312,7 @@ def __init__(self, loader, use_eager_loading=None): self.loader = loader self._app = None self._lock = Lock() - self._bg_loading_exc_info = None + self._bg_loading_...
diff --git a/tests/test_cli.py b/tests/test_cli.py --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -17,6 +17,7 @@ from flask import current_app from flask import Flask from flask.cli import AppGroup +from flask.cli import DispatchingApp from flask.cli import dotenv from flask.cli import find_best_app from flas...
["tests/test_cli.py::test_lazy_load_error"]
["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-path3-test]", "tests/test_cli.py::test_prepare_import[test/__init__-path4-test]"...
null
true
2021-06-22T23:57:43Z
1
17
1
808
0
0.8
1
0.7
1
0.191333
85.224
3,369
swe_bench::dev::0
swe_bench
dev
0
marshmallow-code__marshmallow-1164
marshmallow-code/marshmallow
marshmallow-code/marshmallow
python
1e26d14facab213df5009300b997481aa43df80a
2.x: Nested(many=True) eats first element from generator value when dumping As reproduced in Python 3.6.8: ```py from marshmallow import Schema, fields class O(Schema): i = fields.Int() class P(Schema): os = fields.Nested(O, many=True) def gen(): yield {'i': 1} yield {'i': 0} p = P() p.dump({'os': ...
I confirmed that this is no longer an issue in marshmallow 3. I was able to reproduce this with python 2 and 3 using the latest version of marshmallow 2. `next(iter(...))` is not a safe operation for generators. ```py def gen(): yield 1 yield 2 x = gen() next(iter(x)) # 1 list(x) # [2] ``` I su...
diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -443,6 +443,8 @@ def _serialize(self, nested_obj, attr, obj): schema = self.schema if nested_obj is None: return None + if self.many and utils.is_it...
diff --git a/tests/test_serialization.py b/tests/test_serialization.py --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -782,3 +782,21 @@ class ValueSchema(Schema): serialized = ValueSchema(many=True).dump(slice).data assert serialized == values + + +# https://github.com/marshmallow-co...
["tests/test_serialization.py::test_nested_field_many_serializing_generator"]
["tests/test_serialization.py::TestFieldSerialization::test_default", "tests/test_serialization.py::TestFieldSerialization::test_number[42-42.0]", "tests/test_serialization.py::TestFieldSerialization::test_number[0-0.0]", "tests/test_serialization.py::TestFieldSerialization::test_number[None-None]", "tests/test_seriali...
null
true
2019-03-01T17:03:05Z
2
19
1
758
0
0.8
1
0.7
1
0.189667
85.219
3,370
swe_bench::test::1839
swe_bench
test
1,839
sphinx-doc__sphinx-8620
sphinx-doc/sphinx
sphinx-doc/sphinx
python
21698c14461d27933864d73e6fba568a154e83b3
kbd role generates HTML that's difficult/impossible to style for compound-keystrokes **Describe the bug** The `:kbd:` role doesn't mark container `<kbd>` elements with a CSS class, so they can be styled differently that child `<kbd>` elements representing actual keystrokes. **To Reproduce** For the below input ``` ...
Quite agree, the outer `<kbd>` and inner `<kbd>` should be given different attributes for distinction. CSS has no way of selecting parent element so we are not able to determine whether a `<kbd>` element contains nested `<kbd>`. With key combination and certain style for `<kbd>`, we get: ![87524709-cb7c6300-c688...
diff --git a/sphinx/builders/html/transforms.py b/sphinx/builders/html/transforms.py --- a/sphinx/builders/html/transforms.py +++ b/sphinx/builders/html/transforms.py @@ -28,7 +28,7 @@ class KeyboardTransform(SphinxPostTransform): After:: - <literal class="kbd"> + <literal class="kbd compound"> ...
diff --git a/tests/test_markup.py b/tests/test_markup.py --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -244,7 +244,7 @@ def get(name): # kbd role 'verify', ':kbd:`Control+X`', - ('<p><kbd class="kbd docutils literal notranslate">' + ('<p><kbd class="kbd compound docut...
["tests/test_markup.py::test_inline[verify-:kbd:`Control+X`-<p><kbd", "tests/test_markup.py::test_inline[verify-:kbd:`M-x"]
["tests/test_markup.py::test_inline[verify-:rfc:`2324`-<p><span", "tests/test_markup.py::test_inline[verify-:rfc:`2324#id1`-<p><span", "tests/test_markup.py::test_inline[verify_re-``code", "tests/test_markup.py::test_inline[verify-:menuselection:`a", "tests/test_markup.py::test_inline[verify-:menuselection:`&Foo", "tes...
null
true
2020-12-30T11:53:13Z
1
3
2
2,028
0
0.8
1
0.85
0.8
0.348
85.219
3,371
r2e_gym::train::4952
r2e_gym
train
4,952
datalad__9bca8763145a82da756cd95c943f47941ea36950
datalad
datalad/datalad
python
9bca8763145a82da756cd95c943f47941ea36950
**Analysis** - **Key Parts:** - **Commit Details:** The commit introduces a new function `split_ext` in `addurls.py` to handle file extension splitting based on git-annex's heuristic. It also updates existing functions to utilize this new method. - **Test Results:** Before the commit, the `split_ext` function was ...
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:9bca8763145a82da756cd95c943f47941ea36950
true
null
1
68
null
2,813
0
0.75
1
0.75
1
0.6955
85.2115
3,372
swe_bench::dev::83
swe_bench
dev
83
pydicom__pydicom-1194
pydicom/pydicom
pydicom/pydicom
python
5e70c1dfe09820023fec519dac4c51bebcb7f60d
Error decoding dataset with ambiguous VR element when the value is None Hi all, I used the storescu in pynetdicom 1.5.3 to send the dicom ct files(both on mac and ubuntu): **python storescu.py 192.168.1.120 9002 ~/Downloads/test/** (I also tried https://pydicom.github.io/pynetdicom/stable/examples/storage.html#stor...
```python >>> from pydicom import dcmread >>> dcmread("CT_S1_001.dcm") Traceback (most recent call last): File ".../pydicom/tag.py", line 30, in tag_in_exception yield File ".../pydicom/filewriter.py", line 555, in write_dataset write_data_element(fp, dataset.get_item(tag), dataset_encoding) File ...
diff --git a/pydicom/filewriter.py b/pydicom/filewriter.py --- a/pydicom/filewriter.py +++ b/pydicom/filewriter.py @@ -87,6 +87,9 @@ def _correct_ambiguous_vr_element(elem, ds, is_little_endian): elem.VR = 'SS' byte_type = 'h' + if elem.VM == 0: + return elem + # N...
diff --git a/pydicom/tests/test_filewriter.py b/pydicom/tests/test_filewriter.py --- a/pydicom/tests/test_filewriter.py +++ b/pydicom/tests/test_filewriter.py @@ -1054,7 +1054,7 @@ def test_not_ambiguous_raw_data_element(self): elem = RawDataElement(0x60003000, 'OB', 1, b'\x00', 0, True, True) out = c...
["pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVRElement::test_empty_value"]
["pydicom/tests/test_filewriter.py::TestWriteFile::testRTPlan", "pydicom/tests/test_filewriter.py::TestWriteFile::testRTDose", "pydicom/tests/test_filewriter.py::TestWriteFile::testCT", "pydicom/tests/test_filewriter.py::TestWriteFile::testMR", "pydicom/tests/test_filewriter.py::TestWriteFile::testUnicode", "pydicom/te...
null
true
2020-09-22T03:16:19Z
1
6
1
1,001
0
0.8
1
0.7
1
0.186833
85.2105
3,373
swe_bench::test::1386
swe_bench
test
1,386
pytest-dev__pytest-11041
pytest-dev/pytest
pytest-dev/pytest
python
fbfd4b50050080413c8faca5368b9cb9b1ac9313
UnboundLocalError: cannot access local variable 'x' where it is not associated with a value There seems to be a regression in pytest version `7.3.x` when a **walrus** operator is used in an assert line. Code: ```py import json import pytest def test_json_encoder(): assert (object:="foo") in json.dumps(object) ``` ...
Yep, I could indeed bisect this to #10758 / 6e478b094787f3d2bf2db3676d330c7a13ac6b98. cc @aless10 > Yep, I could indeed bisect this to #10758 / [6e478b0](https://github.com/pytest-dev/pytest/commit/6e478b094787f3d2bf2db3676d330c7a13ac6b98). > > cc @aless10 Hi, I think this is definitely something I worked on....
diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -996,7 +996,9 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: ] ): pytest_te...
diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1436,6 +1436,96 @@ def test_walrus_operator_not_override_value(): assert result.ret == 0 +@pytest.mark.skipif( + sys.version_info < (3, 8), reason="walru...
["testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_in_operand_json_dumps", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_equals_operand_function", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_equals_operand_function_keyword_...
["testing/test_assertrewrite.py::TestAssertionRewrite::test_place_initial_imports", "testing/test_assertrewrite.py::TestAssertionRewrite::test_location_is_set", "testing/test_assertrewrite.py::TestAssertionRewrite::test_dont_rewrite", "testing/test_assertrewrite.py::TestAssertionRewrite::test_name", "testing/test_asser...
null
true
2023-05-27T09:33:16Z
1
25
5
614
0
0.8
1
0.7
1
0.185667
85.207
3,374
swe_bench::dev::92
swe_bench
dev
92
pydicom__pydicom-1413
pydicom/pydicom
pydicom/pydicom
python
f909c76e31f759246cec3708dadd173c5d6e84b1
Error : a bytes-like object is required, not 'MultiValue' Hello, I am getting following error while updating the tag LongTrianglePointIndexList (0066,0040), **TypeError: a bytes-like object is required, not 'MultiValue'** I noticed that the error gets produced only when the VR is given as "OL" , works fine with "OB"...
Also tried following code to get the byte string, but same error. 1. data=array.array('L', indexData).tostring() # to convert to long -> same error 2. data=array.array('Q', indexData).tostring() # to convert to long long -> same error O* VRs should be `bytes`. Use `array.tobytes()` instead of `tostring()`? A...
diff --git a/pydicom/dataelem.py b/pydicom/dataelem.py --- a/pydicom/dataelem.py +++ b/pydicom/dataelem.py @@ -433,13 +433,24 @@ def value(self) -> Any: @value.setter def value(self, val: Any) -> None: """Convert (if necessary) and set the value of the element.""" + # Ignore backslash characte...
diff --git a/pydicom/tests/test_valuerep.py b/pydicom/tests/test_valuerep.py --- a/pydicom/tests/test_valuerep.py +++ b/pydicom/tests/test_valuerep.py @@ -1546,3 +1546,16 @@ def test_set_value(vr, pytype, vm0, vmN, keyword): elem = ds[keyword] assert elem.value == list(vmN) assert list(vmN) == elem.value...
["pydicom/tests/test_valuerep.py::test_assigning_bytes[OD-bytes-vm017-vmN17-DoubleFloatPixelData]", "pydicom/tests/test_valuerep.py::test_assigning_bytes[OL-bytes-vm019-vmN19-TrackPointIndexList]", "pydicom/tests/test_valuerep.py::test_assigning_bytes[OV-bytes-vm020-vmN20-SelectorOVValue]"]
["pydicom/tests/test_valuerep.py::TestTM::test_pickling", "pydicom/tests/test_valuerep.py::TestTM::test_pickling_tm_from_time", "pydicom/tests/test_valuerep.py::TestTM::test_str_and_repr", "pydicom/tests/test_valuerep.py::TestTM::test_new_empty_str", "pydicom/tests/test_valuerep.py::TestTM::test_new_str_conversion", "p...
null
true
2021-06-16T09:47:08Z
1
19
3
733
0
0.8
1
0.7
1
0.1855
85.2065
3,375
swe_bench::test::1135
swe_bench
test
1,135
mwaskom__seaborn-2848
mwaskom/seaborn
mwaskom/seaborn
python
94621cef29f80282436d73e8d2c0aa76dab81273
pairplot fails with hue_order not containing all hue values in seaborn 0.11.1 In seaborn < 0.11, one could plot only a subset of the values in the hue column, by passing a hue_order list containing only the desired values. Points with hue values not in the list were simply not plotted. ```python iris = sns.load_dataset...
The following workarounds seem to work: ``` g.map(sns.scatterplot, hue=iris["species"], hue_order=iris["species"].unique()) ``` or ``` g.map(lambda x, y, **kwargs: sns.scatterplot(x=x, y=y, hue=iris["species"])) ``` > ``` > g.map(sns.scatterplot, hue=iris["species"], hue_order=iris["species"].unique()) > ``` ...
diff --git a/seaborn/_oldcore.py b/seaborn/_oldcore.py --- a/seaborn/_oldcore.py +++ b/seaborn/_oldcore.py @@ -149,6 +149,13 @@ def _lookup_single(self, key): # Use a value that's in the original data vector value = self.lookup_table[key] except KeyError: + + if self.norm i...
diff --git a/tests/test_relational.py b/tests/test_relational.py --- a/tests/test_relational.py +++ b/tests/test_relational.py @@ -9,6 +9,7 @@ from seaborn.external.version import Version from seaborn.palettes import color_palette +from seaborn._oldcore import categorical_order from seaborn.relational import ( ...
["tests/test_relational.py::TestScatterPlotter::test_hue_order"]
["tests/test_relational.py::TestRelationalPlotter::test_wide_df_variables", "tests/test_relational.py::TestRelationalPlotter::test_wide_df_with_nonnumeric_variables", "tests/test_relational.py::TestRelationalPlotter::test_wide_array_variables", "tests/test_relational.py::TestRelationalPlotter::test_flat_array_variables...
null
true
2022-06-11T18:21:32Z
1
7
1
965
0
0.8
1
0.7
1
0.184167
85.2025
3,376
swe_bench::test::29
swe_bench
test
29
astropy__astropy-13469
astropy/astropy
astropy/astropy
python
2b8631e7d64bfc16c70f5c51cda97964d8dd1ae0
Can't convert a list of Astropy tables to a NumPy array of tables I recently stumbled upon [a StackOverflow question](https://stackoverflow.com/questions/69414829/convert-a-list-of-astropy-table-in-a-numpy-array-of-astropy-table) where someone likes to convert a list of Tables to a NumPy array. By default, NumPy will c...
FYI, here is a fix that seems to work. If anyone else wants to put this (or some variation) into a PR and add a test etc then feel free! ```diff (astropy) ➜ astropy git:(main) ✗ git diff diff --git a/astropy/table/table.py b/astropy/table/table.py index d3bcaebeb5..6db399a7b8 100644 --- a/astropy/table/table.py ...
diff --git a/astropy/table/table.py b/astropy/table/table.py --- a/astropy/table/table.py +++ b/astropy/table/table.py @@ -1070,7 +1070,12 @@ def __array__(self, dtype=None): supported and will raise a ValueError. """ if dtype is not None: - raise ValueError('Datatype coercion is n...
diff --git a/astropy/table/tests/test_table.py b/astropy/table/tests/test_table.py --- a/astropy/table/tests/test_table.py +++ b/astropy/table/tests/test_table.py @@ -28,6 +28,7 @@ from .conftest import MaskedTable, MIXIN_COLS from astropy.utils.compat.optional_deps import HAS_PANDAS # noqa +from astropy.utils.com...
["astropy/table/tests/test_table.py::TestConvertNumpyArray::test_convert_numpy_object_array[unmasked]", "astropy/table/tests/test_table.py::TestConvertNumpyArray::test_convert_numpy_object_array[masked]", "astropy/table/tests/test_table.py::TestConvertNumpyArray::test_convert_numpy_object_array[subclass]", "astropy/tab...
["astropy/table/tests/test_table.py::TestSetTableColumn::test_set_row[unmasked]", "astropy/table/tests/test_table.py::TestSetTableColumn::test_set_row[masked]", "astropy/table/tests/test_table.py::TestSetTableColumn::test_set_row[subclass]", "astropy/table/tests/test_table.py::TestSetTableColumn::test_set_row_existing[...
null
true
2022-07-21T01:48:13Z
1
7
6
955
0
0.8
1
0.7
1
0.1825
85.1975
3,377
swe_bench::test::2236
swe_bench
test
2,236
sympy__sympy-21567
sympy/sympy
sympy/sympy
python
2ac6f38c7d88bcc4943cdec4644ef26142392147
`expand_trig` for `csch`, `sech` Although we have fixed #21365, it should be extended further for `csch, sech`. The behavior for `csc, sec` was to expand it in denominator with `cos, sin`, so it could be taken as a reference. ```python3 >>> from sympy import * >>> x, y = symbols('x y') >>> expand_trig(tanh(x + y)) (t...
I am working on this issue. I have fixed the problem in the title, but have also realised there is an issue with coth(a+b) as well so I will work that out before sending the pull request.
diff --git a/sympy/functions/elementary/hyperbolic.py b/sympy/functions/elementary/hyperbolic.py --- a/sympy/functions/elementary/hyperbolic.py +++ b/sympy/functions/elementary/hyperbolic.py @@ -10,8 +10,6 @@ from sympy.core.logic import fuzzy_or, fuzzy_and - - def _rewrite_hyperbolics_as_exp(expr): expr = s...
diff --git a/sympy/functions/elementary/tests/test_hyperbolic.py b/sympy/functions/elementary/tests/test_hyperbolic.py --- a/sympy/functions/elementary/tests/test_hyperbolic.py +++ b/sympy/functions/elementary/tests/test_hyperbolic.py @@ -1,7 +1,7 @@ from sympy import (symbols, Symbol, sinh, nan, oo, zoo, pi, asinh, a...
["test_coth", "test_csch", "test_sech"]
["test_sinh", "test_sinh_series", "test_sinh_fdiff", "test_cosh", "test_cosh_series", "test_cosh_fdiff", "test_tanh", "test_tanh_series", "test_tanh_fdiff", "test_coth_series", "test_coth_fdiff", "test_csch_series", "test_csch_fdiff", "test_sech_series", "test_sech_fdiff", "test_asinh", "test_asinh_rewrite", "test_asin...
null
true
2021-06-02T19:05:29Z
1
26
3
570
0
0.8
1
0.7
1
0.181667
85.195
3,378
swe_bench::test::2110
swe_bench
test
2,110
sympy__sympy-17022
sympy/sympy
sympy/sympy
python
f91de695585c1fbc7d4f49ee061f64fcb1c2c4d8
Lambdify misinterprets some matrix expressions Using lambdify on an expression containing an identity matrix gives us an unexpected result: ```python >>> import numpy as np >>> n = symbols('n', integer=True) >>> A = MatrixSymbol("A", n, n) >>> a = np.array([[1, 2], [3, 4]]) >>> f = lambdify(A, A + Identity(n)) >>> f(a...
If the shape is an explicit number, we can just print `eye(n)`. For unknown shape, it's harder. We can raise an exception for now. It's better to raise an exception than give a wrong answer.
diff --git a/sympy/printing/pycode.py b/sympy/printing/pycode.py --- a/sympy/printing/pycode.py +++ b/sympy/printing/pycode.py @@ -608,6 +608,13 @@ def _print_MatrixBase(self, expr): func = self._module_format('numpy.array') return "%s(%s)" % (func, self._print(expr.tolist())) + def _print_Id...
diff --git a/sympy/printing/tests/test_numpy.py b/sympy/printing/tests/test_numpy.py --- a/sympy/printing/tests/test_numpy.py +++ b/sympy/printing/tests/test_numpy.py @@ -1,6 +1,6 @@ from sympy import ( Piecewise, lambdify, Equality, Unequality, Sum, Mod, cbrt, sqrt, - MatrixSymbol, BlockMatrix + MatrixSymb...
["test_NumPyPrinter"]
["test_numpy_piecewise_regression", "test_PythonCodePrinter", "test_MpmathPrinter", "test_SciPyPrinter", "test_pycode_reserved_words", "test_printmethod", "test_codegen_ast_nodes", "test_issue_14283"]
null
true
2019-06-12T21:54:57Z
1
7
1
940
0
0.8
1
0.7
1
0.18
85.19
3,379
swe_bench::test::2022
swe_bench
test
2,022
sympy__sympy-14308
sympy/sympy
sympy/sympy
python
fb536869fb7aa28b2695ad7a3b70949926b291c4
vectors break pretty printing ```py In [1]: from sympy.vector import * In [2]: e = CoordSysCartesian('e') In [3]: (x/y)**t*e.j Out[3]: ⎛ t⎞ e_j ⎜⎛x⎞ e_j ⎟ ⎜⎜─⎟ ⎟ ⎝⎝y⎠ ⎠ ``` Also, when it does print correctly, the baseline is wrong (it should be centered).
Hi @asmeurer . I would like to work on this issue . Could you help me with the same ?
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 @@ -931,26 +931,49 @@ def _print_BasisDependent(self, expr): #Fixing the newlines lengths = [] strs = [''] + flag = [] for...
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 @@ -6089,6 +6089,28 @@ def test_MatrixElement_printing(): assert upretty(F) == ucode_str1 +def test_issue_12675(...
["test_issue_12675", "test_pretty_print_unicode"]
["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_pretty_ordering", "test_EulerGamma", ...
null
true
2018-02-22T16:54:06Z
1
39
2
260
0
0.8
1
0.7
1
0.173333
85.17
3,380
swe_bench::test::1851
swe_bench
test
1,851
sphinx-doc__sphinx-8719
sphinx-doc/sphinx
sphinx-doc/sphinx
python
d5bc970dd952c2bc121918913798c151c755099a
:kbd: role with Caps Lock rendered incorrectly **Describe the bug** `` :kbd:`Caps Lock` `` produces: ```html <kbd class="kbd compound docutils literal notranslate"> <kbd class="kbd docutils literal notranslate">Caps</kbd> <kbd class="kbd docutils literal notranslate">Lock</kbd> </kbd> ``` **Expected behavior** ...
The same issue goes with other keys like "Page Up", "Page Down"... Absolutely. But we have to separate ```:kbd:`M-x M-s` ``` to two keystrokes....
diff --git a/sphinx/builders/html/transforms.py b/sphinx/builders/html/transforms.py --- a/sphinx/builders/html/transforms.py +++ b/sphinx/builders/html/transforms.py @@ -9,7 +9,7 @@ """ import re -from typing import Any, Dict +from typing import Any, Dict, List from docutils import nodes @@ -38,18 +38,29 @@ c...
diff --git a/tests/test_markup.py b/tests/test_markup.py --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -284,6 +284,13 @@ def get(name): '<p><kbd class="kbd docutils literal notranslate">-</kbd></p>', '\\sphinxkeyboard{\\sphinxupquote{\\sphinxhyphen{}}}', ), + ( + # kbd role +...
["tests/test_markup.py::test_inline[verify-:kbd:`Caps"]
["tests/test_markup.py::test_inline[verify-:rfc:`2324`-<p><span", "tests/test_markup.py::test_inline[verify-:rfc:`2324#id1`-<p><span", "tests/test_markup.py::test_inline[verify_re-``code", "tests/test_markup.py::test_inline[verify-:menuselection:`a", "tests/test_markup.py::test_inline[verify-:menuselection:`&Foo", "tes...
null
true
2021-01-21T15:04:38Z
1
27
1
489
0
0.8
1
0.7
1
0.1715
85.1645
3,381
swe_bench::test::1332
swe_bench
test
1,332
pylint-dev__pylint-5175
pylint-dev/pylint
pylint-dev/pylint
python
1daee40d6f1cf3d379396dc272c123d987ad4cdd
*args is considered as missing in documentation Hi, I met an issue with the following code: ```` def function(file, *args, sep=";"): """Description of the function Parameters ---------- file : str Path to the input. *args Relevant parameters. sep : str, optional File se...
@DanielNoord Would you like to take a look at this? I'm unable to reproduce it with `main`. I'm able to reproduce this. Adding `pylint.extensions.docparams` to `load-plugins` and `no-docstring-rgx=__.*__` makes this warning emit for me. I have a feeling it might be because of the `*` because the message reports i...
diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -279,7 +279,7 @@ class SphinxDocstring(Docstring): \s+ )? - (\w+) # Parameter name + ...
diff --git a/tests/extensions/test_check_docs.py b/tests/extensions/test_check_docs.py --- a/tests/extensions/test_check_docs.py +++ b/tests/extensions/test_check_docs.py @@ -1141,7 +1141,7 @@ def my_func(named_arg, *args): ''' ) with self.assertAddsMessages( - MessageTest(msg_id="...
["tests/extensions/test_check_docs.py::TestParamDocChecker::test_warns_missing_args_sphinx", "tests/extensions/test_check_docs.py::TestParamDocChecker::test_warns_missing_kwargs_sphinx", "tests/extensions/test_check_docs.py::TestParamDocChecker::test_warns_missing_args_google", "tests/extensions/test_check_docs.py::Tes...
["tests/extensions/test_check_docs.py::TestParamDocChecker::test_missing_func_params_in_sphinx_docstring", "tests/extensions/test_check_docs.py::TestParamDocChecker::test_missing_func_params_in_google_docstring", "tests/extensions/test_check_docs.py::TestParamDocChecker::test_missing_type_doc_google_docstring_exempt_kw...
null
true
2021-10-17T20:08:34Z
3
16
11
691
0
0.8
1
0.7
1
0.1685
85.1555
3,382
swe_bench::test::21
swe_bench
test
21
astropy__astropy-13390
astropy/astropy
astropy/astropy
python
1e75f298aef2540240c63b4075d06851d55fc19a
BUG: Table test failures with np 1.23.0rc3 ``` ====================================================================== FAILURES ======================================================================= __________________________________________________________ test_col_unicode_sandwich_unicode ____________________________...
Related details: https://github.com/astropy/astroquery/issues/2440#issuecomment-1155588504 xref https://github.com/numpy/numpy/pull/21041 It was merged 4 days ago, so does this mean it went into the RC before it hits the "nightly wheel" that we tests against here? ahh, good point, I forgot that the "nightly" is not in ...
diff --git a/astropy/table/column.py b/astropy/table/column.py --- a/astropy/table/column.py +++ b/astropy/table/column.py @@ -297,31 +297,23 @@ def _make_compare(oper): oper : str Operator name """ - swapped_oper = {'__eq__': '__eq__', - '__ne__': '__ne__', - ...
diff --git a/astropy/table/tests/test_column.py b/astropy/table/tests/test_column.py --- a/astropy/table/tests/test_column.py +++ b/astropy/table/tests/test_column.py @@ -2,6 +2,7 @@ from astropy.utils.tests.test_metadata import MetaBaseTest import operator +import warnings import pytest import numpy as np @@ -...
["astropy/table/tests/test_column.py::TestColumn::test_quantity_comparison[MaskedColumn]", "astropy/table/tests/test_column.py::test_unicode_sandwich_compare[Column-Column]"]
["astropy/table/tests/test_column.py::TestColumn::test_subclass[Column]", "astropy/table/tests/test_column.py::TestColumn::test_subclass[MaskedColumn]", "astropy/table/tests/test_column.py::TestColumn::test_numpy_ops[Column]", "astropy/table/tests/test_column.py::TestColumn::test_numpy_ops[MaskedColumn]", "astropy/tabl...
null
true
2022-06-23T20:06:08Z
1
43
2
11,767
0
0.8
1
0.65
1
0.643333
85.155
3,383
swe_bench::test::2106
swe_bench
test
2,106
sympy__sympy-16943
sympy/sympy
sympy/sympy
python
a6232c17a6d3c79e95353924df3a3cd062df0708
sympy.fps doesn't always return a formal power series See the following: ```pycon >>> from sympy import Symbol, fps >>> x = Symbol('x') >>> p = fps(x ** 2) >>> p x**2 >>> type(p) <class 'sympy.core.power.Pow'> >>> p[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'Pow' object doe...
well could you please elaborate your issue, as of documentation it returns correct without `O` term if you wish to have value of p(0) try p.subs(x,0) The issue is that the returned value is not a FormalPowerSeries object and doesn't support the same interface as it, so why is it being returned from a method that claim...
diff --git a/sympy/series/formal.py b/sympy/series/formal.py --- a/sympy/series/formal.py +++ b/sympy/series/formal.py @@ -779,7 +779,11 @@ def _compute_fps(f, x, x0, dir, hyper, order, rational, full): result[2].subs(x, rep2 + rep2b)) if f.is_polynomial(x): - return None + k = Dum...
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 @@ -3824,6 +3824,10 @@ def test_sympy__series__formal__FormalPowerSeries(): from sympy.series.formal import fps assert _test_args(fps(log(1 + x), x)) +def test_s...
["test_fps"]
["test_all_classes_are_tested", "test_sympy__assumptions__assume__AppliedPredicate", "test_sympy__assumptions__assume__Predicate", "test_sympy__assumptions__sathandlers__UnevaluatedOnFree", "test_sympy__assumptions__sathandlers__AllArgs", "test_sympy__assumptions__sathandlers__AnyArgs", "test_sympy__assumptions__sathan...
null
true
2019-06-02T14:57:30Z
1
16
1
679
0
0.8
1
0.7
1
0.1665
85.1495
3,384
swe_bench::dev::35
swe_bench
dev
35
pvlib__pvlib-python-1273
pvlib/pvlib-python
pvlib/pvlib-python
python
0e6fea6219618c0da944e6ed686c10f5b1e244a2
Incorrect AOI from pvlib.tracking.singleaxis `pvlib.tracking.singleaxis` produces an incorrect AOI when the sun is above the earth horizon but behind the module plane. **To Reproduce** Model a fixed tilt system (90 tilt, 180 azimuth) and compare to a vertical single axis tracker with very small rotation limit. ``` i...
I agree that `abs` looks like a problem. This is an ancient line first committed April 3, 2015: https://github.com/pvlib/pvlib-python/blob/46f69bf9ae2869d75f74664684b4de3b3b3e9bf2/pvlib/tracking.py#L219 Yes, my initial port of the matlab code was as close to 1:1 as I could make it. I don't recall second guessing the `...
diff --git a/pvlib/tracking.py b/pvlib/tracking.py --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -458,7 +458,9 @@ def singleaxis(apparent_zenith, apparent_azimuth, sun_vec = np.array([xp, yp, zp]) # calculate angle-of-incidence on panel - aoi = np.degrees(np.arccos(np.abs(np.sum(sun_vec*panel_norm, ...
diff --git a/pvlib/tests/test_tracking.py b/pvlib/tests/test_tracking.py --- a/pvlib/tests/test_tracking.py +++ b/pvlib/tests/test_tracking.py @@ -502,3 +502,18 @@ def test_slope_aware_backtracking(): np.testing.assert_allclose( truetracking['tracker_theta'], expected_data['TrueTracking'], rtol=1...
["pvlib/tests/test_tracking.py::test_singleaxis_aoi_gh1221"]
["pvlib/tests/test_tracking.py::test_solar_noon", "pvlib/tests/test_tracking.py::test_scalars", "pvlib/tests/test_tracking.py::test_arrays", "pvlib/tests/test_tracking.py::test_nans", "pvlib/tests/test_tracking.py::test_arrays_multi", "pvlib/tests/test_tracking.py::test_azimuth_north_south", "pvlib/tests/test_tracking....
null
true
2021-08-08T05:20:56Z
1
4
1
1,846
0
0.8
1
0.85
0.8
0.321
85.138
3,385
swe_bench::test::2036
swe_bench
test
2,036
sympy__sympy-15011
sympy/sympy
sympy/sympy
python
b7c5ba2bf3ffd5cf453b25af7c8ddd9a639800cb
lambdify does not work with certain MatrixSymbol names even with dummify=True `lambdify` is happy with curly braces in a symbol name and with `MatrixSymbol`s, but not with both at the same time, even if `dummify` is `True`. Here is some basic code that gives the error. ``` import sympy as sy curlyx = sy.symbols("{x}")...
The default here should be to always dummify, unless dummify is explicitly False https://github.com/sympy/sympy/blob/a78cf1d3efe853f1c360f962c5582b1d3d29ded3/sympy/utilities/lambdify.py?utf8=%E2%9C%93#L742 Hi, I would like to work on this if possible
diff --git a/sympy/utilities/lambdify.py b/sympy/utilities/lambdify.py --- a/sympy/utilities/lambdify.py +++ b/sympy/utilities/lambdify.py @@ -700,14 +700,13 @@ def _is_safe_ident(cls, ident): return isinstance(ident, str) and cls._safe_ident_re.match(ident) \ and not (keyword.iskeyword(id...
diff --git a/sympy/utilities/tests/test_lambdify.py b/sympy/utilities/tests/test_lambdify.py --- a/sympy/utilities/tests/test_lambdify.py +++ b/sympy/utilities/tests/test_lambdify.py @@ -728,6 +728,14 @@ def test_dummification(): raises(SyntaxError, lambda: lambdify(2 * F(t), 2 * F(t) + 5)) raises(SyntaxError...
["test_curly_matrix_symbol"]
["test_no_args", "test_single_arg", "test_list_args", "test_nested_args", "test_str_args", "test_own_namespace_1", "test_own_namespace_2", "test_own_module", "test_bad_args", "test_atoms", "test_sympy_lambda", "test_math_lambda", "test_mpmath_lambda", "test_number_precision", "test_mpmath_precision", "test_math_transl"...
null
true
2018-08-02T12:54:02Z
1
14
1
686
0
0.8
1
0.7
1
0.161
85.133
3,386
swe_bench::test::2274
swe_bench
test
2,274
sympy__sympy-23560
sympy/sympy
sympy/sympy
python
b1cf21e12e84ecef87b45091e3a524b657033ad9
idiff should use `solve_linear` (or better) `idiff` should not use full blown `solve` to implicitly solve for a derivative which will appear in a linear fashion. `solve_linear` would be better to use or else simply use a low-level linear solver for the calculation. The following equation takes too long to solve for `dx...
Hi, Can I take up this issue if possible?
diff --git a/sympy/geometry/util.py b/sympy/geometry/util.py --- a/sympy/geometry/util.py +++ b/sympy/geometry/util.py @@ -19,11 +19,13 @@ from .exceptions import GeometryError from .point import Point, Point2D, Point3D from sympy.core.containers import OrderedSet -from sympy.core.function import Function +from symp...
diff --git a/sympy/geometry/tests/test_util.py b/sympy/geometry/tests/test_util.py --- a/sympy/geometry/tests/test_util.py +++ b/sympy/geometry/tests/test_util.py @@ -1,7 +1,7 @@ from sympy.core.function import (Derivative, Function) from sympy.core.singleton import S from sympy.core.symbol import Symbol -from sympy...
["test_idiff"]
["test_intersection", "test_convex_hull", "test_centroid", "test_farthest_points_closest_points"]
null
true
2022-05-31T06:52:06Z
1
12
1
716
0
0.8
1
0.7
1
0.159333
85.128
3,387
swe_bench::dev::155
swe_bench
dev
155
pylint-dev__astroid-941
pylint-dev/astroid
pylint-dev/astroid
python
962becc0ae86c16f7b33140f43cd6ed8f1e8a045
@property members defined in metaclasses of a base class are not correctly inferred Ref https://github.com/PyCQA/astroid/issues/927#issuecomment-817244963 Inference works on the parent class but not the child in the following example: ```python class BaseMeta(type): @property def __members__(cls): ret...
Looks like this is caused by https://github.com/PyCQA/astroid/blob/f2b197a4f8af0ceeddf435747a5c937c8632872a/astroid/scoped_nodes.py#L2590-L2603. When we are inferring an attribute on a derived class then `class_context` is `True` but `metaclass` is `False` so the property itself is returned.
diff --git a/astroid/brain/brain_namedtuple_enum.py b/astroid/brain/brain_namedtuple_enum.py --- a/astroid/brain/brain_namedtuple_enum.py +++ b/astroid/brain/brain_namedtuple_enum.py @@ -315,6 +315,7 @@ def infer_enum_class(node): if node.root().name == "enum": # Skip if the class is directly from...
diff --git a/tests/unittest_scoped_nodes.py b/tests/unittest_scoped_nodes.py --- a/tests/unittest_scoped_nodes.py +++ b/tests/unittest_scoped_nodes.py @@ -1923,6 +1923,153 @@ def update(self): builder.parse(data) +def test_issue940_metaclass_subclass_property(): + node = builder.extract_node( + "...
["tests/unittest_scoped_nodes.py::test_issue940_metaclass_subclass_property", "tests/unittest_scoped_nodes.py::test_issue940_enums_as_a_real_world_usecase"]
["tests/unittest_scoped_nodes.py::ModuleNodeTest::test_dict_interface", "tests/unittest_scoped_nodes.py::ModuleNodeTest::test_file_stream_api", "tests/unittest_scoped_nodes.py::ModuleNodeTest::test_file_stream_in_memory", "tests/unittest_scoped_nodes.py::ModuleNodeTest::test_file_stream_physical", "tests/unittest_scope...
null
true
2021-04-11T11:57:22Z
2
21
2
529
0
0.8
1
0.7
1
0.158167
85.1245
3,388
swe_bench::dev::127
swe_bench
dev
127
pydicom__pydicom-997
pydicom/pydicom
pydicom/pydicom
python
41e984c8df5533805ae13cbcf419e6c5f63da30c
Generators in encaps don't handle single fragment per frame correctly with no BOT value #### Description Generators in `encaps.py` handling of encapsulated pixel data incorrect when the Basic Offset Table has no value and each frame is a single fragment. #### Steps/Code to Reproduce ```python from pydicom import dcmre...
The problem is that as far as I can tell there's no unambiguous way to determine the difference between one frame with multiple fragments and multiple frames of 1 fragment each when the Basic Offset Table (Part 5, Annex A.4 and Section 8.2) has no value. You can look at the NumberOfFrames value but that won't help if t...
diff --git a/pydicom/encaps.py b/pydicom/encaps.py --- a/pydicom/encaps.py +++ b/pydicom/encaps.py @@ -2,6 +2,7 @@ """Functions for working with encapsulated (compressed) pixel data.""" from struct import pack +import warnings import pydicom.config from pydicom.filebase import DicomBytesIO @@ -50,9 +51,10 @@ de...
diff --git a/pydicom/tests/test_encaps.py b/pydicom/tests/test_encaps.py --- a/pydicom/tests/test_encaps.py +++ b/pydicom/tests/test_encaps.py @@ -4,10 +4,11 @@ import pytest from pydicom import dcmread -from pydicom.data import get_testdata_files +from pydicom.data import get_testdata_file from pydicom.encaps imp...
["pydicom/tests/test_encaps.py::TestGetFrameOffsets::test_bad_tag", "pydicom/tests/test_encaps.py::TestGetFrameOffsets::test_bad_length_multiple", "pydicom/tests/test_encaps.py::TestGetFrameOffsets::test_zero_length", "pydicom/tests/test_encaps.py::TestGetFrameOffsets::test_multi_frame", "pydicom/tests/test_encaps.py::...
[]
null
true
2019-12-19T01:02:16Z
1
162
70
1,272
0
0.8
1
0.85
0.75
0.712
85.1235
3,389
swe_bench::test::1169
swe_bench
test
1,169
psf__requests-1689
psf/requests
psf/requests
python
e91ee0e2461cc9b6822e7c3cc422038604ace08d
Problem POST'ing png file because of UnicodeError Here is the code I'm using: ``` python files = {'file': (upload_handle.upload_token.key, open("test.png", "rb"))} resp = requests.post(url, files=files) ``` This raises the error: ``` UnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 140: invalid st...
Yep, that's a crass little bug. Thanks so much for pointing it out! I'll go through the headers we set and make sure we don't do this anywhere else. =)
diff --git a/requests/models.py b/requests/models.py --- a/requests/models.py +++ b/requests/models.py @@ -407,7 +407,7 @@ def prepare_body(self, data, files): raise NotImplementedError('Streamed bodies and files are mutually exclusive.') if length is not None: - self.head...
diff --git a/test_requests.py b/test_requests.py --- a/test_requests.py +++ b/test_requests.py @@ -684,6 +684,14 @@ def test_can_send_nonstring_objects_with_files(self): self.assertTrue('multipart/form-data' in p.headers['Content-Type']) + def test_autoset_header_values_are_native(self): + data =...
["test_requests.py::RequestsTestCase::test_HTTP_200_OK_HEAD"]
["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_DIGEST_STREAM", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_GET_ALTERNATIVE", "test_requests.py::RequestsTestCase:...
null
true
2013-10-18T17:35:07Z
1
6
1
811
0
0.8
1
0.7
1
0.155167
85.1155
3,390
swe_bench::dev::81
swe_bench
dev
81
pydicom__pydicom-1139
pydicom/pydicom
pydicom/pydicom
python
b9fb05c177b685bf683f7f57b2d57374eb7d882d
Make PersonName3 iterable ```python from pydicom import Dataset ds = Dataset() ds.PatientName = 'SomeName' 'S' in ds.PatientName ``` ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: argument of type 'PersonName3' is not iterable ``` I'm not really sure if this is intentional or...
I think it is reasonable to support at least some `str` methods (definitely `__contains__` for the example above), but there are many that don't make a lot of sense in this context though - e.g. `join`, `ljust`, `maketrans`, `splitlines` just to name a few, but I suppose each would either never be actually used or woul...
diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py --- a/pydicom/valuerep.py +++ b/pydicom/valuerep.py @@ -1,6 +1,5 @@ # Copyright 2008-2018 pydicom authors. See LICENSE file for details. """Special classes for DICOM value representations (VR)""" -from copy import deepcopy from decimal import Decimal import re ...
diff --git a/pydicom/tests/test_valuerep.py b/pydicom/tests/test_valuerep.py --- a/pydicom/tests/test_valuerep.py +++ b/pydicom/tests/test_valuerep.py @@ -427,6 +427,62 @@ def test_hash(self): ) assert hash(pn1) == hash(pn2) + def test_next(self): + """Test that the next function works on ...
["pydicom/tests/test_valuerep.py::TestPersonName::test_next", "pydicom/tests/test_valuerep.py::TestPersonName::test_iterator", "pydicom/tests/test_valuerep.py::TestPersonName::test_contains"]
["pydicom/tests/test_valuerep.py::TestTM::test_pickling", "pydicom/tests/test_valuerep.py::TestDT::test_pickling", "pydicom/tests/test_valuerep.py::TestDA::test_pickling", "pydicom/tests/test_valuerep.py::TestDS::test_empty_value", "pydicom/tests/test_valuerep.py::TestDS::test_float_values", "pydicom/tests/test_valuere...
null
true
2020-06-26T11:47:17Z
1
20
3
526
0
0.8
1
0.7
1
0.154333
85.113
3,391
swe_bench::test::1813
swe_bench
test
1,813
sphinx-doc__sphinx-8202
sphinx-doc/sphinx
sphinx-doc/sphinx
python
3c017dcdee6b9f4b7f5e46b3b0ba2cebced4d4dc
Problems with doc comments using Generic class and extending it **Describe the bug** This is a very specific bug (I think), when we have a `Generic` class with doc comment for an attribute and I extend it. If the child class has the `__init__` method (using typed parameters) and I try to reassign the attribute from `G...
I passed `-vv` option to the Makefile and confirm what happened in the build. As a result, the following reST code is generated during the build: ``` .. py:attribute:: ReaderFutureResult :module: returns.context.requires_context_future_result Sometimes `RequiresContextFutureResult` is too long to type. ...
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 @@ -535,6 +535,11 @@ def process_doc(self, docstrings: List[List[str]]) -> Iterator[str]: self.env.app.emit('autodoc-process-docstring', ...
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 @@ -28,7 +28,8 @@ def on_process_docstring(app, what, name, obj, options, lines): '.. py:function:: func()', ' :module: target.process_docstr...
["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"]
null
true
2020-09-12T09:37:31Z
1
5
1
1,773
0
0.8
1
0.85
0.8
0.312167
85.1115
3,392
swe_bench::test::1356
swe_bench
test
1,356
pylint-dev__pylint-6937
pylint-dev/pylint
pylint-dev/pylint
python
f6b2cfeb76dcd571ca02c3853ca80ee3c938e98b
--disable ignored when --errors-only specified ### Steps to reproduce 1. create a python file (test.py) with a single line _import notfoundpackage_ 2. _pylint --disable=E0401 --errors-only test.py_ ### Current behavior reports ************* Module test test.py:1:0: E0401: Unable to import 'notfoundpackage' (import-e...
This is a `pylint` issue. However, I'd like to reframe it to: ``` pylint --errors-only --disable=E0401 test.py ``` not working as intended. Due to the limitation of argument parsers arguments will be parser consecutively. So if you first disable an error message, but then enable all error message it will be re-e...
diff --git a/pylint/lint/base_options.py b/pylint/lint/base_options.py --- a/pylint/lint/base_options.py +++ b/pylint/lint/base_options.py @@ -529,9 +529,9 @@ def _make_run_options(self: Run) -> Options: "action": _ErrorsOnlyModeAction, "kwargs": {"Run": self}, "short"...
diff --git a/tests/test_self.py b/tests/test_self.py --- a/tests/test_self.py +++ b/tests/test_self.py @@ -1519,6 +1519,16 @@ def test_errors_only() -> None: run = Run(["--errors-only"]) assert run.linter._error_mode + @staticmethod + def test_errors_only_functions_as_disable() -> None...
["tests/test_self.py::TestCallbackOptions::test_errors_only_functions_as_disable"]
["tests/test_self.py::TestRunTC::test_pkginfo", "tests/test_self.py::TestRunTC::test_all", "tests/test_self.py::TestRunTC::test_no_ext_file", "tests/test_self.py::TestRunTC::test_w0704_ignored", "tests/test_self.py::TestRunTC::test_exit_zero", "tests/test_self.py::TestRunTC::test_nonexistent_config_file", "tests/test_s...
null
true
2022-06-12T21:28:40Z
2
17
1
581
0
0.8
1
0.7
1
0.1535
85.1105
3,393
r2e_gym::train::4577
r2e_gym
train
4,577
numpy__afad5902f2e5086c9c30bdad8a21561e3188d816
numpy
numpy/numpy
python
afad5902f2e5086c9c30bdad8a21561e3188d816
**Title:** Incorrect Representation of Matrix Objects in Array Comparison Error Messages **Description:** When comparing a NumPy array with a matrix object, the error message does not correctly represent the matrix. Instead of displaying the matrix's contents and shape, it shows a repr failure message, making it diffi...
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -448,7 +448,7 @@ # skip over array( next_line_prefix += " "*len(prefix) - lst = _formatArray(a, format_function, a.ndim, options['linewidth'], + lst = _formatArray(a, forma...
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -296,11 +296,13 @@ (shapes (2,), (1, 2) mismatch) x: array([1, 2]) - y: [repr failed for <matrix>: %d format: a n...
null
null
namanjain12/numpy_final:afad5902f2e5086c9c30bdad8a21561e3188d816
true
null
1
144
null
1,061
0
0.75
1
0.75
1
0.656833
85.0955
3,394
swe_bench::test::2126
swe_bench
test
2,126
sympy__sympy-17288
sympy/sympy
sympy/sympy
python
2c5dbb45e2cd8832b09f1c3318b70e972e16b71d
Latex printing issue on derivatives with superscripted symbols When I display the derivatives of second-or-more order with superscipted symbols, it gives wrong latex expression and fails to print correctly with IPython environment. For example, ```python x_star = Symbol('x^{*}') Derivative(x_star, x_star,2) ``` this...
I have a fix in progress. Do you really want `x^{*2}`? I think either `{x^{*}}^{2}` or `(x^{*})^{2}` makes more sense (and is easier to implement, to the extent that I can say that `x^{*2}` will not happen, at least not now, since it requires something of a LaTeX parser...). Btw, using {} inside symbol names disabl...
diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py --- a/sympy/printing/latex.py +++ b/sympy/printing/latex.py @@ -206,6 +206,18 @@ def parenthesize(self, item, level, strict=False): else: return self._print(item) + def parenthesize_super(self, s): + """ Parenthesize s if t...
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 @@ -1,7 +1,7 @@ from sympy import ( Add, Abs, Chi, Ci, CosineTransform, Dict, Ei, Eq, FallingFactorial, FiniteSet, Float, FourierTransform, Fu...
["test_latex_basic", "test_issue_17092"]
["test_printmethod", "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_bessel", "test_latex_...
null
true
2019-07-28T10:52:19Z
1
18
2
529
0
0.8
1
0.7
1
0.148167
85.0945
3,395
swe_bench::dev::48
swe_bench
dev
48
pvlib__pvlib-python-1606
pvlib/pvlib-python
pvlib/pvlib-python
python
c78b50f4337ecbe536a961336ca91a1176efc0e8
golden-section search fails when upper and lower bounds are equal **Describe the bug** I was using pvlib for sometime now and until now I was always passing a big dataframe containing readings of a long period. Because of some changes in our software architecture, I need to pass the weather readings as a single reading...
Confirmed. This appears to be an oversight in `pvlib.tools._golden_section_DataFrame` involving error messaging, likely introduced with #1089 . In this code when processing the content of `data`, photocurrent is 0., hence the shunt resistance is infinite and v_oc is 0. That sets the range for the golden section sear...
diff --git a/pvlib/tools.py b/pvlib/tools.py --- a/pvlib/tools.py +++ b/pvlib/tools.py @@ -341,6 +341,8 @@ def _golden_sect_DataFrame(params, lower, upper, func, atol=1e-8): -------- pvlib.singlediode._pwr_optfcn """ + if np.any(upper - lower < 0.): + raise ValueError('upper >= lower is require...
diff --git a/pvlib/tests/test_tools.py b/pvlib/tests/test_tools.py --- a/pvlib/tests/test_tools.py +++ b/pvlib/tests/test_tools.py @@ -45,6 +45,22 @@ def test__golden_sect_DataFrame_vector(): v, x = tools._golden_sect_DataFrame(params, lower, upper, _obj_test_golden_sect) ...
["pvlib/tests/test_tools.py::test__golden_sect_DataFrame_vector"]
["pvlib/tests/test_tools.py::test_build_kwargs[keys0-input_dict0-expected0]", "pvlib/tests/test_tools.py::test_build_kwargs[keys1-input_dict1-expected1]", "pvlib/tests/test_tools.py::test_build_kwargs[keys2-input_dict2-expected2]", "pvlib/tests/test_tools.py::test_build_kwargs[keys3-input_dict3-expected3]", "pvlib/test...
null
true
2022-12-07T21:12:08Z
1
36
1
6,277
0
0.8
1
0.65
1
0.62
85.085
3,396
swe_bench::test::1343
swe_bench
test
1,343
pylint-dev__pylint-6059
pylint-dev/pylint
pylint-dev/pylint
python
789a3818fec81754cf95bef2a0b591678142c227
Is `BaseChecker.__gt__` required ### Bug description As noted by @DanielNoord [here](https://github.com/PyCQA/pylint/pull/5938#discussion_r837867526), [`BaseCheck.__gt__`](https://github.com/PyCQA/pylint/blob/742e60dc07077cdd3338dffc3bb809cd4c27085f/pylint/checkers/base_checker.py#L62-L64) is not currently covered. If...
I think this was used originally to be able to assert that a list of checker is equal to another one in tests. If it's not covered it means we do not do that anymore. It's used in Sphinx and maybe downstream libraries see #6047 . Shall we add a no coverage param then? It's pretty easy to add a unit test for this so wi...
diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py --- a/pylint/checkers/base_checker.py +++ b/pylint/checkers/base_checker.py @@ -61,7 +61,15 @@ def __init__( def __gt__(self, other): """Permit to sort a list of Checker by name.""" - return f"{self.name}{self.msgs}" >...
diff --git a/tests/checkers/unittest_base_checker.py b/tests/checkers/unittest_base_checker.py --- a/tests/checkers/unittest_base_checker.py +++ b/tests/checkers/unittest_base_checker.py @@ -33,6 +33,17 @@ class LessBasicChecker(OtherBasicChecker): ) +class DifferentBasicChecker(BaseChecker): + name = "diff...
["tests/checkers/unittest_base_checker.py::test_base_checker_ordering"]
["tests/checkers/unittest_base_checker.py::test_base_checker_doc"]
null
true
2022-03-30T18:23:36Z
1
10
1
658
0
0.8
1
0.7
1
0.143
85.079
3,397
swe_bench::dev::89
swe_bench
dev
89
pydicom__pydicom-1334
pydicom/pydicom
pydicom/pydicom
python
24a86b316441ac3a46e569779627e24482786a8a
Strings with Value Representation DS are too long **Describe the bug** Strings of Value Representation DS are restricted to a maximum length of 16 bytes according to [Part 5 Section 6.2](http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html#para_15754884-9ca2-4b12-9368-d66f32bc8ce1), but `pydico...
Thanks for this, @hackermd. Pydicom has traditionally been permissive about values as they are set, because sometimes people want to replicate existing invalid DICOM. But for sure this should be an error when `config.enforce_valid_values` is `True` (perhaps a warning otherwise), and pydicom should leave it to the cal...
diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py --- a/pydicom/valuerep.py +++ b/pydicom/valuerep.py @@ -3,6 +3,7 @@ import datetime from decimal import Decimal +from math import floor, isfinite, log10 import platform import re import sys @@ -329,15 +330,139 @@ def __reduce_ex__(self, protocol: int) -> Uni...
diff --git a/pydicom/tests/test_valuerep.py b/pydicom/tests/test_valuerep.py --- a/pydicom/tests/test_valuerep.py +++ b/pydicom/tests/test_valuerep.py @@ -9,7 +9,9 @@ import cPickle as pickle except ImportError: import pickle +import math import sys +from typing import Union from pydicom.tag import Tag ...
["pydicom/tests/test_valuerep.py::TestIsValidDS::test_valid[1]", "pydicom/tests/test_valuerep.py::TestIsValidDS::test_valid[3.14159265358979]", "pydicom/tests/test_valuerep.py::TestIsValidDS::test_valid[-1234.456e78]", "pydicom/tests/test_valuerep.py::TestIsValidDS::test_valid[1.234E-5]", "pydicom/tests/test_valuerep.p...
["pydicom/tests/test_valuerep.py::TestTM::test_pickling", "pydicom/tests/test_valuerep.py::TestTM::test_str", "pydicom/tests/test_valuerep.py::TestTM::test_new_empty_str", "pydicom/tests/test_valuerep.py::TestTM::test_new_str_conversion", "pydicom/tests/test_valuerep.py::TestTM::test_new_obj_conversion", "pydicom/tests...
null
true
2021-04-04T22:06:46Z
1
221
137
1,175
0
0.8
1
0.85
0.75
0.695833
85.075
3,398
swe_bench::dev::49
swe_bench
dev
49
pvlib__pvlib-python-1616
pvlib/pvlib-python
pvlib/pvlib-python
python
25af86599845f23b0ce57dc1cbe743b3a1e68d1a
IAM that supports AR coating like Fresnel # Problem Currently pvlib supports the DeSoto physical model (similar to normal glass), ASHRAE, Martin & Ruiz, and SAPM polynomial, but it doesn't have a pure Fresnel model that allows additional interfaces like an AR coating. * DeSoto physical model is most similar to the Fre...
+1. This [reference](https://www.sciencedirect.com/science/article/abs/pii/S0038092X96001375) might be relevant. I seem to recall from somewhere that PVsyst actually interpolates from a fixed set of pre-calculated values when simulating. PVsyst allows a user specified custom IAM v AOI lookup table in the module PAN fil...
diff --git a/pvlib/iam.py b/pvlib/iam.py --- a/pvlib/iam.py +++ b/pvlib/iam.py @@ -11,7 +11,7 @@ import numpy as np import pandas as pd import functools -from pvlib.tools import cosd, sind, tand, asind +from pvlib.tools import cosd, sind # a dict of required parameter names for each IAM model # keys are the func...
diff --git a/pvlib/tests/test_iam.py b/pvlib/tests/test_iam.py --- a/pvlib/tests/test_iam.py +++ b/pvlib/tests/test_iam.py @@ -42,7 +42,7 @@ def test_physical(): expected = np.array([0, 0.8893998, 0.98797788, 0.99926198, 1, 0.99926198, 0.98797788, 0.8893998, 0, np.nan]) iam = _iam.ph...
["pvlib/tests/test_iam.py::test_physical_ar", "pvlib/tests/test_iam.py::test_physical_noar"]
["pvlib/tests/test_iam.py::test_ashrae", "pvlib/tests/test_iam.py::test_ashrae_scalar", "pvlib/tests/test_iam.py::test_physical", "pvlib/tests/test_iam.py::test_physical_scalar", "pvlib/tests/test_iam.py::test_martin_ruiz", "pvlib/tests/test_iam.py::test_martin_ruiz_exception", "pvlib/tests/test_iam.py::test_martin_rui...
null
true
2022-12-16T11:52:35Z
1
119
2
4,320
0
0.8
1
0.62
1
0.896667
85.06
3,399
swe_bench::test::2182
swe_bench
test
2,182
sympy__sympy-19007
sympy/sympy
sympy/sympy
python
f9e030b57623bebdc2efa7f297c1b5ede08fcebf
Wrong matrix element fetched from BlockMatrix Given this code: ``` from sympy import * n, i = symbols('n, i', integer=True) A = MatrixSymbol('A', 1, 1) B = MatrixSymbol('B', n, 1) C = BlockMatrix([[A], [B]]) print('C is') pprint(C) print('C[i, 0] is') pprint(C[i, 0]) ``` I get this output: ``` C is ⎡A⎤ ⎢ ⎥ ⎣B⎦ C[i, 0] ...
I was aware of the problem that the coordinates were loosely handled even if the matrix had symbolic dimensions I also think that `C[3, 0]` should be undefined because there is no guarantee that n is sufficiently large to contain elements. `C[3, 0]` should just stay unevaluated, since it might be valid (I assume that'...
diff --git a/sympy/matrices/expressions/blockmatrix.py b/sympy/matrices/expressions/blockmatrix.py --- a/sympy/matrices/expressions/blockmatrix.py +++ b/sympy/matrices/expressions/blockmatrix.py @@ -7,7 +7,7 @@ from sympy.utilities import sift from sympy.utilities.misc import filldedent -from sympy.matrices.express...
diff --git a/sympy/matrices/expressions/tests/test_blockmatrix.py b/sympy/matrices/expressions/tests/test_blockmatrix.py --- a/sympy/matrices/expressions/tests/test_blockmatrix.py +++ b/sympy/matrices/expressions/tests/test_blockmatrix.py @@ -192,7 +192,6 @@ def test_BlockDiagMatrix(): def test_blockcut(): A = Ma...
["test_block_index_symbolic", "test_block_index_symbolic_nonzero", "test_block_index_large"]
["test_bc_matmul", "test_bc_matadd", "test_bc_transpose", "test_bc_dist_diag", "test_block_plus_ident", "test_BlockMatrix", "test_block_collapse_explicit_matrices", "test_issue_17624", "test_issue_18618", "test_BlockMatrix_trace", "test_BlockMatrix_Determinant", "test_squareBlockMatrix", "test_BlockDiagMatrix", "test_b...
null
true
2020-03-29T13:47:11Z
1
18
3
451
0
0.8
1
0.7
1
0.135167
85.0555