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,200 | swe_bench::dev::121 | swe_bench | dev | 121 | pydicom__pydicom-944 | pydicom/pydicom | pydicom/pydicom | python | a0300a69a1da1626caef0d9738cff29b17ce79cc | Embedded Null character
#### Description
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/pydicom/charset.py in convert_encodings(encodings)
624 try:
--> 625 ... | Well, this is invalid DICOM, so strictly speaking this is not a bug, but we can probably just ignore the null character and change the error into a warning (if `config.enforce_valid_values` is not set).
> Well, this is invalid DICOM, so strictly speaking this is not a bug, but we can probably just ignore the null chara... | diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py
--- a/pydicom/valuerep.py
+++ b/pydicom/valuerep.py
@@ -545,7 +545,7 @@ def MultiString(val, valtype=str):
# 2005.05.25: also check for trailing 0, error made
# in PET files we are converting
- if val and (val.endswith(' ') or val.endswith('\x00')):
... | diff --git a/pydicom/tests/test_values.py b/pydicom/tests/test_values.py
--- a/pydicom/tests/test_values.py
+++ b/pydicom/tests/test_values.py
@@ -86,6 +86,21 @@ def test_single_value_with_delimiters(self):
expected = u'Διονυσιος\r\nJérôme/Люкceмбypг\tJérôme'
assert expected == convert_single_string(b... | ["pydicom/tests/test_values.py::TestConvertText::test_value_ending_with_padding"] | ["pydicom/tests/test_values.py::TestConvertTag::test_big_endian", "pydicom/tests/test_values.py::TestConvertTag::test_little_endian", "pydicom/tests/test_values.py::TestConvertTag::test_offset", "pydicom/tests/test_values.py::TestConvertAE::test_strip_blanks", "pydicom/tests/test_values.py::TestConvertText::test_single... | null | true | 2019-09-05T18:25:50Z | 2 | 4 | 1 | 3,556 | 0 | 0.8 | 1 | 0.92 | 0.8 | 0.513333 | 87.71 | |
3,201 | swe_bench::test::1742 | swe_bench | test | 1,742 | sphinx-doc__sphinx-10504 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 113e1d8759e444342544bd97ed93bc1622b9a6bb | IndexError: list index out of range
### Describe the bug
make[1]: *** [Documentation/Makefile:96: htmldocs] Error 2
make: *** [Makefile:1678: htmldocs] Error 2
==> ERROR: A failure occurred in build().
Aborting...
### How to Reproduce
[Arch Build System](https://wiki.archlinux.org/title/Arch_Build_System)
```
$ ... | Getting the same in a Github Action, started happening yesterday, as the build switched to Sphinx 5:
```
sphinx:
[echo] Running sphinx-build -D release=28-SNAPSHOT -q -W --keep-going -j auto -b html -d "/home/runner/work/geotools/geotools/docs/target/developer/doctrees" . "/home/runner/work/geotools/geotools/... | 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
@@ -40,7 +40,9 @@ class KeyboardTransform(SphinxPostTransform):
def run(self, **kwargs: Any) -> None:
matcher = NodeMatcher(nodes.literal... | diff --git a/tests/roots/test-transforms-post_transforms-keyboard/conf.py b/tests/roots/test-transforms-post_transforms-keyboard/conf.py
new file mode 100644
diff --git a/tests/roots/test-transforms-post_transforms-keyboard/index.rst b/tests/roots/test-transforms-post_transforms-keyboard/index.rst
new file mode 100644
... | ["tests/test_transforms_post_transforms.py::test_keyboard_hyphen_spaces"] | ["tests/test_transforms_post_transforms.py::test_nitpicky_warning", "tests/test_transforms_post_transforms.py::test_missing_reference", "tests/test_transforms_post_transforms.py::test_missing_reference_conditional_pending_xref"] | null | true | 2022-05-31T23:37:32Z | 1 | 4 | 1 | 5,303 | 0 | 0.8 | 1 | 0.92 | 0.8 | 0.513333 | 87.71 | |
3,202 | swe_bench::test::1301 | swe_bench | test | 1,301 | pydata__xarray-7101 | pydata/xarray | pydata/xarray | python | e678a1d7884a3c24dba22d41b2eef5d7fe5258e7 | Broken state when using assign_coords with multiindex
### What happened?
I was trying to assign coordinates on a dataset that had been created by using stack. After assigning the coordinates, the dataset was in a state where its length was coming out as less than zero, which caused all sorts of issues.
### What did y... | Hi @znichollscr, thanks for the report. Indeed it looks like `_coord_names` are not updated properly. | diff --git a/xarray/core/coordinates.py b/xarray/core/coordinates.py
--- a/xarray/core/coordinates.py
+++ b/xarray/core/coordinates.py
@@ -315,6 +315,7 @@ def _maybe_drop_multiindex_coords(self, coords: set[Hashable]) -> None:
variables, indexes = drop_coords(
coords, self._data._variables, self._... | 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
@@ -1501,9 +1501,7 @@ def test_assign_coords(self) -> None:
def test_assign_coords_existing_multiindex(self) -> None:
data = self.mda
- with pytes... | ["xarray/tests/test_dataarray.py::TestDataArray::test_assign_coords_existing_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_assign_coords_existing_multiindex"] | ["xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray... | null | true | 2022-09-28T16:21:48Z | 1 | 3 | 2 | 4,370 | 0 | 0.8 | 1 | 0.92 | 0.8 | 0.51 | 87.7 | |
3,203 | swe_bench::test::1501 | swe_bench | test | 1,501 | scikit-learn__scikit-learn-10443 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 48f3303bfc0be26136b98e9aa95dc3b3f916daff | TfidfVectorizer dtype argument ignored
#### Description
TfidfVectorizer's fit/fit_transform output is always np.float64 instead of the specified dtype
#### Steps/Code to Reproduce
```py
from sklearn.feature_extraction.text import TfidfVectorizer
test = TfidfVectorizer(dtype=np.float32)
print(test.fit_transform(["Help ... | diff --git a/sklearn/feature_extraction/text.py b/sklearn/feature_extraction/text.py
--- a/sklearn/feature_extraction/text.py
+++ b/sklearn/feature_extraction/text.py
@@ -11,7 +11,7 @@
The :mod:`sklearn.feature_extraction.text` submodule gathers utilities to
build feature vectors from text documents.
"""
-from __fut... | diff --git a/sklearn/feature_extraction/tests/test_text.py b/sklearn/feature_extraction/tests/test_text.py
--- a/sklearn/feature_extraction/tests/test_text.py
+++ b/sklearn/feature_extraction/tests/test_text.py
@@ -1,6 +1,9 @@
from __future__ import unicode_literals
import warnings
+import pytest
+from scipy import... | ["sklearn/feature_extraction/tests/test_text.py::test_tfidf_transformer_type[float32]", "sklearn/feature_extraction/tests/test_text.py::test_tfidf_vectorizer_type[int32-float64-UserWarning-'dtype'", "sklearn/feature_extraction/tests/test_text.py::test_tfidf_vectorizer_type[int64-float64-UserWarning-'dtype'", "sklearn/f... | ["sklearn/feature_extraction/tests/test_text.py::test_strip_accents", "sklearn/feature_extraction/tests/test_text.py::test_to_ascii", "sklearn/feature_extraction/tests/test_text.py::test_word_analyzer_unigrams", "sklearn/feature_extraction/tests/test_text.py::test_word_analyzer_unigrams_and_bigrams", "sklearn/feature_e... | null | true | 2018-01-10T04:02:32Z | 1 | 42 | 4 | 671 | 0 | 0.8 | 1 | 0.85 | 1 | 0.251833 | 87.6805 | ||
3,204 | swe_bench::test::1490 | swe_bench | test | 1,490 | pytest-dev__pytest-9911 | pytest-dev/pytest | pytest-dev/pytest | python | 2ba8fd5bc50f293fea11a863c2b8c4dc3488762b | Improved error when `()` (empty tuple) is passed to `pytest.raises()` or `pytest.warns()`
When using `pytest.raises()` as a context manager, you can pass an exception type or tuple of exception types; it's then an error if no exception is raised or if the exception raised is not an instance of the expected type(s). Th... | 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
@@ -899,6 +899,12 @@ def raises(
"""
__tracebackhide__ = True
+ if not expected_exception:
+ raise ValueError(
+ f"Expected an exception type or a tuple of ... | diff --git a/testing/python/raises.py b/testing/python/raises.py
--- a/testing/python/raises.py
+++ b/testing/python/raises.py
@@ -19,6 +19,16 @@ def test_raises_function(self):
excinfo = pytest.raises(ValueError, int, "hello")
assert "invalid literal" in str(excinfo.value)
+ def test_raises_does... | ["testing/python/raises.py::TestRaises::test_raises_does_not_allow_none", "testing/python/raises.py::TestRaises::test_raises_does_not_allow_empty_tuple"] | ["testing/python/raises.py::TestRaises::test_check_callable", "testing/python/raises.py::TestRaises::test_raises", "testing/python/raises.py::TestRaises::test_raises_function", "testing/python/raises.py::TestRaises::test_raises_callable_no_exception", "testing/python/raises.py::TestRaises::test_raises_falsey_type_error... | null | true | 2022-05-02T17:17:01Z | 1 | 6 | 2 | 1,368 | 0 | 0.8 | 1 | 0.85 | 1 | 0.248 | 87.669 | ||
3,205 | swe_bench::test::1326 | swe_bench | test | 1,326 | pylint-dev__pylint-4669 | pylint-dev/pylint | pylint-dev/pylint | python | c2d03c6b3881a9df7353432b109523984adf06f9 | Similarities checker with "ignore-signatures" option enabled ignores functions with docstring-only bodies
#4648 follow-up.
### Steps to reproduce
Given multiple files:
```
module\
__init__.py
a.py
b.py
```
`a.py`:
```python
def example_func(
arg1,
arg2,
arg3,
arg4,
):
"""Valid functio... | diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py
--- a/pylint/checkers/similar.py
+++ b/pylint/checkers/similar.py
@@ -223,9 +223,11 @@ def stripped_lines(
signature_lines = set(
chain(
*(
- range(func.fromlineno, func.body[0].lineno)
+ ... | diff --git a/tests/checkers/unittest_similar.py b/tests/checkers/unittest_similar.py
--- a/tests/checkers/unittest_similar.py
+++ b/tests/checkers/unittest_similar.py
@@ -35,6 +35,8 @@
SIMILAR4 = str(INPUT / "similar4")
SIMILAR5 = str(INPUT / "similar5")
SIMILAR6 = str(INPUT / "similar6")
+EMPTY_FUNCTION_1 = str(INP... | ["tests/checkers/unittest_similar.py::test_ignore_signatures_empty_functions_pass"] | ["tests/checkers/unittest_similar.py::test_ignore_comments", "tests/checkers/unittest_similar.py::test_ignore_docsrings", "tests/checkers/unittest_similar.py::test_ignore_imports", "tests/checkers/unittest_similar.py::test_multiline_imports", "tests/checkers/unittest_similar.py::test_ignore_multiline_imports", "tests/c... | null | true | 2021-07-04T19:07:27Z | 1 | 6 | 1 | 1,365 | 0 | 0.8 | 1 | 0.85 | 1 | 0.2475 | 87.6675 | ||
3,206 | swe_bench::dev::14 | swe_bench | dev | 14 | pvlib__pvlib-python-1072 | pvlib/pvlib-python | pvlib/pvlib-python | python | 04a523fafbd61bc2e49420963b84ed8e2bd1b3cf | temperature.fuentes errors when given tz-aware inputs on pandas>=1.0.0
**Describe the bug**
When the weather timeseries inputs to `temperature.fuentes` have tz-aware index, an internal call to `np.diff(index)` returns an array of `Timedelta` objects instead of an array of nanosecond ints, throwing an error immediately ... | diff --git a/pvlib/temperature.py b/pvlib/temperature.py
--- a/pvlib/temperature.py
+++ b/pvlib/temperature.py
@@ -599,8 +599,9 @@ def fuentes(poa_global, temp_air, wind_speed, noct_installed, module_height=5,
# n.b. the way Fuentes calculates the first timedelta makes it seem like
# the value doesn't matter ... | diff --git a/pvlib/tests/test_temperature.py b/pvlib/tests/test_temperature.py
--- a/pvlib/tests/test_temperature.py
+++ b/pvlib/tests/test_temperature.py
@@ -190,3 +190,17 @@ def test_fuentes(filename, inoct):
night_difference = expected_tcell[is_night] - actual_tcell[is_night]
assert night_difference.max() ... | ["pvlib/tests/test_temperature.py::test_fuentes_timezone[Etc/GMT+5]"] | ["pvlib/tests/test_temperature.py::test_sapm_cell", "pvlib/tests/test_temperature.py::test_sapm_module", "pvlib/tests/test_temperature.py::test_sapm_cell_from_module", "pvlib/tests/test_temperature.py::test_sapm_ndarray", "pvlib/tests/test_temperature.py::test_sapm_series", "pvlib/tests/test_temperature.py::test_pvsyst... | null | true | 2020-10-01T00:53:14Z | 1 | 5 | 1 | 2,260 | 0 | 0.8 | 1 | 1 | 0.8 | 0.393333 | 87.63 | ||
3,207 | swe_bench::test::1856 | swe_bench | test | 1,856 | sphinx-doc__sphinx-8801 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 7ca279e33aebb60168d35e6be4ed059f4a68f2c1 | autodoc: The annotation only member in superclass is treated as "undocumented"
**Describe the bug**
autodoc: The annotation only member in superclass is treated as "undocumented".
**To Reproduce**
```
# example.py
class Foo:
"""docstring"""
attr1: int #: docstring
class Bar(Foo):
"""docstring"""
att... | diff --git a/sphinx/ext/autodoc/importer.py b/sphinx/ext/autodoc/importer.py
--- a/sphinx/ext/autodoc/importer.py
+++ b/sphinx/ext/autodoc/importer.py
@@ -294,24 +294,35 @@ def get_class_members(subject: Any, objpath: List[str], attrgetter: Callable
try:
for cls in getmro(subject):
+ try:
+ ... | diff --git a/tests/roots/test-ext-autodoc/target/uninitialized_attributes.py b/tests/roots/test-ext-autodoc/target/uninitialized_attributes.py
new file mode 100644
--- /dev/null
+++ b/tests/roots/test-ext-autodoc/target/uninitialized_attributes.py
@@ -0,0 +1,8 @@
+class Base:
+ attr1: int #: docstring
+ attr2: s... | ["tests/test_ext_autodoc_autoclass.py::test_uninitialized_attributes"] | ["tests/test_ext_autodoc_autoclass.py::test_classes", "tests/test_ext_autodoc_autoclass.py::test_instance_variable", "tests/test_ext_autodoc_autoclass.py::test_inherited_instance_variable", "tests/test_ext_autodoc_autoclass.py::test_undocumented_uninitialized_attributes", "tests/test_ext_autodoc_autoclass.py::test_deco... | null | true | 2021-01-31T11:12:59Z | 1 | 27 | 1 | 851 | 0 | 0.8 | 1 | 0.85 | 1 | 0.231833 | 87.6205 | ||
3,208 | swe_bench::test::1878 | swe_bench | test | 1,878 | sphinx-doc__sphinx-9289 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 82dad44e5bd3776ecb6fd8ded656bc8151d0e63d | python_use_unqualified_type_names does not work on function descriptions
**Describe the bug**
When combining the new `python_use_unqualified_type_names` configuration with `autodoc_typehints='description'`, the type names are not shortened even though links are created.
**To Reproduce**
Here's a minimal project using ... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -299,6 +299,16 @@ def make_xref(self, rolename: str, domain: str, target: str,
for node in result.traverse(nodes.Text):
node.parent[node.parent.index(node)] = n... | diff --git a/tests/roots/test-domain-py-python_use_unqualified_type_names/index.rst b/tests/roots/test-domain-py-python_use_unqualified_type_names/index.rst
--- a/tests/roots/test-domain-py-python_use_unqualified_type_names/index.rst
+++ b/tests/roots/test-domain-py-python_use_unqualified_type_names/index.rst
@@ -4,5 +... | ["tests/test_domain_py.py::test_python_python_use_unqualified_type_names"] | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f... | null | true | 2021-06-02T15:06:11Z | 1 | 10 | 1 | 1,179 | 0 | 0.8 | 1 | 0.85 | 1 | 0.229833 | 87.6145 | ||
3,209 | swe_bench::test::1117 | swe_bench | test | 1,117 | matplotlib__matplotlib-26285 | matplotlib/matplotlib | matplotlib/matplotlib | python | a861b8af82cc4618e0a631e5eac5b4030b3f04a1 | [Bug]: set_ticks provides mysterious error message
### Bug summary
`set_yticks(ticks, which="minor")` errors with `ValueError: labels argument cannot be None when kwargs are passed`.
### Code for reproduction
```python
fig, ax = plt.subplots(figsize=(5.4, 5.4), layout='constrained')
x = np.arange(100)
for nn, ax in... | diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py
--- a/lib/matplotlib/axis.py
+++ b/lib/matplotlib/axis.py
@@ -2055,8 +2055,8 @@ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs):
minor : bool, default: False
If ``False``, set the major ticks; if ``True``, the minor tic... | 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
@@ -5987,7 +5987,7 @@ def test_set_ticks_kwargs_raise_error_without_labels():
"""
fig, ax = plt.subplots()
ticks = [1, 2, 3]
- with pytest.... | ["lib/matplotlib/tests/test_axes.py::test_set_ticks_kwargs_raise_error_without_labels"] | ["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-07-10T21:12:45Z | 1 | 11 | 1 | 1,154 | 0 | 0.8 | 1 | 0.85 | 1 | 0.229 | 87.612 | ||
3,210 | swe_bench::dev::220 | swe_bench | dev | 220 | sqlfluff__sqlfluff-5206 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 895e668a0047bd31fb87865fcab50d846bfb88ce | Exception thrown when SELECT DISTINCT not on the same line
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
Check a file containing this request:
```sql
SELECT
DISTINCT `FIELD`
FROM `TABLE`;
```
It fails this way:... | diff --git a/src/sqlfluff/core/parser/segments/base.py b/src/sqlfluff/core/parser/segments/base.py
--- a/src/sqlfluff/core/parser/segments/base.py
+++ b/src/sqlfluff/core/parser/segments/base.py
@@ -13,7 +13,6 @@
import logging
import weakref
from collections import defaultdict
-from copy import copy
from dataclass... | diff --git a/test/core/parser/segments/segments_base_test.py b/test/core/parser/segments/segments_base_test.py
--- a/test/core/parser/segments/segments_base_test.py
+++ b/test/core/parser/segments/segments_base_test.py
@@ -302,3 +302,58 @@ def test__parser__base_segments_pickle_safe(raw_seg_list):
assert test_seg ... | ["test/rules/std_RF01_LT09_test.py::test__rules__std_RF01_LT09_copy"] | ["test/core/parser/segments/segments_base_test.py::test__parser__base_segments_type", "test/core/parser/segments/segments_base_test.py::test__parser__base_segments_class_types", "test/core/parser/segments/segments_base_test.py::test__parser__base_segments_descendant_type_set", "test/core/parser/segments/segments_base_t... | null | true | 2023-09-13T18:57:24Z | 2 | 59 | 1 | 11,432 | 0 | 0.8 | 1 | 0.8 | 1 | 0.696667 | 87.59 | ||
3,211 | swe_bench::test::1780 | swe_bench | test | 1,780 | sphinx-doc__sphinx-7615 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 6ce265dc813f9ecb92bf1cdf8733fbada7f5c967 | Sphinx, unlike Docutils, incorrectly renders consecutive backslashes
**Describe the bug**
Sphinx incorrectly renders four or more consecutive backslashes. In pure Docutils, they are renderer properly according with RST spec.
**To Reproduce**
The following snippet demonstrantes buggy rendering.
```
Two \\
Three \\\
F... | diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py
--- a/sphinx/transforms/__init__.py
+++ b/sphinx/transforms/__init__.py
@@ -23,6 +23,7 @@
from sphinx.config import Config
from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
from sphinx.locale import _, __
+from sphinx.... | diff --git a/tests/test_markup.py b/tests/test_markup.py
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -13,7 +13,6 @@
import pytest
from docutils import frontend, utils, nodes
from docutils.parsers.rst import Parser as RstParser
-from docutils.transforms.universal import SmartQuotes
from sphinx import ... | ["tests/test_markup.py::test_inline_docutils16[verify-4"] | ["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-05-05T09:27:36Z | 1 | 17 | 1 | 756 | 0 | 0.8 | 1 | 0.85 | 1 | 0.182667 | 87.473 | ||
3,212 | swe_bench::test::989 | swe_bench | test | 989 | matplotlib__matplotlib-22734 | matplotlib/matplotlib | matplotlib/matplotlib | python | a395083238625500dd3fa879e4976617d5353342 | [Bug]: tripcolor ignores clim
### Bug summary
```python
from pylab import *
tripcolor(np.random.rand(100), np.random.rand(100), np.random.rand(100), clim=(0, 0.5))
colorbar()
show()
```
shows that tripcolor ignores clim.
### Code for reproduction
```python
See above.
```
### Actual outcome
Colorbar/colormapping go... | diff --git a/lib/matplotlib/tri/tripcolor.py b/lib/matplotlib/tri/tripcolor.py
--- a/lib/matplotlib/tri/tripcolor.py
+++ b/lib/matplotlib/tri/tripcolor.py
@@ -115,13 +115,14 @@ def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
if 'antialiaseds' not in kwargs and ec.lower() == "none":
kw... | diff --git a/lib/matplotlib/tests/test_triangulation.py b/lib/matplotlib/tests/test_triangulation.py
--- a/lib/matplotlib/tests/test_triangulation.py
+++ b/lib/matplotlib/tests/test_triangulation.py
@@ -266,6 +266,16 @@ def test_tripcolor_color():
ax.tripcolor(x, y, facecolors=[1, 2]) # faces
+def test_tripco... | ["lib/matplotlib/tests/test_triangulation.py::test_tripcolor_clim"] | ["lib/matplotlib/tests/test_triangulation.py::TestTriangulationParams::test_extract_triangulation_params[args0-kwargs0-expected0]", "lib/matplotlib/tests/test_triangulation.py::TestTriangulationParams::test_extract_triangulation_params[args1-kwargs1-expected1]", "lib/matplotlib/tests/test_triangulation.py::TestTriangul... | null | true | 2022-03-30T21:01:05Z | 1 | 14 | 1 | 809 | 0 | 0.8 | 1 | 0.85 | 1 | 0.1815 | 87.4695 | ||
3,213 | swe_bench::test::1057 | swe_bench | test | 1,057 | matplotlib__matplotlib-24924 | matplotlib/matplotlib | matplotlib/matplotlib | python | 5a87d37835693ccc6579938d4948cf91a974a23b | [Bug]: Cannot toggle set_tight_layout
### Bug summary
As of #20426 calling `Figure.set_tight_layout(False)` does not disable the tight layout algorithm.
### Code for reproduction
```python
from matplotlib import pyplot as plt
fig, ax = plt.subplots()
fig.set_tight_layout(True)
fig.set_tight_layout(False)
assert not... | diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -2760,9 +2760,9 @@ def set_tight_layout(self, tight):
"""
if tight is None:
tight = mpl.rcParams['figure.autolayout']
+ _tight = 'tight' if bool(tight) ... | diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
--- a/lib/matplotlib/tests/test_constrainedlayout.py
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
@@ -667,3 +667,14 @@ def test_compressed1():
def test_set_constrained_layout(arg, state):
fig, ax =... | ["lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_toggle", "lib/matplotlib/tests/test_tightlayout.py::test_tight_toggle"] | ["lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout1[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout2[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout3[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout4[pn... | null | true | 2023-01-10T07:28:52Z | 1 | 9 | 2 | 896 | 0 | 0.8 | 1 | 0.85 | 1 | 0.179333 | 87.463 | ||
3,214 | swe_bench::test::1167 | swe_bench | test | 1,167 | psf__requests-1635 | psf/requests | psf/requests | python | 9968a10fcfad7268b552808c4f8946eecafc956a | Cookies not persisted when set via functional API.
Cookies set as part of a call to `Session.request()` (or any of the top level methods that call it) are _not_ persisted, including on redirects.
Expected behaviour:
``` python
>>> s = requests.Session()
>>> r = s.get('http://httpbin.org/redirect/1', cookies={'Hi': 'T... | diff --git a/requests/cookies.py b/requests/cookies.py
--- a/requests/cookies.py
+++ b/requests/cookies.py
@@ -392,15 +392,21 @@ def morsel_to_cookie(morsel):
return c
-def cookiejar_from_dict(cookie_dict, cookiejar=None):
+def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True):
"""Returns a... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -164,6 +164,12 @@ def test_cookie_quote_wrapped(self):
s.get(httpbin('cookies/set?foo="bar:baz"'))
self.assertTrue(s.cookies['foo'] == '"bar:baz"')
+ def test_cookie_persists_via_api(self):
+ ... | ["test_requests.py::RequestsTestCase::test_cookie_persists_via_api"] | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::Re... | null | true | 2013-09-28T14:50:12Z | 3 | 15 | 1 | 745 | 0 | 0.8 | 1 | 0.85 | 1 | 0.174167 | 87.4475 | ||
3,215 | swe_bench::test::1819 | swe_bench | test | 1,819 | sphinx-doc__sphinx-8282 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 2c2335bbb8af99fa132e1573bbf45dc91584d5a2 | autodoc_typehints does not effect to overloaded callables
**Describe the bug**
autodoc_typehints does not effect to overloaded callables.
**To Reproduce**
```
# in conf.py
autodoc_typehints = 'none'
```
```
# in index.rst
.. automodule:: example
:members:
:undoc-members:
```
```
# in example.py
from typing impo... | 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
@@ -1240,7 +1240,9 @@ def add_directive_header(self, sig: str) -> None:
def format_signature(self, **kwargs: Any) -> str:
sigs = []
- if self.anal... | diff --git a/tests/test_ext_autodoc_configs.py b/tests/test_ext_autodoc_configs.py
--- a/tests/test_ext_autodoc_configs.py
+++ b/tests/test_ext_autodoc_configs.py
@@ -610,6 +610,54 @@ def test_autodoc_typehints_none(app):
]
+@pytest.mark.sphinx('html', testroot='ext-autodoc',
+ confoverrides... | ["tests/test_ext_autodoc_configs.py::test_autodoc_typehints_none_for_overload"] | ["tests/test_ext_autodoc_configs.py::test_autoclass_content_class", "tests/test_ext_autodoc_configs.py::test_autoclass_content_init", "tests/test_ext_autodoc_configs.py::test_autoclass_content_both", "tests/test_ext_autodoc_configs.py::test_autodoc_inherit_docstrings", "tests/test_ext_autodoc_configs.py::test_autodoc_d... | null | true | 2020-10-04T09:04:48Z | 1 | 10 | 1 | 762 | 0 | 0.8 | 1 | 0.85 | 1 | 0.160333 | 87.406 | ||
3,216 | swe_bench::test::1864 | swe_bench | test | 1,864 | sphinx-doc__sphinx-9155 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 69cbf7aa92b2d30a1d865de7429f6388cb94b946 | C Domain: Reference Error when using builtin type in :param: or :type:
When documenting a C function, using a builtin type like `int` as the type for a parameter using `:param <type> <name>:` or `:type <name>: <type>`:
```rst
.. c:function:: int foo(int bar)
:param int bar: Bar
```
This results in the following w... | Thanks for reporting. This looks like a problem in general with the C and C++ domains, but not immediately trivial to solve.
@jakobandersen, maybe the builtin types can be excluded from the keyword list for the time being? For example (without knowing much about the internals of sphinx, I admit), the following patch h... | diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py
--- a/sphinx/domains/c.py
+++ b/sphinx/domains/c.py
@@ -3115,7 +3115,7 @@ class CObject(ObjectDescription[ASTDeclaration]):
doc_field_types = [
TypedField('parameter', label=_('Parameters'),
names=('param', 'parameter', 'arg', 'arg... | diff --git a/tests/roots/test-domain-c/field-role.rst b/tests/roots/test-domain-c/field-role.rst
new file mode 100644
--- /dev/null
+++ b/tests/roots/test-domain-c/field-role.rst
@@ -0,0 +1,4 @@
+.. c:function:: void f(int a, int *b)
+
+ :param int a:
+ :param int* b:
diff --git a/tests/roots/test-domain-cpp/field-role... | ["tests/test_domain_c.py::test_build_field_role", "tests/test_domain_cpp.py::test_build_domain_cpp_field_role"] | ["tests/test_domain_c.py::test_expressions", "tests/test_domain_c.py::test_type_definitions", "tests/test_domain_c.py::test_macro_definitions", "tests/test_domain_c.py::test_member_definitions", "tests/test_domain_c.py::test_function_definitions", "tests/test_domain_c.py::test_nested_name", "tests/test_domain_c.py::tes... | null | true | 2021-05-01T12:11:44Z | 5 | 106 | 2 | 1,957 | 0 | 0.8 | 1 | 0.85 | 0.85 | 0.6795 | 87.401 | |
3,217 | swe_bench::test::1823 | swe_bench | test | 1,823 | sphinx-doc__sphinx-8435 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 5d8d6275a54f2c5fb72b82383b5712c22d337634 | autodoc_type_aliases does not effect to variables and attributes
**Describe the bug**
autodoc_type_aliases does not effect to variables and attributes
**To Reproduce**
```
# example.py
from __future__ import annotations
#: blah blah blah
var: String
class MyString:
"mystring"
#: blah blah blah
var: Str... | 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
@@ -1702,7 +1702,8 @@ def add_directive_header(self, sig: str) -> None:
if not self.options.annotation:
# obtain annotation for this data
... | diff --git a/tests/roots/test-ext-autodoc/target/annotations.py b/tests/roots/test-ext-autodoc/target/annotations.py
--- a/tests/roots/test-ext-autodoc/target/annotations.py
+++ b/tests/roots/test-ext-autodoc/target/annotations.py
@@ -4,6 +4,9 @@
myint = int
+#: docstring
+variable: myint
+
def sum(x: myint, y:... | ["tests/test_ext_autodoc_configs.py::test_autodoc_type_aliases"] | ["tests/test_ext_autodoc_configs.py::test_autoclass_content_class", "tests/test_ext_autodoc_configs.py::test_autoclass_content_init", "tests/test_ext_autodoc_configs.py::test_autoclass_content_both", "tests/test_ext_autodoc_configs.py::test_autodoc_inherit_docstrings", "tests/test_ext_autodoc_configs.py::test_autodoc_d... | null | true | 2020-11-15T17:12:24Z | 1 | 6 | 1 | 817 | 0 | 0.8 | 1 | 0.85 | 1 | 0.156167 | 87.3935 | ||
3,218 | swe_bench::dev::54 | swe_bench | dev | 54 | pvlib__pvlib-python-1707 | pvlib/pvlib-python | pvlib/pvlib-python | python | 40e9e978c170bdde4eeee1547729417665dbc34c | regression: iam.physical returns nan for aoi > 90° when n = 1
**Describe the bug**
For pvlib==0.9.5, when n = 1 (no reflection) and aoi > 90°, we get nan as result.
**To Reproduce**
```python
import pvlib
pvlib.iam.physical(aoi=100, n=1)
```
returns `nan`.
**Expected behavior**
The result should be `0`, as it was for... | diff --git a/pvlib/iam.py b/pvlib/iam.py
--- a/pvlib/iam.py
+++ b/pvlib/iam.py
@@ -175,8 +175,12 @@ def physical(aoi, n=1.526, K=4.0, L=0.002, *, n_ar=None):
n2costheta2 = n2 * costheta
# reflectance of s-, p-polarized, and normal light by the first interface
- rho12_s = ((n1costheta1 - n2costheta2) / (n... | 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
@@ -51,6 +51,18 @@ def test_physical():
assert_series_equal(iam, expected)
+def test_physical_n1_L0():
+ aoi = np.array([0, 22.5, 45, 67.5, 90, 100, np.nan])
+ expected = np.array([1... | ["pvlib/tests/test_iam.py::test_physical_n1_L0"] | ["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_ar", "pvlib/tests/test_iam.py::test_physical_noar", "pvlib/tests/test_iam.py::test_physical_scalar", "pvlib/tests/test_iam.py::test_martin_ruiz", "pvl... | null | true | 2023-03-24T10:46:42Z | 1 | 21 | 1 | 439 | 0 | 0.8 | 1 | 0.85 | 1 | 0.143167 | 87.3545 | ||
3,219 | swe_bench::test::1281 | swe_bench | test | 1,281 | pydata__xarray-6548 | pydata/xarray | pydata/xarray | python | 126051f2bf2ddb7926a7da11b047b852d5ca6b87 | xr.polyval first arg requires name attribute
### What happened?
I have some polynomial coefficients and want to evaluate them at some values using `xr.polyval`.
As described in the docstring/docu I created a 1D coordinate DataArray and pass it to `xr.polyval` but it raises a KeyError (see example).
### What did you ... | Actually, I just realized that the second version also does not work since it uses the index of the `coord` argument and not its values. I guess that was meant by "The 1D coordinate along which to evaluate the polynomial".
Would you be open to a PR that allows any DataArray as `coord` argument and evaluates the poly... | diff --git a/asv_bench/benchmarks/polyfit.py b/asv_bench/benchmarks/polyfit.py
new file mode 100644
--- /dev/null
+++ b/asv_bench/benchmarks/polyfit.py
@@ -0,0 +1,38 @@
+import numpy as np
+
+import xarray as xr
+
+from . import parameterized, randn, requires_dask
+
+NDEGS = (2, 5, 20)
+NX = (10**2, 10**6)
+
+
+class P... | diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py
--- a/xarray/tests/test_computation.py
+++ b/xarray/tests/test_computation.py
@@ -1933,37 +1933,100 @@ def test_where_attrs() -> None:
assert actual.attrs == {}
-@pytest.mark.parametrize("use_dask", [True, False])
-@pytest.mark.pa... | ["xarray/tests/test_computation.py::test_polyval[simple-False]", "xarray/tests/test_computation.py::test_polyval[broadcast-x-False]", "xarray/tests/test_computation.py::test_polyval[shared-dim-False]", "xarray/tests/test_computation.py::test_polyval[reordered-index-False]", "xarray/tests/test_computation.py::test_polyv... | ["xarray/tests/test_computation.py::test_signature_properties", "xarray/tests/test_computation.py::test_result_name", "xarray/tests/test_computation.py::test_ordered_set_union", "xarray/tests/test_computation.py::test_ordered_set_intersection", "xarray/tests/test_computation.py::test_join_dict_keys", "xarray/tests/test... | null | true | 2022-04-30T14:50:53Z | 2 | 139 | 10 | 2,491 | 0 | 0.8 | 1 | 0.7 | 1 | 0.8785 | 87.2855 | |
3,220 | swe_bench::dev::143 | swe_bench | dev | 143 | pylint-dev__astroid-1903 | pylint-dev/astroid | pylint-dev/astroid | python | 344454c8ee25d41a4ce12980bc85ba604b7835dd | Unhandled AttributeError during str.format template evaluation
### Steps to reproduce
1. Use `astroid` to parse code that provides arguments to a `str.format` template that attempts to access non-existent attributes
```py
daniel_age = 12
"My name is {0.name}".format(daniel_age) # int literal has no 'name' attribute
... | diff --git a/astroid/brain/brain_builtin_inference.py b/astroid/brain/brain_builtin_inference.py
--- a/astroid/brain/brain_builtin_inference.py
+++ b/astroid/brain/brain_builtin_inference.py
@@ -952,7 +952,8 @@ def _infer_str_format_call(
try:
formatted_string = format_template.format(*pos_values, **key... | diff --git a/tests/unittest_brain_builtin.py b/tests/unittest_brain_builtin.py
--- a/tests/unittest_brain_builtin.py
+++ b/tests/unittest_brain_builtin.py
@@ -109,6 +109,10 @@ def test_string_format(self, format_string: str) -> None:
"""
"My hex format is {:4x}".format('1')
""",
+... | ["tests/unittest_brain_builtin.py::TestStringNodes::test_string_format_uninferable[\\n"] | ["tests/unittest_brain_builtin.py::BuiltinsTest::test_infer_property", "tests/unittest_brain_builtin.py::TestStringNodes::test_string_format[empty-indexes]", "tests/unittest_brain_builtin.py::TestStringNodes::test_string_format[numbered-indexes]", "tests/unittest_brain_builtin.py::TestStringNodes::test_string_format[na... | null | true | 2022-12-15T02:58:17Z | 1 | 3 | 1 | 1,599 | 0 | 0.8 | 1 | 1 | 0.8 | 0.2765 | 87.2795 | ||
3,221 | swe_bench::test::1516 | swe_bench | test | 1,516 | scikit-learn__scikit-learn-10870 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | b0e91e4110942e5b3c4333b1c6b6dfefbd1a6124 | In Gaussian mixtures, when n_init > 1, the lower_bound_ is not always the max
#### Description
In Gaussian mixtures, when `n_init` is set to any value greater than 1, the `lower_bound_` is not the max lower bound across all initializations, but just the lower bound of the last initialization.
The bug can be fixed by a... | diff --git a/sklearn/mixture/base.py b/sklearn/mixture/base.py
--- a/sklearn/mixture/base.py
+++ b/sklearn/mixture/base.py
@@ -172,11 +172,14 @@ def _initialize(self, X, resp):
def fit(self, X, y=None):
"""Estimate model parameters with the EM algorithm.
- The method fits the model `n_init` times... | diff --git a/sklearn/mixture/tests/test_gaussian_mixture.py b/sklearn/mixture/tests/test_gaussian_mixture.py
--- a/sklearn/mixture/tests/test_gaussian_mixture.py
+++ b/sklearn/mixture/tests/test_gaussian_mixture.py
@@ -764,7 +764,6 @@ def test_gaussian_mixture_verbose():
def test_warm_start():
-
random_state ... | ["sklearn/mixture/tests/test_gaussian_mixture.py::test_init"] | ["sklearn/mixture/tests/test_gaussian_mixture.py::test_gaussian_mixture_attributes", "sklearn/mixture/tests/test_gaussian_mixture.py::test_check_X", "sklearn/mixture/tests/test_gaussian_mixture.py::test_check_weights", "sklearn/mixture/tests/test_gaussian_mixture.py::test_check_means", "sklearn/mixture/tests/test_gauss... | null | true | 2018-03-25T14:06:57Z | 2 | 30 | 1 | 3,391 | 0.055556 | 0.8 | 1 | 0.92 | 1 | 0.6 | 87.262 | ||
3,222 | swe_bench::test::1966 | swe_bench | test | 1,966 | sympy__sympy-13279 | sympy/sympy | sympy/sympy | python | 613373e31790f06b7324dd5ef887198538204bcc | TypeErrors encountered when doing subs with Matrices
```
>>> Mul(zeros(2), y, evaluate=False).subs(y, 0)
0 # instead of zeros(2)
>>> (x + y).subs({x: zeros(2), y: zeros(2)})
Traceback (most recent call last):
...
TypeError: cannot add <class 'sympy.matrices.immutable.ImmutableDenseMatrix'> and <class 'sympy.core.numbe... | diff --git a/sympy/core/add.py b/sympy/core/add.py
--- a/sympy/core/add.py
+++ b/sympy/core/add.py
@@ -144,7 +144,8 @@ def flatten(cls, seq):
continue
elif isinstance(o, MatrixExpr):
- coeff = o.__add__(coeff)
+ # can't add 0 to Matrix so make sure coeff is ... | diff --git a/sympy/core/tests/test_subs.py b/sympy/core/tests/test_subs.py
--- a/sympy/core/tests/test_subs.py
+++ b/sympy/core/tests/test_subs.py
@@ -1,8 +1,10 @@
from __future__ import division
-from sympy import (Symbol, Wild, sin, cos, exp, sqrt, pi, Function, Derivative,
- abc, Integer, Eq, symbols, Add, I... | ["test_subs_Matrix"] | ["test_subs", "test_subs_AccumBounds", "test_trigonometric", "test_powers", "test_logexppow", "test_bug", "test_subbug1", "test_subbug2", "test_dict_set", "test_dict_ambigous", "test_deriv_sub_bug3", "test_equality_subs1", "test_equality_subs2", "test_issue_3742", "test_subs_dict1", "test_mul", "test_subs_simple", "tes... | null | true | 2017-09-08T16:54:04Z | 2 | 8 | 1 | 453 | 0 | 0.8 | 1 | 0.85 | 1 | 0.102167 | 87.2315 | ||
3,223 | swe_bench::dev::164 | swe_bench | dev | 164 | pyvista__pyvista-4226 | pyvista/pyvista | pyvista/pyvista | python | 1f28aadcb39b5be2f955feae9d462eadb0dfc5c1 | Diffuse and Specular setters silently ignore invalid values
### Describe the bug, what's wrong, and what you expected.
While working on #3870, I noticed that `diffuse` and `specular` do not always get set on `pyvista.Property`. This happens if an invalid value is used. For example, diffuse should be between 0-1, but i... | Something similar came up [on this PR](https://github.com/pyvista/pyvista/pull/1040#issuecomment-739850576). To quote that comment of mine:
> If the user sets nonsense data we should either raise, or pass it on to vtk which probably clamps internally (I haven't tested yet).
(later it was discussed that yes, VTK cl... | diff --git a/pyvista/plotting/_property.py b/pyvista/plotting/_property.py
--- a/pyvista/plotting/_property.py
+++ b/pyvista/plotting/_property.py
@@ -4,7 +4,7 @@
import pyvista as pv
from pyvista import _vtk
from pyvista.plotting.opts import InterpolationType
-from pyvista.utilities.misc import no_new_attr
+from py... | diff --git a/tests/test_property.py b/tests/test_property.py
--- a/tests/test_property.py
+++ b/tests/test_property.py
@@ -1,6 +1,7 @@
import pytest
import pyvista as pv
+from pyvista.plotting._property import _check_range
@pytest.fixture()
@@ -8,6 +9,14 @@ def prop():
return pv.Property()
+def test_c... | ["tests/test_property.py::test_check_range", "tests/test_property.py::test_property_init", "tests/test_property.py::test_property_style", "tests/test_property.py::test_property_edge_color", "tests/test_property.py::test_property_opacity", "tests/test_property.py::test_property_show_edges", "tests/test_property.py::test... | [] | null | true | 2023-04-03T23:29:30Z | 4 | 107 | 25 | 1,189 | 0 | 0.8 | 1 | 0.85 | 0.85 | 0.554833 | 87.027 | |
3,224 | swe_bench::test::1053 | swe_bench | test | 1,053 | matplotlib__matplotlib-24768 | matplotlib/matplotlib | matplotlib/matplotlib | python | ecf6e26f0b0241bdc80466e13ee0c13a0c12f412 | [Bug]: pcolormesh(rasterized=True) conflicts with set_rasterization_zorder()
### Bug summary
According to the [documentation](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html), a color plot can be rasterized in two ways:
* `pyplot.pcolormesh(…, rasterized=True)`
* `pyplot.gca().set_rasterization_zor... | 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
@@ -3127,23 +3127,23 @@ def draw(self, renderer):
if (rasterization_zorder is not None and
artists and artists[0].zorder < rasterization_zorder):
- ... | 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
@@ -8449,3 +8449,11 @@ def get_next_color():
c = 'red\n'
mpl.axes.Axes._parse_scatter_color_args(
c, None, kwargs={}, xsize=2,... | ["lib/matplotlib/tests/test_axes.py::test_zorder_and_explicit_rasterization"] | ["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 | 2022-12-18T20:07:59Z | 1 | 79 | 1 | 4,039 | 0 | 0.8 | 1 | 0.77 | 1 | 0.763333 | 86.935 | ||
3,225 | swe_bench::dev::78 | swe_bench | dev | 78 | pydicom__pydicom-1069 | pydicom/pydicom | pydicom/pydicom | python | 30ac743bcaedbc06f0e0d5cef590cb173756eb2d | apply_color_lut() incorrect exception when missing RedPaletteColorLUTDescriptor
**Describe the bug**
`AttributeError` when used on a dataset without `RedPaletteColorLookupTableDescriptor `
**Expected behavior**
Should raise `ValueError` for consistency with later exceptions
**Steps To Reproduce**
```python
from pydic... | diff --git a/pydicom/pixel_data_handlers/util.py b/pydicom/pixel_data_handlers/util.py
--- a/pydicom/pixel_data_handlers/util.py
+++ b/pydicom/pixel_data_handlers/util.py
@@ -112,6 +112,9 @@ def apply_color_lut(arr, ds=None, palette=None):
"Table Module is not currently supported"
)
+ if 'Red... | 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
@@ -1150,6 +1150,15 @@ def test_first_map_negative(self):
assert [60160, 25600, 37376] == list(rgb[arr == 130][0])
assert ([60160, 2560... | ["pydicom/tests/test_handler_util.py::TestNumpy_PaletteColor::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 | 2020-03-14T00:02:52Z | 1 | 3 | 1 | 850 | 0 | 0.8 | 1 | 1 | 0.8 | 0.151667 | 86.905 | ||
3,226 | swe_bench::dev::202 | swe_bench | dev | 202 | sqlfluff__sqlfluff-3608 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | d783e421b714ed989d9e641977ea9b3b6ffaf807 | Return codes are inconsistent
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
Working on #3431 - I noticed that we're inconsistent in our return codes.
In `commands.py` we call `sys.exit()` in 15 places (currently).
... | I'm happy to contribute the changes for this one, but would appreciate views on what the error codes we should align on first @barrywhart @tunetheweb
I'm not familiar with any widespread conventions about exit codes, except to keep them below 256.
This Stack Overflow post has a lot of discussion, often self-contrad... | diff --git a/src/sqlfluff/cli/__init__.py b/src/sqlfluff/cli/__init__.py
--- a/src/sqlfluff/cli/__init__.py
+++ b/src/sqlfluff/cli/__init__.py
@@ -1 +1,6 @@
"""init py for cli."""
+
+
+EXIT_SUCCESS = 0
+EXIT_FAIL = 1
+EXIT_ERROR = 2
diff --git a/src/sqlfluff/cli/commands.py b/src/sqlfluff/cli/commands.py
--- a/src/sql... | 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
@@ -71,7 +71,7 @@ def invoke_assert_code(
def test__cli__command_directed():
"""Basic checking of lint functionality."""
result = invoke_assert_code(
- ret_code=65,
+ ... | ["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... | ["test/cli/commands_test.py::test__cli__command_lint_stdin[command0]", "test/cli/commands_test.py::test__cli__command_lint_stdin[command1]", "test/cli/commands_test.py::test__cli__command_lint_stdin[command2]", "test/cli/commands_test.py::test__cli__command_lint_stdin[command3]", "test/cli/commands_test.py::test__cli__... | null | true | 2022-07-14T15:06:34Z | 4 | 51 | 50 | 2,049 | 0 | 0.8 | 1 | 0.85 | 0.85 | 0.5115 | 86.897 | |
3,227 | swe_bench::test::1761 | swe_bench | test | 1,761 | sphinx-doc__sphinx-11550 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 4dee1629901f5e5c2aefc274da42483e16770e50 | autodoc preserve defaults leads to exception on multiline lambda
### Describe the bug
In [cssutils](/jaraco/cssutils), I've stumbled into an issue where the docs builds are failing (https://github.com/jaraco/cssutils/issues/36).
After some [investigation](https://stackoverflow.com/questions/76443979/exception-invalid... | **TL;DR** `autodoc_preserve_defaults` does not work with lambdas.
Even the following simple example
```python
X = object()
Z = lambda x=X: x
"""The Z function."""
```
miserably fails. The reason is because the object being documented is a lambda function. Because of that, the extracted AST node is not a f... | diff --git a/sphinx/ext/autodoc/preserve_defaults.py b/sphinx/ext/autodoc/preserve_defaults.py
--- a/sphinx/ext/autodoc/preserve_defaults.py
+++ b/sphinx/ext/autodoc/preserve_defaults.py
@@ -8,17 +8,23 @@
import ast
import inspect
-from typing import TYPE_CHECKING, Any
+import types
+import warnings
+from typing im... | diff --git a/tests/roots/test-ext-autodoc/target/preserve_defaults.py b/tests/roots/test-ext-autodoc/target/preserve_defaults.py
--- a/tests/roots/test-ext-autodoc/target/preserve_defaults.py
+++ b/tests/roots/test-ext-autodoc/target/preserve_defaults.py
@@ -30,3 +30,31 @@ def clsmeth(cls, name: str = CONSTANT, sentine... | ["tests/test_ext_autodoc_preserve_defaults.py::test_preserve_defaults", "tests/test_ext_autodoc_preserve_defaults.py::test_preserve_defaults_special_constructs"] | [] | null | true | 2023-08-03T08:56:59Z | 1 | 84 | 2 | 2,759 | 0 | 0.8 | 1 | 0.7 | 1 | 0.739833 | 86.8695 | |
3,228 | swe_bench::test::2233 | swe_bench | test | 2,233 | sympy__sympy-21436 | sympy/sympy | sympy/sympy | python | 45d4e5f7fe1ac8bcdfa425bbac722481d2ec183f | Support orienting adjacent reference frames in arbitrary orders
Suppose you want to establish relative orientation among frames A, B, C, D, and E as such:
```
A ----- B
|
|-------C----D
|
|----E
```
A is the root of the tree, B, D, and E are leaves. You do this now with code that looks like:
```pytho... | @angadhn I've opened an issue for this topic that we discussed last night.
A minimum enhancement here would be to explain in the various `.orient*()` documentation that any call to `X.orient*()` will remove any prior relationships to `X` and that to construct a chain or tree of relative oriented reference frames requir... | diff --git a/sympy/physics/vector/frame.py b/sympy/physics/vector/frame.py
--- a/sympy/physics/vector/frame.py
+++ b/sympy/physics/vector/frame.py
@@ -4,6 +4,8 @@
from sympy.physics.vector.vector import Vector, _check_vector
from sympy.utilities.misc import translate
+from warnings import warn
+
__all__ = ['Coordi... | diff --git a/sympy/physics/vector/tests/test_frame.py b/sympy/physics/vector/tests/test_frame.py
--- a/sympy/physics/vector/tests/test_frame.py
+++ b/sympy/physics/vector/tests/test_frame.py
@@ -6,6 +6,7 @@
from sympy.physics.vector.frame import _check_frame
from sympy.physics.vector.vector import VectorTypeError
fr... | ["test_looped_frame_warning"] | ["test_dict_list", "test_coordinate_vars", "test_ang_vel", "test_dcm", "test_w_diff_dcm1", "test_w_diff_dcm2", "test_orientnew_respects_parent_class", "test_orientnew_respects_input_indices", "test_orientnew_respects_input_latexs", "test_orientnew_respects_input_variables", "test_issue_10348", "test_issue_11503", "test... | null | true | 2021-05-06T06:38:29Z | 1 | 67 | 1 | 2,875 | 0 | 0.8 | 1 | 0.7 | 1 | 0.7025 | 86.7575 | |
3,229 | swe_bench::test::1216 | swe_bench | test | 1,216 | pydata__xarray-3338 | pydata/xarray | pydata/xarray | python | 3f0049ffc51e4c709256cf174c435f741370148d | Dataset.groupby reductions give "Dataset does not contain dimensions error" in v0.13
#### MCVE Code Sample
```python
>>> ds = xr.DataArray(np.ones((4,5)), dims=['z', 'x']).to_dataset(name='a')
>>> ds.a.groupby('z').mean()
<xarray.DataArray 'a' (z: 4)>
array([1., 1., 1., 1.])
Dimensions without coordinates: z
>>> ds.g... | diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py
--- a/xarray/core/groupby.py
+++ b/xarray/core/groupby.py
@@ -7,7 +7,7 @@
from . import dtypes, duck_array_ops, nputils, ops
from .arithmetic import SupportsArithmetic
-from .common import ImplementsArrayReduce, ImplementsDatasetReduce
+from .common impor... | 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
@@ -2579,6 +2579,15 @@ def change_metadata(x):
expected = change_metadata(expected)
assert_equal(expected, actual)
+ def test_groupby_reduce_dimen... | ["xarray/tests/test_groupby.py::test_groupby_repr[obj0-z]", "xarray/tests/test_groupby.py::test_groupby_repr[obj1-z]", "xarray/tests/test_groupby.py::test_groupby_grouping_errors"] | ["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-09-24T14:39:02Z | 1 | 48 | 3 | 3,051 | 0 | 0.8 | 1 | 0.77 | 1 | 0.66 | 86.625 | ||
3,230 | swe_bench::test::2009 | swe_bench | test | 2,009 | sympy__sympy-13988 | sympy/sympy | sympy/sympy | python | 219d0b02f3402e158ebd809c8e91420208870467 | Integral.as_sum() should output a Sum() object
Currently, Integral.as_sum() outputs an evaluated summation instead of an unevaluated expression:
```
In [1]: import sympy as sm
In [2]: t, t0, tf = sm.symbols('t, t0, tf')
In [3]: x = sm.Function('x')(t)
In [4]: y = sm.Function('y')(t)
In [5]: J = sm.Integral((x - y)... | Hi @moorepants ! I want to work on this issue .
Go for it!
@moorepants Any kind of help will be appreciated.I'm new to this organization.
Start here: https://github.com/sympy/sympy/wiki/introduction-to-contributing
Read the materials, setup your dev environment, and do the tutorial.
@moorepants I've read the materia... | diff --git a/sympy/integrals/integrals.py b/sympy/integrals/integrals.py
--- a/sympy/integrals/integrals.py
+++ b/sympy/integrals/integrals.py
@@ -1047,23 +1047,29 @@ def _eval_as_leading_term(self, x):
break
return integrate(leading_term, *self.args[1:])
- def as_sum(self, n, method="mid... | diff --git a/sympy/integrals/tests/test_integrals.py b/sympy/integrals/tests/test_integrals.py
--- a/sympy/integrals/tests/test_integrals.py
+++ b/sympy/integrals/tests/test_integrals.py
@@ -683,10 +683,13 @@ def test_as_sum_midpoint1():
def test_as_sum_midpoint2():
e = Integral((x + y)**2, (x, 0, 1))
+ n = ... | ["test_as_sum_raises"] | ["test_constructor", "test_diff_wrt", "test_conjugate_transpose", "test_integration", "test_multiple_integration", "test_issue_3532", "test_issue_3560", "test_integrate_poly", "test_integrate_poly_defined", "test_integrate_omit_var", "test_integrate_poly_accurately", "test_issue_3635", "test_issue_3618", "test_issue_36... | null | true | 2018-01-22T07:22:00Z | 1 | 113 | 1 | 1,681 | 0 | 0.8 | 1 | 0.7 | 1 | 0.656833 | 86.6205 | |
3,231 | swe_bench::test::1485 | swe_bench | test | 1,485 | pytest-dev__pytest-9646 | pytest-dev/pytest | pytest-dev/pytest | python | 6aaa017b1e81f6eccc48ee4f6b52d25c49747554 | Pytest 7 not ignoring warnings as instructed on `pytest.ini`
- [x] a detailed description of the bug or problem you are having
- [x] output of `pip list` from the virtual environment you are using
- [x] pytest and operating system versions
- [x] minimal example if possible
## Problem
Hello, with the latest version o... | diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ -656,20 +656,6 @@ class Item(Node):
nextitem = None
- def __init_subclass__(cls) -> None:
- problems = ", ".join(
- base.__name__ for base in cls.__bases__ if issubclass(base, ... | diff --git a/testing/test_nodes.py b/testing/test_nodes.py
--- a/testing/test_nodes.py
+++ b/testing/test_nodes.py
@@ -1,3 +1,5 @@
+import re
+import warnings
from pathlib import Path
from typing import cast
from typing import List
@@ -58,30 +60,31 @@ def test_subclassing_both_item_and_collector_deprecated(
req... | ["testing/test_nodes.py::test_subclassing_both_item_and_collector_deprecated"] | ["testing/test_nodes.py::test_iterparentnodeids[-expected0]", "testing/test_nodes.py::test_iterparentnodeids[a-expected1]", "testing/test_nodes.py::test_iterparentnodeids[aa/b-expected2]", "testing/test_nodes.py::test_iterparentnodeids[a/b/c-expected3]", "testing/test_nodes.py::test_iterparentnodeids[a/bbb/c::D-expecte... | null | true | 2022-02-08T13:38:22Z | 1 | 45 | 1 | 4,342 | 0 | 0.8 | 1 | 0.77 | 1 | 0.65 | 86.595 | ||
3,232 | swe_bench::test::2227 | swe_bench | test | 2,227 | sympy__sympy-21271 | sympy/sympy | sympy/sympy | python | 72fa16acc88deae0f7c7a8c2e263eb7b912b97e0 | Doctest failure in sympy/physics/vector/frame.py
See discussion in #20946.
CC @moorepants
There was a doctest failure but the test was disabled in #20954 to unblock CI. The cause of the failure remains unfixed though.
The failure was:
```
$ bin/doctest sympy/physics/vector/
==========================================... | I can fix this. I want to work on this issue.
I think I found a fix , if I succeed I'll make a PR.
@sidhu1012 What do you think the issue is?
It's worth noting that this passes:
```
bin/doctest sympy/physics/vector/functions.py sympy/physics/vector/frame.py
```
and this fails:
```
bin/doctest sympy/physi... | diff --git a/sympy/physics/vector/frame.py b/sympy/physics/vector/frame.py
--- a/sympy/physics/vector/frame.py
+++ b/sympy/physics/vector/frame.py
@@ -190,9 +190,9 @@ def __init__(self, name, indices=None, latexs=None, variables=None):
self.latex_vecs = latexs
self.name = name
self._var_d... | diff --git a/sympy/physics/vector/tests/test_frame.py b/sympy/physics/vector/tests/test_frame.py
--- a/sympy/physics/vector/tests/test_frame.py
+++ b/sympy/physics/vector/tests/test_frame.py
@@ -471,3 +471,63 @@ def test_orient_quaternion():
B = ReferenceFrame('B')
B.orient_quaternion(A, (0,0,0,0))
asser... | ["test_frame_dict"] | ["test_dict_list", "test_coordinate_vars", "test_ang_vel", "test_dcm", "test_w_diff_dcm1", "test_w_diff_dcm2", "test_orientnew_respects_parent_class", "test_orientnew_respects_input_indices", "test_orientnew_respects_input_latexs", "test_orientnew_respects_input_variables", "test_issue_10348", "test_issue_11503", "test... | null | true | 2021-04-09T07:15:12Z | 1 | 45 | 1 | 2,972 | 0 | 0.8 | 1 | 0.7 | 1 | 0.645333 | 86.586 | |
3,233 | swe_bench::test::1253 | swe_bench | test | 1,253 | pydata__xarray-4767 | pydata/xarray | pydata/xarray | python | 7298df0c05168896a9813249b54a2d11f35cfa8f | DataArray transpose inconsistent with Dataset Ellipsis usage
This works:
```
import xarray as xr
ds = xr.tutorial.open_dataset('air_temperature')
ds.transpose('not_existing_dim', 'lat', 'lon', 'time', ...)
```
This doesn't (subset air):
```
import xarray as xr
ds = xr.tutorial.open_dataset('air_temperature')
ds['air']... | > ds.transpose('not_existing_dim', 'lat', 'lon', 'time', ...)
IMO this should raise an error too
> > ds.transpose('not_existing_dim', 'lat', 'lon', 'time', ...)
>
> IMO this should raise an error too
I actually like it handling non_existing_dims automatically; maybe could be keyword though:
`ds.transpose('not... | diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py
--- a/xarray/core/dataarray.py
+++ b/xarray/core/dataarray.py
@@ -2120,7 +2120,12 @@ def to_unstacked_dataset(self, dim, level=0):
# unstacked dataset
return Dataset(data_dict)
- def transpose(self, *dims: Hashable, transpose_coords... | 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
@@ -797,13 +797,13 @@ def test_isel(self):
assert_identical(self.dv[:3, :5], self.dv.isel(x=slice(3), y=slice(5)))
with raises_regex(
Valu... | ["xarray/tests/test_dataarray.py::TestDataArray::test_isel", "xarray/tests/test_dataarray.py::TestDataArray::test_transpose", "xarray/tests/test_dataset.py::TestDataset::test_isel", "xarray/tests/test_variable.py::TestVariable::test_isel"] | ["xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray... | null | true | 2021-01-05T17:49:05Z | 2 | 79 | 4 | 2,169 | 0 | 0.8 | 1 | 0.7 | 1 | 0.624833 | 86.5245 | |
3,234 | swe_bench::test::63 | swe_bench | test | 63 | astropy__astropy-14590 | astropy/astropy | astropy/astropy | python | 5f74eacbcc7fff707a44d8eb58adaa514cb7dcb5 | TST: np.fix check fails with numpy-dev (TypeError: cannot write to unmasked output)
Started popping up in numpy-dev jobs. @mhvk is investigating.
```
____________________________ TestUfuncLike.test_fix ____________________________
self = <astropy.utils.masked.tests.test_function_helpers.TestUfuncLike object at 0x7fdd... | Ah, yes, that was https://github.com/numpy/numpy/pull/23240 and we actually checked in that discussion whether it would pose problems for astropy - https://github.com/numpy/numpy/pull/23240#discussion_r1112314891 - conclusion was that only `np.fix` was affected and that it would be a trivial fix. I'll make that now... | diff --git a/astropy/utils/masked/core.py b/astropy/utils/masked/core.py
--- a/astropy/utils/masked/core.py
+++ b/astropy/utils/masked/core.py
@@ -671,20 +671,35 @@ def __ne__(self, other):
)
return result.any(axis=-1)
- def _combine_masks(self, masks, out=None):
+ def _combine_masks(self, mas... | diff --git a/astropy/utils/masked/tests/test_functions.py b/astropy/utils/masked/tests/test_functions.py
--- a/astropy/utils/masked/tests/test_functions.py
+++ b/astropy/utils/masked/tests/test_functions.py
@@ -11,6 +11,7 @@
from astropy import units as u
from astropy.units import Quantity
+from astropy.utils.compa... | ["astropy/utils/masked/tests/test_functions.py::TestMaskedArrayUfuncs::test_ufunc_inplace_where[True]", "astropy/utils/masked/tests/test_functions.py::TestMaskedArrayUfuncs::test_ufunc_inplace_where[False]", "astropy/utils/masked/tests/test_functions.py::TestMaskedArrayUfuncs::test_ufunc_inplace_masked_where[True]", "a... | ["astropy/utils/masked/tests/test_functions.py::TestMaskedArrayUfuncs::test_2op_ufunc[add]", "astropy/utils/masked/tests/test_functions.py::TestMaskedArrayUfuncs::test_2op_ufunc[subtract]", "astropy/utils/masked/tests/test_functions.py::TestMaskedArrayUfuncs::test_2op_ufunc[divide]", "astropy/utils/masked/tests/test_fu... | null | true | 2023-03-27T23:57:35Z | 1 | 77 | 12 | 2,172 | 0 | 0.8 | 1 | 0.7 | 1 | 0.618667 | 86.506 | |
3,235 | swe_bench::dev::18 | swe_bench | dev | 18 | pvlib__pvlib-python-1138 | pvlib/pvlib-python | pvlib/pvlib-python | python | 56971c614e7faea3c24013445f1bf6ffe9943305 | document or support modules_per_string strings_per_inverter with pvwatts in modelchain
Hi,
I am trying to run Modelchain with pvwatt model but it seems that the `modules_per_string` and `strings_per inverter ` doesn't have any affect on the total output.
I am not sure why is it so.
May be ModelChain isn't supporting ... | https://stackoverflow.com/questions/49550656/run-pvlib-modelchain-with-pvwatts-model/50165303#50165303
The work around is to scale your ``module_parameters ['pdc0']``. Pull requests welcome for improving the functionality and/or documentation.
It seems that the system scaling provided by `PVSystem.scale_voltage_curr... | diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py
--- a/pvlib/modelchain.py
+++ b/pvlib/modelchain.py
@@ -730,8 +730,33 @@ def pvsyst(self):
return self._singlediode(self.system.calcparams_pvsyst)
def pvwatts_dc(self):
+ """Calculate DC power using the PVWatts model.
+
+ Results are s... | diff --git a/pvlib/tests/test_modelchain.py b/pvlib/tests/test_modelchain.py
--- a/pvlib/tests/test_modelchain.py
+++ b/pvlib/tests/test_modelchain.py
@@ -1180,6 +1180,25 @@ def test_dc_model_user_func(pvwatts_dc_pvwatts_ac_system, location, weather,
assert not mc.results.ac.empty
+def test_pvwatts_dc_multiple... | ["pvlib/tests/test_modelchain.py::test_pvwatts_dc_multiple_strings"] | ["pvlib/tests/test_modelchain.py::test_ModelChain_creation", "pvlib/tests/test_modelchain.py::test_with_sapm", "pvlib/tests/test_modelchain.py::test_with_pvwatts", "pvlib/tests/test_modelchain.py::test_orientation_strategy[None-expected0]", "pvlib/tests/test_modelchain.py::test_orientation_strategy[None-expected1]", "p... | null | true | 2021-01-20T21:18:35Z | 2 | 64 | 1 | 2,369 | 0 | 0.8 | 1 | 0.7 | 1 | 0.608167 | 86.4745 | |
3,236 | swe_bench::dev::16 | swe_bench | dev | 16 | pvlib__pvlib-python-1089 | pvlib/pvlib-python | pvlib/pvlib-python | python | d5d1d66aae4913f0e23b9a79c655efa1bdafe5f4 | Apparent numerical instability in I_mp calculation using PVsyst model
**Describe the bug**
I used these parameters in `pvlib.pvsystem.calcparams_pvsyst()` in order to calculate `I_mp` vs. `T` using `pvlib.pvsystem.singlediode()` with `effective_irradiance` fixed at 1000 W/m^2 and `temp_cell` having 1001 values ranging... | Confirmed. Looks like it's a lack of convergence in `pvlib.singlediode._lambertw`. Some time ago a similar issue was reported for PVLib Matlab, I think we bumped up the iteration count to fix it.
If you set `pvlib.singlediode(..., method='brentq',...)` the noise smooths away.
@cwhanse Thanks. `method='brentq'` fixe... | diff --git a/pvlib/ivtools/sdm.py b/pvlib/ivtools/sdm.py
--- a/pvlib/ivtools/sdm.py
+++ b/pvlib/ivtools/sdm.py
@@ -979,7 +979,8 @@ def _filter_params(ee, isc, io, rs, rsh):
negrs = rs < 0.
badrs = np.logical_or(rs > rsh, np.isnan(rs))
imagrs = ~(np.isreal(rs))
- badio = np.logical_or(~(np.isreal(rs)),... | diff --git a/pvlib/tests/test_pvsystem.py b/pvlib/tests/test_pvsystem.py
--- a/pvlib/tests/test_pvsystem.py
+++ b/pvlib/tests/test_pvsystem.py
@@ -1313,32 +1313,35 @@ def test_singlediode_array():
resistance_series, resistance_shunt, nNsVth,
method='lambertw... | ["pvlib/tests/test_pvsystem.py::test_singlediode_array", "pvlib/tests/test_pvsystem.py::test_singlediode_floats", "pvlib/tests/test_pvsystem.py::test_singlediode_floats_ivcurve", "pvlib/tests/test_pvsystem.py::test_singlediode_series_ivcurve", "pvlib/tests/test_tools.py::test__golden_sect_DataFrame[params0-0.0-1.0-0.5-... | ["pvlib/tests/test_pvsystem.py::test_PVSystem_get_iam[ashrae-model_params0]", "pvlib/tests/test_pvsystem.py::test_PVSystem_get_iam[physical-model_params1]", "pvlib/tests/test_pvsystem.py::test_PVSystem_get_iam[martin_ruiz-model_params2]", "pvlib/tests/test_pvsystem.py::test_PVSystem_multi_array_get_iam", "pvlib/tests/t... | null | true | 2020-11-16T23:21:16Z | 2 | 73 | 9 | 2,027 | 0 | 0.8 | 1 | 0.7 | 1 | 0.581167 | 86.3935 | |
3,237 | swe_bench::test::1334 | swe_bench | test | 1,334 | pylint-dev__pylint-5231 | pylint-dev/pylint | pylint-dev/pylint | python | 76a7553066130a7dbf4d10922b2530161b2ec5b0 | False positive missing-param-doc on numpy style when ` : <type>` omitted
### Bug description
```python
"""A module."""
# https://numpydoc.readthedocs.io/en/latest/format.html#parameters
# The numpy style guide describes that parameters can be defined without
# being followed with a semi-colon and the type, i.e. arg2 ... | With respect to `missing-return-type-doc`:
I think this is due to the fact that the section `Returns` is missing.
Perhaps this is allowed in `numpy` documentation and we should update this, but if you look at the docs you linked there is actually a section on return type annotation.
https://numpydoc.readthedocs.io/e... | 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
@@ -23,7 +23,7 @@
"""Utility methods for docstring checking."""
import re
-from typing import List
+from typing import List, Set, Tup... | 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
@@ -1338,13 +1338,17 @@ def my_func(named_arg, **kwargs):
def test_finds_args_without_type_numpy(self) -> None:
node = astroid.extract_... | ["tests/extensions/test_check_docs.py::TestParamDocChecker::test_finds_args_without_type_numpy"] | ["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-30T14:37:50Z | 1 | 39 | 1 | 2,701 | 0 | 0.8 | 1 | 0.7 | 1 | 0.580167 | 86.3905 | |
3,238 | swe_bench::test::1289 | swe_bench | test | 1,289 | pydata__xarray-6823 | pydata/xarray | pydata/xarray | python | a17a00f8f95195838e1d7360426454c8ed0570ea | RuntimeError when formatting sparse-backed DataArray in f-string
### What happened?
On upgrading from xarray 2022.3.0 to 2022.6.0, f-string formatting of sparse-backed DataArray raises an exception.
### What did you expect to happen?
- Code does not error, or
- A breaking change is listed in the [“Breaking changes”]... | diff --git a/xarray/core/common.py b/xarray/core/common.py
--- a/xarray/core/common.py
+++ b/xarray/core/common.py
@@ -163,9 +163,22 @@ def _repr_html_(self):
return f"<pre>{escape(repr(self))}</pre>"
return formatting_html.array_repr(self)
- def __format__(self: Any, format_spec: str) -> str... | diff --git a/xarray/tests/test_formatting.py b/xarray/tests/test_formatting.py
--- a/xarray/tests/test_formatting.py
+++ b/xarray/tests/test_formatting.py
@@ -391,7 +391,10 @@ def test_diff_dataset_repr(self) -> None:
def test_array_repr(self) -> None:
ds = xr.Dataset(coords={"foo": [1, 2, 3], "bar": [1, ... | ["xarray/tests/test_formatting.py::TestFormatting::test_array_repr"] | ["xarray/tests/test_formatting.py::TestFormatting::test_get_indexer_at_least_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_first_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_last_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_last_item", "xarray/tests/test_format... | null | true | 2022-07-25T09:43:21Z | 1 | 19 | 1 | 3,423 | 0 | 0.8 | 1 | 0.77 | 1 | 0.563333 | 86.335 | ||
3,239 | swe_bench::test::9 | swe_bench | test | 9 | astropy__astropy-12962 | astropy/astropy | astropy/astropy | python | d21dc232d8626b3aff24784628a6e85d177784ae | Convert CCDData to ImageHDU
### Description
As far as I can tell, currently there's no way to directly convert a `CCDData` object to an `ImageHDU` object. If we write it to a file using `CCDData.write()` it will always create a file where the first HDU is a `PrimaryHDU` that contains the `CCDData.data`, followed by opt... | According to this line, that interface already exists:
https://github.com/astropy/astropy/blob/40ba5e4c609d2760152898b8d92a146e3e38c744/astropy/nddata/ccddata.py#L709
https://docs.astropy.org/en/latest/api/astropy.nddata.CCDData.html#astropy.nddata.CCDData.to_hdu
Maybe it just needs some tune up to write the HDU ... | diff --git a/astropy/nddata/ccddata.py b/astropy/nddata/ccddata.py
--- a/astropy/nddata/ccddata.py
+++ b/astropy/nddata/ccddata.py
@@ -270,7 +270,8 @@ def uncertainty(self, value):
self._uncertainty = value
def to_hdu(self, hdu_mask='MASK', hdu_uncertainty='UNCERT',
- hdu_flags=None, w... | diff --git a/astropy/nddata/tests/test_ccddata.py b/astropy/nddata/tests/test_ccddata.py
--- a/astropy/nddata/tests/test_ccddata.py
+++ b/astropy/nddata/tests/test_ccddata.py
@@ -196,6 +196,20 @@ def test_ccddata_writer(tmpdir):
np.testing.assert_array_equal(ccd_data.data, ccd_disk.data)
+def test_ccddata_writ... | ["astropy/nddata/tests/test_ccddata.py::test_ccddata_writer_as_imagehdu", "astropy/nddata/tests/test_ccddata.py::test_to_hdu_as_imagehdu"] | ["astropy/nddata/tests/test_ccddata.py::test_ccddata_empty", "astropy/nddata/tests/test_ccddata.py::test_ccddata_must_have_unit", "astropy/nddata/tests/test_ccddata.py::test_ccddata_unit_cannot_be_set_to_none", "astropy/nddata/tests/test_ccddata.py::test_ccddata_meta_header_conflict", "astropy/nddata/tests/test_ccddata... | null | true | 2022-03-17T01:25:15Z | 1 | 27 | 2 | 2,778 | 0 | 0.8 | 1 | 0.7 | 1 | 0.553 | 86.309 | |
3,240 | swe_bench::dev::206 | swe_bench | dev | 206 | sqlfluff__sqlfluff-3904 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 2ac8e125604aa1f19d9811f7dc5bd56eefa654ac | Standardise `--disable_progress_bar` naming
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
As noted in https://github.com/sqlfluff/sqlfluff/pull/3610#discussion_r926014745 `--disable_progress_bar` is the only command ... | I like the idea (of at least as a transition) or accepting both, but then defaulting to the one consistent with the other options.
So this is about changing option `--disable_progress_bar` to `--disable-progress-bar`, right? I think I can take care of that, it was me who introduced it here :)
Additionally I would ma... | diff --git a/src/sqlfluff/cli/click_deprecated_option.py b/src/sqlfluff/cli/click_deprecated_option.py
new file mode 100644
--- /dev/null
+++ b/src/sqlfluff/cli/click_deprecated_option.py
@@ -0,0 +1,104 @@
+"""Allows to provide deprecated options for click's command."""
+
+from typing import Any, Callable
+
+import cli... | 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
@@ -112,7 +112,7 @@ def test__cli__command_directed():
args=[
lint,
[
- "--disable_progress_bar",
+ "--disable-progress-bar"... | ["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-10-01T22:18:25Z | 2 | 115 | 117 | 1,002 | 0 | 0.8 | 1 | 0.7 | 1 | 0.550333 | 86.301 | |
3,241 | swe_bench::test::983 | swe_bench | test | 983 | matplotlib__matplotlib-21559 | matplotlib/matplotlib | matplotlib/matplotlib | python | 95463c32e684ffd752da1c303bdbdf21eed22fff | [Bug]: eventplot cannot handle multiple datetime-based series
### Bug summary
I am having the exact same issue as in #5248 (which apparently was resolved at some point, but it's not working for me) with the latest version of matplotlib as passing a list of `datetime.date`s to `eventplot` is not working.
### Code for ... | 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
@@ -1254,10 +1254,11 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
--------
.. plot:: gallery/lines_bars_and_markers/eventplot_dem... | 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
@@ -4137,6 +4137,21 @@ def test_eventplot_orientation(data, orientation):
plt.draw()
+@check_figures_equal(extensions=['png'])
+def test_eventplot_u... | ["lib/matplotlib/tests/test_axes.py::test_eventplot_units_list[png]"] | ["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[... | null | true | 2021-11-07T15:59:23Z | 1 | 14 | 1 | 5,627 | 0 | 0.8 | 1 | 0.77 | 1 | 0.546667 | 86.285 | ||
3,242 | swe_bench::dev::210 | swe_bench | dev | 210 | sqlfluff__sqlfluff-4084 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 181918e9c2840dc3f5ff1c713bf6b5a00d0725b5 | Multiple processes not used when list of explicit filenames is passed
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### What Happened
When providing a long list of file names to `sqlfluff lint -p -1`, only a single CPU is used. This s... | I have been wondering for some time why sqlfluff never manages to use 100% of CPU. Running it on my Code base takes about 90 minutes. Though never more than 30% of cpu is used… maybe this sis the reason…
Yeah - this looks like an accurate diagnosis. Most of the testing for the multiprocessing feature was done on large ... | diff --git a/src/sqlfluff/core/linter/linter.py b/src/sqlfluff/core/linter/linter.py
--- a/src/sqlfluff/core/linter/linter.py
+++ b/src/sqlfluff/core/linter/linter.py
@@ -1103,17 +1103,39 @@ def lint_path(
processes: Optional[int] = None,
) -> LintedDir:
"""Lint a path."""
- linted_path = ... | 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
@@ -1272,15 +1272,16 @@ def test__cli__command_lint_nocolor(isatty, should_strip_ansi, capsys, tmpdir):
)
@pytest.mark.parametrize("write_file", [None, "outfile"])
def test__cli__command... | ["test/cli/commands_test.py::TestProgressBars::test_cli_lint_enabled_progress_bar_multiple_paths", "test/cli/commands_test.py::TestProgressBars::test_cli_lint_enabled_progress_bar_multiple_files"] | ["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-11-18T22:49:21Z | 1 | 95 | 2 | 1,344 | 0 | 0.8 | 1 | 0.7 | 1 | 0.540667 | 86.272 | |
3,243 | swe_bench::test::1126 | swe_bench | test | 1,126 | matplotlib__matplotlib-26472 | matplotlib/matplotlib | matplotlib/matplotlib | python | e4905bf8ae7d2f58025442018606f59641daa226 | Switching to inline backend closes GUI windows
### Bug report
**Bug summary**
When a plot is made with the `qt5` backend on and then the backend is changed to `inline`, the active plot window(s) are closed. This makes it very difficult to switch cleanly between backends within a notebook. The two mediocre workaround... | I don't really have a good feel for whether what you are asking for is possible or not, but have you tried the `notebook` backend, or the `widgets` backend? They seem suited to what you want to do.
I guess I have a few issues with `notebook` and `widgets`:
- You can't easily switch between `inline` and `notebook`/... | diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py
--- a/lib/matplotlib/backend_bases.py
+++ b/lib/matplotlib/backend_bases.py
@@ -45,7 +45,7 @@
import matplotlib as mpl
from matplotlib import (
_api, backend_tools as tools, cbook, colors, _docstring, text,
- _tight_bbox, transform... | diff --git a/lib/matplotlib/testing/conftest.py b/lib/matplotlib/testing/conftest.py
--- a/lib/matplotlib/testing/conftest.py
+++ b/lib/matplotlib/testing/conftest.py
@@ -75,7 +75,9 @@ def mpl_test_settings(request):
try:
yield
finally:
- matplotlib.use(prev_backend)
+ ... | ["lib/matplotlib/tests/test_backend_bases.py::test_non_gui_warning", "lib/matplotlib/tests/test_pyplot.py::test_switch_backend_no_close"] | ["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-08-08T20:53:05Z | 2 | 15 | 2 | 2,908 | 0 | 0.8 | 1 | 0.7 | 1 | 0.534667 | 86.254 | |
3,244 | swe_bench::test::2250 | swe_bench | test | 2,250 | sympy__sympy-21952 | sympy/sympy | sympy/sympy | python | b8156f36f0f3144c5e3b66002b9e8fcbe2ee66c4 | If n is even, n**2/2 should also be even
The following:
``` python
>>> n = Symbol('n', integer=True, even=True)
>>> (n**2/2).is_even
```
should return `True`, but it returns `None` (of course, this is also an enhancement).
That makes me think that perhaps symbolic integers should keep a more complex "assumptions" me... | I have added some handling for this instance in this [PR](https://github.com/sympy/sympy/pull/12320). I did put thought into generalizing this even more for any integer divisor, but because we don't have the factorizations for the symbols, this does not seem easily possible.
Can you add some tests (based on the other ... | diff --git a/sympy/core/mul.py b/sympy/core/mul.py
--- a/sympy/core/mul.py
+++ b/sympy/core/mul.py
@@ -1334,6 +1334,7 @@ def _eval_is_zero(self):
#_eval_is_integer = lambda self: _fuzzy_group(
# (a.is_integer for a in self.args), quick_exit=True)
def _eval_is_integer(self):
+ from sympy import ... | 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
@@ -512,6 +512,12 @@ def test_Mul_is_even_odd():
assert (x*(x + k)).is_odd is False
assert (x*(x + m)).is_odd is None
+ # issue 8648
+ assert (m**2/2).is_e... | ["test_Mul_is_even_odd", "test_Pow_is_integer"] | ["test_bug1", "test_Symbol", "test_arit0", "test_div", "test_pow", "test_pow2", "test_pow3", "test_mod_pow", "test_pow_E", "test_pow_issue_3516", "test_pow_im", "test_real_mul", "test_ncmul", "test_mul_add_identity", "test_ncpow", "test_powerbug", "test_Mul_doesnt_expand_exp", "test_Mul_is_integer", "test_Add_Mul_is_in... | null | true | 2021-08-26T11:12:47Z | 2 | 102 | 2 | 1,113 | 0 | 0.8 | 1 | 0.7 | 1 | 0.5255 | 86.2265 | |
3,245 | swe_bench::test::1062 | swe_bench | test | 1,062 | matplotlib__matplotlib-25079 | matplotlib/matplotlib | matplotlib/matplotlib | python | 66f7956984cbfc3647e867c6e5fde889a89c64ef | [Bug]: Setting norm with existing colorbar fails with 3.6.3
### Bug summary
Setting the norm to a `LogNorm` after the colorbar has been created (e.g. in interactive code) fails with an `Invalid vmin` value in matplotlib 3.6.3.
The same code worked in previous matplotlib versions.
Not that vmin and vmax are explicitl... | diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py
--- a/lib/matplotlib/colors.py
+++ b/lib/matplotlib/colors.py
@@ -1362,8 +1362,12 @@ def inverse(self, value):
def autoscale(self, A):
"""Set *vmin*, *vmax* to min, max of *A*."""
- self.vmin = self.vmax = None
- self.autosca... | 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
@@ -1493,6 +1493,11 @@ def test_norm_callback():
norm.vmax = 5
assert increment.call_count == 2
+ # We only want autoscale() calls to ... | ["lib/matplotlib/tests/test_colors.py::test_norm_callback"] | ["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_index_dtype[uint8]", "lib/matplotlib/tests/test_... | null | true | 2023-01-25T15:24:44Z | 1 | 8 | 1 | 3,659 | 0 | 0.8 | 1 | 0.77 | 1 | 0.526667 | 86.225 | ||
3,246 | swe_bench::dev::97 | swe_bench | dev | 97 | pydicom__pydicom-1539 | pydicom/pydicom | pydicom/pydicom | python | a125a02132c2db5ff5cad445e4722802dd5a8d55 | pydicom produces invalid DICOM files if ds.EncapsulatedDocument contains byte array of odd length
**Bug Description**
When inserting a byte array of odd length into the ds.EncapsulatedDocument field, and saving this as a DICOM file, the DICOM file produced is not valid. This happens because the resulting file produced ... | diff --git a/pydicom/filewriter.py b/pydicom/filewriter.py
--- a/pydicom/filewriter.py
+++ b/pydicom/filewriter.py
@@ -272,7 +272,12 @@ def write_numbers(fp: DicomIO, elem: DataElement, struct_format: str) -> None:
def write_OBvalue(fp: DicomIO, elem: DataElement) -> None:
"""Write a data_element with VR of 'ot... | 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
@@ -474,6 +474,20 @@ def test_write_ascii_vr_with_padding(self):
data_elem = DataElement(0x00080060, 'CS', b'REG')
self.check_data_element(data... | ["pydicom/tests/test_filewriter.py::TestWriteDataElement::test_write_OB_odd"] | ["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 | 2021-11-26T06:22:47Z | 1 | 7 | 1 | 5,222 | 0 | 0.8 | 1 | 0.77 | 1 | 0.523333 | 86.215 | ||
3,247 | swe_bench::test::1004 | swe_bench | test | 1,004 | matplotlib__matplotlib-23057 | matplotlib/matplotlib | matplotlib/matplotlib | python | 8bfd2c43344215008a2f5597ecc0ee467fb039d3 | [Bug]: Figures fail to redraw with IPython
### Bug summary
A regression between release versions 3.5.1 and 3.5.2 causes figures to fail to redraw after an initial plot is added using the `pyplot` interface in an interactive IPython session. This has been observed with both `pyplot.plot` and `pyplot.tripcolor`. The fig... | On the bright side, there is a very easy fix, an explicit call to `ion` (aka `plt.ion` aka `matplotlib.pyplot.ion()`) will fix the behavior.
I suspect that this is more fallout from deferring actually loading the backend until it is actually needed.
@ahesford Thank you for reporting this and sorry we broke this.
... | diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py
--- a/lib/matplotlib/pyplot.py
+++ b/lib/matplotlib/pyplot.py
@@ -206,12 +206,6 @@ def _get_backend_mod():
# will (re)import pyplot and then call switch_backend if we need to
# resolve the auto sentinel)
switch_backend(dict.__ge... | diff --git a/lib/matplotlib/tests/test_pyplot.py b/lib/matplotlib/tests/test_pyplot.py
--- a/lib/matplotlib/tests/test_pyplot.py
+++ b/lib/matplotlib/tests/test_pyplot.py
@@ -1,5 +1,6 @@
import difflib
import numpy as np
+import os
import subprocess
import sys
from pathlib import Path
@@ -367,3 +368,26 @@ def test... | ["lib/matplotlib/tests/test_pyplot.py::test_pylab_integration"] | ["lib/matplotlib/tests/test_pyplot.py::test_pyplot_up_to_date", "lib/matplotlib/tests/test_pyplot.py::test_copy_docstring_and_deprecators", "lib/matplotlib/tests/test_pyplot.py::test_pyplot_box", "lib/matplotlib/tests/test_pyplot.py::test_stackplot_smoke", "lib/matplotlib/tests/test_pyplot.py::test_nrows_error", "lib/m... | null | true | 2022-05-17T21:13:07Z | 1 | 10 | 1 | 2,837 | 0 | 0.8 | 1 | 0.7 | 1 | 0.506167 | 86.1685 | |
3,248 | swe_bench::test::1633 | swe_bench | test | 1,633 | scikit-learn__scikit-learn-14114 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 7b8cbc875b862ebb81a9b3415bdee235cca99ca6 | AdaBoost's "SAMME" algorithm uses 'predict' while fitting and 'predict_proba' while predicting probas
Subj. This seems to me to be a wrong approach, moreover this drives to such mistakes:
<pre>
AdaBoostClassifier(algorithm="SAMME", base_estimator=SVC()).fit(trainX, trainY).predict_proba(testX)
------------------------... | (Not an AdaBoost expert)
Why is it wrong? How else would you define `predict_proba`?
The idea of using only predictions during training and use afterwards probas of base_estimators is strange. The base_estimator can return -0.1 and 0.9 or -0.9 and 0.1.
They will have same predictions and different probas - but you d... | diff --git a/sklearn/ensemble/weight_boosting.py b/sklearn/ensemble/weight_boosting.py
--- a/sklearn/ensemble/weight_boosting.py
+++ b/sklearn/ensemble/weight_boosting.py
@@ -34,6 +34,7 @@
from ..tree import DecisionTreeClassifier, DecisionTreeRegressor
from ..utils import check_array, check_random_state, check_X_y... | diff --git a/sklearn/ensemble/tests/test_weight_boosting.py b/sklearn/ensemble/tests/test_weight_boosting.py
--- a/sklearn/ensemble/tests/test_weight_boosting.py
+++ b/sklearn/ensemble/tests/test_weight_boosting.py
@@ -1,6 +1,7 @@
"""Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
+impo... | ["sklearn/ensemble/tests/test_weight_boosting.py::test_adaboost_consistent_predict[SAMME]"] | ["sklearn/ensemble/tests/test_weight_boosting.py::test_samme_proba", "sklearn/ensemble/tests/test_weight_boosting.py::test_oneclass_adaboost_proba", "sklearn/ensemble/tests/test_weight_boosting.py::test_classification_toy[SAMME]", "sklearn/ensemble/tests/test_weight_boosting.py::test_classification_toy[SAMME.R]", "skle... | null | true | 2019-06-18T13:20:20Z | 1 | 63 | 1 | 1,769 | 0 | 0.8 | 1 | 0.7 | 1 | 0.504833 | 86.1645 | |
3,249 | swe_bench::test::960 | swe_bench | test | 960 | matplotlib__matplotlib-19763 | matplotlib/matplotlib | matplotlib/matplotlib | python | 28289122be81e0bc0a6ee0c4c5b7343a46ce2e4e | Multicursor disappears when not moving on nbagg with useblit=False + burns CPU
### Bug report
**Bug summary**
When on the nbagg backend if you stop moving the mouse the multicursor will disappear. The same example works fine on the qt backend.
Additionally I noticed that when I add the multicursor my cpu usage jumps... | On matplotlib master nbagg supports blitting - so I also tried with that - which prevents the high cpu usage but the smearing of the image (https://github.com/matplotlib/matplotlib/issues/19116) is renders the widget unusable:
:
super().__init__(ax)
- self.connect_event('motion_no... | diff --git a/lib/matplotlib/tests/test_widgets.py b/lib/matplotlib/tests/test_widgets.py
--- a/lib/matplotlib/tests/test_widgets.py
+++ b/lib/matplotlib/tests/test_widgets.py
@@ -1517,7 +1517,7 @@ def test_MultiCursor(horizOn, vertOn):
# Can't use `do_event` as that helper requires the widget
# to have a sing... | ["lib/matplotlib/tests/test_widgets.py::test_MultiCursor[False-False]", "lib/matplotlib/tests/test_widgets.py::test_MultiCursor[False-True]", "lib/matplotlib/tests/test_widgets.py::test_MultiCursor[True-False]", "lib/matplotlib/tests/test_widgets.py::test_MultiCursor[True-True]"] | ["lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs0-None]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs2-None]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs4-None]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs5-None]", "li... | null | true | 2021-03-24T07:55:54Z | 1 | 51 | 4 | 2,007 | 0 | 0.8 | 1 | 0.7 | 1 | 0.5045 | 86.1635 | |
3,250 | swe_bench::dev::103 | swe_bench | dev | 103 | pydicom__pydicom-1674 | pydicom/pydicom | pydicom/pydicom | python | e77e6586fa38e6f7e98efca80d560d0fea8a9669 | Codify not generating content sequences correctly
**Describe the bug**
I am trying to generate a radiation dose structure report. I ran Codify on an existing RDSR to generate a template. The sequence content is reproduced but does not seem to be attached to the base dataset. When I run the generated python file the di... | Hi Alan,
I'm happy to look into this, but may need a file to work with. But perhaps we can first have a look at the generated code, which normally immediately attaches any sequence it creates. For example:
```
$ pydicom codify pydicom::rtplan.dcm
```
Gives lines like
```python
# Beam Sequence
beam_seque... | diff --git a/pydicom/cli/main.py b/pydicom/cli/main.py
--- a/pydicom/cli/main.py
+++ b/pydicom/cli/main.py
@@ -10,10 +10,11 @@
import argparse
import pkg_resources
import re
+import sys
from typing import Tuple, cast, List, Any, Dict, Optional, Callable
from pydicom import dcmread
-from pydicom.data.data_manager... | diff --git a/pydicom/tests/test_cli.py b/pydicom/tests/test_cli.py
--- a/pydicom/tests/test_cli.py
+++ b/pydicom/tests/test_cli.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# Copyright 2020 pydicom authors. See LICENSE file for details.
"""Tests for command-line interface"""
@@ -138,6 +139,13 @@ def test_codify_data... | ["pydicom/tests/test_cli.py::TestCLIcall::test_codify_UTF8", "pydicom/tests/test_util.py::TestCodify::test_code_sequence", "pydicom/tests/test_util.py::TestCodify::test_codify_recurring_keyword"] | ["pydicom/tests/test_cli.py::TestFilespec::test_syntax[extra:colon]", "pydicom/tests/test_cli.py::TestFilespec::test_syntax[no_callable()]", "pydicom/tests/test_cli.py::TestFilespec::test_syntax[no_equals", "pydicom/tests/test_cli.py::TestFilespec::test_syntax[BeamSequence[0]extra]", "pydicom/tests/test_cli.py::TestFil... | null | true | 2022-08-18T17:35:33Z | 2 | 92 | 3 | 1,138 | 0 | 0.8 | 1 | 0.7 | 1 | 0.496333 | 86.139 | |
3,251 | swe_bench::test::2124 | swe_bench | test | 2,124 | sympy__sympy-17271 | sympy/sympy | sympy/sympy | python | 52641f02c78331a274ec79b6b2ccf78c38a3c6ce | frac(zoo) gives TypeError
```
In [1]: from sympy import frac, zoo
In [2]: frac(zoo)
Traceback (most recent call last):
File "<ipython-input-2-eb6875922196>", line 1, in <module>
frac(zoo)
File "C:\Users\Oscar\sympy\sympy\core\function.py", line 458, in __new__
result = super(Function, cls).__new__(cls, ... | I think it should return nan instead of None so that `frac(zoo) -> nan`.
oo gives `AccumBounds(0, 1)` so an option may be `AccumBounds(0, 1) + I*AccumBounds(0, 1)` or something. Not sure when one would like to call it though. Even for oo.
I think that `nan` would be the best choice (for `oo` as well unless a "real nan"... | diff --git a/sympy/functions/elementary/integers.py b/sympy/functions/elementary/integers.py
--- a/sympy/functions/elementary/integers.py
+++ b/sympy/functions/elementary/integers.py
@@ -3,9 +3,11 @@
from sympy.core import Add, S
from sympy.core.evalf import get_integer_part, PrecisionExhausted
from sympy.core.funct... | diff --git a/sympy/functions/elementary/tests/test_integers.py b/sympy/functions/elementary/tests/test_integers.py
--- a/sympy/functions/elementary/tests/test_integers.py
+++ b/sympy/functions/elementary/tests/test_integers.py
@@ -1,5 +1,6 @@
from sympy import AccumBounds, Symbol, floor, nan, oo, zoo, E, symbols, \
- ... | ["test_floor", "test_ceiling", "test_frac", "test_latex_functions"] | ["test_series", "test_issue_11207", "test_printmethod", "test_latex_basic", "test_latex_builtins", "test_latex_SingularityFunction", "test_latex_cycle", "test_latex_permutation", "test_latex_Float", "test_latex_vector_expressions", "test_latex_symbols", "test_function_subclass_different_name", "test_hyper_printing", "t... | null | true | 2019-07-26T14:40:54Z | 2 | 99 | 4 | 995 | 0 | 0.8 | 1 | 0.7 | 1 | 0.495833 | 86.1375 | |
3,252 | swe_bench::test::2172 | swe_bench | test | 2,172 | sympy__sympy-18728 | sympy/sympy | sympy/sympy | python | e33d341aa8423c58ddb3d441955108eefbe12a2e | Fix is_zero and is_positive for Pow
#### References to other Issues or PRs
Fixes #9532
#### Brief description of what is fixed or changed
Still a work in progress. This attempts to get Pow.is_zero working in all cases.
This PR fixes Pow.is_zero so that it doesn't assume finiteness unless justified by assumptions. ... | :white_check_mark:
Hi, I am the [SymPy bot](https://github.com/sympy/sympy-bot) (v145). I'm here to help you write a release notes entry. Please read the [guide on how to write release notes](https://github.com/sympy/sympy/wiki/Writing-Release-Notes).
Your release notes are in good order.
Here is what the release ... | diff --git a/sympy/core/power.py b/sympy/core/power.py
--- a/sympy/core/power.py
+++ b/sympy/core/power.py
@@ -561,18 +561,20 @@ def _eval_is_zero(self):
elif self.exp.is_extended_nonpositive:
return False
elif self.base.is_zero is False:
- if self.exp.is_negative:
+ ... | 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
@@ -1200,6 +1200,108 @@ def test_Pow_is_zero():
assert Pow(S.Half, oo, evaluate=False).is_zero
assert Pow(S.Half, -oo, evaluate=False).is_zero is False
+ # Al... | ["test_Pow_is_zero"] | ["test_bug1", "test_Symbol", "test_arit0", "test_div", "test_pow", "test_pow2", "test_pow3", "test_mod_pow", "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_e... | null | true | 2020-02-25T21:53:01Z | 1 | 15 | 1 | 2,650 | 0 | 0.8 | 1 | 0.7 | 1 | 0.491667 | 86.125 | |
3,253 | swe_bench::test::1342 | swe_bench | test | 1,342 | pylint-dev__pylint-5951 | pylint-dev/pylint | pylint-dev/pylint | python | 6de7100e4bed8641f898cef160e1874ec788ab96 | DOC: pyreverse supported format not recognized missing puml, plantuml, mmd, etc
### Bug description
Some supported formats are not listed in the error messaging:
```
> pyreverse -ASmy -o .puml my_package/my_module.py
parsing my_package/my_module.py...
Format: "puml" not recognized. Use one of: bmp canon cmap cmapx cm... | Thank you for the report.
This error message is not generated by ``pyreverse`` itself, but comes from the call to the ``dot`` executable.
The logic for the output format in ``pyreverse`` is as follows:
1. First, we check if the given output format can be generated directly by ``pyreverse`` - this includes VCG (`... | diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py
--- a/pylint/pyreverse/dot_printer.py
+++ b/pylint/pyreverse/dot_printer.py
@@ -19,7 +19,7 @@
from astroid import nodes
from pylint.pyreverse.printer import EdgeType, Layout, NodeProperties, NodeType, Printer
-from pylint.pyreverse.utils... | diff --git a/tests/pyreverse/test_main.py b/tests/pyreverse/test_main.py
--- a/tests/pyreverse/test_main.py
+++ b/tests/pyreverse/test_main.py
@@ -2,15 +2,39 @@
import os
import sys
from typing import Iterator
+from unittest import mock
import pytest
from pylint.lint import fix_import_path
+from pylint.pyrever... | ["tests/pyreverse/test_main.py::test_graphviz_supported_image_format", "tests/pyreverse/test_main.py::test_graphviz_cant_determine_supported_formats", "tests/pyreverse/test_main.py::test_graphviz_unsupported_image_format"] | ["tests/pyreverse/test_main.py::test_project_root_in_sys_path[/tests]", "tests/pyreverse/test_main.py::test_project_root_in_sys_path[/data]"] | null | true | 2022-03-22T08:27:39Z | 3 | 67 | 3 | 1,608 | 0 | 0.8 | 1 | 0.7 | 1 | 0.491333 | 86.124 | |
3,254 | swe_bench::test::1404 | swe_bench | test | 1,404 | pytest-dev__pytest-5413 | pytest-dev/pytest | pytest-dev/pytest | python | 450d2646233c670654744d3d24330b69895bb9d2 | str() on the pytest.raises context variable doesn't behave same as normal exception catch
Pytest 4.6.2, macOS 10.14.5
```Python
try:
raise LookupError(
f"A\n"
f"B\n"
f"C"
)
except LookupError as e:
print(str(e))
```
prints
> A
> B
> C
But
```Python
with pytest.raises(LookupError)... | > Any chance the behavior could be changed to eliminate this gotcha?
What do you suggest?
Proxying through to the exceptions `__str__`?
Hi @fiendish,
Indeed this is a bit confusing.
Currently `ExceptionInfo` objects (which is `pytest.raises` returns to the context manager) implements `__str__` like this:
... | diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py
--- a/src/_pytest/_code/code.py
+++ b/src/_pytest/_code/code.py
@@ -534,13 +534,6 @@ def getrepr(
)
return fmt.repr_excinfo(self)
- def __str__(self):
- if self._excinfo is None:
- return repr(self)
- entr... | diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py
--- a/testing/code/test_excinfo.py
+++ b/testing/code/test_excinfo.py
@@ -333,18 +333,10 @@ def test_excinfo_exconly():
assert msg.endswith("world")
-def test_excinfo_repr():
+def test_excinfo_repr_str():
excinfo = pytest.raises(Valu... | ["testing/code/test_excinfo.py::test_excinfo_repr_str"] | ["testing/code/test_excinfo.py::test_excinfo_simple", "testing/code/test_excinfo.py::test_excinfo_getstatement", "testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_entries", "testing/code/test_excinfo.py::TestTraceback_f_g_h::test_traceback_entry_getsource", "testing/code/test_excinfo.py::TestTraceback_... | null | true | 2019-06-06T15:21:20Z | 1 | 7 | 1 | 2,793 | 0 | 0.8 | 1 | 0.7 | 1 | 0.488833 | 86.1165 | |
3,255 | swe_bench::dev::99 | swe_bench | dev | 99 | pydicom__pydicom-1562 | pydicom/pydicom | pydicom/pydicom | python | e1a035a88fe36d466579b2f3940bde5b8b1bc84d | Revise the type annotation for pydicom.datadict.dictionary_has_tag()
**Describe the bug**
The documentation of [`pydicom.datadict.dictionary_has_tag()`](https://pydicom.github.io/pydicom/dev/reference/generated/pydicom.datadict.dictionary_has_tag.html#pydicom.datadict.dictionary_has_tag) suggests that a query using ke... | Yeah, it should be plain old `int`. Not sure how I missed that one...
The keyword to tag conversion is actually kind of (relatively) expensive, and this function is used in our initial dataset parsing so we want it to be fast. | diff --git a/pydicom/datadict.py b/pydicom/datadict.py
--- a/pydicom/datadict.py
+++ b/pydicom/datadict.py
@@ -249,9 +249,10 @@ def get_entry(tag: TagType) -> Tuple[str, str, str, str, str]:
Parameters
----------
- tag : int
- The tag for the element whose entry is to be retrieved. Only entries
- ... | diff --git a/pydicom/tests/test_dictionary.py b/pydicom/tests/test_dictionary.py
--- a/pydicom/tests/test_dictionary.py
+++ b/pydicom/tests/test_dictionary.py
@@ -30,6 +30,8 @@ def test_dict_has_tag(self):
"""Test dictionary_has_tag"""
assert dictionary_has_tag(0x00100010)
assert not dictiona... | ["pydicom/tests/test_dictionary.py::TestDict::test_dict_has_tag"] | ["pydicom/tests/test_dictionary.py::TestDict::test_tag_not_found", "pydicom/tests/test_dictionary.py::TestDict::test_repeaters", "pydicom/tests/test_dictionary.py::TestDict::test_repeater_has_tag", "pydicom/tests/test_dictionary.py::TestDict::test_repeater_has_keyword", "pydicom/tests/test_dictionary.py::TestDict::test... | null | true | 2021-12-30T20:52:59Z | 1 | 69 | 1 | 1,488 | 0 | 0.8 | 1 | 0.7 | 1 | 0.478 | 86.084 | |
3,256 | swe_bench::test::1242 | swe_bench | test | 1,242 | pydata__xarray-4442 | pydata/xarray | pydata/xarray | python | 9a4313b4b75c181eade5a61f1a2f053b9d1bb293 | to_dataframe/to_series fails when one out of more than one dims are stacked / multiindex
#### Code Sample, a copy-pastable example if possible
```python
da = xr.DataArray([[[1]]], dims=["a","b","c"]).stack(ab=["a", "b"])
da.to_series()
# or
da.to_dataframe("A")
```
#### Problem description
When a dataarray has one mul... | I agree, this is definitely not ideal behavior!
I hesitate to call it a bug only because I'm not sure if we've ever supported this behavior.
It would be nice to fix this, and I would encourage you (or other interested users) to look into it.
This seems to happen because `MultiIndex.from_product` is being pa... | diff --git a/xarray/core/coordinates.py b/xarray/core/coordinates.py
--- a/xarray/core/coordinates.py
+++ b/xarray/core/coordinates.py
@@ -13,6 +13,7 @@
cast,
)
+import numpy as np
import pandas as pd
from . import formatting, indexing
@@ -107,8 +108,49 @@ def to_index(self, ordered_dims: Sequence[Hashable]... | 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
@@ -3635,6 +3635,33 @@ def test_to_dataframe(self):
with raises_regex(ValueError, "unnamed"):
arr.to_dataframe()
+ def test_to_dataframe_multi... | ["xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_to_dataframe_0length"] | ["xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray... | null | true | 2020-09-20T20:45:12Z | 1 | 46 | 2 | 1,929 | 0 | 0.8 | 1 | 0.7 | 1 | 0.474833 | 86.0745 | |
3,257 | swe_bench::test::2284 | swe_bench | test | 2,284 | sympy__sympy-24353 | sympy/sympy | sympy/sympy | python | 900caa3f53cb160612928afe8699d2c9bcd27691 | py.bench broken
```
$ bin/py.bench
Traceback (most recent call last):
File "bin/py.bench", line 15, in <module>
from sympy.utilities import benchmarking
File "sympy/utilities/benchmarking.py", line 4, in <module>
from py.__.test.item import Item
ImportError: No module named __.test.item
$ python -c "import ... | ```
It works for me, but I have 0.9.2. So something in py must have broken it.
```
Original comment: http://code.google.com/p/sympy/issues/detail?id=1741#c1
Original author: https://code.google.com/u/asmeurer@gmail.com/
```
It's kinda written on the tin that this would break with any new release. Surely, a
module na... | diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -16,10 +16,7 @@
In addition, there are some other commands:
- python setup.py clean -> will clean all trash (*.pyc and stuff)
python setup.py test -> will run the complete test suite
- python setup.py bench -> will run the complete bench... | diff --git a/sympy/testing/benchmarking.py b/sympy/testing/benchmarking.py
deleted file mode 100644
--- a/sympy/testing/benchmarking.py
+++ /dev/null
@@ -1,221 +0,0 @@
-"""benchmarking through py.test"""
-
-import py
-from py.__.test.item import Item
-from py.__.test.terminal.terminal import TerminalSession
-
-from mat... | ["test_files"] | ["test_raise_statement_regular_expression", "test_implicit_imports_regular_expression", "test_test_suite_defs", "test_test_duplicate_defs", "test_find_self_assignments"] | null | true | 2022-12-07T04:35:36Z | 2 | 115 | 1 | 507 | 0 | 0.8 | 1 | 0.7 | 1 | 0.467833 | 86.0535 | |
3,258 | swe_bench::test::1837 | swe_bench | test | 1,837 | sphinx-doc__sphinx-8599 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 3a0a6556c59a7b31586dd97b43101f8dbfd2ef63 | Allow custom link texts for permalinks and links to source code.
I'd like to be able to customize the content of the HTML links that Sphinx generates for permalinks and links to source code (generated by the `viewcode` extension).
E.g. instead of ``<a class="headerlink" href="..." title="Permalink to this definition">... | Thank you for proposal. I agree with your idea. But it would better to customize it via CSS to me. How about wrapping these labels with `<span>`? Adding a custom node will cause incompatibility to writers. Please take a look errors in Travis CI.
I agree that adding a custom node might be to invasive, but I don't know h... | 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
@@ -1205,6 +1205,16 @@ def validate_html_favicon(app: Sphinx, config: Config) -> None:
config.html_favicon = None # type: ignore
+def migrate_html_... | 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
@@ -1665,3 +1665,23 @@ def test_highlight_options_old(app):
location=ANY, opts={})
assert call_args[2] == call(ANY, 'java', force=False, linenos=Fa... | ["tests/test_build_html.py::test_html_permalink_disable", "tests/test_build_html.py::test_html_permalink_icon"] | ["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_html.py::test_html5_output[images.html-expect3]", ... | null | true | 2020-12-27T09:15:38Z | 3 | 61 | 2 | 1,573 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4655 | 86.0465 | |
3,259 | swe_bench::dev::185 | swe_bench | dev | 185 | sqlfluff__sqlfluff-2573 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 8822bf4d831ccbf6bc63a44b34978daf6939d996 | Configuration from current working path not being loaded when path provided.
I have the following directory structure.
```
~/GitHub/sqlfluff-bug
➜ tree -a
.
├── .sqlfluffignore
├── ignore_me_1.sql
├── path_a
│ └── ignore_me_2.sql
└── path_b
├── ignore_me_3.sql
└── lint_me_1.sql
2 directories, 5 files
```
An... | This is currently functioning as expected in that it only looks for `.sqlfluffignore` files within the directories you specify. So if you point sqlfluff at `/path_b`, it would only looks for a `.sqlfluffignore` file at `/path_b/.sqlfluffignore` and any child directories of that. It won't check in parents of the given f... | diff --git a/src/sqlfluff/core/config.py b/src/sqlfluff/core/config.py
--- a/src/sqlfluff/core/config.py
+++ b/src/sqlfluff/core/config.py
@@ -395,7 +395,7 @@ def load_config_up_to_path(
@classmethod
def find_ignore_config_files(
- cls, path, working_path=os.getcwd(), ignore_file_name=".sqlfluffignor... | diff --git a/test/core/linter_test.py b/test/core/linter_test.py
--- a/test/core/linter_test.py
+++ b/test/core/linter_test.py
@@ -1,10 +1,12 @@
"""The Test file for the linter class."""
-import pytest
+import os
import logging
from typing import List
from unittest.mock import patch
+import pytest
+
from sqlfl... | ["test/core/linter_test.py::test__linter__path_from_paths__sqlfluffignore_current_directory"] | ["test/core/linter_test.py::test__linter__path_from_paths__dir", "test/core/linter_test.py::test__linter__path_from_paths__default", "test/core/linter_test.py::test__linter__path_from_paths__exts", "test/core/linter_test.py::test__linter__path_from_paths__file", "test/core/linter_test.py::test__linter__path_from_paths_... | null | true | 2022-02-07T17:47:05Z | 2 | 43 | 1 | 1,924 | 0 | 0.8 | 1 | 0.7 | 1 | 0.464 | 86.042 | |
3,260 | swe_bench::test::954 | swe_bench | test | 954 | matplotlib__matplotlib-14471 | matplotlib/matplotlib | matplotlib/matplotlib | python | ddb891751d797517e28b9f74d1fffc98716f8c7d | Existing FigureCanvasQT objects destroyed by call to plt.figure
### Bug report
**Bug summary**
For a number of years, I have been maintaining an interactive application that embeds subclassed FigureCanvasQT objects within a PyQt application. Up until Matplotlib v3.0.3., it was possible to create standard Matplotlib P... | This bisects to #12637, and is essentially due to the fact that we now initialize ipython/matplotlib support when the first canvas is created (here, by `plt.figure()`), that during initialization, ipython calls `switch_backend`, that `switch_backend` starts by calling `close("all")`, and that NXPlotView() is registered... | diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -1105,6 +1105,10 @@ def use(backend, *, force=True):
"""
Select the backend used for rendering and GUI integration.
+ If pyplot is already imported, `~matplotlib.pyplo... | diff --git a/lib/matplotlib/tests/test_pyplot.py b/lib/matplotlib/tests/test_pyplot.py
--- a/lib/matplotlib/tests/test_pyplot.py
+++ b/lib/matplotlib/tests/test_pyplot.py
@@ -398,3 +398,14 @@ def test_minor_ticks():
tick_labels = ax.get_yticklabels(minor=True)
assert np.all(tick_pos == np.array([3.5, 6.5]))
... | ["lib/matplotlib/tests/test_pyplot.py::test_switch_backend_no_close"] | ["lib/matplotlib/tests/test_pyplot.py::test_pyplot_up_to_date", "lib/matplotlib/tests/test_pyplot.py::test_copy_docstring_and_deprecators", "lib/matplotlib/tests/test_pyplot.py::test_pyplot_box", "lib/matplotlib/tests/test_pyplot.py::test_stackplot_smoke", "lib/matplotlib/tests/test_pyplot.py::test_nrows_error", "lib/m... | null | true | 2019-06-06T22:15:33Z | 2 | 25 | 1 | 2,283 | 0 | 0.8 | 1 | 0.7 | 1 | 0.463833 | 86.0415 | |
3,261 | swe_bench::test::1953 | swe_bench | test | 1,953 | sympy__sympy-13018 | sympy/sympy | sympy/sympy | python | e95969f314e084e8125d913099c1091a2643e530 | Wrong/surprising result from noncommutative Pow.subs
The following behavior in Sympy seems surprising:
```
>>> import sympy
>>> sympy.__version__
'1.1'
>>> x = sympy.Symbol('x', commutative=False)
>>> (x*x*x).subs({x*x: 1}) # !!!
1
```
I would have expected this produces `x`.
The issue appears to be that `Pow._eval_... | Agreed, fractional power logic should not apply to noncommutatives. Does your patch result in `x` or `x**3` for the substitution?
It results to `x**3`, so there's room for improvement.
If you're happy with `x**3` you can use `xreplace` instead of `subs` as a workaround. `xreplace` just does exact substitution, no mathe... | diff --git a/sympy/core/power.py b/sympy/core/power.py
--- a/sympy/core/power.py
+++ b/sympy/core/power.py
@@ -564,29 +564,61 @@ def _eval_is_polar(self):
def _eval_subs(self, old, new):
from sympy import exp, log, Symbol
def _check(ct1, ct2, old):
- """Return bool, pow where, if bool ... | diff --git a/sympy/core/tests/test_subs.py b/sympy/core/tests/test_subs.py
--- a/sympy/core/tests/test_subs.py
+++ b/sympy/core/tests/test_subs.py
@@ -292,6 +292,8 @@ def test_subs_commutative():
def test_subs_noncommutative():
w, x, y, z, L = symbols('w x y z L', commutative=False)
+ alpha = symbols('alpha'... | ["test_subs_noncommutative"] | ["test_subs", "test_subs_AccumBounds", "test_trigonometric", "test_powers", "test_bug", "test_subbug1", "test_subbug2", "test_dict_set", "test_dict_ambigous", "test_deriv_sub_bug3", "test_equality_subs1", "test_equality_subs2", "test_issue_3742", "test_subs_dict1", "test_mul", "test_subs_simple", "test_subs_constants",... | null | true | 2017-07-20T22:09:54Z | 1 | 80 | 1 | 1,152 | 0 | 0.8 | 1 | 0.7 | 1 | 0.458667 | 86.026 | |
3,262 | swe_bench::test::1220 | swe_bench | test | 1,220 | pydata__xarray-3527 | pydata/xarray | pydata/xarray | python | c0ef2f616e87e9f924425bcd373ac265f14203cb | DatasetGroupBy does not implement quantile
The docs claim `quantile` works on grouped datasets, but that does not seem to be the case:
```python
>>> import xarray as xr
>>> ds = xr.Dataset(data_vars={"a": ("x", list("abcd"))}, coords={"x": range(4)})
>>> ds.a.groupby(ds.x % 2 == 0).quantile
<bound method DataArrayGroup... | while looking for related issues, I found #3018, so this seems to be known?
OK, fine to leave this open since that's closed
actually, I think the fix proposed in the old issue (move `DataArrayGroupBy.quantile` to `GroupBy`) should also silence the warnings, since the other methods in `GroupBy` work just fine?
That woul... | diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py
--- a/xarray/core/groupby.py
+++ b/xarray/core/groupby.py
@@ -557,6 +557,59 @@ def fillna(self, value):
out = ops.fillna(self, value)
return out
+ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None):
+ """Com... | diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py
--- a/xarray/tests/test_groupby.py
+++ b/xarray/tests/test_groupby.py
@@ -137,42 +137,58 @@ def test_da_groupby_empty():
def test_da_groupby_quantile():
- array = xr.DataArray([1, 2, 3, 4, 5, 6], [("x", [1, 1, 1, 2, 2, 2])])
+ array = x... | ["xarray/tests/test_groupby.py::test_da_groupby_quantile", "xarray/tests/test_groupby.py::test_ds_groupby_quantile"] | ["xarray/tests/test_groupby.py::test_consolidate_slices", "xarray/tests/test_groupby.py::test_groupby_dims_property", "xarray/tests/test_groupby.py::test_multi_index_groupby_map", "xarray/tests/test_groupby.py::test_multi_index_groupby_sum", "xarray/tests/test_groupby.py::test_groupby_da_datetime", "xarray/tests/test_g... | null | true | 2019-11-13T23:03:07Z | 1 | 107 | 2 | 593 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4555 | 86.0165 | |
3,263 | swe_bench::test::1961 | swe_bench | test | 1,961 | sympy__sympy-13198 | sympy/sympy | sympy/sympy | python | b3e01a97bd5dfb67fb7b6d2f051b7187b8c41abf | Problem factoring trivial polynomial
```
>>> import sympy as sp
>>> x, y = sp.symbols('x y')
>>> z = 0.0001 * (x * (x + (4.0 * y))) + 0.0001 * (y * (x + (4.0 * y)))
>>> z
0.0001*x*(x + 4.0*y) + 0.0001*y*(x + 4.0*y)
>>> w = sp.expand(z)
>>> w
0.0001*x**2 + 0.0005*x*y + 0.0004*y**2
>>> v = sp.factor(w)
>>> v
1.0*(0.0001*... | Oh, just another example why Float's are dangerous for CAS.
No issue if coefficients from the field of rationals:
``` python
In [29]: z_r = Rational(0.0001) * (x * (x + (Rational(4.0) * y))) + Rational(0.0001) * (y * (x + (Rational(4.0) * y)))
In [30]: w_r = expand(z_r); w_r
Out[30]:
2 ... | diff --git a/sympy/polys/factortools.py b/sympy/polys/factortools.py
--- a/sympy/polys/factortools.py
+++ b/sympy/polys/factortools.py
@@ -1218,14 +1218,15 @@ def dup_factor_list(f, K0):
factors[i] = (dup_convert(f, K, K0), k)
coeff = K0.convert(coeff, K)
+ coeff = K0.quo(coef... | diff --git a/sympy/polys/tests/test_factortools.py b/sympy/polys/tests/test_factortools.py
--- a/sympy/polys/tests/test_factortools.py
+++ b/sympy/polys/tests/test_factortools.py
@@ -528,7 +528,10 @@ def test_dup_factor_list():
f = 6.7225336055071*x**2 - 10.6463972754741*x - 0.33469524022264
coeff, factors ... | ["test_dup_factor_list", "test_dmp_factor_list", "test_combsimp"] | ["test_dup_trial_division", "test_dmp_trial_division", "test_dup_zz_mignotte_bound", "test_dmp_zz_mignotte_bound", "test_dup_zz_hensel_step", "test_dup_zz_hensel_lift", "test_dup_zz_irreducible_p", "test_dup_cyclotomic_p", "test_dup_zz_cyclotomic_poly", "test_dup_zz_cyclotomic_factor", "test_dup_zz_factor", "test_dmp_z... | null | true | 2017-08-26T06:08:13Z | 1 | 18 | 3 | 2,365 | 0 | 0.8 | 1 | 0.7 | 1 | 0.454167 | 86.0125 | |
3,264 | swe_bench::test::1652 | swe_bench | test | 1,652 | scikit-learn__scikit-learn-14806 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 5cf88db24491112d2b8672f75df22f65a140d167 | IterativeImputer behaviour on missing nan's in fit data
Why is this behaviour forced:
_Features with missing values during transform which did not have any missing values during fit will be imputed with the initial imputation method only._
[https://scikit-learn.org/dev/modules/generated/sklearn.impute.IterativeImpute... | That sounds reasonable to me, at least as an option and probably default
behaviour. But I don't think it's worth blocking release for that feature,
so if you want it in 0.21, offer a pull request soon? Ping @sergeyf
OK, I do pull request. Sorry iam a newby on github participation.
We keep the issue open until the issu... | diff --git a/sklearn/impute/_iterative.py b/sklearn/impute/_iterative.py
--- a/sklearn/impute/_iterative.py
+++ b/sklearn/impute/_iterative.py
@@ -101,6 +101,13 @@ class IterativeImputer(TransformerMixin, BaseEstimator):
"random"
A random order for each round.
+ skip_complete : boolean, optio... | diff --git a/sklearn/impute/tests/test_impute.py b/sklearn/impute/tests/test_impute.py
--- a/sklearn/impute/tests/test_impute.py
+++ b/sklearn/impute/tests/test_impute.py
@@ -457,6 +457,18 @@ def test_imputation_missing_value_in_test_array(Imputer):
imputer.fit(train).transform(test)
+@pytest.mark.parametrize(... | ["sklearn/impute/tests/test_impute.py::test_iterative_imputer_one_feature[X0]", "sklearn/impute/tests/test_impute.py::test_iterative_imputer_one_feature[X1]", "sklearn/impute/tests/test_impute.py::test_iterative_imputer_imputation_order[random]", "sklearn/impute/tests/test_impute.py::test_iterative_imputer_imputation_o... | ["sklearn/impute/tests/test_impute.py::test_imputation_shape[mean]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[median]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[most_frequent]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[constant]", "sklearn/impute/tests/test_imput... | null | true | 2019-08-25T17:40:52Z | 1 | 47 | 9 | 1,775 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4525 | 86.0075 | |
3,265 | swe_bench::test::991 | swe_bench | test | 991 | matplotlib__matplotlib-22815 | matplotlib/matplotlib | matplotlib/matplotlib | python | 19992285cb2bff300ac1c1a688dae2cde1999b81 | [Bug]: make_norm_from_scale should create picklable classes even when used in-line.
### Bug summary
The new `matplotlib.colors.make_norm_from_scale` helper dynamically generates a norm class from a scale class. Currently, in the codebase, it is only used as a decorator to create "toplevel" classes (e.g., it is used t... | Hey, I want to try and fix this bug. Will you assign me or should I just start working on it?
Go for it.
I think this wasn't fully solved for the built-in classes of `matplotlib.colors`. Adding this test to `test_dynamic_norm`:
```python
# Also test the builtin classes
norm = mpl.colors.LogNorm(vmin=0.01,... | diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py
--- a/lib/matplotlib/colors.py
+++ b/lib/matplotlib/colors.py
@@ -43,6 +43,7 @@
from collections.abc import Sized, Sequence
import copy
import functools
+import importlib
import inspect
import io
import itertools
@@ -1528,9 +1529,22 @@ def _make_nor... | diff --git a/lib/matplotlib/tests/test_pickle.py b/lib/matplotlib/tests/test_pickle.py
--- a/lib/matplotlib/tests/test_pickle.py
+++ b/lib/matplotlib/tests/test_pickle.py
@@ -221,6 +221,11 @@ def test_mpl_toolkits():
assert type(pickle.loads(pickle.dumps(ax))) == parasite_axes.HostAxes
+def test_standard_norm(... | ["lib/matplotlib/tests/test_pickle.py::test_standard_norm"] | ["lib/matplotlib/tests/test_pickle.py::test_simple", "lib/matplotlib/tests/test_pickle.py::test_complete[png]", "lib/matplotlib/tests/test_pickle.py::test_gcf", "lib/matplotlib/tests/test_pickle.py::test_no_pyplot", "lib/matplotlib/tests/test_pickle.py::test_renderer", "lib/matplotlib/tests/test_pickle.py::test_image",... | null | true | 2022-04-09T21:14:55Z | 1 | 23 | 1 | 2,238 | 0 | 0.8 | 1 | 0.7 | 1 | 0.449667 | 85.999 | |
3,266 | swe_bench::test::1875 | swe_bench | test | 1,875 | sphinx-doc__sphinx-9260 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | e878299cc608614e959e0e99025cccfd48de00bc | Linkchecker croaks on specific anchors of GitHub-rendered reStructuredText documents
Dear Sphinx developers,
first things first: Thanks a stack for your paramount work on Sphinx. You already saved many souls of people writing technical documentation and probably also beyond this audience.
We just observed a minor woe... | If my understanding is correct, the behavior of anchors in GH came from JavaScript works. There is no anchors without "user-content" prefix in the HTML output. So it's difficult to check the anchor.
Do you remember what version have you used before the update? I'd like to try to reproduce why the old version can han... | diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -21,7 +21,7 @@
from threading import Thread
from typing import (Any, Dict, Generator, List, NamedTuple, Optional, Pattern, Set, Tuple,
Union, cast)
-fr... | diff --git a/tests/roots/test-linkcheck/links.txt b/tests/roots/test-linkcheck/links.txt
--- a/tests/roots/test-linkcheck/links.txt
+++ b/tests/roots/test-linkcheck/links.txt
@@ -13,6 +13,8 @@ Some additional anchors to exercise ignore code
* `Complete nonsense <https://localhost:7777/doesnotexist>`_
* `Example valid... | ["tests/test_build_linkcheck.py::test_defaults_json"] | ["tests/test_build_linkcheck.py::test_raises_for_invalid_status", "tests/test_build_linkcheck.py::test_auth_header_uses_first_match", "tests/test_build_linkcheck.py::test_auth_header_no_match", "tests/test_build_linkcheck.py::test_linkcheck_request_headers", "tests/test_build_linkcheck.py::test_linkcheck_request_header... | null | true | 2021-05-22T05:14:16Z | 1 | 28 | 1 | 2,118 | 0 | 0.8 | 1 | 0.7 | 1 | 0.446333 | 85.989 | |
3,267 | swe_bench::test::1353 | swe_bench | test | 1,353 | pylint-dev__pylint-6556 | pylint-dev/pylint | pylint-dev/pylint | python | fa183c7d15b5f3c7dd8dee86fc74caae42c3926c | Can't disable bad-option-value
### Steps to reproduce
1. Write code on a computer with a somewhat new pylint (2.4.3 in my example). Get a warning like `useless-object-inheritance` that I want to ignore, as I'm writing code compatible with python2 and python3.
2. Disable said warning with `# pylint: disable=useless-obje... | Thanks for the report, this is definitely something we should be able to fix.
Hi. It seems to work when it's on the same line but not globally (which could be useful but I didn't found anything on the documentation). So I have to do:
`# pylint: disable=bad-option-value,useless-object-inheritance`
If I later want to u... | diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py
--- a/pylint/lint/pylinter.py
+++ b/pylint/lint/pylinter.py
@@ -937,8 +937,6 @@ def _check_astroid_module(
self.process_tokens(tokens)
if self._ignore_file:
return False
- # walk ast to collect line numb... | diff --git a/tests/functional/b/bad_option_value_disable.py b/tests/functional/b/bad_option_value_disable.py
new file mode 100644
--- /dev/null
+++ b/tests/functional/b/bad_option_value_disable.py
@@ -0,0 +1,14 @@
+"""Tests for the disabling of bad-option-value."""
+# pylint: disable=invalid-name
+
+# pylint: disable=b... | ["tests/lint/unittest_lint.py::test_enable_message_block", "tests/test_deprecation.py::test_collectblocklines"] | ["tests/lint/unittest_lint.py::test_no_args", "tests/lint/unittest_lint.py::test_one_arg[case0]", "tests/lint/unittest_lint.py::test_one_arg[case1]", "tests/lint/unittest_lint.py::test_one_arg[case2]", "tests/lint/unittest_lint.py::test_one_arg[case3]", "tests/lint/unittest_lint.py::test_one_arg[case4]", "tests/lint/un... | null | true | 2022-05-09T07:24:39Z | 2 | 84 | 2 | 963 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4405 | 85.9715 | |
3,268 | swe_bench::test::1963 | swe_bench | test | 1,963 | sympy__sympy-13259 | sympy/sympy | sympy/sympy | python | 8850d4eb343002601ba3c8fb37cb20dcf4a551cb | simplify: wrong simplification with trigonometric functions with complex arguments
sympy version is 1.0
```
>>> from sympy import *
>>> a = 2*sqrt(2)*I*cos(pi/6 - `I*asinh(5*sqrt(2)/2)/3)/3`
>>> a
2*sqrt(2)*I*cos(pi/6 - I*asinh(5*sqrt(2)/2)/3)/3
>>> a.evalf()
-0.333333333333333 + 1.0*I
>>> b = a.simplify()
>>> b
2*sqr... | Can I work on this issue?
Go for it.
This seems to be problem in hyper_as_trig(osborne) in fu.
The implemented osborne's rule isn't valid for simplification like TR10i. | 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
@@ -1,6 +1,7 @@
from __future__ import print_function, division
from sympy.core import S, sympify, cacheit
+from sympy.core.a... | 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
@@ -1,10 +1,10 @@
from sympy import (
- Add, Mul, S, Symbol, cos, cot, pi, I, sin, sqrt, tan, root,
- powsimp, symbols, sinh, cosh, tanh, coth, Dummy)
+ Ad... | ["test_hyper_as_trig", "test_hyperbolic_simp"] | ["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_TR12", "test_TR13", "test_L", "test_fu", "test_objective", "test_process_common_addends", "test_trig_split", "test_TRmorrie", "test_TR12i", "test_TR14... | null | true | 2017-09-05T04:53:51Z | 3 | 89 | 2 | 825 | 0 | 0.8 | 1 | 0.7 | 1 | 0.434167 | 85.9525 | |
3,269 | swe_bench::test::971 | swe_bench | test | 971 | matplotlib__matplotlib-20805 | matplotlib/matplotlib | matplotlib/matplotlib | python | 9a7329c8c111ae8d499a9d3b6db90cc3ca979526 | [Bug]: spines and ticklabels
### Bug summary
Hello everyone, I am not sure if this is a bug or just how the spines function (https://matplotlib.org/stable/api/spines_api.html) is supposed to work. Basically, if I set the spines command "after" the tick_params specs, the "labelrotation" commands is not followed but ev... | Its hard to tell from the above what the bug is. If I simplify, and do:
```python
import matplotlib.pyplot as plt
import matplotlib.ticker
import numpy as np
X = np.arange(100)
Y = X**2+3
fig1, (ax1, ax2) = plt.subplots(1, 2, constrained_layout=True)
ax1.plot(X,Y)
ax1.set_xlabel("X",fontsize='small')
... | diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py
--- a/lib/matplotlib/axis.py
+++ b/lib/matplotlib/axis.py
@@ -167,10 +167,12 @@ def __init__(self, axes, loc, *,
GRIDLINE_INTERPOLATION_STEPS
self.label1 = mtext.Text(
np.nan, np.nan,
- fontsize=labelsize, color=l... | 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
@@ -4779,6 +4779,26 @@ def test_reset_grid():
assert ax.xaxis.majorTicks[0].gridline.get_visible()
+@check_figures_equal(extensions=['png'])
+de... | ["lib/matplotlib/tests/test_axes.py::test_reset_ticks[png]"] | ["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[... | null | true | 2021-08-07T05:07:07Z | 1 | 6 | 1 | 2,470 | 0 | 0.8 | 1 | 0.7 | 1 | 0.431667 | 85.945 | |
3,270 | swe_bench::test::1188 | swe_bench | test | 1,188 | psf__requests-2617 | psf/requests | psf/requests | python | 636b946af5eac8ba4cffa63a727523cd8c2c01ab | Prepared requests containing binary files will not send when unicode_literals is imported
``` python
#!/usr/bin/env python
from __future__ import unicode_literals
import requests
import sys
def main():
request = requests.Request(method='PUT', url='https://httpbin.org/put')
with open(sys.argv[1], 'rb') as fp:
... | Unfortunately this is a bit of a limitation imposed on us by httplib. As you can see, the place where unicode and bytes are concatenated together is actually deep inside httplib. I'm afraid you'll have to pass bytestrings to requests.
Can you explain why it works fine when the request isn't prepared? That seems incons... | diff --git a/requests/models.py b/requests/models.py
--- a/requests/models.py
+++ b/requests/models.py
@@ -328,8 +328,9 @@ def copy(self):
def prepare_method(self, method):
"""Prepares the given HTTP method."""
self.method = method
- if self.method is not None:
- self.method = s... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -89,7 +89,7 @@ def test_invalid_url(self):
requests.get('http://')
def test_basic_building(self):
- req = requests.Request()
+ req = requests.Request(method='GET')
req.url = 'http... | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_GET_WITH_PARAMS", "test_requests.py::RequestsTestCase::test_POSTBIN_GET_POST_FILES_WITH_DATA", "test_requests.py::R... | ["test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_DIGEST_HTTP_200_OK_GET", "test_requests.py::RequestsTestC... | null | true | 2015-05-28T17:09:51Z | 2 | 8 | 8 | 2,413 | 0 | 0.8 | 1 | 0.7 | 1 | 0.428833 | 85.9365 | |
3,271 | swe_bench::test::1577 | swe_bench | test | 1,577 | scikit-learn__scikit-learn-13087 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | a73260db9c0b63d582ef4a7f3c696b68058c1c43 | Feature request: support for arbitrary bin spacing in calibration.calibration_curve
#### Description
I was using [`sklearn.calibration.calibration_curve`](https://scikit-learn.org/stable/modules/generated/sklearn.calibration.calibration_curve.html), and it currently accepts an `n_bins` parameter to specify the number o... | It actually sounds like the problem is not the number of bins, but that
bins should be constructed to reflect the distribution, rather than the
range, of the input. I think we should still use n_bins as the primary
parameter, but allow those bins to be quantile based, providing a strategy
option for discretisation (
ht... | diff --git a/sklearn/calibration.py b/sklearn/calibration.py
--- a/sklearn/calibration.py
+++ b/sklearn/calibration.py
@@ -519,7 +519,8 @@ def predict(self, T):
return expit(-(self.a_ * T + self.b_))
-def calibration_curve(y_true, y_prob, normalize=False, n_bins=5):
+def calibration_curve(y_true, y_prob, n... | diff --git a/sklearn/tests/test_calibration.py b/sklearn/tests/test_calibration.py
--- a/sklearn/tests/test_calibration.py
+++ b/sklearn/tests/test_calibration.py
@@ -259,6 +259,21 @@ def test_calibration_curve():
assert_raises(ValueError, calibration_curve, [1.1], [-0.1],
normalize=False)
+ ... | ["sklearn/tests/test_calibration.py::test_calibration_curve"] | ["sklearn/tests/test_calibration.py::test_calibration", "sklearn/tests/test_calibration.py::test_sample_weight", "sklearn/tests/test_calibration.py::test_calibration_multiclass", "sklearn/tests/test_calibration.py::test_calibration_prefit", "sklearn/tests/test_calibration.py::test_sigmoid_calibration", "sklearn/tests/t... | null | true | 2019-02-04T08:08:07Z | 1 | 22 | 1 | 2,123 | 0 | 0.8 | 1 | 0.7 | 1 | 0.427167 | 85.9315 | |
3,272 | swe_bench::test::2095 | swe_bench | test | 2,095 | sympy__sympy-16637 | sympy/sympy | sympy/sympy | python | df58361055cbd92b03cef14dba41ac6f0a004fd7 | Intersection between Plane and Segment3D returns points outside of the segment
It seems to me that, as far as ``Plane.intersection`` is concerned, ``Segment3D`` is treated as if it wasn't delimited on both ends (i.e., as if it was a ``Line3D``), and so additional intersections that aren't actually within the segment ar... | I would like to work on this issue if it is not solved yet or anyone else is not working on this.
| diff --git a/sympy/geometry/plane.py b/sympy/geometry/plane.py
--- a/sympy/geometry/plane.py
+++ b/sympy/geometry/plane.py
@@ -282,27 +282,22 @@ def distance(self, o):
if self.intersection(o) != []:
return S.Zero
- if isinstance(o, Point3D):
- x, y, z = map(Dummy, 'xyz')
- ... | diff --git a/sympy/geometry/tests/test_plane.py b/sympy/geometry/tests/test_plane.py
--- a/sympy/geometry/tests/test_plane.py
+++ b/sympy/geometry/tests/test_plane.py
@@ -90,8 +90,18 @@ def test_plane():
assert pl6.distance(pl6.p1) == 0
assert pl7.distance(pl6) == 0
assert pl7.distance(l1) == 0
- asse... | ["test_plane"] | ["test_dimension_normalization"] | null | true | 2019-04-13T09:41:07Z | 1 | 44 | 1 | 1,682 | 0 | 0.8 | 1 | 0.7 | 1 | 0.427 | 85.931 | |
3,273 | swe_bench::test::2185 | swe_bench | test | 2,185 | sympy__sympy-19091 | sympy/sympy | sympy/sympy | python | 64d28fe0534f6993695d11244ea740f783958dc8 | Tensor contractions are wrong
This is essentially a generalization of #17328.
The problem in the current implementation is that contractions are handled before applications of the metric, which leads to incorrect results such as in #17328.
In `tensor/tensor.py`:
```python
class Tensor(TensExpr):
# ...
def _extrac... | Hi! This is @drybalka.
I totally agree, due to the module design it is impossible to solve this problem without overhaul. Tensor indices contraction is placed inside TensorMul class (for some reason twice, if I’m not mistaken) even though you can have contractions in a single tensor. This code is intertwined with tens... | diff --git a/sympy/tensor/tensor.py b/sympy/tensor/tensor.py
--- a/sympy/tensor/tensor.py
+++ b/sympy/tensor/tensor.py
@@ -2084,9 +2084,19 @@ def recursor(expr, pos):
return recursor(self, ())
@staticmethod
- def _match_indices_with_other_tensor(array, free_ind1, free_ind2, replacement_dict):
+ de... | diff --git a/sympy/tensor/tests/test_tensor.py b/sympy/tensor/tests/test_tensor.py
--- a/sympy/tensor/tests/test_tensor.py
+++ b/sympy/tensor/tests/test_tensor.py
@@ -1910,6 +1910,13 @@ def test_tensor_replacement():
repl = {H(i, -i): 42}
assert expr._extract_data(repl) == ([], 42)
+ expr = H(i, -i)
+ ... | ["test_tensor_replacement"] | ["test_canonicalize_no_slot_sym", "test_canonicalize_no_dummies", "test_tensorhead_construction_without_symmetry", "test_no_metric_symmetry", "test_canonicalize1", "test_bug_correction_tensor_indices", "test_riemann_invariants", "test_riemann_products", "test_canonicalize2", "test_canonicalize3", "test_TensorIndexType"... | null | true | 2020-04-08T07:43:30Z | 1 | 30 | 1 | 1,961 | 0 | 0.8 | 1 | 0.7 | 1 | 0.426833 | 85.9305 | |
3,274 | swe_bench::test::2057 | swe_bench | test | 2,057 | sympy__sympy-15555 | sympy/sympy | sympy/sympy | python | 29034f1104c9ce5500a1ae8fa23e3608464a362d | primepi doesn't work with symbolic arguments
```
While trying to demonstrate the prime number theorem, I came across the following bug-
In [57]: limit(primepi(x), x, 100)
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | ```
This if course has nothing to do with the limit function, but is just because primepi doesn't work with symbolic arguments. It should be rewritten to derive from Function.
**Summary:** primepi doesn't work with symbolic arguments
```
Original comment: http://code.google.com/p/sympy/issues/detail?id=2735#c1
Or... | diff --git a/sympy/ntheory/generate.py b/sympy/ntheory/generate.py
--- a/sympy/ntheory/generate.py
+++ b/sympy/ntheory/generate.py
@@ -12,6 +12,7 @@
from .primetest import isprime
from sympy.core.compatibility import as_int, range
+from sympy import Function, S
def _azeros(n):
@@ -375,8 +376,8 @@ def prime(nth... | 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
@@ -4223,6 +4223,13 @@ def test_sympy__ntheory__residue_ntheory__mobius():
assert _test_args(mobius(2))
+def test_sympy__ntheory__generate__primepi():
+ from sym... | ["test_sympy__ntheory__generate__primepi", "test_primepi"] | ["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 | 2018-11-28T05:06:46Z | 1 | 82 | 2 | 865 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4175 | 85.9025 | |
3,275 | swe_bench::test::2079 | swe_bench | test | 2,079 | sympy__sympy-16106 | sympy/sympy | sympy/sympy | python | 0e987498b00167fdd4a08a41c852a97cb70ce8f2 | mathml printer for IndexedBase required
Writing an `Indexed` object to MathML fails with a `TypeError` exception: `TypeError: 'Indexed' object is not iterable`:
```
In [340]: sympy.__version__
Out[340]: '1.0.1.dev'
In [341]: from sympy.abc import (a, b)
In [342]: sympy.printing.mathml(sympy.IndexedBase(a)[b])
------... | Now it returns
```
'<indexed><indexedbase><ci>a</ci></indexedbase><ci>b</ci></indexed>'
```
for content printer and
```
'<mrow><mi>indexed</mi><mfenced><mrow><mi>indexedbase</mi><mfenced><mi>a</mi></mfenced></mrow><mi>b</mi></mfenced></mrow>'
```
for presentation printer.
Probably not correct as it seems li... | diff --git a/sympy/printing/mathml.py b/sympy/printing/mathml.py
--- a/sympy/printing/mathml.py
+++ b/sympy/printing/mathml.py
@@ -1271,6 +1271,26 @@ def _print_Lambda(self, e):
return x
+ def _print_tuple(self, e):
+ x = self.dom.createElement('mfenced')
+ for i in e:
+ x.appen... | 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
@@ -1,7 +1,7 @@
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \
tan, asin, acos, atan, sinh, cosh, tanh, asinh,... | ["test_print_IndexedBase"] | ["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-02-28T17:21:46Z | 1 | 20 | 1 | 2,093 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4155 | 85.8965 | |
3,276 | swe_bench::test::1855 | swe_bench | test | 1,855 | sphinx-doc__sphinx-8771 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 647510e184f3bb8c14d82911b6a0e1d9f8a2b15b | Keeping original signatures for functions/methods
I'm using Sphinx's autodoc feature to document my API.
Example:
```
#!python
DEFAULT_OPTION = 'default'
def do_something(msg, option=DEFAULT_OPTION):
print msg
```
The generated documentation now shows the following signature:
```
do_something(msg, option='defa... | +1
@shimizukawa,@martinpengellyphillips you may try my fork with this feature.
Install [sphinx](https://github.com/hypnocat/sphinx), and add to conf.py
autodoc_dumb_docstring = True
then rebuild docs. Feel free to msg me.
Another alternative that would be nice and might work easily is to allow the user to specify the... | 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
@@ -2634,6 +2634,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.connect('config-inited', migrate_autodoc_member_order, priority=800)
+ app.setup_extensio... | diff --git a/tests/roots/test-ext-autodoc/target/preserve_defaults.py b/tests/roots/test-ext-autodoc/target/preserve_defaults.py
new file mode 100644
--- /dev/null
+++ b/tests/roots/test-ext-autodoc/target/preserve_defaults.py
@@ -0,0 +1,19 @@
+from datetime import datetime
+from typing import Any
+
+CONSTANT = 'foo'
+... | ["tests/test_ext_autodoc_preserve_defaults.py::test_preserve_defaults"] | [] | null | true | 2021-01-27T17:09:38Z | 2 | 89 | 1 | 712 | 0 | 0.8 | 1 | 0.7 | 1 | 0.415333 | 85.896 | |
3,277 | swe_bench::test::1243 | swe_bench | test | 1,243 | pydata__xarray-4493 | pydata/xarray | pydata/xarray | python | a5f53e203c52a7605d5db799864046471115d04f | DataSet.update causes chunked dask DataArray to evalute its values eagerly
**What happened**:
Used `DataSet.update` to update a chunked dask DataArray, but the DataArray is no longer chunked after the update.
**What you expected to happen**:
The chunked DataArray should still be chunked after the update
**Minimal Com... | that's because `xarray.core.variable.as_compatible_data` doesn't consider `DataArray` objects: https://github.com/pydata/xarray/blob/333e8dba55f0165ccadf18f2aaaee9257a4d716b/xarray/core/variable.py#L202-L203 and thus falls back to `DataArray.values`: https://github.com/pydata/xarray/blob/333e8dba55f0165ccadf18f2aaaee92... | diff --git a/xarray/core/variable.py b/xarray/core/variable.py
--- a/xarray/core/variable.py
+++ b/xarray/core/variable.py
@@ -120,6 +120,16 @@ def as_variable(obj, name=None) -> "Union[Variable, IndexVariable]":
if isinstance(obj, Variable):
obj = obj.copy(deep=False)
elif isinstance(obj, tuple):
+ ... | diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py
--- a/xarray/tests/test_dask.py
+++ b/xarray/tests/test_dask.py
@@ -1233,7 +1233,7 @@ def test_map_blocks_to_array(map_ds):
lambda x: x.drop_vars("x"),
lambda x: x.expand_dims(k=[1, 2, 3]),
lambda x: x.expand_dims(k=3),
- ... | ["xarray/tests/test_variable.py::TestVariable::test_as_variable"] | ["xarray/tests/test_dask.py::test_raise_if_dask_computes", "xarray/tests/test_dask.py::TestVariable::test_basics", "xarray/tests/test_dask.py::TestVariable::test_copy", "xarray/tests/test_dask.py::TestVariable::test_chunk", "xarray/tests/test_dask.py::TestVariable::test_indexing", "xarray/tests/test_dask.py::TestVariab... | null | true | 2020-10-06T22:00:41Z | 1 | 10 | 1 | 2,278 | 0 | 0.8 | 1 | 0.7 | 1 | 0.413 | 85.889 | |
3,278 | swe_bench::test::2276 | swe_bench | test | 2,276 | sympy__sympy-23808 | sympy/sympy | sympy/sympy | python | 68bd36271334d7bf0ede9beea4bef494bceaacab | `sympy.solvers.diophantine.diophantine.sum_of_squares` recursion overflow even for for small `n`
As title, I am trying to run `sympy.solvers.diophantine.diophantine.sum_of_squares` for `n = 588693170` and `k = 2`, but it throws a `RecursionError`:
```python
>>> from sympy.solvers.diophantine.diophantine import sum_of_... | Nevermind, I should've looked closer at the problem...
The problem is that the function `sum_of_squares` calls `power_representation`, which then calls `pow_rep_recursive`, which is a simple recursive bruteforce algorithm. This can be fixed by generating the representations using the factorisation of `n` instead of br... | diff --git a/sympy/solvers/diophantine/diophantine.py b/sympy/solvers/diophantine/diophantine.py
--- a/sympy/solvers/diophantine/diophantine.py
+++ b/sympy/solvers/diophantine/diophantine.py
@@ -3891,15 +3891,34 @@ def power_representation(n, p, k, zeros=False):
def pow_rep_recursive(n_i, k, n_remaining, terms, p)... | diff --git a/sympy/solvers/diophantine/tests/test_diophantine.py b/sympy/solvers/diophantine/tests/test_diophantine.py
--- a/sympy/solvers/diophantine/tests/test_diophantine.py
+++ b/sympy/solvers/diophantine/tests/test_diophantine.py
@@ -623,6 +623,17 @@ def test_diop_general_sum_of_squares_quick():
raises(NotImp... | ["test_issue_23807"] | ["test_input_format", "test_nosols", "test_univariate", "test_classify_diop", "test_linear", "test_quadratic_simple_hyperbolic_case", "test_quadratic_elliptical_case", "test_quadratic_parabolic_case", "test_quadratic_perfect_square", "test_quadratic_non_perfect_square", "test_issue_9106", "test_issue_18138", "test_DN",... | null | true | 2022-07-20T19:16:43Z | 1 | 27 | 1 | 1,847 | 0 | 0.8 | 1 | 0.7 | 1 | 0.397833 | 85.8435 | |
3,279 | swe_bench::test::1044 | swe_bench | test | 1,044 | matplotlib__matplotlib-24431 | matplotlib/matplotlib | matplotlib/matplotlib | python | 90617dd125a59cc5fc4dfb3f73c9fc361c37b055 | eventplot: allow a list of alpha channels as in the case with colors
I'm not sure if it's a bug or a feature. It's both.
```python
>>> plt.eventplot([[0, 1, 2], [0.5, 2.3]], color=['r', 'g'])
```
works while
```python
>>> plt.eventplot([[0, 1, 2], [0.5, 2.3]], alpha=[0.5, 0.2])
```
throws an error
```
Traceback (most ... | You can pass colors as rgba values, so like
```python
from matplotlib.colors import to_rgba
plt.eventplot([[0, 1, 2], [0.5, 2.3]], color=[to_rgba('r', .5), to_rgba('g', .2)])
```
should do it
But I don't want to specify the colors.
-_-
This is solved ?
Running:
```python
plt.eventplot([[0, 1, 2], [0.5, 2... | 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
@@ -1184,7 +1184,7 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
"colors", "linestyles"])
@_docstring.dedent_int... | 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
@@ -4559,6 +4559,26 @@ def test_eventplot_colors(colors):
assert_allclose(coll.get_color(), color)
+def test_eventplot_alpha():
+ fig, ax = p... | ["lib/matplotlib/tests/test_axes.py::test_eventplot_alpha"] | ["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 | 2022-11-11T23:58:56Z | 2 | 33 | 1 | 1,717 | 0 | 0.8 | 1 | 0.7 | 1 | 0.396167 | 85.8385 | |
3,280 | swe_bench::dev::169 | swe_bench | dev | 169 | pyvista__pyvista-4406 | pyvista/pyvista | pyvista/pyvista | python | 461bb5ed5be8c9dda6e9ed765fab3224149d9c62 | to_tetrahedra active scalars
### Describe the bug, what's wrong, and what you expected.
#4311 passes cell data through the `to_tetrahedra` call. However, after these changes. The active scalars information is lost.
cc @akaszynski who implemented these changes in that PR.
### Steps to reproduce the bug.
```py
impor... | First, these lines should reset the active_scalars to the last scalars added to the tetrahedral mesh:
https://github.com/pyvista/pyvista/blob/a87cf37d9cea6fc68d8099a56d86ded8f6e78734/pyvista/core/filters/rectilinear_grid.py#L119-L123
These subsequent lines pop out the active scalars, which is somehow the blank sc... | diff --git a/pyvista/core/filters/rectilinear_grid.py b/pyvista/core/filters/rectilinear_grid.py
--- a/pyvista/core/filters/rectilinear_grid.py
+++ b/pyvista/core/filters/rectilinear_grid.py
@@ -2,24 +2,29 @@
import collections
from typing import Sequence, Union
+import warnings
import numpy as np
from pyvist... | diff --git a/tests/filters/test_rectilinear_grid.py b/tests/filters/test_rectilinear_grid.py
--- a/tests/filters/test_rectilinear_grid.py
+++ b/tests/filters/test_rectilinear_grid.py
@@ -2,6 +2,7 @@
import pytest
import pyvista as pv
+from pyvista.utilities.misc import PyVistaDeprecationWarning
@pytest.fixture... | ["tests/filters/test_rectilinear_grid.py::test_to_tetrahedral_pass_cell_ids", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral_pass_cell_data"] | ["tests/filters/test_rectilinear_grid.py::test_to_tetrahedral[5]", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral[6]", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral[12]", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral_raise", "tests/filters/test_rectilinear_grid.py::test_to_te... | null | true | 2023-05-10T18:54:53Z | 1 | 36 | 2 | 1,565 | 0 | 0.8 | 1 | 0.7 | 1 | 0.380833 | 85.7925 | |
3,281 | swe_bench::test::1696 | swe_bench | test | 1,696 | scikit-learn__scikit-learn-25733 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | eae3f294d3ba8ae636730537faef4cdd612083ff | FutureWarning is not issued for deprecated class
FutureWarning is not issued when using `BaseNB` as a baseclass but its `__init__()` is not called in the subclass, here: https://github.com/astroML/astroML/blob/master/astroML/classification/gmm_bayes.py#L15
```
In [1]: from astroML.classification import GMMBayes
In [2... |
@NicolasHug - this has fallen through the cracks. I'll try to come back and wrap it up over the weekend.
Did you still want to work on this?
yes, can come back to it after the sprint/once the current PR is opened. | diff --git a/sklearn/utils/deprecation.py b/sklearn/utils/deprecation.py
--- a/sklearn/utils/deprecation.py
+++ b/sklearn/utils/deprecation.py
@@ -60,17 +60,18 @@ def _decorate_class(self, cls):
if self.extra:
msg += "; %s" % self.extra
- # FIXME: we should probably reset __new__ for full... | diff --git a/sklearn/tests/test_docstring_parameters.py b/sklearn/tests/test_docstring_parameters.py
--- a/sklearn/tests/test_docstring_parameters.py
+++ b/sklearn/tests/test_docstring_parameters.py
@@ -109,12 +109,11 @@ def test_docstring_parameters():
"Error for __init__ of %s in %s:\n%s" % (cls,... | ["sklearn/utils/tests/test_deprecation.py::test_deprecated", "sklearn/utils/tests/test_deprecation.py::test_is_deprecated"] | ["sklearn/utils/tests/test_deprecation.py::test_pickle"] | null | true | 2023-03-01T10:45:25Z | 1 | 15 | 2 | 1,967 | 0 | 0.8 | 1 | 0.7 | 1 | 0.377833 | 85.7835 | |
3,282 | swe_bench::dev::162 | swe_bench | dev | 162 | pyvista__pyvista-3750 | pyvista/pyvista | pyvista/pyvista | python | 3db44d72070ccd6e8fc5c7f708500424011bcc47 | Unexpected threshold behavior
### Describe the bug, what's wrong, and what you expected.
I'm using simple structed grids of cells, and need to filter-out some "nodata" cells. To do this, I'm setting scalar values to the cell data, then using [threshold](https://docs.pyvista.org/api/core/_autosummary/pyvista.DataSetFil... | Can confirm, and I am seeing quite a few inconsistent results with the threshold filter. So this is not a user error!
For example `inverter=True/False` should produce two logical inverses for this mesh, but it doesn't:
<img width="624" alt="Screen Shot 2022-11-16 at 11 18 48 PM" src="https://user-images.githubuser... | diff --git a/pyvista/core/filters/data_set.py b/pyvista/core/filters/data_set.py
--- a/pyvista/core/filters/data_set.py
+++ b/pyvista/core/filters/data_set.py
@@ -937,9 +937,10 @@ def threshold(
continuous=False,
preference='cell',
all_scalars=False,
- progress_bar=False,
- comp... | diff --git a/tests/plotting/test_widgets.py b/tests/plotting/test_widgets.py
--- a/tests/plotting/test_widgets.py
+++ b/tests/plotting/test_widgets.py
@@ -150,10 +150,12 @@ def test_widget_slider(uniform):
p.add_slider_widget(callback=func, rng=[0, 10], style="modern", pass_widget=True)
p.close()
- p = p... | ["tests/test_filters.py::test_threshold", "tests/test_filters.py::test_threshold_paraview_consistency"] | ["tests/test_filters.py::test_datasetfilters_init", "tests/test_filters.py::test_clip_filter", "tests/test_filters.py::test_clip_by_scalars_filter[False-False]", "tests/test_filters.py::test_clip_by_scalars_filter[False-True]", "tests/test_filters.py::test_clip_by_scalars_filter[True-False]", "tests/test_filters.py::te... | null | true | 2022-12-25T02:44:32Z | 2 | 242 | 2 | 2,585 | 0 | 0.8 | 1 | 0.85 | 0.75 | 0.930833 | 85.78 | |
3,283 | swe_bench::test::1569 | swe_bench | test | 1,569 | scikit-learn__scikit-learn-12961 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | d300f406aeeac439b4212558f208ce5a9613a1d5 | model_selection._search._format_results ValueError not enough values to unpack (expected 5, got 0)
I'm using `lightgbm 2.2.2` with `RandomizedSearchCV` in sklearn v 0.20.1. MacOS Mojave.
```
raceback (most recent call last):
File "gbm.py", line 1339, in <module>
scoring=score_methods, refit='nll')
File "gbm.py... | Thanks for reporting the issue. Could you please also include a [minimal and reproducible example](http://sscce.org/) for us to better diagnose the problem?
Hi - yes I'll try to find one, unfortunately the dataset I'm working on has some licensing restrictions, so will need to reproduce it with something else.
I figur... | diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py
--- a/sklearn/model_selection/_search.py
+++ b/sklearn/model_selection/_search.py
@@ -668,6 +668,17 @@ def evaluate_candidates(candidate_params):
in product(candidate_params,
... | 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
@@ -1725,3 +1725,47 @@ def test_deprecated_grid_search_iid():
grid = GridSearchCV(SVC(gamma='scale'), param_... | ["sklearn/model_selection/tests/test_search.py::test_empty_cv_iterator_error", "sklearn/model_selection/tests/test_search.py::test_random_search_bad_cv"] | ["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-01-12T01:12:23Z | 1 | 11 | 2 | 2,031 | 0 | 0.8 | 1 | 0.7 | 1 | 0.375167 | 85.7755 | |
3,284 | swe_bench::test::2025 | swe_bench | test | 2,025 | sympy__sympy-14396 | sympy/sympy | sympy/sympy | python | f35ad6411f86a15dd78db39c29d1e5291f66f9b5 | Poly(domain='RR[y,z]') doesn't work
``` py
In [14]: Poly(1.2*x*y*z, x)
Out[14]: Poly(1.2*y*z*x, x, domain='RR[y,z]')
In [15]: Poly(1.2*x*y*z, x, domain='RR[y,z]')
---------------------------------------------------------------------------
OptionError Traceback (most recent call last)
<ipy... | ```
In [14]: Poly(1.2*x*y*z, x)
Out[14]: Poly(1.2*y*z*x, x, domain='RR[y,z]')
```
I guess this is quite good
I mean why would we wanna do this
`In [15]: Poly(1.2*x*y*z, x, domain='RR[y,z]')`
BTW, Is this issue still on?
It is still a valid issue. The preprocessing of options should be extended to accept poly... | diff --git a/sympy/polys/polyoptions.py b/sympy/polys/polyoptions.py
--- a/sympy/polys/polyoptions.py
+++ b/sympy/polys/polyoptions.py
@@ -405,7 +405,7 @@ class Domain(with_metaclass(OptionType, Option)):
_re_realfield = re.compile(r"^(R|RR)(_(\d+))?$")
_re_complexfield = re.compile(r"^(C|CC)(_(\d+))?$")
... | diff --git a/sympy/polys/tests/test_polyoptions.py b/sympy/polys/tests/test_polyoptions.py
--- a/sympy/polys/tests/test_polyoptions.py
+++ b/sympy/polys/tests/test_polyoptions.py
@@ -6,7 +6,7 @@
Frac, Formal, Polys, Include, All, Gen, Symbols, Method)
from sympy.polys.orderings import lex
-from sympy.polys.doma... | ["test_Domain_preprocess"] | ["test_Options_clone", "test_Expand_preprocess", "test_Expand_postprocess", "test_Gens_preprocess", "test_Gens_postprocess", "test_Wrt_preprocess", "test_Wrt_postprocess", "test_Sort_preprocess", "test_Sort_postprocess", "test_Order_preprocess", "test_Order_postprocess", "test_Field_preprocess", "test_Field_postprocess... | null | true | 2018-03-05T19:18:01Z | 1 | 8 | 1 | 2,064 | 0 | 0.8 | 1 | 0.7 | 1 | 0.370667 | 85.762 | |
3,285 | swe_bench::test::975 | swe_bench | test | 975 | matplotlib__matplotlib-21042 | matplotlib/matplotlib | matplotlib/matplotlib | python | 8a8dd9093d381500555bccf46fc5d46b42d132ec | MatplotlibDeprecationWarning when updating rcparams
### Bug report
**Bug summary**
Updating RC params in code produces a deprecation warning. In order to control rcParams for an internal library I am reading in parameters and popping some that I don't want used. I am using a variation on the code below. I think I h... | Those were all removed in 3.4.2, and indeed are not loaded. I expect you have a crossed install somehow, and maybe an old matplotlibrc kicking around.
I thought that too at first, but I don't believe that is the case here.
After more digging, it seems to be related to line 846 of [\_\_init\_\_.py'](https://gith... | diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -699,7 +699,10 @@ def find_all(self, pattern):
if pattern_re.search(key))
def copy(self):
- return {k: dict.__getitem__(self, k) for k in self}... | diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py
--- a/lib/matplotlib/tests/test_rcparams.py
+++ b/lib/matplotlib/tests/test_rcparams.py
@@ -546,3 +546,8 @@ def test_deprecation(monkeypatch):
mpl.rcParams["svg.hashsalt"] = "foobar"
assert mpl.rcParams["svg.hashsal... | ["lib/matplotlib/tests/test_rcparams.py::test_deprecation"] | ["lib/matplotlib/tests/test_rcparams.py::test_rcparams", "lib/matplotlib/tests/test_rcparams.py::test_RcParams_class", "lib/matplotlib/tests/test_rcparams.py::test_Bug_2543", "lib/matplotlib/tests/test_rcparams.py::test_legend_colors[same", "lib/matplotlib/tests/test_rcparams.py::test_legend_colors[inherited", "lib/mat... | null | true | 2021-09-11T13:02:29Z | 1 | 7 | 1 | 2,076 | 0 | 0.8 | 1 | 0.7 | 1 | 0.369333 | 85.758 | |
3,286 | swe_bench::test::1844 | swe_bench | test | 1,844 | sphinx-doc__sphinx-8658 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 40f2c832ff3ce2d908b0d8bace3e1f6698eed712 | Napoleon: more custom docstring section styles
Although the `napoleon_custom_sections` option help renders custom docstring section, the style is inconsistent with the rest of the doc.
For example, I have a custom docstring section `Side Effect`. I would like it to be displayed as `returns` or `parameters` docstring s... | Boy, I could really use this right away. If it were up to me:
* `napoleon_custom_sections` would be called `napoleon_custom_aliases`, and only accept a list of `(new alias, existing section)` tuples.
* A hypothetical new `napoleon_custom_sections` would only accept a list of `(new section, existing section)` or `(... | diff --git a/sphinx/ext/napoleon/__init__.py b/sphinx/ext/napoleon/__init__.py
--- a/sphinx/ext/napoleon/__init__.py
+++ b/sphinx/ext/napoleon/__init__.py
@@ -253,10 +253,15 @@ def __unicode__(self):
* To create a custom "generic" section, just pass a string.
* To create an alias for an existing 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
@@ -1072,10 +1072,27 @@ def test_custom_generic_sections(self):
Sooper Warning:
Stop hitting yourself!
""", """:Warns: **Stop hitting your... | ["tests/test_ext_napoleon_docstring.py::GoogleDocstringTest::test_custom_generic_sections"] | ["tests/test_ext_napoleon_docstring.py::NamedtupleSubclassTest::test_attributes_docstring", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member", "tests/test_ext_napoleon_docstring.py::InlineAttributeTest::test_class_data_member_inline", "tests/test_ext_napoleon_docstring.py::InlineAttrib... | null | true | 2021-01-05T21:26:21Z | 2 | 31 | 1 | 1,583 | 0 | 0.8 | 1 | 0.7 | 1 | 0.367167 | 85.7515 | |
3,287 | swe_bench::test::86 | swe_bench | test | 86 | astropy__astropy-8251 | astropy/astropy | astropy/astropy | python | 2002221360f4ad75f6b275bbffe4fa68412299b3 | FITS-standard unit parsing fails on some types of exponents
Why don't these work:
```python
from astropy.units import Unit
Unit('10**17 erg/(cm2 s Angstrom)', format='fits')
Unit('10^17 erg/(cm2 s Angstrom)', format='fits')
```
When these all do:
```python
from astropy.units import Unit
Unit('10+17 erg/(cm2 s Angstrom)... | Additional examples that *do* work:
```python
Unit('10**+17 erg/(cm2 s Angstrom)', format='fits')
Unit('10^+17 erg/(cm2 s Angstrom)', format='fits')
```
It seems that currently the sign is always required for the `**` and `^`, though it should not:
> The final units string is the compound string, or a compound o... | diff --git a/astropy/units/format/generic.py b/astropy/units/format/generic.py
--- a/astropy/units/format/generic.py
+++ b/astropy/units/format/generic.py
@@ -274,7 +274,9 @@ def p_factor_int(p):
def p_factor_fits(p):
'''
factor_fits : UINT power OPEN_PAREN signed_int CLOSE_PAREN
+ ... | diff --git a/astropy/units/tests/test_format.py b/astropy/units/tests/test_format.py
--- a/astropy/units/tests/test_format.py
+++ b/astropy/units/tests/test_format.py
@@ -434,40 +434,42 @@ def test_vounit_implicit_custom():
assert x.bases[0]._represents.bases[0].name == 'urlong'
-def test_fits_scale_factor():
... | ["astropy/units/tests/test_format.py::test_fits_scale_factor[10**2-100-10**2]", "astropy/units/tests/test_format.py::test_fits_scale_factor[10**(2)-100-10**2]", "astropy/units/tests/test_format.py::test_fits_scale_factor[10^2-100-10**2]", "astropy/units/tests/test_format.py::test_fits_scale_factor[10^(2)-100-10**2]"] | ["astropy/units/tests/test_format.py::test_unit_grammar[strings0-unit0]", "astropy/units/tests/test_format.py::test_unit_grammar[strings1-unit1]", "astropy/units/tests/test_format.py::test_unit_grammar[strings2-unit2]", "astropy/units/tests/test_format.py::test_unit_grammar[strings3-unit3]", "astropy/units/tests/test_f... | null | true | 2018-12-07T20:21:59Z | 2 | 70 | 4 | 791 | 0 | 0.8 | 1 | 0.7 | 1 | 0.365167 | 85.7455 | |
3,288 | swe_bench::test::1056 | swe_bench | test | 1,056 | matplotlib__matplotlib-24912 | matplotlib/matplotlib | matplotlib/matplotlib | python | 7bc69f27db70f87b59b0452216d7ae2b5babb329 | [ENH]: Allow override of contour level autoscaling
### Problem
In Matplotlib 3, when using a list of values for the `levels` argument in `contour()`, the list of values is overridden in the case that all requested levels fall outside the data range. While this may be desirable for casually browsing data when the user ... | I agree that at the very least this should be an option. I think the original 3.0 "feature" to provide a contour that wasn't asked for is of pretty dubious value
What ever we do to `contour` we need to do the same thing for `contourf`.
Looking at the code around https://github.com/matplotlib/matplotlib/blob/7c6a... | diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py
--- a/lib/matplotlib/contour.py
+++ b/lib/matplotlib/contour.py
@@ -1137,18 +1137,8 @@ def _process_contour_level_args(self, args, z_dtype):
self.levels = self._autolev(levels_arg)
else:
self.levels = np.asarray(levels... | 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
@@ -62,15 +62,16 @@ def test_contour_shape_error(args, message):
ax.contour(*args)
-def test_contour_empty_levels():
-
- x = np.a... | ["lib/matplotlib/tests/test_contour.py::test_contour_no_valid_levels"] | ["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-01-09T11:48:29Z | 1 | 10 | 1 | 1,982 | 0 | 0.8 | 1 | 0.7 | 1 | 0.363667 | 85.741 | |
3,289 | swe_bench::test::1089 | swe_bench | test | 1,089 | matplotlib__matplotlib-25631 | matplotlib/matplotlib | matplotlib/matplotlib | python | a1f9e0fc03b5c4ec7eadef9723ea48168d0e992f | [Bug]: `bbox_inches="tight"` does not work for writer.grab_frame()
### Bug summary
`bbox_inches="tight"` will make snowflake movie in the example.
The example runs fine after removing `bbox_inches="tight"`.
### Code for reproduction
```python
import matplotlib.pyplot as plt
from matplotlib.animation import FFMpeg... | Bbox_inches tight basically changes the size of the canvas every frame. I guess a todo might be to lock that option out, but the work around is to not do that.
Can we resize the size for first frame and then fix to that size?
I do not have FFMpeg installed to try, but
```
fig, ax = plt.subplots(layout='tight')
``... | diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py
--- a/lib/matplotlib/animation.py
+++ b/lib/matplotlib/animation.py
@@ -213,7 +213,13 @@ def grab_frame(self, **savefig_kwargs):
Grab the image information from the figure and save as a movie frame.
All keyword arguments in *save... | 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
@@ -62,6 +62,8 @@ def setup(self, fig, outfile, dpi, *args):
self._count = 0
def grab_frame(self, **savefig_kwargs):
+ ... | ["lib/matplotlib/tests/test_animation.py::test_null_movie_writer", "lib/matplotlib/tests/test_animation.py::test_save_animation_smoketest[anim0-null-None-movie.null]", "lib/matplotlib/tests/test_animation.py::test_save_animation_smoketest[anim0-null-None-output35]", "lib/matplotlib/tests/test_animation.py::test_grabfra... | ["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_save_animation_smoketest[anim0-ffmpeg-rgba-movie.mp4]", "lib/matplotlib/tests/test_animation.py::test_save_animation_smoketest[a... | null | true | 2023-04-05T20:43:18Z | 1 | 49 | 42 | 1,184 | 0 | 0.8 | 1 | 0.7 | 1 | 0.360667 | 85.732 | |
3,290 | swe_bench::test::948 | swe_bench | test | 948 | matplotlib__matplotlib-13959 | matplotlib/matplotlib | matplotlib/matplotlib | python | bbd10ba989748c1ff94fb3f3a24b366dfe6b5ad3 | Inconsistent shape handling of parameter c compared to x/y in scatter()
### Bug report
As described in https://github.com/matplotlib/matplotlib/pull/11663#pullrequestreview-171359644:
Something funny is going on here (I know it was already there before, but still seems worth pointing out): we take x and y of any sha... | (I think we should just reject (with deprecation, yada yada) any non-1D input (and yes, that includes (n, 1) and (1, n) input).)
The `ravel` that we do is a considerable convenience for common use cases such as working with gridded data for ocean or atmospheric fields.
I dunno - it all seems pretty inconsistent to me, ... | 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
@@ -4133,7 +4133,7 @@ def dopatch(xs, ys, **kwargs):
medians=medians, fliers=fliers, means=means)
@staticmethod
- def _parse_scatter_color_args(c,... | 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
@@ -1862,6 +1862,13 @@ def test_scatter_color(self):
with pytest.raises(ValueError):
plt.scatter([1, 2, 3], [1, 2, 3], color=[1, 2, 3])... | ["lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_size_arg_size", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_single_point[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_different_shapes[png]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_c[0.5-None]... | ["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matpl... | null | true | 2019-04-14T23:44:41Z | 1 | 49 | 52 | 1,159 | 0 | 0.8 | 1 | 0.7 | 1 | 0.3565 | 85.7195 | |
3,291 | swe_bench::test::946 | swe_bench | test | 946 | matplotlib__matplotlib-13908 | matplotlib/matplotlib | matplotlib/matplotlib | python | dd18211687623c5fa57658990277440814d422f0 | Minor ticklabels are missing at positions of major ticks.
### Bug report
**Bug summary**
Minor ticklabels are missing at positions of major ticks.
**Code for reproduction**
```
import numpy as np
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
t = np.arange("2018-11-03", "2018-11-06", dtype="dat... | There is no minor tick there anymore so there won’t be a label. What’s wrong w putting the HH:MM in the major label?
Actually, I don't think there is anything wrong with that. It's more that the previous code suddenly broke. Was this an intentional change?
Yes though I’m on my phone and can’t look up the PRs. Recent ... | diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py
--- a/lib/matplotlib/axis.py
+++ b/lib/matplotlib/axis.py
@@ -723,6 +723,8 @@ def __init__(self, axes, pickradius=15):
`.Axis.contains`.
"""
martist.Artist.__init__(self)
+ self._remove_overlapping_locs = True
+
... | diff --git a/lib/matplotlib/tests/test_ticker.py b/lib/matplotlib/tests/test_ticker.py
--- a/lib/matplotlib/tests/test_ticker.py
+++ b/lib/matplotlib/tests/test_ticker.py
@@ -923,3 +923,49 @@ def minorticksubplot(xminor, yminor, i):
minorticksubplot(True, False, 2)
minorticksubplot(False, True, 3)
minort... | ["lib/matplotlib/tests/test_ticker.py::test_remove_overlap[True-6]", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[None-6]", "lib/matplotlib/tests/test_ticker.py::test_remove_overlap[False-9]"] | ["lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[20-100-expected0]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[0.001-0.0001-expected1]", "lib/matplotlib/tests/test_ticker.py::TestMaxNLocator::test_basic[-1000000000000000.0-1000000000000000.0-expected2]", "lib/matplotlib/tests/t... | null | true | 2019-04-09T02:29:24Z | 1 | 40 | 3 | 1,329 | 0 | 0.8 | 1 | 0.7 | 1 | 0.354833 | 85.7145 | |
3,292 | swe_bench::dev::19 | swe_bench | dev | 19 | pvlib__pvlib-python-1140 | pvlib/pvlib-python | pvlib/pvlib-python | python | 6b92d218653633e366241c31e8836c0072739ece | Inconsistent default settings for _prep_inputs_solar_pos in prepare_inputs and prepare_inputs_from_poa
Hi there,
I find that `_prep_inputs_solar_pos` method has been both called in [`prepare_inputs`](https://pvlib-python.readthedocs.io/en/stable/_modules/pvlib/modelchain.html#ModelChain.prepare_inputs) and [`prepare_i... | > Meanwhile, does the temperature really matter? How much uncertainty will it cause in the calculation of the sun's position? Should we provide avg. local temperature data if for a global modelling purpose?
Taking [A simple ModelChain example](https://pvlib-python.readthedocs.io/en/stable/modelchain.html#a-simple-mo... | diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py
--- a/pvlib/modelchain.py
+++ b/pvlib/modelchain.py
@@ -1210,10 +1210,19 @@ def _complete_irradiance(self, weather):
weather.ghi - weather.dni *
tools.cosd(self.results.solar_position.zenith))
- def _prep_inputs_solar_pos(self... | diff --git a/pvlib/tests/test_modelchain.py b/pvlib/tests/test_modelchain.py
--- a/pvlib/tests/test_modelchain.py
+++ b/pvlib/tests/test_modelchain.py
@@ -886,6 +886,20 @@ def test_temperature_models_arrays_multi_weather(
!= mc.results.cell_temperature[1]).all()
+def test_run_model_solar_position_weath... | ["pvlib/tests/test_modelchain.py::test_run_model_from_poa_arrays_solar_position_weather"] | ["pvlib/tests/test_modelchain.py::test_ModelChain_creation", "pvlib/tests/test_modelchain.py::test_with_sapm", "pvlib/tests/test_modelchain.py::test_with_pvwatts", "pvlib/tests/test_modelchain.py::test_orientation_strategy[None-expected0]", "pvlib/tests/test_modelchain.py::test_orientation_strategy[None-expected1]", "p... | null | true | 2021-01-22T03:58:56Z | 1 | 24 | 1 | 1,645 | 0 | 0.8 | 1 | 0.7 | 1 | 0.354167 | 85.7125 | |
3,293 | swe_bench::test::1694 | swe_bench | test | 1,694 | scikit-learn__scikit-learn-25694 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 7b595569b26f4aa65a74a971ef428f4f071f48c4 | MLPRegressor.partial_fit produces an error when early_stopping is True
### Describe the bug
WIth `sklearn = 1.2.1`, when using `early_stopping = True`, `fit` works fine, but partial fit produces the following error:
I think this is related to this change: https://github.com/scikit-learn/scikit-learn/pull/24683.
### ... | diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py
--- a/sklearn/neural_network/_multilayer_perceptron.py
+++ b/sklearn/neural_network/_multilayer_perceptron.py
@@ -575,7 +575,9 @@ def _fit_stochastic(
)
# early_stopping in partia... | diff --git a/sklearn/neural_network/tests/test_mlp.py b/sklearn/neural_network/tests/test_mlp.py
--- a/sklearn/neural_network/tests/test_mlp.py
+++ b/sklearn/neural_network/tests/test_mlp.py
@@ -948,3 +948,16 @@ def test_mlp_warm_start_no_convergence(MLPEstimator, solver):
with pytest.warns(ConvergenceWarning):
... | ["sklearn/neural_network/tests/test_mlp.py::test_mlp_partial_fit_after_fit[MLPClassifier]", "sklearn/neural_network/tests/test_mlp.py::test_mlp_partial_fit_after_fit[MLPRegressor]"] | ["sklearn/neural_network/tests/test_mlp.py::test_alpha", "sklearn/neural_network/tests/test_mlp.py::test_fit", "sklearn/neural_network/tests/test_mlp.py::test_gradient", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification[X0-y0]", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification[X1-... | null | true | 2023-02-24T18:22:16Z | 1 | 4 | 2 | 3,215 | 0 | 0.8 | 1 | 0.92 | 0.8 | 0.513333 | 85.71 | ||
3,294 | swe_bench::test::1689 | swe_bench | test | 1,689 | scikit-learn__scikit-learn-25570 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | cd25abee0ad0ac95225d4a9be8948eff69f49690 | ColumnTransformer with pandas output can't handle transformers with no features
### Describe the bug
Hi,
ColumnTransformer doesn't deal well with transformers that apply to 0 features (categorical_features in the example below) when using "pandas" as output. It seems steps with 0 features are not fitted, hence don't ... | diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py
--- a/sklearn/compose/_column_transformer.py
+++ b/sklearn/compose/_column_transformer.py
@@ -865,7 +865,9 @@ def _hstack(self, Xs):
transformer_names = [
t[0] for t in self._iter(fitted=Tr... | diff --git a/sklearn/compose/tests/test_column_transformer.py b/sklearn/compose/tests/test_column_transformer.py
--- a/sklearn/compose/tests/test_column_transformer.py
+++ b/sklearn/compose/tests/test_column_transformer.py
@@ -2129,3 +2129,32 @@ def test_transformers_with_pandas_out_but_not_feature_names_out(
ct.s... | ["sklearn/compose/tests/test_column_transformer.py::test_empty_selection_pandas_output[list]", "sklearn/compose/tests/test_column_transformer.py::test_empty_selection_pandas_output[bool]", "sklearn/compose/tests/test_column_transformer.py::test_empty_selection_pandas_output[bool_int]"] | ["sklearn/compose/tests/test_column_transformer.py::test_column_transformer", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_tuple_transformers_parameter", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_dataframe", "sklearn/compose/tests/test_column_transformer.py... | null | true | 2023-02-08T18:28:21Z | 1 | 4 | 3 | 5,464 | 0 | 0.8 | 1 | 0.92 | 0.8 | 0.513333 | 85.71 | ||
3,295 | swe_bench::test::1021 | swe_bench | test | 1,021 | matplotlib__matplotlib-23516 | matplotlib/matplotlib | matplotlib/matplotlib | python | 12d3c8e6389728fe584d395bb5f9635a817d39ac | [Bug]: scatter plot color settings discarded unless c given
### Bug summary
When making an animation of a scatter plot, if you don't set `c` (the color value parameter) when initializing the artist, the color settings are ignored.
### Code for reproduction
```python
import matplotlib.animation as animation
import ma... | Thank you for diagnosing and reporting this @adamjstewart
> Raise an error/warning if cmap/vmin/vmax are given but c is not
I think this is the better option of the two. It will capture some unintentional usage and I think will be less surprising in the long run.
https://github.com/matplotlib/matplotlib/blo... | 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
@@ -4559,6 +4559,16 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
collection.set_cmap(cmap)
collection.set_norm(norm)
... | 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
@@ -2383,6 +2383,25 @@ def test_scatter_color(self):
with pytest.raises(ValueError):
plt.scatter([1, 2, 3], [1, 2, 3], color=[1, 2, 3])... | ["lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs0]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs1]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scatter_color_warning[kwargs2]", "lib/matplotlib/tests/test_axes.py::TestScatter::test_scat... | ["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 | 2022-07-29T18:24:47Z | 1 | 10 | 4 | 1,901 | 0 | 0.8 | 1 | 0.7 | 1 | 0.350167 | 85.7005 | |
3,296 | swe_bench::test::1370 | swe_bench | test | 1,370 | pylint-dev__pylint-8819 | pylint-dev/pylint | pylint-dev/pylint | python | dc1f5f6cbb1e649feab8ae53ed8be88845afeaf1 | enable/disable options in rcfile should not depend on the order with which they are specified
Hello,
i'm running `pylint 2.5.3 / astroid 2.4.2`; i kinda understand why
`$ pylint --enable=all --disable=fixme`
behaves differently than
`$ pylint --disable=fixme --enable=all`
(where the first command enables everything... | +1 from my side. Same goes for the pyproject.toml file
This should be done during a configuration refactor, or it will be a small patch on something old and already very patched using optparse.
I tried to figure out where exactly this order sensitive disable/enable comes from since it affects CLI, init and toml config... | diff --git a/pylint/config/config_initialization.py b/pylint/config/config_initialization.py
--- a/pylint/config/config_initialization.py
+++ b/pylint/config/config_initialization.py
@@ -13,7 +13,10 @@
from pylint import reporters
from pylint.config.config_file_parser import _ConfigurationFileParser
-from pylint.co... | diff --git a/tests/config/functional/toml/toml_with_mutually_exclusive_disable_enable_all.toml b/tests/config/functional/toml/toml_with_mutually_exclusive_disable_enable_all.toml
new file mode 100644
--- /dev/null
+++ b/tests/config/functional/toml/toml_with_mutually_exclusive_disable_enable_all.toml
@@ -0,0 +1,3 @@
+[... | ["tests/config/test_config.py::test_enable_all_disable_all_mutually_exclusive", "tests/config/test_config.py::test_disable_before_enable_all_takes_effect", "tests/config/test_config.py::test_enable_before_disable_all_takes_effect"] | ["tests/config/test_config.py::test_can_read_toml_env_variable", "tests/config/test_config.py::test_unknown_message_id", "tests/config/test_config.py::test_unknown_option_name", "tests/config/test_config.py::test_unknown_short_option_name", "tests/config/test_config.py::test_unknown_confidence", "tests/config/test_conf... | null | true | 2023-07-04T00:34:21Z | 1 | 54 | 3 | 1,000 | 0 | 0.8 | 1 | 0.7 | 1 | 0.346667 | 85.69 | |
3,297 | swe_bench::test::2283 | swe_bench | test | 2,283 | sympy__sympy-24325 | sympy/sympy | sympy/sympy | python | cdef6fcbfc12008d0de65ecd8ed21d1912e77e5d | Numerical error on conversion of coulomb to statcoulomb
```python
In[2]: from sympy.physics.units import convert_to
In[3]: from sympy.physics.units.systems.cgs import cgs_gauss
In[4]: from sympy.physics.units.definitions.unit_definitions import statcoulomb, coulomb, second, gram, centimeter, erg
In[5]: convert_to(coulo... | Can I open the PR for that ?
Can I open the PR for that ?
| diff --git a/sympy/physics/units/systems/cgs.py b/sympy/physics/units/systems/cgs.py
--- a/sympy/physics/units/systems/cgs.py
+++ b/sympy/physics/units/systems/cgs.py
@@ -56,16 +56,16 @@
cgs_gauss.set_quantity_scale_factor(maxwell, sqrt(centimeter**3*gram)/second)
# SI units expressed in CGS-gaussian units:
-cgs_ga... | diff --git a/sympy/physics/units/tests/test_unit_system_cgs_gauss.py b/sympy/physics/units/tests/test_unit_system_cgs_gauss.py
--- a/sympy/physics/units/tests/test_unit_system_cgs_gauss.py
+++ b/sympy/physics/units/tests/test_unit_system_cgs_gauss.py
@@ -4,17 +4,16 @@
from sympy.functions.elementary.miscellaneous impo... | ["test_conversion_to_from_si"] | [] | null | true | 2022-11-29T10:29:14Z | 1 | 12 | 1 | 1,840 | 0 | 0.8 | 1 | 0.7 | 1 | 0.346667 | 85.69 | |
3,298 | swe_bench::test::1622 | swe_bench | test | 1,622 | scikit-learn__scikit-learn-13915 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | b7b4d3e2f1a65bcb6d40431d3b61ed1d563c9dab | utils.sparsefuncs.min_max_axis gives TypeError when input is large csc matrix when OS is 32 bit Windows
#### Description
On 32 bit versions of Windows, when `min_max_axis` is called on a csc matrix where `indptr.dtype` is int64, an error is produced. This prevents [this](https://github.com/scikit-learn/scikit-learn/pul... | Proposed fix:
Add
```python
if mat.indptr.dtype == np.int64:
mat.indptr = mat.indptr.astype('int32')
```
below `mat = X.tocsc() if axis == 0 else X.tocsr()` in `utils.sparsefuncs._min_or_max_axis`.
When `tocsc` is called for a csr matrix with indptr dtype int64, it returns a csc matrix with indptr dty... | diff --git a/sklearn/__init__.py b/sklearn/__init__.py
--- a/sklearn/__init__.py
+++ b/sklearn/__init__.py
@@ -45,7 +45,7 @@
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#
-__version__ = '0.21.1'
+__version__ = '0.21.2'
# On OSX, we ca... | diff --git a/sklearn/cross_decomposition/tests/test_pls.py b/sklearn/cross_decomposition/tests/test_pls.py
--- a/sklearn/cross_decomposition/tests/test_pls.py
+++ b/sklearn/cross_decomposition/tests/test_pls.py
@@ -358,13 +358,13 @@ def test_scale_and_stability():
X_score, Y_score = clf.fit_transform(X, Y)... | ["sklearn/metrics/tests/test_pairwise.py::test_euclidean_distances_upcast[dense-dense-None]", "sklearn/metrics/tests/test_pairwise.py::test_euclidean_distances_upcast[dense-dense-5]", "sklearn/metrics/tests/test_pairwise.py::test_euclidean_distances_upcast[dense-dense-7]", "sklearn/metrics/tests/test_pairwise.py::test_... | ["sklearn/cross_decomposition/tests/test_pls.py::test_pls", "sklearn/cross_decomposition/tests/test_pls.py::test_convergence_fail", "sklearn/cross_decomposition/tests/test_pls.py::test_PLSSVD", "sklearn/cross_decomposition/tests/test_pls.py::test_univariate_pls_regression", "sklearn/cross_decomposition/tests/test_pls.p... | null | true | 2019-05-21T08:19:34Z | 7 | 69 | 26 | 2,597 | 0 | 0.8 | 1 | 1 | 0.6 | 0.662833 | 85.6885 | |
3,299 | swe_bench::test::2261 | swe_bench | test | 2,261 | sympy__sympy-22773 | sympy/sympy | sympy/sympy | python | 96c9c40b2bd41105cf82440cc83c27f032ac5ffc | Incorrect LaTeX display of a determinant
It displays like |(A)| instead of |A|. I fixed that issue for myself in LatexPrinter like this:
```python
def _print_Determinant(self, expr, exp=None):
mat_delim_backup = self._settings['mat_delim']
self._settings['mat_delim'] = ''
tex = r"\left|{%s}\... | I think this is probably a good enough way to solve it. The option would be to set the delimiter to `|`, but both approaches would include modifying and restoring the delimiter, so I cannot really see any benefit of the other way, rather the opposite.
I think the only "requirement" is to add a test for it (and make ... | diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -1066,7 +1066,6 @@ def _print_Abs(self, expr, exp=None):
return r"%s^{%s}" % (tex, exp)
else:
return tex
- _print_Determinant = _print_Abs
def _print... | 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
@@ -53,7 +53,8 @@
bernoulli, fibonacci, tribonacci, lucas, stieltjes, mathieuc, mathieus,
mathieusprime, mathie... | ["test_Adjoint", "test_Transpose", "test_pretty_Determinant", "test_Determinant"] | ["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_missing_in_2X_issue_9047", "test_upretty_modifiers", "test_pretty_Cycle", "test_pretty_Permutation", "test_pretty_basic", "test_negative_fractions", "t... | null | true | 2021-12-31T12:47:30Z | 2 | 66 | 4 | 733 | 0 | 0.8 | 1 | 0.7 | 1 | 0.342167 | 85.6765 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.