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
2,900
swe_bench_verified::test::66
swe_bench_verified
test
66
django__django-11951
django/django
django/django
python
312049091288dbba2299de8d07ea3e3311ed7238
bulk_create batch_size param overrides the compatible batch size calculation Description (last modified by Ahmet Kucuk) At this line: ​https://github.com/django/django/blob/stable/2.2.x/django/db/models/query.py#L1197 batch_size param overrides compatible batch size calculation. This looks like a bug as bulk_update...
diff --git a/django/db/models/query.py b/django/db/models/query.py --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1209,7 +1209,8 @@ def _batched_insert(self, objs, fields, batch_size, ignore_conflicts=False): if ignore_conflicts and not connections[self.db].features.supports_ignore_conflic...
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py --- a/tests/bulk_create/tests.py +++ b/tests/bulk_create/tests.py @@ -1,3 +1,4 @@ +from math import ceil from operator import attrgetter from django.db import IntegrityError, NotSupportedError, connection @@ -214,6 +215,14 @@ def test_explicit_bat...
["test_explicit_batch_size_respects_max_batch_size (bulk_create.tests.BulkCreateTests)"]
["test_batch_same_vals (bulk_create.tests.BulkCreateTests)", "test_bulk_insert_expressions (bulk_create.tests.BulkCreateTests)", "test_bulk_insert_nullable_fields (bulk_create.tests.BulkCreateTests)", "test_efficiency (bulk_create.tests.BulkCreateTests)", "test_empty_model (bulk_create.tests.BulkCreateTests)", "test_ex...
null
true
2019-10-21T09:35:46Z
1
3
1
604
0.5
1
1
0.4
0.8
0.110667
47.8795
2,901
swe_bench::dev::168
swe_bench
dev
168
pyvista__pyvista-4329
pyvista/pyvista
pyvista/pyvista
python
b9ee9b9c0625d737dfd4a60e9ed10609e7e0b7fd
PolyData faces array is not updatable in-place and has unexpected behavior ### Describe the bug, what's wrong, and what you expected. When accessing `PolyData.faces` (and likely other cell data), we cannot update the array in place. Further, there is some unexpected behavior where accessing `PolyData.faces` will overr...
Considering we are purely using VTK for this interface through the `vtk_to_numpy` function, I'm inclined to think this may be an upstream bug where the array doesn't interface completely https://github.com/pyvista/pyvista/blob/eaa71a640264765c8a9b40d485b6ccdb970c87b0/pyvista/core/pointset.py#L762 or perhaps ther...
diff --git a/pyvista/core/pointset.py b/pyvista/core/pointset.py --- a/pyvista/core/pointset.py +++ b/pyvista/core/pointset.py @@ -13,7 +13,7 @@ import pyvista from pyvista import _vtk from pyvista.utilities import abstract_class -from pyvista.utilities.cells import CellArray, create_mixed_cells, get_mixed_cells +fr...
diff --git a/tests/test_grid.py b/tests/test_grid.py --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -146,6 +146,14 @@ def test_init_from_arrays(specify_offset): assert np.allclose(cells, grid.cells) assert np.allclose(grid.cell_connectivity, np.arange(16)) + # grid.cells is not mutable + assert ...
["tests/test_grid.py::test_init_from_arrays[False]", "tests/test_grid.py::test_init_from_arrays[True]", "tests/test_polydata.py::test_init_from_arrays"]
["tests/test_grid.py::test_volume", "tests/test_grid.py::test_init_from_polydata", "tests/test_grid.py::test_init_from_structured", "tests/test_grid.py::test_init_from_unstructured", "tests/test_grid.py::test_init_from_numpy_arrays", "tests/test_grid.py::test_init_bad_input", "tests/test_grid.py::test_init_from_dict[Fa...
null
true
2023-04-24T18:15:27Z
2
89
3
2,457
0
0.8
1
1
1
0.706167
95.3185
2,902
swe_bench::dev::201
swe_bench
dev
201
sqlfluff__sqlfluff-3436
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
23cd31e77a712a210c734e38488d7a34afd83a25
Fatal templating error with Jinja templater. Tracer produces odd results. ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened Issue found while assessing an Airflow project. The smallest query I can make which triggers th...
I'll take a look. And darn it -- first bug report against this code in the past couple months, I think. 😅 Starting to look at this. One problem I noticed (perhaps not the only one) is that the trailing literal newline in the source string has no corresponding templated slice, so it's like building the templated sli...
diff --git a/src/sqlfluff/core/templaters/slicers/tracer.py b/src/sqlfluff/core/templaters/slicers/tracer.py --- a/src/sqlfluff/core/templaters/slicers/tracer.py +++ b/src/sqlfluff/core/templaters/slicers/tracer.py @@ -40,6 +40,7 @@ class RawSliceInfo: unique_alternate_id: Optional[str] alternate_code: Option...
diff --git a/test/core/templaters/jinja_test.py b/test/core/templaters/jinja_test.py --- a/test/core/templaters/jinja_test.py +++ b/test/core/templaters/jinja_test.py @@ -1060,6 +1060,61 @@ def test__templater_jinja_slice_template(test, result): ("block_end", slice(27, 39, None), slice(13, 13, None)), ...
["test/core/templaters/jinja_test.py::test__templater_jinja_slice_file[SELECT", "test/core/templaters/jinja_test.py::test__templater_jinja_slice_file[{%"]
["test/core/templaters/jinja_test.py::test__templater_jinja[simple]", "test/core/templaters/jinja_test.py::test__templater_jinja[unboundlocal_bugfix]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[basic_block]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[strip_left_block]", "...
null
true
2022-06-07T21:36:59Z
1
65
2
2,706
0
0.8
1
1
1
0.667667
95.203
2,903
swe_bench::test::2
swe_bench
test
2
astropy__astropy-12318
astropy/astropy
astropy/astropy
python
43ce7895bb5b61d4fab2f9cc7d07016cf105f18e
BlackBody bolometric flux is wrong if scale has units of dimensionless_unscaled The `astropy.modeling.models.BlackBody` class has the wrong bolometric flux if `scale` argument is passed as a Quantity with `dimensionless_unscaled` units, but the correct bolometric flux if `scale` is simply a float. ### Description ###...
I forgot who added that part of `BlackBody`. It was either @karllark or @astrofrog . There are several problems here: 1. In `BlackBody.evaluate()`, there is an `if` statement that handles two special cases: either scale is dimensionless, and multiplies the original blackbody surface brightness, or `scale` has units ...
diff --git a/astropy/modeling/physical_models.py b/astropy/modeling/physical_models.py --- a/astropy/modeling/physical_models.py +++ b/astropy/modeling/physical_models.py @@ -27,7 +27,12 @@ class BlackBody(Fittable1DModel): Blackbody temperature. scale : float or `~astropy.units.Quantity` ['dimensionles...
diff --git a/astropy/modeling/tests/test_physical_models.py b/astropy/modeling/tests/test_physical_models.py --- a/astropy/modeling/tests/test_physical_models.py +++ b/astropy/modeling/tests/test_physical_models.py @@ -40,6 +40,17 @@ def test_blackbody_sefanboltzman_law(): assert_quantity_allclose(b.bolometric_flu...
["astropy/modeling/tests/test_physical_models.py::test_blackbody_input_units", "astropy/modeling/tests/test_physical_models.py::test_blackbody_exceptions_and_warnings", "astropy/modeling/tests/test_physical_models.py::test_blackbody_dimensionless"]
["astropy/modeling/tests/test_physical_models.py::test_blackbody_evaluate[temperature0]", "astropy/modeling/tests/test_physical_models.py::test_blackbody_evaluate[temperature1]", "astropy/modeling/tests/test_physical_models.py::test_blackbody_weins_law", "astropy/modeling/tests/test_physical_models.py::test_blackbody_s...
null
true
2021-10-28T15:32:17Z
1
99
3
1,517
0
0.8
1
1
1
0.582833
94.9485
2,904
swe_bench::test::1561
swe_bench
test
1,561
scikit-learn__scikit-learn-12758
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
3a884c5ee507f735e2df384727340c72c5219a8e
Showing micro-average in classification report is confusing This is a follow up on #11679. I don't think it makes sense to include the micro-average for multi-class classification. The three columns will always show the same value, all of which being the same as accuracy. I find that confusing. If you want to show this...
Not sure if we want to do this for 0.20.1 as a bugfix? If the target is multiclass and labels is None or includes all present labels, I agree it would be less confusing if micro is hidden or is labelled "accuracy". I don't mind making this a fix for 0.20.x, but it's not worth blocking on. Hi, Is this issue being wor...
diff --git a/sklearn/metrics/classification.py b/sklearn/metrics/classification.py --- a/sklearn/metrics/classification.py +++ b/sklearn/metrics/classification.py @@ -1645,12 +1645,14 @@ def classification_report(y_true, y_pred, labels=None, target_names=None, ... } - The reported a...
diff --git a/sklearn/metrics/tests/test_classification.py b/sklearn/metrics/tests/test_classification.py --- a/sklearn/metrics/tests/test_classification.py +++ b/sklearn/metrics/tests/test_classification.py @@ -127,10 +127,7 @@ def test_classification_report_dictionary_output(): 'p...
["sklearn/metrics/tests/test_classification.py::test_classification_report_dictionary_output", "sklearn/metrics/tests/test_classification.py::test_classification_report_multiclass", "sklearn/metrics/tests/test_classification.py::test_classification_report_multiclass_balanced", "sklearn/metrics/tests/test_classification...
["sklearn/metrics/tests/test_classification.py::test_multilabel_accuracy_score_subset_accuracy", "sklearn/metrics/tests/test_classification.py::test_precision_recall_f1_score_binary", "sklearn/metrics/tests/test_classification.py::test_precision_recall_f_binary_single_class", "sklearn/metrics/tests/test_classification....
null
true
2018-12-12T01:30:18Z
1
54
8
2,303
0
0.8
1
1
1
0.563833
94.8915
2,905
swe_bench::test::1697
swe_bench
test
1,697
scikit-learn__scikit-learn-25744
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
2c867b8f822eb7a684f0d5c4359e4426e1c9cfe0
Setting min_samples_split=1 in DecisionTreeClassifier does not raise exception ### Describe the bug If `min_samples_split` is set to 1, an exception should be raised according to the paramter's constraints: https://github.com/scikit-learn/scikit-learn/blob/e2e705021eb6c9f23f0972f119b56e37cd7567ef/sklearn/tree/_classe...
I think that this is on purpose. Otherwise, we would have used `closed="neither"` for the `Real` case and `1` is qualified as a `Real`. At least this is not a regression since the code in the past would have failed and now we allow it to be considered as 100% of the train set. If we exclude `1` it means that we d...
diff --git a/sklearn/tree/_classes.py b/sklearn/tree/_classes.py --- a/sklearn/tree/_classes.py +++ b/sklearn/tree/_classes.py @@ -99,16 +99,16 @@ class BaseDecisionTree(MultiOutputMixin, BaseEstimator, metaclass=ABCMeta): "max_depth": [Interval(Integral, 1, None, closed="left"), None], "min_samples_s...
diff --git a/sklearn/tree/tests/test_tree.py b/sklearn/tree/tests/test_tree.py --- a/sklearn/tree/tests/test_tree.py +++ b/sklearn/tree/tests/test_tree.py @@ -2425,3 +2425,25 @@ def test_tree_deserialization_from_read_only_buffer(tmpdir): clf.tree_, "The trees of the original and loaded classifiers ar...
["sklearn/tree/tests/test_tree.py::test_min_sample_split_1_error[DecisionTreeClassifier]", "sklearn/tree/tests/test_tree.py::test_min_sample_split_1_error[ExtraTreeClassifier]", "sklearn/tree/tests/test_tree.py::test_min_sample_split_1_error[DecisionTreeRegressor]", "sklearn/tree/tests/test_tree.py::test_min_sample_spl...
["sklearn/tree/tests/test_tree.py::test_classification_toy", "sklearn/tree/tests/test_tree.py::test_weighted_classification_toy", "sklearn/tree/tests/test_tree.py::test_regression_toy[squared_error-DecisionTreeRegressor]", "sklearn/tree/tests/test_tree.py::test_regression_toy[squared_error-ExtraTreeRegressor]", "sklear...
null
true
2023-03-02T17:04:42Z
2
43
5
2,422
0
0.8
1
1
1
0.547
94.841
2,906
swe_bench::dev::175
swe_bench
dev
175
sqlfluff__sqlfluff-1517
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
304a197829f98e7425a46d872ada73176137e5ae
"Dropped elements in sequence matching" when doubled semicolon ## Expected Behaviour Frankly, I'm not sure whether it (doubled `;`) should be just ignored or rather some specific rule should be triggered. ## Observed Behaviour ```console (.venv) ?master ~/prod/_inne/sqlfluff> echo "select id from tbl;;" | sqlfluff lint...
Sounds similar to #1458 where we should handle "empty" statement/files better? Nope, that's the different issue. I doubt that solving one of them would help in other one. I think both issues should stay, just in the case. But what do you think @tunetheweb - should it just ignore these `;;` or raise something like `Foun...
diff --git a/src/sqlfluff/core/parser/helpers.py b/src/sqlfluff/core/parser/helpers.py --- a/src/sqlfluff/core/parser/helpers.py +++ b/src/sqlfluff/core/parser/helpers.py @@ -2,6 +2,7 @@ from typing import Tuple, List, Any, Iterator, TYPE_CHECKING +from sqlfluff.core.errors import SQLParseError from sqlfluff.core...
diff --git a/test/dialects/ansi_test.py b/test/dialects/ansi_test.py --- a/test/dialects/ansi_test.py +++ b/test/dialects/ansi_test.py @@ -3,7 +3,7 @@ import pytest import logging -from sqlfluff.core import FluffConfig, Linter +from sqlfluff.core import FluffConfig, Linter, SQLParseError from sqlfluff.core.parser ...
["test/dialects/ansi_test.py::test__dialect__ansi_multiple_semicolons[select"]
["test/dialects/ansi_test.py::test__dialect__ansi__file_lex[a", "test/dialects/ansi_test.py::test__dialect__ansi__file_lex[b.c-res1]", "test/dialects/ansi_test.py::test__dialect__ansi__file_lex[abc", "test/dialects/ansi_test.py::test__dialect__ansi_specific_segment_parses[SelectKeywordSegment-select]", "test/dialects/a...
null
true
2021-10-06T07:57:35Z
1
11
1
2,968
0
0.8
1
1
1
0.531333
94.794
2,907
swe_bench::test::1199
swe_bench
test
1,199
psf__requests-4356
psf/requests
psf/requests
python
234f80af88ff2aab39bbd65a3131ae93e1917c25
Misleading exception with invalid protocol in proxy variable When the value of `https_proxy` or `HTTPS_PROXY` variable(s) accidentally miss one '/' in the protocol, a traceback is thrown to the user which doesn't pin point that the issue is with the proxy configuration. ## Expected Result A better exception ## Actua...
On dumping the connection object right before calling `conn.urlopen()`, the output for `print(vars(conn))` reveals: ``` 'proxy': Url(scheme='http', auth=None, host=None, port=80, path='/my.proxy.com:3128', query=None, fragment=None), ``` And this makes urllib3 think that the proxy to be reached is: `http://:80/my....
diff --git a/requests/adapters.py b/requests/adapters.py --- a/requests/adapters.py +++ b/requests/adapters.py @@ -13,6 +13,7 @@ from urllib3.poolmanager import PoolManager, proxy_from_url from urllib3.response import HTTPResponse +from urllib3.util import parse_url from urllib3.util import Timeout as TimeoutSauce...
diff --git a/tests/test_requests.py b/tests/test_requests.py --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -23,7 +23,7 @@ from requests.exceptions import ( ConnectionError, ConnectTimeout, InvalidSchema, InvalidURL, MissingSchema, ReadTimeout, Timeout, RetryError, TooManyRedirects, - ProxyE...
["tests/test_requests.py::TestRequests::test_entry_points", "tests/test_requests.py::TestRequests::test_invalid_url[MissingSchema-hiwpefhipowhefopw]", "tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-localhost:3128]", "tests/test_requests.py::TestRequests::test_invalid_url[InvalidSchema-localhost.l...
[]
null
true
2017-10-26T14:41:40Z
2
11
115
2,903
0
0.8
1
1
1
0.5205
94.7615
2,908
swe_bench::dev::119
swe_bench
dev
119
pydicom__pydicom-933
pydicom/pydicom
pydicom/pydicom
python
38436b6824c079564b8760ea6acfa4c0fd3ee9c3
Deferred Read Fails For File-Like Objects #### Description Deferred reads are failing when dcmread is passed a file-like object (instead of a filepath). There are two old issues from 2014 which describe the same issue which were apparently fixed, but I'm still seeing it on v1.3: https://github.com/pydicom/pydicom/issu...
This certainly makes sense, though deferred reads have not been implemented for file-like, so I see this as a feature request. @darcymason - I suggest to flag this for the 1.4 release. Note that the two mentioned issues have not addressed this - the first one was not about deferred read, the second one was about defe...
diff --git a/pydicom/dataset.py b/pydicom/dataset.py --- a/pydicom/dataset.py +++ b/pydicom/dataset.py @@ -2114,11 +2114,12 @@ def __init__(self, self.file_meta = file_meta self.is_implicit_VR = is_implicit_VR self.is_little_endian = is_little_endian + filename = None if isins...
diff --git a/pydicom/tests/test_filereader.py b/pydicom/tests/test_filereader.py --- a/pydicom/tests/test_filereader.py +++ b/pydicom/tests/test_filereader.py @@ -3,6 +3,7 @@ """Unit tests for the pydicom.filereader module.""" import gzip +import io from io import BytesIO import os import shutil @@ -918,6 +919,1...
["pydicom/tests/test_filereader.py::TestDeferredRead::test_filelike_deferred"]
["pydicom/tests/test_filereader.py::TestReader::test_empty_numbers_tag", "pydicom/tests/test_filereader.py::TestReader::test_UTF8_filename", "pydicom/tests/test_filereader.py::TestReader::test_RTPlan", "pydicom/tests/test_filereader.py::TestReader::test_RTDose", "pydicom/tests/test_filereader.py::TestReader::test_CT", ...
null
true
2019-08-15T20:21:09Z
2
73
1
1,628
0
0.8
1
1
1
0.514667
94.744
2,909
swe_bench::dev::115
swe_bench
dev
115
pydicom__pydicom-900
pydicom/pydicom
pydicom/pydicom
python
3746878d8edf1cbda6fbcf35eec69f9ba79301ca
can open my dicom, error in re.match('^ISO[^_]IR', encoding) ``` (test) root@DESKTOP-COPUCVT:/mnt/e/test# python3 mydicom.py Traceback (most recent call last): File "/root/.local/share/virtualenvs/test-LINKoilU/lib/python3.6/site-packages/pydicom/charset.py", line 625, in convert_encodings py_encodings.append(pyt...
The traceback is not really conclusive - apparently there is a syntax error somewhere in `mydicom.py`. Can you show the contents that code please? The traceback seems not to match the lines you gave below. In the DICOM file I cannot see anything out of the order, apart from ProtocolName being in the wrong encoding...
diff --git a/pydicom/dataelem.py b/pydicom/dataelem.py --- a/pydicom/dataelem.py +++ b/pydicom/dataelem.py @@ -165,6 +165,17 @@ def __init__(self, if not isinstance(tag, BaseTag): tag = Tag(tag) self.tag = tag + + # a known tag shall only have the VR 'UN' if it has a length that + ...
diff --git a/pydicom/tests/test_dataelem.py b/pydicom/tests/test_dataelem.py --- a/pydicom/tests/test_dataelem.py +++ b/pydicom/tests/test_dataelem.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2008-2018 pydicom authors. See LICENSE file for details. """Unit tests for the pydicom.dataelem module.""" @@ -3...
["pydicom/tests/test_dataelem.py::TestDataElement::test_known_tags_with_UN_VR"]
["pydicom/tests/test_dataelem.py::TestDataElement::test_VM_1", "pydicom/tests/test_dataelem.py::TestDataElement::test_VM_2", "pydicom/tests/test_dataelem.py::TestDataElement::test_DSFloat_conversion", "pydicom/tests/test_dataelem.py::TestDataElement::test_backslash", "pydicom/tests/test_dataelem.py::TestDataElement::te...
null
true
2019-07-26T20:06:47Z
1
11
1
2,793
0
0.8
1
1
1
0.502167
94.7065
2,910
swe_bench::dev::23
swe_bench
dev
23
pvlib__pvlib-python-1165
pvlib/pvlib-python
pvlib/pvlib-python
python
b40df75ddbc467a113b87643c1faef073cc37b3e
ValueError: ModelChain.run_from_effective_irradiance([weather]) when only providing temp_air and wind_speed **Describe the bug** According to the (new) docstring for `ModelChain.run_from_effective_irradiance`, cell temperature can be calculated from temperature_model using `'effective_irradiance'`. This is not the case...
@cwhanse we overlooked updating this in #1129: https://github.com/pvlib/pvlib-python/blob/b40df75ddbc467a113b87643c1faef073cc37b3e/pvlib/modelchain.py#L1594-L1598 One possible solution is ```python if any(p is None for p in poa): raise ValueError ```
diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1572,11 +1572,13 @@ def _prepare_temperature(self, data=None): """ poa = _irrad_for_celltemp(self.results.total_irrad, self.results.effective_irradiance) - ...
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 @@ -985,26 +985,44 @@ def test_run_model_from_poa_tracking(sapm_dc_snl_ac_system, location, assert_series_equal(ac, expected) +@pytest.mark.parametrize("input_t...
["pvlib/tests/test_modelchain.py::test_run_model_from_effective_irradiance_no_poa_global[tuple]", "pvlib/tests/test_modelchain.py::test_run_model_from_effective_irradiance_no_poa_global[list]"]
["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-02-06T18:01:53Z
1
27
2
2,431
0
0.8
1
1
1
0.495167
94.6855
2,911
swe_bench::dev::100
swe_bench
dev
100
pydicom__pydicom-1598
pydicom/pydicom
pydicom/pydicom
python
e9fc645cd8e75d71f7835c0d6e3c0b94b22c2808
KeyError when saving a FileSet **Describe the bug** Saving a fileset that was loaded using DICOMDIR returns a Key Error. **Expected behavior** Fileset is saved without error **Steps To Reproduce** Code: ```python from pydicom.fileset import FileSet fpath="DICOMDIR" data=FileSet(fpath) print(data) data.write(use_ex...
This is going to be difficult to troubleshoot without the original DICOMDIR dataset. Could you create an anonymised version of it using the following and attach it please? ```python from pydicom import dcmread ds = dcmread("DICOMDIR") for item in ds.DirectoryRecordSequence: if item.DirectoryRecordType == "...
diff --git a/pydicom/dataset.py b/pydicom/dataset.py --- a/pydicom/dataset.py +++ b/pydicom/dataset.py @@ -393,6 +393,9 @@ def __init__(self, *args: _DatasetType, **kwargs: Any) -> None: self.is_little_endian: Optional[bool] = None self.is_implicit_VR: Optional[bool] = None + # True if the da...
diff --git a/pydicom/tests/test_fileset.py b/pydicom/tests/test_fileset.py --- a/pydicom/tests/test_fileset.py +++ b/pydicom/tests/test_fileset.py @@ -2450,6 +2450,21 @@ def test_add_bad_one_level(self, dummy): with pytest.raises(ValueError, match=msg): fs.add(ds) + def test_write_undefined_l...
["pydicom/tests/test_fileset.py::TestFileSet_Modify::test_write_undefined_length"]
["pydicom/tests/test_fileset.py::test_is_conformant_file_id", "pydicom/tests/test_fileset.py::test_prefixes", "pydicom/tests/test_fileset.py::TestGenerateFilename::test_numeric", "pydicom/tests/test_fileset.py::TestGenerateFilename::test_numeric_prefix", "pydicom/tests/test_fileset.py::TestGenerateFilename::test_numeri...
null
true
2022-02-11T01:14:16Z
2
8
1
2,791
0
0.8
1
1
1
0.491833
94.6755
2,912
swe_bench::test::1048
swe_bench
test
1,048
matplotlib__matplotlib-24619
matplotlib/matplotlib
matplotlib/matplotlib
python
0aac9f17b9373f66c709f436149568bda69595b3
[Bug]: integer colours for pcolorfast / quadmesh ### Bug summary I get an error ``` ValueError: RGBA values should be within 0-1 range ``` when passing a byte/integer array to pcolorfast to code the colors as RGBA. It also fails when data type is `uint8` ### Code for reproduction ```python import numpy as np import...
Matplotlib works using the 0-1 convention, not 0-255. https://matplotlib.org/stable/api/colors_api.html#module-matplotlib.colors I seem to recall it used to support this format in the for color specification in the past. This is also the reason, I believe, the `dtype.kind - "i"` was in the first code piece I quoted. ...
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 @@ -5679,7 +5679,7 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs): if len(args) == 1: C = np.asanyarray(args[0]) - nrows,...
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 @@ -1298,6 +1298,17 @@ def test_pcolormesh_alpha(): ax4.pcolormesh(Qx, Qy, Z, cmap=cmap, shading='gouraud', zorder=1) +@pytest.mark.parametrize("dim...
["lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-3-1]", "lib/matplotlib/tests/test_axes.py::test_pcolormesh_rgba[png-4-0.5]", "lib/matplotlib/tests/test_collections.py::test_quadmesh_set_array_validation", "lib/matplotlib/tests/test_collections.py::test_array_wrong_dimensions"]
["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-04T17:55:35Z
2
55
4
1,822
0
0.8
1
1
1
0.487
94.661
2,913
swe_bench::dev::198
swe_bench
dev
198
sqlfluff__sqlfluff-3354
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
36e89cbf2d13d5d95d2430f905a2fd122cf103c7
TypeError when using integer placeholder ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened An exception occurs when trying to use integer substituents. ### Expected Behaviour Work without errors. ### Observed Behaviou...
This sounds more like a templater feature than a dialect feature. Does psql allow variables to contain SQL fragments, e.g.: `WHERE foo = '3'`? > This sounds more like a templater feature than a dialect feature. True! After looking over the code some, that may well be the right place to implement this. > Does ps...
diff --git a/src/sqlfluff/core/templaters/placeholder.py b/src/sqlfluff/core/templaters/placeholder.py --- a/src/sqlfluff/core/templaters/placeholder.py +++ b/src/sqlfluff/core/templaters/placeholder.py @@ -21,6 +21,8 @@ KNOWN_STYLES = { # e.g. WHERE bla = :name "colon": regex.compile(r"(?<![:\w\x5c]):(?P<pa...
diff --git a/test/core/templaters/placeholder_test.py b/test/core/templaters/placeholder_test.py --- a/test/core/templaters/placeholder_test.py +++ b/test/core/templaters/placeholder_test.py @@ -79,6 +79,20 @@ def test__templater_raw(): city_ids="(1, 2, 3, 45)", ), ), + ( +...
["test/core/templaters/placeholder_test.py::test__templater_param_style[colon_nospaces]", "test/core/templaters/placeholder_test.py::test__templater_param_style[pyformat]", "test/core/templaters/placeholder_test.py::test__templater_param_style[dollar]"]
["test/core/templaters/placeholder_test.py::test__templater_raw", "test/core/templaters/placeholder_test.py::test__templater_param_style[no_changes]", "test/core/templaters/placeholder_test.py::test__templater_param_style[colon_simple_substitution]", "test/core/templaters/placeholder_test.py::test__templater_param_styl...
null
true
2022-05-17T11:50:34Z
1
10
3
2,663
0
0.8
1
1
1
0.477167
94.6315
2,914
swe_bench::test::47
swe_bench
test
47
astropy__astropy-14213
astropy/astropy
astropy/astropy
python
a5ccc9522ca139df7a7cf4e2e506ffd288e55620
The `range` argument to `numpy.histogram`-like functions does not accept instances of `astropy.units.Quantity` ### Description When using `numpy.histogram()`, `numpy.histogram2d()`, etc. family of functions, with instances of `astropy.units.Quantity`, the `range` argument only accepts instances of `float`. ### Expect...
Hmm, definitely an oversight; I do remember being quite fed up by the time I got to `histogram` as it had so many options... Anyway, I guess to fix this one needs to add treatment to https://github.com/astropy/astropy/blob/87963074a50b14626fbd825536f384a6e96835af/astropy/units/quantity_helper/function_helpers.py#L666-L...
diff --git a/astropy/units/quantity_helper/function_helpers.py b/astropy/units/quantity_helper/function_helpers.py --- a/astropy/units/quantity_helper/function_helpers.py +++ b/astropy/units/quantity_helper/function_helpers.py @@ -663,6 +663,12 @@ def _check_bins(bins, unit): return bins +def _check_range(...
diff --git a/astropy/units/tests/test_quantity_non_ufuncs.py b/astropy/units/tests/test_quantity_non_ufuncs.py --- a/astropy/units/tests/test_quantity_non_ufuncs.py +++ b/astropy/units/tests/test_quantity_non_ufuncs.py @@ -1392,6 +1392,25 @@ def test_histogram(self): with pytest.raises(u.UnitsError): ...
["astropy/units/tests/test_quantity_non_ufuncs.py::TestHistogramFunctions::test_histogram_range[range0]", "astropy/units/tests/test_quantity_non_ufuncs.py::TestHistogramFunctions::test_histogram_range[range1]", "astropy/units/tests/test_quantity_non_ufuncs.py::TestHistogramFunctions::test_histogram_bin_edges_range[rang...
["astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeInformation::test_shape", "astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeInformation::test_size", "astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeInformation::test_ndim", "astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeManipul...
null
true
2022-12-22T16:37:17Z
1
20
9
2,362
0
0.8
1
1
1
0.460333
94.581
2,915
swe_bench::dev::110
swe_bench
dev
110
pydicom__pydicom-816
pydicom/pydicom
pydicom/pydicom
python
3551f5b5a5f8d4de3ed92e5e479ac8c74a8c893a
LookupError: unknown encoding: Not Supplied #### Description Output from `ds = pydicom.read_file(dcmFile)` (an RTSTRUCT dicom file, SOP UID 1.2.840.10008.5.1.4.1.1.481.3) results in some tags throwing a LookupError: "LookupError: unknown encoding: Not Supplied" Specific tags which cannot be decoded are as follows: ['De...
You said on the pynetdicom issue you can't upload an anonymised file, but can you open the file in a hex editor and post the raw byte output from the first few (non-identifying) elements? From the start of the file to the end of say (0008,0070) should be enough. Alternatively you could truncate the file at the end o...
diff --git a/pydicom/charset.py b/pydicom/charset.py --- a/pydicom/charset.py +++ b/pydicom/charset.py @@ -125,15 +125,24 @@ def decode_string(value, encodings, delimiters): """ # shortcut for the common case - no escape sequences present if ESC not in value: + first_encoding = encodings[0] ...
diff --git a/pydicom/tests/test_charset.py b/pydicom/tests/test_charset.py --- a/pydicom/tests/test_charset.py +++ b/pydicom/tests/test_charset.py @@ -100,6 +100,26 @@ def test_standard_file(self): ds.decode() assert u'CompressedSamples^CT1' == ds.PatientName + def test_invalid_character_set(self...
["pydicom/tests/test_charset.py::TestCharset::test_invalid_character_set", "pydicom/tests/test_charset.py::TestCharset::test_bad_encoded_single_encoding", "pydicom/tests/test_charset.py::TestCharset::test_patched_charset"]
["pydicom/tests/test_charset.py::TestCharset::test_encodings", "pydicom/tests/test_charset.py::TestCharset::test_nested_character_sets", "pydicom/tests/test_charset.py::TestCharset::test_inherited_character_set_in_sequence", "pydicom/tests/test_charset.py::TestCharset::test_standard_file", "pydicom/tests/test_charset.p...
null
true
2019-03-10T15:41:44Z
1
17
3
2,344
0
0.8
1
1
1
0.447333
94.542
2,916
swe_bench::test::4
swe_bench
test
4
astropy__astropy-12825
astropy/astropy
astropy/astropy
python
43ee5806e9c6f7d58c12c1cb9287b3c61abe489d
SkyCoord in Table breaks aggregate on group_by ### Description, actual behaviour, reproduction When putting a column of `SkyCoord`s in a `Table`, `aggregate` does not work on `group_by().groups`: ```python from astropy.table import Table import astropy.units as u from astropy.coordinates import SkyCoord import numpy a...
Hmm. Maybe the logic here needs fixing: https://github.com/astropy/astropy/blob/bcde23429a076859af856d941282f3df917b8dd4/astropy/table/groups.py#L351-L360 Mostly finished with a fix for this which makes it possible to aggregate tables that have mixin columns. In cases where the aggregation makes sense (e.g. with Qua...
diff --git a/astropy/table/column.py b/astropy/table/column.py --- a/astropy/table/column.py +++ b/astropy/table/column.py @@ -340,7 +340,9 @@ class ColumnInfo(BaseColumnInfo): This is required when the object is used as a mixin column within a table, but can be used as a general way to store meta information...
diff --git a/astropy/table/tests/conftest.py b/astropy/table/tests/conftest.py --- a/astropy/table/tests/conftest.py +++ b/astropy/table/tests/conftest.py @@ -178,16 +178,17 @@ def mixin_cols(request): @pytest.fixture(params=[False, True]) def T1(request): - T = Table.read([' a b c d', - ' 2 c...
["astropy/table/tests/test_groups.py::test_table_aggregate[False]", "astropy/table/tests/test_groups.py::test_table_aggregate[True]", "astropy/table/tests/test_groups.py::test_group_mixins_unsupported[col0]", "astropy/table/tests/test_groups.py::test_group_mixins_unsupported[col1]", "astropy/table/tests/test_groups.py:...
["astropy/table/tests/test_groups.py::test_column_group_by[False]", "astropy/table/tests/test_groups.py::test_column_group_by[True]", "astropy/table/tests/test_groups.py::test_table_group_by[False]", "astropy/table/tests/test_groups.py::test_groups_keys[False]", "astropy/table/tests/test_groups.py::test_groups_keys[Tru...
null
true
2022-02-05T12:13:44Z
3
52
5
1,523
0
0.8
1
1
1
0.427167
94.4815
2,917
swe_bench::test::101
swe_bench
test
101
django__django-10390
django/django
django/django
python
4c086d7da4c5cf23935a5340dbb9a8d6835cf7cc
Trunc() should allow passing is_dst resolution to avoid NonExistentTimeError/AmbiguousTimeError Description (last modified by Alexander Holmbäck) When Trunc() truncates to a nonexisting or ambiguous datetime, the exception raised by pytz remains unhandled. The expected behavior would, IMO, be to not check the valid...
I don't have much expertise but reading the documentation, it sounds like you may be ​creating invalid data. Django converts datetimes when USE_TZ is activate, I don't think it can hide that exception. Did you carefully review the pytz documentation which states, "Unfortunately using the tzinfo argument of the standard...
diff --git a/django/db/models/functions/datetime.py b/django/db/models/functions/datetime.py --- a/django/db/models/functions/datetime.py +++ b/django/db/models/functions/datetime.py @@ -170,8 +170,9 @@ class TruncBase(TimezoneMixin, Transform): kind = None tzinfo = None - def __init__(self, expression, ...
diff --git a/tests/db_functions/datetime/test_extract_trunc.py b/tests/db_functions/datetime/test_extract_trunc.py --- a/tests/db_functions/datetime/test_extract_trunc.py +++ b/tests/db_functions/datetime/test_extract_trunc.py @@ -1044,6 +1044,30 @@ def test_trunc_timezone_applied_before_truncation(self): self...
["test_trunc_ambiguous_and_invalid_times (db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests)"]
["test_extract_day_func (db_functions.datetime.test_extract_trunc.DateFunctionTests)", "test_extract_duration_without_native_duration_field (db_functions.datetime.test_extract_trunc.DateFunctionTests)", "test_extract_func (db_functions.datetime.test_extract_trunc.DateFunctionTests)", "test_extract_hour_func (db_functio...
null
true
2018-09-14T17:50:40Z
1
12
1
2,275
0
0.8
1
1
1
0.419167
94.4575
2,918
swe_bench::dev::90
swe_bench
dev
90
pydicom__pydicom-1365
pydicom/pydicom
pydicom/pydicom
python
bd82f01faf4212f6e43f55a1cc6da17956122d8f
DA class is inconsistent **Describe the bug** pydicom.valuerep.DA accepts strings or datetime.date objects - but DA objects created with datetime.date inputs are invalid. **Expected behavior** I would expect both of these expressions to generate the same output: ``` print(f'DA("20201117") => {DA("20201117")}') print(f...
Thanks for this - I agree that the print output should be consistent, and that the class should work correctly for json. I think that the problem is in the _DateTimeBase method __str__ - there is no 'original_string' so it's calling the __str__ method if the object's superclass and the default for datetime.date puts ...
diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py --- a/pydicom/valuerep.py +++ b/pydicom/valuerep.py @@ -135,6 +135,8 @@ def __init__(self, val: Union[str, _DA, datetime.date]) -> None: self.original_string = val elif isinstance(val, DA) and hasattr(val, 'original_string'): self...
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 @@ -300,8 +300,7 @@ def test_multivalue_DA(self): DA_expected = date(1961, 8, 4) tzinfo = timezone(timedelta(seconds=-21600), '-0600') ...
["pydicom/tests/test_valuerep.py::TestTM::test_str", "pydicom/tests/test_valuerep.py::TestDT::test_str", "pydicom/tests/test_valuerep.py::TestDA::test_str"]
["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-04-26T19:16:35Z
1
25
3
2,000
0
0.8
1
1
1
0.416667
94.45
2,919
swe_bench::test::33
swe_bench
test
33
astropy__astropy-13638
astropy/astropy
astropy/astropy
python
c00626462ee48a483791d92197582e7d1366c9e0
`Quantity.__ilshift__` throws exception with `dtype=int` ### Description The `astropy.units.quantity_input` decorator throws a `UFuncTypeError` when used on a function that returns a `Quantity` with `dtype=int` and a return type annotation. ### Expected behavior For the function to return a `Quantity` with `dtype=i...
Welcome to Astropy 👋 and thank you for your first issue! A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta...
diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py --- a/astropy/units/quantity.py +++ b/astropy/units/quantity.py @@ -1088,21 +1088,23 @@ def __ilshift__(self, other): try: other = Unit(other, parse_strict='silent') except UnitTypeError: - return NotImplemented...
diff --git a/astropy/units/tests/test_quantity.py b/astropy/units/tests/test_quantity.py --- a/astropy/units/tests/test_quantity.py +++ b/astropy/units/tests/test_quantity.py @@ -699,6 +699,32 @@ def test_quantity_conversion(): q1.to_value(u.zettastokes) +def test_quantity_ilshift(): # in-place conversion...
["astropy/units/tests/test_quantity.py::test_regression_12964", "astropy/units/tests/test_structured.py::TestStructuredQuantity::test_inplace_conversion"]
["astropy/units/tests/test_quantity.py::TestQuantityCreation::test_1", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_2", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_3", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_nan_inf", "astropy/units/tests/test_quantit...
null
true
2022-09-11T23:32:16Z
1
24
2
1,950
0
0.8
1
1
1
0.405
94.415
2,920
swe_bench::test::1078
swe_bench
test
1,078
matplotlib__matplotlib-25430
matplotlib/matplotlib
matplotlib/matplotlib
python
7eafdd8af3c523c1c77b027d378fb337dd489f18
[Bug]: savefig + jpg + metadata fails with inscrutable error message ### Bug summary If we call `savefig` with a `filename` with a `.jpg` extension, with the `metadata` kwarg specified, the error message is inscrutable. ### Code for reproduction ```python #!/usr/bin/env python3 import matplotlib.pyplot as plt import...
Ultimately the jpg writer does not support metadata. If it could, that would be the most ideal solution for at least the narrow case. (Though this is not at all specific to jpg, while many of the most common formats such as png, pdf, or svg do accept metadata, not all do) I could see an argument for failing a bit ea...
diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -441,7 +441,9 @@ def buffer_rgba(self): """ return self.renderer.buffer_rgba() - def print_raw(self, filename_o...
diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -1548,3 +1548,14 @@ def test_gridspec_no_mutate_input(): plt.subplots(1, 2, width_ratios=[1, 2], gridspec_kw=gs) assert gs == gs_orig ...
["lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[jpeg]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[jpg]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[tif]", "lib/matplotlib/tests/test_figure.py::test_savefig_metadata_error[tiff]", "lib/matplotlib/tests/tes...
["lib/matplotlib/tests/test_figure.py::test_align_labels[png]", "lib/matplotlib/tests/test_figure.py::test_align_labels_stray_axes", "lib/matplotlib/tests/test_figure.py::test_figure_label", "lib/matplotlib/tests/test_figure.py::test_fignum_exists", "lib/matplotlib/tests/test_figure.py::test_clf_keyword", "lib/matplotl...
null
true
2023-03-11T02:40:44Z
3
24
7
1,934
0
0.8
1
1
1
0.402333
94.407
2,921
swe_bench::dev::75
swe_bench
dev
75
pydicom__pydicom-1033
pydicom/pydicom
pydicom/pydicom
python
701c1062bf66de2b29df68fa5540be6009943885
to_json does not work with binary data in pixel_array **Describe the issue** Loading a dicom file and then performing a to_json() on it does not work with binary data in pixel_array. **Expected behavior** I would have expected that a base64 conversion is first performed on the binary data and then encoded to json. **...
Can you please check with pydicom 1.4? Binary data handling should have been fixed there. ok works now once I set the bulk_data_threshold value to a higher value. Thank you! Ok, that may be an issue with the data size. Currently, the default for `bulk_data_threshold` is 1, if I remember correctly, which may not be...
diff --git a/pydicom/dataelem.py b/pydicom/dataelem.py --- a/pydicom/dataelem.py +++ b/pydicom/dataelem.py @@ -315,32 +315,21 @@ def to_json_dict(self, bulk_data_element_handler, bulk_data_threshold): via DICOMweb WADO-RS bulk_data_threshold: int Size of base64 encoded data element ab...
diff --git a/pydicom/tests/test_json.py b/pydicom/tests/test_json.py --- a/pydicom/tests/test_json.py +++ b/pydicom/tests/test_json.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- # Copyright 2008-2019 pydicom authors. See LICENSE file for details. import json -import sys import pytest from pydicom import dcmread...
["pydicom/tests/test_json.py::TestDataSetToJson::test_json_from_dicom_file", "pydicom/tests/test_json.py::TestDataSetToJson::test_roundtrip", "pydicom/tests/test_json.py::TestBinary::test_inline_binary"]
["pydicom/tests/test_json.py::TestPersonName::test_json_pn_from_file", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_to_json", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_from_json", "pydicom/tests/test_json.py::TestPersonName::test_empty_value", "pydicom/tests/test_json.py::TestPe...
null
true
2020-01-17T20:57:00Z
2
40
3
1,538
0
0.8
1
1
1
0.389667
94.369
2,922
swe_bench::test::1676
swe_bench
test
1,676
scikit-learn__scikit-learn-19664
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
2620a5545a806ee416d9d10e07c2de30cdd9bf20
LabelPropagation raises TypeError: A sparse matrix was passed #### Describe the bug LabelPropagation (and LabelSpreading) error out for sparse matrices. #### Steps/Code to Reproduce ``` import sklearn from scipy.sparse import csr_matrix from sklearn.datasets import make_classification from sklearn.semi_supervised im...
Just checked: the fix seems to work for kernel='rbf', too. Hi, I would like to take over since this is stalled. Hi @cozek , sure go ahead: FYI you can comment "take" in this issue and it will automatically assigned to you.
diff --git a/sklearn/semi_supervised/_label_propagation.py b/sklearn/semi_supervised/_label_propagation.py --- a/sklearn/semi_supervised/_label_propagation.py +++ b/sklearn/semi_supervised/_label_propagation.py @@ -241,7 +241,7 @@ def fit(self, X, y): Parameters ---------- - X : array-like of...
diff --git a/sklearn/semi_supervised/tests/test_label_propagation.py b/sklearn/semi_supervised/tests/test_label_propagation.py --- a/sklearn/semi_supervised/tests/test_label_propagation.py +++ b/sklearn/semi_supervised/tests/test_label_propagation.py @@ -15,6 +15,9 @@ assert_allclose, assert_array_equal, ) +...
["sklearn/semi_supervised/tests/test_label_propagation.py::test_sparse_input_types[LabelPropagation-parameters0-float32-int32-sparse_csr]", "sklearn/semi_supervised/tests/test_label_propagation.py::test_sparse_input_types[LabelPropagation-parameters0-float32-int32-sparse_csc]", "sklearn/semi_supervised/tests/test_label...
["sklearn/semi_supervised/tests/test_label_propagation.py::test_fit_transduction[float64-LabelPropagation-parameters0]", "sklearn/semi_supervised/tests/test_label_propagation.py::test_fit_transduction[float64-LabelPropagation-parameters1]", "sklearn/semi_supervised/tests/test_label_propagation.py::test_fit_transduction...
null
true
2021-03-11T17:53:04Z
1
13
50
2,014
0
0.8
1
1
1
0.379
94.337
2,923
swe_bench::test::1619
swe_bench
test
1,619
scikit-learn__scikit-learn-13864
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
eb1f5f29df4bcb64fa3a96e3018aefcbe99dffab
AttributeError thrown when calling metrics.pairwise_distances with binary metrics and Y is None #### Description `AttributeError` thrown when calling `metrics.pairwise_distances` with binary metrics if `Y` is `None`. #### Steps/Code to Reproduce ```python import numpy as np import sklearn binary_data = np.array((0, ...
Hi, if possible I would like to contribute to this issue!
diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -306,7 +306,7 @@ def _euclidean_distances_upcast(X, XX=None, Y=None, YY=None): maxmem = max( ((x_density * n_samples_X + y_density * n_samples_Y) * n_features ...
diff --git a/sklearn/metrics/tests/test_pairwise.py b/sklearn/metrics/tests/test_pairwise.py --- a/sklearn/metrics/tests/test_pairwise.py +++ b/sklearn/metrics/tests/test_pairwise.py @@ -173,6 +173,15 @@ def test_pairwise_boolean_distance(metric): with pytest.warns(DataConversionWarning, match=msg): pairw...
["sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[dice]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[jaccard]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[kulsinski]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance...
["sklearn/metrics/tests/test_pairwise.py::test_pairwise_distances", "sklearn/metrics/tests/test_pairwise.py::test_no_data_conversion_warning", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_precomputed[pairwise_distances]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_precomputed[pairwise_kernels]", "...
null
true
2019-05-11T13:28:11Z
1
14
9
1,926
0
0.8
1
1
1
0.367667
94.303
2,924
swe_bench::test::1618
swe_bench
test
1,618
scikit-learn__scikit-learn-13828
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
f23e92ed4cdc5a952331e597023bd2c9922e6f9d
sklearn.cluster.AffinityPropagation doesn't support sparse affinity matrix #### Description sklearn.cluster.AffinityPropagation doesn't support sparse affinity matrix. A similar question is at #4051. It focuses on default affinity. #### Steps/Code to Reproduce ```python from sklearn.cluster import AffinityPropagation...
Yes, it should be providing a better error message. A pull request doing so is welcome. I don't know affinity propagation well enough to comment on whether we should support a sparse graph as we do with dbscan.. This is applicable only when a sample's nearest neighbours are all that is required to cluster the sample. ...
diff --git a/sklearn/cluster/affinity_propagation_.py b/sklearn/cluster/affinity_propagation_.py --- a/sklearn/cluster/affinity_propagation_.py +++ b/sklearn/cluster/affinity_propagation_.py @@ -364,7 +364,11 @@ def fit(self, X, y=None): y : Ignored """ - X = check_array(X, accept_sparse='csr...
diff --git a/sklearn/cluster/tests/test_affinity_propagation.py b/sklearn/cluster/tests/test_affinity_propagation.py --- a/sklearn/cluster/tests/test_affinity_propagation.py +++ b/sklearn/cluster/tests/test_affinity_propagation.py @@ -63,7 +63,8 @@ def test_affinity_propagation(): assert_raises(ValueError, affinit...
["sklearn/cluster/tests/test_affinity_propagation.py::test_affinity_propagation"]
["sklearn/cluster/tests/test_affinity_propagation.py::test_affinity_propagation_predict", "sklearn/cluster/tests/test_affinity_propagation.py::test_affinity_propagation_predict_error", "sklearn/cluster/tests/test_affinity_propagation.py::test_affinity_propagation_fit_non_convergence", "sklearn/cluster/tests/test_affini...
null
true
2019-05-08T10:22:32Z
1
6
1
2,041
0
0.8
1
1
1
0.360167
94.2805
2,925
swe_bench::test::616
swe_bench
test
616
django__django-14508
django/django
django/django
python
316cc34d046ad86e100227772294f906fae1c2e5
Overwriting a property with field during model inheritance. Description Documentation says (in ​https://docs.djangoproject.com/en/1.3/topics/db/models/#field-name-hiding-is-not-permitted paragraph) that: This restriction only applies to attributes which are Field instances. Normal Python attributes can be overridden i...
I can confirm that this bug exists. It happens with CharFields, but not ForeignKeys. I haven't actually checked, but I'm guessing that the problem lies in the use of contribute_to_class, which would mean that the attribute with the field's name would never actually be set on the class - and thus the property would not ...
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -782,11 +782,7 @@ def contribute_to_class(self, cls, name, private_only=False): self.model = cls cls._meta.add_field(self, priva...
diff --git a/tests/check_framework/tests.py b/tests/check_framework/tests.py --- a/tests/check_framework/tests.py +++ b/tests/check_framework/tests.py @@ -314,6 +314,12 @@ class ModelWithDescriptorCalledCheck(models.Model): obj=ModelWithAttributeCalledCheck, id='models.E020' ...
["test_model_check_method_not_shadowed (check_framework.tests.CheckFrameworkReservedNamesTests)", "In contrast to standard Python MRO, resolution of inherited fields is", "Single layer multiple inheritance is as expected, deriving the", "test_shadow_parent_attribute_with_field (model_inheritance.tests.ModelInheritanceT...
["test_register_and_run_checks (check_framework.tests.SystemCheckFrameworkTests)", "test_register_no_kwargs_error (check_framework.tests.SystemCheckFrameworkTests)", "test_register_run_checks_non_iterable (check_framework.tests.SystemCheckFrameworkTests)", "test_equal_to_same_constructed_check (check_framework.tests.Me...
null
true
2021-06-09T15:04:31Z
1
6
7
1,966
0
0.8
1
1
1
0.347667
94.243
2,926
swe_bench::test::1511
swe_bench
test
1,511
scikit-learn__scikit-learn-10687
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
69e9111b437084f99011dde6ab8ccc848c8c3783
Shape of `coef_` wrong for linear_model.Lasso when using `fit_intercept=False` #### Description Shape of `coef_` wrong for linear_model.Lasso when using `fit_intercept=False` #### Steps/Code to Reproduce Example: ```python import numpy as np from sklearn import linear_model est_intercept = linear_model.Lasso(fit_in...
So coef_ is a 0-dimensional array. Sounds like a misuse of `np.squeeze`. Hi, Jnothman, I am new to this community, may I try this one? @jnothman Sure, if you understand the problem: add a test, fix it, and open a pull request. @jnothman This problem happens to Elastic Net too. Not just Lasso. But I did not find it...
diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -762,8 +762,12 @@ def fit(self, X, y, check_input=True): if n_targets == 1: self.n_iter_ = sel...
diff --git a/sklearn/linear_model/tests/test_coordinate_descent.py b/sklearn/linear_model/tests/test_coordinate_descent.py --- a/sklearn/linear_model/tests/test_coordinate_descent.py +++ b/sklearn/linear_model/tests/test_coordinate_descent.py @@ -803,3 +803,9 @@ def test_enet_l1_ratio(): est.fit(X, y[:, None])...
["sklearn/linear_model/tests/test_coordinate_descent.py::test_coef_shape_not_zero"]
["sklearn/linear_model/tests/test_coordinate_descent.py::test_lasso_zero", "sklearn/linear_model/tests/test_coordinate_descent.py::test_lasso_toy", "sklearn/linear_model/tests/test_coordinate_descent.py::test_enet_toy", "sklearn/linear_model/tests/test_coordinate_descent.py::test_lasso_cv", "sklearn/linear_model/tests/...
null
true
2018-02-24T16:37:13Z
1
6
1
1,959
0
0.8
1
1
1
0.3465
94.2395
2,927
swe_bench::test::1867
swe_bench
test
1,867
sphinx-doc__sphinx-9207
sphinx-doc/sphinx
sphinx-doc/sphinx
python
d2c8cd3c803b27537a4d6f871279fce93d503d82
Sphinx 4.0 finds more than one target for cross-reference Hello everyone, **Describe the bug** After upgrading to 4.0.0 we have discovered that existing code is raising a warning with `more than one target found for cross-reference`. In 3.5.4 we did not see this warning **To Reproduce** I have set up a minimal reprod...
Thank you for reporting. I reproduced the same error with this mark-up: ``` .. py:class:: TestError :module: test :canonical: test.file1.TestError .. py:method:: SomeClass.somemethod() :module: test.file2 :raises .TestError: abc ```
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -1269,9 +1269,13 @@ def resolve_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder if not matches: return None elif len(matches) > 1: - ...
diff --git a/tests/roots/test-domain-py/canonical.rst b/tests/roots/test-domain-py/canonical.rst new file mode 100644 --- /dev/null +++ b/tests/roots/test-domain-py/canonical.rst @@ -0,0 +1,9 @@ +caninical +========= + +:py:class:`.Foo` + +.. py:module:: canonical + +.. py:class:: Foo + :canonical: original.module.Fo...
["tests/test_domain_py.py::test_domain_py_canonical"]
["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-05-10T16:10:03Z
1
10
1
1,856
0
0.8
1
1
1
0.342667
94.228
2,928
swe_bench::dev::47
swe_bench
dev
47
pvlib__pvlib-python-1589
pvlib/pvlib-python
pvlib/pvlib-python
python
bd86597f62013f576670a452869ea88a47c58c01
ZeroDivisionError when gcr is zero **Describe the bug** Though maybe not intuitive, setting ground coverage ratio to zero is useful when a plant consists of a single shed, e.g. calculating the irradiance on the backside of the panels. However, e.g., `bifacial.infinite_sheds.get_irradiance_poa` fails with `ZeroDivision...
@kdebrab thanks for investigating this case, which wasn't consider in the implementation. @pvlib/pvlib-core I think we should fix this. For consistency we should also extend `shading.masking_angle_passias` for the limiting case of `gcr=0`. That may be more complicated and could be done in a second PR. I think `in...
diff --git a/pvlib/bifacial/infinite_sheds.py b/pvlib/bifacial/infinite_sheds.py --- a/pvlib/bifacial/infinite_sheds.py +++ b/pvlib/bifacial/infinite_sheds.py @@ -216,8 +216,8 @@ def _ground_angle(x, surface_tilt, gcr): # : \ v *-.\ # : \<-----P---->\ - x1 = x * sind(surface_tilt...
diff --git a/pvlib/tests/bifacial/test_infinite_sheds.py b/pvlib/tests/bifacial/test_infinite_sheds.py --- a/pvlib/tests/bifacial/test_infinite_sheds.py +++ b/pvlib/tests/bifacial/test_infinite_sheds.py @@ -106,6 +106,14 @@ def test__ground_angle(test_system): assert np.allclose(angles, expected_angles) +def t...
["pvlib/tests/bifacial/test_infinite_sheds.py::test__ground_angle_zero_gcr", "pvlib/tests/test_shading.py::test_masking_angle_zero_gcr"]
["pvlib/tests/bifacial/test_infinite_sheds.py::test__vf_ground_sky_integ", "pvlib/tests/bifacial/test_infinite_sheds.py::test__vf_row_sky_integ", "pvlib/tests/bifacial/test_infinite_sheds.py::test__poa_sky_diffuse_pv", "pvlib/tests/bifacial/test_infinite_sheds.py::test__ground_angle", "pvlib/tests/bifacial/test_infinit...
null
true
2022-11-11T14:19:29Z
2
8
2
1,887
0
0.8
1
1
1
0.341167
94.2235
2,929
swe_bench::test::1834
swe_bench
test
1,834
sphinx-doc__sphinx-8579
sphinx-doc/sphinx
sphinx-doc/sphinx
python
955d6558ec155dffaef999d890c2cdb224cbfbb9
Linkcheck crashes in 3.4.0 **Describe the bug** When running linkcheck in Weblate docs, it crashes with: ``` Exception in thread Thread-2: Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/threading.py", line 932, in _bootstrap_inner Exception occurred: self.run() ...
Hi, Thanks for the report! I can reproduce the issue. I’ll be looking into fixing it later today. I understand what is wrong: Linkcheck organizes the urls to checks in a `PriorityQueue`. The items are tuples `(priority, url, docname, lineno)`. For some links, the `get_node_line()` returns `None`, I’m guessing the ...
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -22,7 +22,7 @@ from urllib.parse import unquote, urlparse from docutils import nodes -from docutils.nodes import Node +from docutils.nodes import Element, Node from requ...
diff --git a/tests/roots/test-linkcheck-localserver-two-links/conf.py b/tests/roots/test-linkcheck-localserver-two-links/conf.py new file mode 100644 --- /dev/null +++ b/tests/roots/test-linkcheck-localserver-two-links/conf.py @@ -0,0 +1 @@ +exclude_patterns = ['_build'] diff --git a/tests/roots/test-linkcheck-localser...
["tests/test_build_linkcheck.py::test_priorityqueue_items_are_comparable"]
["tests/test_build_linkcheck.py::test_defaults", "tests/test_build_linkcheck.py::test_defaults_json", "tests/test_build_linkcheck.py::test_anchors_ignored", "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...
null
true
2020-12-22T20:03:13Z
1
14
1
1,744
0
0.8
1
1
1
0.337333
94.212
2,930
swe_bench::dev::142
swe_bench
dev
142
pylint-dev__astroid-1866
pylint-dev/astroid
pylint-dev/astroid
python
6cf238d089cf4b6753c94cfc089b4a47487711e5
"TypeError: unsupported format string passed to NoneType.__format__" while running type inference in version 2.12.x ### Steps to reproduce I have no concise reproducer. Exception happens every time I run pylint on some internal code, with astroid 2.12.10 and 2.12.12 (debian bookworm). It does _not_ happen with earlier...
Hi @crosser, thanks for the report. > I have no concise reproducer. We might be able to help you distill one. `pylint` produces a crash report, and shows the link in your terminal, like this: ```shell ************* Module a a.py:1:0: F0002: a.py: Fatal error while checking 'a.py'. Please open an issue in o...
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 @@ -954,8 +954,10 @@ def _infer_str_format_call( try: formatted_string = format_template.format(*pos_values, **ke...
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 @@ -103,6 +103,12 @@ def test_string_format(self, format_string: str) -> None: """ "My name is {fname}, I'm {age}".format(fsname = "Daniel"...
["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-11-12T19:21:34Z
1
6
1
1,894
0
0.8
1
1
1
0.335667
94.207
2,931
swe_bench::test::1464
swe_bench
test
1,464
pytest-dev__pytest-8365
pytest-dev/pytest
pytest-dev/pytest
python
4964b468c83c06971eb743fbc57cc404f760c573
tmpdir creation fails when the username contains illegal characters for directory names `tmpdir`, `tmpdir_factory` and `tmp_path_factory` rely on `getpass.getuser()` for determining the `basetemp` directory. I found that the user name returned by `getpass.getuser()` may return characters that are not allowed for direct...
Thanks for the report @pborsutzki!
diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -115,7 +115,12 @@ def getbasetemp(self) -> Path: # use a sub-directory in the temproot to speed-up # make_numbered_dir() call rootdir = temproot.joinpath(f"pytest-...
diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -11,6 +11,7 @@ import pytest from _pytest import pathlib from _pytest.config import Config +from _pytest.monkeypatch import MonkeyPatch from _pytest.pathlib import cleanup_numbered_dir from _py...
["testing/test_tmpdir.py::test_tmp_path_factory_handles_invalid_dir_characters"]
["testing/test_tmpdir.py::TestTempdirHandler::test_mktemp", "testing/test_tmpdir.py::TestTempdirHandler::test_tmppath_relative_basetemp_absolute", "testing/test_tmpdir.py::test_get_user_uid_not_found", "testing/test_tmpdir.py::TestNumberedDir::test_make", "testing/test_tmpdir.py::TestNumberedDir::test_cleanup_lock_crea...
null
true
2021-02-22T20:26:35Z
1
7
1
1,842
0
0.8
1
1
1
0.330333
94.191
2,932
swe_bench::test::1548
swe_bench
test
1,548
scikit-learn__scikit-learn-12443
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
88cdeb85a9303a7b580952b720703a4aca9dc1c0
OneHotEncoder throws unhelpful error messages when tranform called prior to fit #### Description OneHotEncoder throws an `AttributeError` instead of a `NotFittedError` when tranform is called prior to fit - if `transform` is called prior to being fit an `AttributeError` is thrown - if `categories` includes arrays of...
Thanks for the report. Do you want to work on a fix? Sure, I am happy to. Thanks!
diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py --- a/sklearn/preprocessing/_encoders.py +++ b/sklearn/preprocessing/_encoders.py @@ -21,10 +21,8 @@ from .base import _transform_selected from .label import _encode, _encode_check_unknown - range = six.moves.range - __all__ = ...
diff --git a/sklearn/preprocessing/tests/test_encoders.py b/sklearn/preprocessing/tests/test_encoders.py --- a/sklearn/preprocessing/tests/test_encoders.py +++ b/sklearn/preprocessing/tests/test_encoders.py @@ -7,6 +7,7 @@ from scipy import sparse import pytest +from sklearn.exceptions import NotFittedError from s...
["sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_not_fitted", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_no_categorical_features"]
["sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_sparse", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_dense", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_deprecationwarnings", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_force_ne...
null
true
2018-10-23T17:02:13Z
1
11
2
1,464
0
0.8
1
1
1
0.280667
94.042
2,933
swe_bench::test::811
swe_bench
test
811
django__django-16041
django/django
django/django
python
6df9398cce063874ae4d59db126d4adacb0fa8d3
Rendering empty_form crashes when empty_permitted is passed to form_kwargs Description Issue When explicitly setting form_kwargs = {'empty_permitted':True} or form_kwargs = {'empty_permitted':False} , a KeyError occurs when rendering a template that uses a formset's empty_form. Expected Behavior empty_permitted is ign...
Thanks for the report. It should be enough to change form_kwargs for empty_form, e.g. django/forms/formsets.py diff --git a/django/forms/formsets.py b/django/forms/formsets.py index 57676428ff..b73d1d742e 100644 a b class BaseFormSet(RenderableFormMixin): 257257 258258 @property 259259 def empty_form(self): 260 form = ...
diff --git a/django/forms/formsets.py b/django/forms/formsets.py --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -257,14 +257,15 @@ def extra_forms(self): @property def empty_form(self): - form = self.form( - auto_id=self.auto_id, - prefix=self.add_prefix("__pre...
diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py --- a/tests/forms_tests/tests/test_formsets.py +++ b/tests/forms_tests/tests/test_formsets.py @@ -179,6 +179,10 @@ def test_form_kwargs_empty_form(self): self.assertTrue(hasattr(formset.empty_form, "custom_kwarg"))...
["test_empty_permitted_ignored_empty_form (forms_tests.tests.test_formsets.FormsFormsetTestCase)", "test_empty_permitted_ignored_empty_form (forms_tests.tests.test_formsets.Jinja2FormsFormsetTestCase)"]
["all_valid() validates all forms, even when some are invalid.", "test_valid (forms_tests.tests.test_formsets.AllValidTests)", "is_multipart() works with an empty formset.", "An empty formset still calls clean()", "Media is available on empty formset.", "Management forms are already rendered with the new div template."...
null
true
2022-09-09T10:07:29Z
1
15
2
1,250
0
0.8
1
1
1
0.258333
93.975
2,934
swe_bench::test::1222
swe_bench
test
1,222
pydata__xarray-3635
pydata/xarray
pydata/xarray
python
f2b2f9f62ea0f1020262a7ff563bfe74258ffaa1
"ValueError: Percentiles must be in the range [0, 100]" #### MCVE Code Sample ```python import xarray as xr da = xr.DataArray([0, 1, 2]) da.quantile(q=50) >>> ValueError: Percentiles must be in the range [0, 100] ``` #### Expected Output ```python ValueError: Quantiles must be in the range [0, 1] ``` #### Problem D...
Looks straightforward - could you open a PR?
diff --git a/xarray/core/variable.py b/xarray/core/variable.py --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -1731,6 +1731,10 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): scalar = utils.is_scalar(q) q = np.atleast_1d(np.asarray(q, dtype=np.float64)) +...
diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -1542,6 +1542,14 @@ def test_quantile_chunked_dim_error(self): with raises_regex(ValueError, "dimension 'x'"): v.quantile(0.5, dim="x") + @pyte...
["xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[-0.1]", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[1.1]", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[q2]", "xarray/tests/test_variable.py::TestVariable::test_quantile_out_of_bounds[q3...
["xarray/tests/test_variable.py::TestVariable::test_properties", "xarray/tests/test_variable.py::TestVariable::test_attrs", "xarray/tests/test_variable.py::TestVariable::test_getitem_dict", "xarray/tests/test_variable.py::TestVariable::test_getitem_1d", "xarray/tests/test_variable.py::TestVariable::test_getitem_1d_fanc...
null
true
2019-12-17T13:16:40Z
1
6
4
1,425
0
0.8
1
1
1
0.2575
93.9725
2,935
swe_bench::test::1520
swe_bench
test
1,520
scikit-learn__scikit-learn-10913
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
3dab1c4fcc2e34aff69e2c2361620e982820fce4
MultiLabelBinarizer breaks when seeing unseen labels...should there be an option to handle this instead? #### Description I am not sure if it's intended for MultiLabelBinarizer to fit and transform only seen data or not. However, there are many times that it is not possible/not in our interest to know all of the clas...
Yes, I suppose such a setting would be useful. On 6 January 2018 at 06:13, Ploy Temiyasathit <notifications@github.com> wrote: > Description > > I am not sure if it's intended for MultiLabelBinarizer to fit and > transform only seen data or not. > > However, there are many times that it is not possible/not in our int...
diff --git a/sklearn/preprocessing/label.py b/sklearn/preprocessing/label.py --- a/sklearn/preprocessing/label.py +++ b/sklearn/preprocessing/label.py @@ -9,6 +9,7 @@ from collections import defaultdict import itertools import array +import warnings import numpy as np import scipy.sparse as sp @@ -684,6 +685,7 @...
diff --git a/sklearn/preprocessing/tests/test_label.py b/sklearn/preprocessing/tests/test_label.py --- a/sklearn/preprocessing/tests/test_label.py +++ b/sklearn/preprocessing/tests/test_label.py @@ -14,6 +14,7 @@ from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_raises from sklea...
["sklearn/preprocessing/tests/test_label.py::test_multilabel_binarizer_unknown_class"]
["sklearn/preprocessing/tests/test_label.py::test_label_binarizer", "sklearn/preprocessing/tests/test_label.py::test_label_binarizer_unseen_labels", "sklearn/preprocessing/tests/test_label.py::test_label_binarizer_set_label_encoding", "sklearn/preprocessing/tests/test_label.py::test_label_binarizer_errors", "sklearn/pr...
null
true
2018-04-03T18:38:27Z
1
14
1
1,097
0
0.8
1
1
1
0.2295
93.8885
2,936
swe_bench::test::990
swe_bench
test
990
matplotlib__matplotlib-22767
matplotlib/matplotlib
matplotlib/matplotlib
python
b36ef478bd07be1cf525789696d8d0334d913b67
[Bug]: Issue with find_nearest_contour in contour.py ### Bug summary The default for the indices keyword in the find_nearest_contour function within countour.py is defined incorrectly in the code. Line 1377 should be "indices = range(len(self.layers))" instead of "indices = range(len(self.levels))." ### Code for rep...
@jhelmboldt Would you be willing to open a PR with that change + a test? If @jhelmboldt does not want to open a PR, I can make one later today. Thanks, @andrew-fennell. I've never submitted a PR before and don't have time to learn today, so I would appreciate you handling it. Thank you.
diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1334,6 +1334,8 @@ def find_nearest_contour(self, x, y, indices=None, pixel=True): """ Find the point in the contour plot that is closest to ``(x, y)``. + This...
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 @@ -470,6 +470,48 @@ def test_contour_line_start_on_corner_edge(): cbar.add_lines(lines) +def test_find_nearest_contour(): + xy = np....
["lib/matplotlib/tests/test_contour.py::test_find_nearest_contour_no_filled"]
["lib/matplotlib/tests/test_contour.py::test_contour_shape_1d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_2d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args0-Length", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args1-Length", "lib/matplotlib/tests/t...
null
true
2022-04-01T19:11:12Z
1
7
1
1,177
0
0.8
1
1
1
0.2195
93.8585
2,937
swe_bench::dev::148
swe_bench
dev
148
pylint-dev__astroid-2023
pylint-dev/astroid
pylint-dev/astroid
python
2108ae51b516458243c249cf67301cb387e33afa
Invalid variable lookup when walrus operator is used ### Steps to reproduce 1. Consider following code in `loop_error.py`: ``` """Test module""" def walrus_in_comprehension_test_2(some_path, module_namespace): """Suspected error""" for mod in some_path.iterdir(): print(mod) for org_mod i...
## Investigation I tried to understand the possible reason for this warning. ### Minimum reproducible code It seems ultra-rare case, because we cannot: - remove first loop (`for mod in some_path.iterdir():`), - remove first condition (`if org_mod.is_dir():`), - rewrite walrus operator to standard assignment (`...
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -137,10 +137,14 @@ def are_exclusive(stmt1, stmt2, exceptions: list[str] | None = None) -> bool: # if the common parent is a If or TryExcept statement, look ...
diff --git a/tests/test_utils.py b/tests/test_utils.py --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -4,7 +4,10 @@ import unittest -from astroid import Uninferable, builder, nodes +import pytest + +from astroid import Uninferable, builder, extract_node, nodes +from astroid.const import PY38_PLUS from ast...
["tests/test_utils.py::InferenceUtil::test_not_exclusive_walrus_multiple", "tests/test_utils.py::InferenceUtil::test_not_exclusive_walrus_operator", "tests/test_utils.py::InferenceUtil::test_not_exclusive_walrus_operator_nested"]
["tests/test_utils.py::InferenceUtil::test_if", "tests/test_utils.py::InferenceUtil::test_not_exclusive", "tests/test_utils.py::InferenceUtil::test_try_except", "tests/test_utils.py::InferenceUtil::test_unpack_infer_empty_tuple", "tests/test_utils.py::InferenceUtil::test_unpack_infer_uninferable_nodes"]
null
true
2023-02-11T18:13:13Z
1
12
3
988
0
0.8
1
1
1
0.204667
93.814
2,938
swe_bench::test::1630
swe_bench
test
1,630
scikit-learn__scikit-learn-14067
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
7b8cbc875b862ebb81a9b3415bdee235cca99ca6
ARD Regressor accuracy degrades when upgrading Scipy 1.2.1 -> 1.3.0 Hi, bit of a tricky one, I'm hoping someone will have some time and/or suggestions for further investigation! There seems to be an often-occurring worsening of performance (i.e. accuracy, although run-time increases too!) from the ARD regressor when u...
Thanks for the report. After a quick check `ARDRegression` uses `pinvh` from scipy. The cutoff factor for small singular values was recently changed in https://github.com/scipy/scipy/pull/10067 it might be worth setting the previous value in scikit-learn code and see if that allows you to reproduce previous results. T...
diff --git a/sklearn/externals/_scipy_linalg.py b/sklearn/externals/_scipy_linalg.py new file mode 100644 --- /dev/null +++ b/sklearn/externals/_scipy_linalg.py @@ -0,0 +1,118 @@ +# This should remained pinned to version 1.2 and not updated like other +# externals. +"""Copyright (c) 2001-2002 Enthought, Inc. 2003-2019...
diff --git a/sklearn/linear_model/tests/test_bayes.py b/sklearn/linear_model/tests/test_bayes.py --- a/sklearn/linear_model/tests/test_bayes.py +++ b/sklearn/linear_model/tests/test_bayes.py @@ -200,6 +200,24 @@ def test_toy_ard_object(): assert_array_almost_equal(clf.predict(test), [1, 3, 4], 2) +def test_ard...
["sklearn/linear_model/tests/test_bayes.py::test_ard_accuracy_on_easy_problem"]
["sklearn/linear_model/tests/test_bayes.py::test_n_iter", "sklearn/linear_model/tests/test_bayes.py::test_bayesian_ridge_scores", "sklearn/linear_model/tests/test_bayes.py::test_bayesian_ridge_score_values", "sklearn/linear_model/tests/test_bayes.py::test_bayesian_ridge_parameter", "sklearn/linear_model/tests/test_baye...
null
true
2019-06-11T14:13:50Z
3
127
1
5,656
0
0.8
1
0.92
1
0.923333
93.69
2,939
swe_bench::test::1638
swe_bench
test
1,638
scikit-learn__scikit-learn-14430
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
7e022a7e8ba0f95b65d9acade559da95115ad9e5
Pickling Tokenizers fails due to use of lambdas #### Description Cannot pickle a `CountVectorizer` using the builtin python `pickle` module, likely due to the use of lambdas in https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/feature_extraction/text.py #### Steps/Code to Reproduce Example: ```python i...
You're saying we can't pickle the tokenizer, pickling the vectorizer is fine, right? The title says vectorizer. We could rewrite it to allow pickling the tokenizer if we want to support that. There doesn't really seem a reason not to do that, but it's not a very common use-case, right? And I would prefer the fix 2....
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 @@ -15,6 +15,7 @@ import array from collections import defaultdict from collections.abc import Mapping +from functools import partial import numbers ...
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 @@ -480,7 +480,12 @@ def test_vectorizer(): # ascii preprocessor? v3.set_params(strip_accents='as...
["sklearn/feature_extraction/tests/test_text.py::test_pickling_built_processors[build_analyzer]", "sklearn/feature_extraction/tests/test_text.py::test_pickling_built_processors[build_preprocessor]", "sklearn/feature_extraction/tests/test_text.py::test_pickling_built_processors[build_tokenizer]"]
["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[CountVectorizer]", "sklearn/feature_extraction/tests/test_text.py::test_word_analyzer_unigrams[HashingVectoriz...
null
true
2019-07-21T02:47:05Z
1
101
3
3,375
0
0.8
1
0.92
1
0.836667
93.43
2,940
swe_bench::dev::80
swe_bench
dev
80
pydicom__pydicom-1090
pydicom/pydicom
pydicom/pydicom
python
5098c9147fadcb3e5918487036867931435adeb8
Write deflated content when called Transfer Syntax is Deflated Explicit VR Little Endian **Describe the bug** After using `dcmread` to read a deflated .dcm file created from pydicom's [CT_small.dcm sample](https://github.com/pydicom/pydicom/blob/v1.4.2/pydicom/data/test_files/CT_small.dcm), with the following file meta...
Of course, it's entirely possible I'm just not using the library properly. Regardless, here are my original and generated files, as well as the reproduction steps: [write_deflated_file.zip](https://github.com/pydicom/pydicom/files/4557981/write_deflated_file.zip) Thanks for your attention in this. Assuming it's de...
diff --git a/pydicom/filereader.py b/pydicom/filereader.py --- a/pydicom/filereader.py +++ b/pydicom/filereader.py @@ -710,7 +710,7 @@ def read_partial(fileobj, stop_when=None, defer_size=None, is_implicit_VR = False is_little_endian = False elif transfer_syntax == pydicom.uid.DeflatedExplicitVRL...
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 @@ -11,6 +11,7 @@ from struct import unpack from tempfile import TemporaryFile +import zlib import pytest @@ -49,6 +50,7 @@ unicode_name = get_charse...
["pydicom/tests/test_filewriter.py::TestWriteFile::test_write_deflated_retains_elements", "pydicom/tests/test_filewriter.py::TestWriteFile::test_write_deflated_deflates_post_file_meta", "pydicom/tests/test_filewriter.py::TestScratchWriteDateTime::test_write_deflated_retains_elements", "pydicom/tests/test_filewriter.py:...
["pydicom/tests/test_filewriter.py::TestWriteFile::testRTPlan", "pydicom/tests/test_filewriter.py::TestWriteFile::testRTDose", "pydicom/tests/test_filewriter.py::TestWriteFile::testCT", "pydicom/tests/test_filewriter.py::TestWriteFile::testMR", "pydicom/tests/test_filewriter.py::TestWriteFile::testUnicode", "pydicom/te...
null
true
2020-05-01T16:10:56Z
2
92
4
3,275
0
0.8
1
0.92
1
0.806667
93.34
2,941
swe_bench::test::484
swe_bench
test
484
django__django-13589
django/django
django/django
python
83a8da576dc6ccd6986e6426a308b69b9639b818
Saving parent object after setting on child leads to unexpected data loss in bulk_create(). Description Example: class Country(models.Model): name = models.CharField(max_length=255) iso_two_letter = models.CharField(max_length=2) description = models.TextField() class City(models.Model): name = models.CharField(ma...
Duplicate of #29085.
diff --git a/django/db/models/base.py b/django/db/models/base.py --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -679,38 +679,7 @@ def save(self, force_insert=False, force_update=False, using=None, that the "save" must be an SQL insert or update (or equivalent for non-SQL backends), r...
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py --- a/tests/bulk_create/tests.py +++ b/tests/bulk_create/tests.py @@ -321,3 +321,29 @@ def test_ignore_conflicts_ignore(self): # Without ignore_conflicts=True, there's a problem. with self.assertRaises(IntegrityError): T...
["test_nullable_fk_after_parent (bulk_create.tests.BulkCreateTests)", "test_unsaved_parent (bulk_create.tests.BulkCreateTests)"]
["test_batch_same_vals (bulk_create.tests.BulkCreateTests)", "test_bulk_insert_nullable_fields (bulk_create.tests.BulkCreateTests)", "test_efficiency (bulk_create.tests.BulkCreateTests)", "test_empty_model (bulk_create.tests.BulkCreateTests)", "test_explicit_batch_size (bulk_create.tests.BulkCreateTests)", "test_explic...
null
true
2020-10-22T19:05:51Z
2
73
2
2,458
0
0.8
1
1
1
0.653
93.159
2,942
swe_bench::test::1251
swe_bench
test
1,251
pydata__xarray-4758
pydata/xarray
pydata/xarray
python
46591d28d9fbbfc184aaf4075d330b1c8f070627
CFTime offsets missing for milli- and micro-seconds The smallest cftime offset defined in `xarray.coding.cftime_offsets.py` is "second" (S), but the precision of cftime objects goes down to the millisecond (L) and microsecond (U). They should be easily added. PR #4033 adds a `xr.infer_freq` that supports the two, bu...
diff --git a/xarray/coding/cftime_offsets.py b/xarray/coding/cftime_offsets.py --- a/xarray/coding/cftime_offsets.py +++ b/xarray/coding/cftime_offsets.py @@ -576,6 +576,26 @@ def __apply__(self, other): return other + self.as_timedelta() +class Millisecond(BaseCFTimeOffset): + _freq = "L" + + def as...
diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -68,6 +68,7 @@ def LooseVersion(vstring): has_pseudonetcdf, requires_pseudonetcdf = _importorskip("PseudoNetCDF") has_cftime, requires_cftime = _importorskip("cftime") has_cftime_1_1_0, r...
["xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_field_access[year]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_field_access[month]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_field_access[day]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_field_ac...
["xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_isocalendar[year-year]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_isocalendar[week-week]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor::test_isocalendar[weekday-day]", "xarray/tests/test_accessor_dt.py::TestDatetimeAccessor:...
null
true
2021-01-04T00:47:32Z
2
104
160
1,637
0
0.8
1
1
1
0.6195
93.0585
2,943
swe_bench::test::18
swe_bench
test
18
astropy__astropy-13234
astropy/astropy
astropy/astropy
python
11b3214f18b74aea5e3f8349e50ae1b09c39d30e
Structured column serialization round-trip fails with field name of "name" ### Description A structured column with a field name of `name` cannot be round-tripped through ECSV. Along with #13231 this suggests a tweak to the serialization format is needed. Perhaps: ``` # data: !astropy.table.SerializedColumn # ...
diff --git a/astropy/table/serialize.py b/astropy/table/serialize.py --- a/astropy/table/serialize.py +++ b/astropy/table/serialize.py @@ -293,14 +293,18 @@ def _construct_mixin_from_obj_attrs_and_info(obj_attrs, info): # untrusted code by only importing known astropy classes. cls_full_name = obj_attrs.pop('_...
diff --git a/astropy/io/ascii/tests/test_ecsv.py b/astropy/io/ascii/tests/test_ecsv.py --- a/astropy/io/ascii/tests/test_ecsv.py +++ b/astropy/io/ascii/tests/test_ecsv.py @@ -267,15 +267,10 @@ def assert_objects_equal(obj1, obj2, attrs, compare_class=True): if compare_class: assert obj1.__class__ is obj2....
["astropy/io/ascii/tests/test_ecsv.py::test_ecsv_mixins_per_column[1-Table-name_col24]", "astropy/io/ascii/tests/test_ecsv.py::test_ecsv_mixins_per_column[1-Table-name_col25]", "astropy/io/ascii/tests/test_ecsv.py::test_ecsv_mixins_per_column[1-QTable-name_col24]", "astropy/io/ascii/tests/test_ecsv.py::test_ecsv_mixins...
["astropy/io/ascii/tests/test_ecsv.py::astropy.io.ascii.tests.test_ecsv.test_round_trip_masked_table_default", "astropy/io/ascii/tests/test_ecsv.py::test_write_simple", "astropy/io/ascii/tests/test_ecsv.py::test_write_full", "astropy/io/ascii/tests/test_ecsv.py::test_write_read_roundtrip", "astropy/io/ascii/tests/test_...
null
true
2022-05-07T22:16:47Z
1
38
12
2,789
0
0.8
1
1
1
0.5915
92.9745
2,944
swe_bench::test::1688
swe_bench
test
1,688
scikit-learn__scikit-learn-25500
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
4db04923a754b6a2defa1b172f55d492b85d165e
CalibratedClassifierCV doesn't work with `set_config(transform_output="pandas")` ### Describe the bug CalibratedClassifierCV with isotonic regression doesn't work when we previously set `set_config(transform_output="pandas")`. The IsotonicRegression seems to return a dataframe, which is a problem for `_CalibratedClass...
I can reproduce it. We need to investigate but I would expect the inner estimator not being able to handle some dataframe because we expected NumPy arrays before. This could be a bit like https://github.com/scikit-learn/scikit-learn/pull/25370 where things get confused when pandas output is configured. I think the solu...
diff --git a/sklearn/isotonic.py b/sklearn/isotonic.py --- a/sklearn/isotonic.py +++ b/sklearn/isotonic.py @@ -360,23 +360,16 @@ def fit(self, X, y, sample_weight=None): self._build_f(X, y) return self - def transform(self, T): - """Transform new data by linear interpolation. - - Pa...
diff --git a/sklearn/tests/test_isotonic.py b/sklearn/tests/test_isotonic.py --- a/sklearn/tests/test_isotonic.py +++ b/sklearn/tests/test_isotonic.py @@ -5,6 +5,7 @@ import pytest +import sklearn from sklearn.datasets import make_regression from sklearn.isotonic import ( check_increasing, @@ -680,3 +681,24...
["sklearn/tests/test_isotonic.py::test_isotonic_regression_output_predict"]
["sklearn/tests/test_isotonic.py::test_permutation_invariance", "sklearn/tests/test_isotonic.py::test_check_increasing_small_number_of_samples", "sklearn/tests/test_isotonic.py::test_check_increasing_up", "sklearn/tests/test_isotonic.py::test_check_increasing_up_extreme", "sklearn/tests/test_isotonic.py::test_check_inc...
null
true
2023-01-27T19:49:28Z
1
41
1
4,588
0
0.8
1
0.92
1
0.636667
92.83
2,945
swe_bench::test::1224
swe_bench
test
1,224
pydata__xarray-3649
pydata/xarray
pydata/xarray
python
3cbc459caa010f9b5042d3fa312b66c9b2b6c403
combine_by_coords should allow for missing panels in hypercube #### MCVE Code Sample ```python import numpy as np import xarray as xr x1 = xr.Dataset( { "temperature": (("y", "x"), 20 * np.random.rand(6).reshape(2, 3)) }, coords={"y": [0, 1], "x": [10, 20, 30]}, ) x2 = xr.Dataset( { ...
diff --git a/xarray/core/combine.py b/xarray/core/combine.py --- a/xarray/core/combine.py +++ b/xarray/core/combine.py @@ -115,11 +115,12 @@ def _infer_concat_order_from_coords(datasets): return combined_ids, concat_dims -def _check_shape_tile_ids(combined_tile_ids): +def _check_dimension_depth_tile_ids(combin...
diff --git a/xarray/tests/test_combine.py b/xarray/tests/test_combine.py --- a/xarray/tests/test_combine.py +++ b/xarray/tests/test_combine.py @@ -711,6 +711,22 @@ def test_check_for_impossible_ordering(self): ): combine_by_coords([ds1, ds0]) + def test_combine_by_coords_incomplete_hypercube(...
["xarray/tests/test_combine.py::TestCombineAuto::test_combine_by_coords_incomplete_hypercube"]
["xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_1d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_2d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_3d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_single_dataset", "xarray/tests/test_combine.py::Test...
null
true
2019-12-19T22:08:11Z
1
36
1
2,513
0
0.8
1
1
1
0.538833
92.8165
2,946
swe_bench::test::1042
swe_bench
test
1,042
matplotlib__matplotlib-24362
matplotlib/matplotlib
matplotlib/matplotlib
python
aca6e9d5e98811ca37c442217914b15e78127c89
[Bug]: sharex and sharey don't accept 0 and 1 as bool values ### Bug summary When using `0` or `1` in place of `False` or `True` in `sharex` or `sharex` arguments of `pyplot.subplots` an error is raised. ### Code for reproduction ```python import matplotlib.pyplot as plt fig, ax = plt.subplots(ncols=2,sharey=1) ```...
diff --git a/lib/matplotlib/gridspec.py b/lib/matplotlib/gridspec.py --- a/lib/matplotlib/gridspec.py +++ b/lib/matplotlib/gridspec.py @@ -276,21 +276,12 @@ def subplots(self, *, sharex=False, sharey=False, squeeze=True, raise ValueError("GridSpec.subplots() only works for GridSpecs " ...
diff --git a/lib/matplotlib/tests/test_subplots.py b/lib/matplotlib/tests/test_subplots.py --- a/lib/matplotlib/tests/test_subplots.py +++ b/lib/matplotlib/tests/test_subplots.py @@ -84,7 +84,7 @@ def test_shared(): plt.close(f) # test all option combinations - ops = [False, True, 'all', 'none', 'row', '...
["lib/matplotlib/tests/test_subplots.py::test_shared"]
["lib/matplotlib/tests/test_subplots.py::test_label_outer_span", "lib/matplotlib/tests/test_subplots.py::test_label_outer_non_gridspec", "lib/matplotlib/tests/test_subplots.py::test_shared_and_moved", "lib/matplotlib/tests/test_subplots.py::test_exceptions", "lib/matplotlib/tests/test_subplots.py::test_subplots_offsett...
null
true
2022-11-04T10:37:58Z
1
17
1
2,891
0
0.8
1
1
1
0.5385
92.8155
2,947
swe_bench::dev::158
swe_bench
dev
158
pylint-dev__astroid-984
pylint-dev/astroid
pylint-dev/astroid
python
d2394a3e24236106355418e102b1bb0f1bef879c
Pyreverse regression after #857 (astroid 2.5) ### Steps to reproduce 1. Checkout pylint's source (which contains pyreverse) 1. cd `<pylint checkout>` 2. Run `source .tox/py39/bin/activate` or similar (you may need to run a tox session first) 3. Ensure you have `astroid` ac2b173bc8acd2d08f6b6ffe29dd8cda0b2c8814 or later...
Some notes: - The `ModuleNotFoundError` exception is thrown by `importlib.util.find_spec`. Before python 3.7 this was an `AttributeError` - `modutils.is_relative()` is the call-site for the `find_spec` call - It seems that `is_ralative()` is trying to find a parent mod-spec for the anchor `from_file` parameter so ...
diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -292,15 +292,13 @@ def _precache_zipimporters(path=None): new_paths = _cached_set_diff(req_paths, cached_paths) for entry_path in new_pa...
diff --git a/tests/unittest_modutils.py b/tests/unittest_modutils.py --- a/tests/unittest_modutils.py +++ b/tests/unittest_modutils.py @@ -301,6 +301,18 @@ def test_knownValues_is_relative_1(self): def test_knownValues_is_relative_3(self): self.assertFalse(modutils.is_relative("astroid", astroid.__path__[...
["tests/unittest_modutils.py::IsRelativeTest::test_knownValues_is_relative_4", "tests/unittest_modutils.py::IsRelativeTest::test_knownValues_is_relative_5"]
["tests/unittest_modutils.py::ModuleFileTest::test_find_egg_module", "tests/unittest_modutils.py::ModuleFileTest::test_find_zipped_module", "tests/unittest_modutils.py::LoadModuleFromNameTest::test_knownValues_load_module_from_name_1", "tests/unittest_modutils.py::LoadModuleFromNameTest::test_knownValues_load_module_fr...
null
true
2021-05-01T16:13:04Z
3
33
2
3,542
0
0.8
1
0.92
1
0.61
92.75
2,948
swe_bench::test::1320
swe_bench
test
1,320
pylint-dev__pylint-4421
pylint-dev/pylint
pylint-dev/pylint
python
24b5159e00b8a380c1776dab6ce096df7bad79b1
Pylint 2.8.2 broke pylint-quotes ### Steps to reproduce See https://github.com/edaniszewski/pylint-quotes/issues/24 See `pylintrc` in attached [pylint_bug.zip](https://github.com/PyCQA/pylint/files/6393225/pylint_bug.zip) ```bash python -m venv venv . venv/bin/activate pip install -r requirements.txt pylint --rcfile...
Hello, thank you for the report. We changed the tuple from int to string because we can't be sure that we're capable of getting the version from ``importlib_metadata`` so there is a default ``2.8.2+`` value that would not be castable to an int. Okay, but that was a breaking change for plugin developers, and as such I'm...
diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -1,5 +1,6 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/LICENSE +from typing import Tuple from pkg_r...
diff --git a/tests/test_numversion.py b/tests/test_numversion.py new file mode 100644 --- /dev/null +++ b/tests/test_numversion.py @@ -0,0 +1,26 @@ +# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE + +import pytest + +fr...
["tests/test_numversion.py::test_numversion[2.8.1-expected_numversion0]", "tests/test_numversion.py::test_numversion[2.8.2+-expected_numversion1]", "tests/test_numversion.py::test_numversion[3.0.0a0-expected_numversion2]", "tests/test_numversion.py::test_numversion[3..0-expected_numversion3]", "tests/test_numversion.py...
[]
null
true
2021-04-28T20:10:47Z
1
32
11
3,023
0
0.8
1
0.92
1
0.606667
92.74
2,949
swe_bench::test::1201
swe_bench
test
1,201
psf__requests-5087
psf/requests
psf/requests
python
a4c18cd733f97b5659a29589432d8a39e7a0de87
Accessing response.content twice removes forgets read error I had a hard debugging time today because an error in the response stream is only reported when accessing `response.content` for the first time. This is especially irritating when running code in a debugger. ## Expected Result If accessing `response.content...
diff --git a/requests/models.py b/requests/models.py --- a/requests/models.py +++ b/requests/models.py @@ -640,6 +640,10 @@ def __init__(self): #: is a response. self.request = None + #: If there was an error in the processing of content, + #: then save the error that would return the ...
diff --git a/tests/test_lowlevel.py b/tests/test_lowlevel.py --- a/tests/test_lowlevel.py +++ b/tests/test_lowlevel.py @@ -3,6 +3,7 @@ import pytest import threading import requests +from requests.exceptions import ChunkedEncodingError from tests.testserver.server import Server, consume_socket_content @@ -307,3...
["tests/test_lowlevel.py::test_response_content_retains_error"]
["tests/test_lowlevel.py::test_chunked_upload", "tests/test_lowlevel.py::test_digestauth_401_count_reset_on_redirect", "tests/test_lowlevel.py::test_digestauth_401_only_sent_once", "tests/test_lowlevel.py::test_digestauth_only_on_4xx", "tests/test_lowlevel.py::test_redirect_rfc1808_to_non_ascii_location", "tests/test_l...
null
true
2019-05-14T09:18:13Z
1
23
1
2,400
0
0.8
1
1
1
0.476667
92.63
2,950
swe_bench::test::947
swe_bench
test
947
matplotlib__matplotlib-13913
matplotlib/matplotlib
matplotlib/matplotlib
python
dd18211687623c5fa57658990277440814d422f0
`is_color_like` returning erroneous value on strings of integers ### Bug report **Bug summary** `matplotlib.colors.is_color_like` returns `True` on strings containing integers, even though these are invalid colours when passed to `plt.scatter` or equivalent. **Code for reproduction** ```python import matplotlib im...
diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -225,17 +225,23 @@ def _to_rgba_no_colorcycle(c, alpha=None): return tuple(color) # string gray. try: - return (float(c),) * 3 + (alpha if alpha is ...
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 @@ -471,12 +471,6 @@ def test_autoscale_masked(): plt.draw() -def test_colors_no_float(): - # Gray must be a string to distinguish 3-4 gr...
["lib/matplotlib/tests/test_colors.py::test_failed_conversions"]
["lib/matplotlib/tests/test_colors.py::test_resample", "lib/matplotlib/tests/test_colors.py::test_colormap_copy", "lib/matplotlib/tests/test_colors.py::test_colormap_endian", "lib/matplotlib/tests/test_colors.py::test_BoundaryNorm", "lib/matplotlib/tests/test_colors.py::test_LogNorm", "lib/matplotlib/tests/test_colors....
null
true
2019-04-09T23:26:28Z
1
12
1
2,611
0
0.8
1
1
1
0.475167
92.6255
2,951
swe_bench::test::1358
swe_bench
test
1,358
pylint-dev__pylint-7097
pylint-dev/pylint
pylint-dev/pylint
python
c33d237e6ea5795632295bb6390778a21e6f4080
Traceback on unknown encoding ### Steps to reproduce Run Pylint against the following code: ```python # encoding=UTF-9 ``` ### Current behavior ```pytb Traceback (most recent call last): File "/usr/lib/python3.7/tokenize.py", line 397, in find_cookie codec = lookup(encoding) LookupError: unknown encoding: UTF-...
@jwilk thanks for the report. This bug is triggered in the `imp` module that `astroid` uses. To be honest i don't think it worth developing a fix inside `astroid` to solve this kind of issue that is rare and quite easy to avoid. @AWhetter @Pierre-Sassoulas @PCManticore what do you think about it? This is strange, we...
diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -28,6 +28,7 @@ ) from pylint.exceptions import EmptyReportError from pylint.graph import DotBackend, get_cycles +from pylint.interfaces import HIGH from pylint.reporters.ureports...
diff --git a/tests/functional/i/import_error.txt b/tests/functional/i/import_error.txt --- a/tests/functional/i/import_error.txt +++ b/tests/functional/i/import_error.txt @@ -1,5 +1,5 @@ import-error:3:0:3:22::Unable to import 'totally_missing':UNDEFINED import-error:21:4:21:26::Unable to import 'maybe_missing_2':UND...
["tests/test_self.py::TestRunTC::test_stdin_syntax_error"]
["tests/test_self.py::TestRunTC::test_pkginfo", "tests/test_self.py::TestRunTC::test_all", "tests/test_self.py::TestRunTC::test_no_ext_file", "tests/test_self.py::TestRunTC::test_w0704_ignored", "tests/test_self.py::TestRunTC::test_exit_zero", "tests/test_self.py::TestRunTC::test_nonexistent_config_file", "tests/test_s...
null
true
2022-06-30T12:27:56Z
2
18
1
3,104
0
0.8
1
0.92
1
0.56
92.6
2,952
swe_bench::test::1655
swe_bench
test
1,655
scikit-learn__scikit-learn-14890
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
14f5302b7000e9096de93beef37dcdb08f55f128
Fitting TransformedTargetRegressor with sample_weight in Pipeline #### Description Can't fit a `TransformedTargetRegressor` using `sample_weight`. May be link to #10945 ? #### Steps/Code to Reproduce Example: ```python import pandas as pd import numpy as np from sklearn.pipeline import Pipeline from sklearn.preproce...
This has nothing to do with TransformedTargetRegressor. Pipeline requires you to pass model__sample_weight, not just sample_weight... But the error message is terrible! We should improve it. Thank you for your prompt reply @jnothman ### Second try : ```python clf_trans.fit(X_train[use_col], y_train, ...
diff --git a/sklearn/compose/_target.py b/sklearn/compose/_target.py --- a/sklearn/compose/_target.py +++ b/sklearn/compose/_target.py @@ -148,7 +148,7 @@ def _fit_transformer(self, y): " you are sure you want to proceed regardless" ", set 'check_inverse=Fal...
diff --git a/sklearn/compose/tests/test_target.py b/sklearn/compose/tests/test_target.py --- a/sklearn/compose/tests/test_target.py +++ b/sklearn/compose/tests/test_target.py @@ -14,6 +14,8 @@ from sklearn.preprocessing import FunctionTransformer from sklearn.preprocessing import StandardScaler +from sklearn.pipeli...
["sklearn/compose/tests/test_target.py::test_transform_target_regressor_pass_fit_parameters", "sklearn/compose/tests/test_target.py::test_transform_target_regressor_route_pipeline"]
["sklearn/compose/tests/test_target.py::test_transform_target_regressor_error", "sklearn/compose/tests/test_target.py::test_transform_target_regressor_invertible", "sklearn/compose/tests/test_target.py::test_transform_target_regressor_functions", "sklearn/compose/tests/test_target.py::test_transform_target_regressor_fu...
null
true
2019-09-05T13:19:06Z
1
14
2
3,911
0
0.8
1
0.92
1
0.546667
92.56
2,953
swe_bench::dev::82
swe_bench
dev
82
pydicom__pydicom-1192
pydicom/pydicom
pydicom/pydicom
python
1f099ae0f75f0e2ed402a21702e584aac54a30ef
"TypeError: 'NoneType' object is not subscriptable" when reading dcm file with empty string as Chartset and "use_none_as_empty_text_VR_value=True" **Describe the bug** Once thing I noticed is that `convert_encodings` in `charset.py` expects a list of encodings (according to the docstrings) from tag `0008,0005` but it c...
As you wrote, an empty string is not allowed as Specific Character Set, but I agree that this is a case that we shall handle gracefully (e.g. just handle as if the tag were absent). I will have a look.
diff --git a/pydicom/charset.py b/pydicom/charset.py --- a/pydicom/charset.py +++ b/pydicom/charset.py @@ -634,13 +634,16 @@ def convert_encodings(encodings): ``True``. """ - # If a list if passed, we don't want to modify the list in place so copy it - encodings = encodings[:] + encodings = enc...
diff --git a/pydicom/tests/test_charset.py b/pydicom/tests/test_charset.py --- a/pydicom/tests/test_charset.py +++ b/pydicom/tests/test_charset.py @@ -140,6 +140,15 @@ def test_bad_charset(self): pydicom.charset.decode_element(elem, []) assert 'iso8859' in elem.value.encodings + def test_empty_ch...
["pydicom/tests/test_charset.py::TestCharset::test_convert_empty_encoding"]
["pydicom/tests/test_charset.py::TestCharset::test_encodings", "pydicom/tests/test_charset.py::TestCharset::test_nested_character_sets", "pydicom/tests/test_charset.py::TestCharset::test_inherited_character_set_in_sequence", "pydicom/tests/test_charset.py::TestCharset::test_standard_file", "pydicom/tests/test_charset.p...
null
true
2020-09-19T12:22:29Z
1
11
1
3,035
0
0.8
1
0.92
1
0.536667
92.53
2,954
swe_bench::test::817
swe_bench
test
817
django__django-16076
django/django
django/django
python
cfe3008123ed7c9e3f3a4d51d4a22f9d96634e33
Registering lookups on relation fields should be supported. Description (last modified by Thomas) Hello, I have a model, let's call it Parent, with a field called object_id. I have another model, let's call it Child, which has a ForeignKey field called parent_object[_id] pointing to Parent.object_id. I need to do a...
Thanks for the report. Django 4.2 (cd1afd553f9c175ebccfc0f50e72b43b9604bd97) allows ​registering lookups per field instances, so you will be able to register __startswith for parent_object_id, e.g. parent_field = Child._meta.get_field("parent_object_id") with register_lookup(parent_field, StartsWith): Child.objects.fil...
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1278,10 +1278,6 @@ def build_lookup(self, lookups, lhs, rhs): # supports both transform and lookup for the name. lookup_class = lhs.get_lookup(lookup_n...
diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -786,10 +786,16 @@ def test_unsupported_lookups(self): def test_relation_nested_lookup_error(self): # An invalid nested lookup on a related field raises a useful error. - msg = "R...
["test_relation_nested_lookup_error (lookup.tests.LookupTests)", "test_filter_by_related_field_transform (queries.tests.Queries1Tests)"]
["Can create an instance of a model with only the PK field (#17056).\"", "test_ticket_7302 (queries.tests.EscapingTests)", "test_ticket7371 (queries.tests.CustomPkTests)", "test_ticket15786 (queries.tests.Exclude15786)", "test_datetimes_invalid_field (queries.tests.Queries3Tests)", "test_ticket22023 (queries.tests.Quer...
null
true
2022-09-20T11:42:13Z
1
10
2
3,153
0
0.8
1
0.92
1
0.533333
92.52
2,955
swe_bench::test::1040
swe_bench
test
1,040
matplotlib__matplotlib-24265
matplotlib/matplotlib
matplotlib/matplotlib
python
e148998d9bed9d1b53a91587ad48f9bb43c7737f
[Bug]: Setting matplotlib.pyplot.style.library['seaborn-colorblind'] result in key error on matplotlib v3.6.1 ### Bug summary I have code that executes: ``` import matplotlib.pyplot as plt the_rc = plt.style.library["seaborn-colorblind"] ``` Using version 3.4.3 of matplotlib, this works fine. I recently installed my ...
diff --git a/lib/matplotlib/style/core.py b/lib/matplotlib/style/core.py --- a/lib/matplotlib/style/core.py +++ b/lib/matplotlib/style/core.py @@ -43,6 +43,32 @@ class __getattr__: 'toolbar', 'timezone', 'figure.max_open_warning', 'figure.raise_window', 'savefig.directory', 'tk.window_focus', 'docstring....
diff --git a/lib/matplotlib/tests/test_style.py b/lib/matplotlib/tests/test_style.py --- a/lib/matplotlib/tests/test_style.py +++ b/lib/matplotlib/tests/test_style.py @@ -184,6 +184,8 @@ def test_deprecated_seaborn_styles(): with pytest.warns(mpl._api.MatplotlibDeprecationWarning): mpl.style.use("seaborn-...
["lib/matplotlib/tests/test_style.py::test_deprecated_seaborn_styles"]
["lib/matplotlib/tests/test_style.py::test_invalid_rc_warning_includes_filename", "lib/matplotlib/tests/test_style.py::test_available", "lib/matplotlib/tests/test_style.py::test_use", "lib/matplotlib/tests/test_style.py::test_use_url", "lib/matplotlib/tests/test_style.py::test_single_path", "lib/matplotlib/tests/test_s...
null
true
2022-10-25T02:03:19Z
1
69
1
1,236
0
0.8
1
1
1
0.436
92.508
2,956
swe_bench::test::1422
swe_bench
test
1,422
pytest-dev__pytest-6283
pytest-dev/pytest
pytest-dev/pytest
python
6df0b9c41a30c39d4e9c5b560f1b50700a175a61
Calls to logging.xxx() in skipif causes all logging calls to be duplicated to stderr Using pytest 5.2.2 / 5.3.0, when a function called from a `@pytest.mark.skipif` uses a logging function, the captured log calls are duplicated to stderr. Minimal working example: ```python import logging import pytest def _check_con...
Same behaviour when logging from `pytest_configure()`. Hi! I'm a first-time contributor and would like to work on this issue. Do You any suggestions on how to tackle this? You could start by reproducing the issue on your machine. Interestingly, the issue does not occur when `--log-cli-level` is set to at least WARN:...
diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -613,7 +613,13 @@ def pytest_collection(self) -> Generator[None, None, None]: with catching_logs(self.log_file_handler, level=self.log_file_level): yield ...
diff --git a/testing/test_capture.py b/testing/test_capture.py --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1493,3 +1493,32 @@ def test__get_multicapture() -> None: pytest.raises(ValueError, _get_multicapture, "unknown").match( r"^unknown capturing method: 'unknown'" ) + + +def tes...
["testing/test_capture.py::test_logging_while_collecting"]
["test_capsysbinary.py::test_hello", "[100%]", "testing/test_capture.py::TestCaptureManager::test_capturing_basic_api[no]", "testing/test_capture.py::TestCaptureManager::test_capturing_basic_api[sys]", "testing/test_capture.py::TestCaptureManager::test_capturing_basic_api[fd]", "testing/test_capture.py::TestCaptureMana...
null
true
2019-11-27T11:03:42Z
1
8
1
3,153
0
0.8
1
0.92
1
0.526667
92.5
2,957
swe_bench::dev::61
swe_bench
dev
61
pvlib__pvlib-python-1782
pvlib/pvlib-python
pvlib/pvlib-python
python
0bc5a53dedd8aa9e553c732a31003ce020bc2f54
_golden_sect_DataFrame changes in 0.9.4 **Describe the bug** `0.9.4` introduced the following changes in the `_golden_sect_DataFrame`: We are checking `upper` and `lower` parameters and raise an error if `lower > upper`. https://github.com/pvlib/pvlib-python/blob/81598e4fa8a9bd8fadaa7544136579c44885b3d1/pvlib/tools.p...
See #1673 @cedricleroy can you provide the inputs and function call that produced the negative `v_oc` shown above? @echedey-ls Thanks! I thought I checked for related issues, but apparently not enough 😄 @cwhanse Sure thing: Running [`_lambertw_v_from_i` in `_lambertw`](https://github.com/pvlib/pvlib-python/blo...
diff --git a/pvlib/singlediode.py b/pvlib/singlediode.py --- a/pvlib/singlediode.py +++ b/pvlib/singlediode.py @@ -794,6 +794,13 @@ def _lambertw(photocurrent, saturation_current, resistance_series, # Compute open circuit voltage v_oc = _lambertw_v_from_i(0., **params) + # Set small elements <0 in v_oc t...
diff --git a/pvlib/tests/test_singlediode.py b/pvlib/tests/test_singlediode.py --- a/pvlib/tests/test_singlediode.py +++ b/pvlib/tests/test_singlediode.py @@ -168,6 +168,19 @@ def test_singlediode_precision(method, precise_iv_curves): assert np.allclose(pc['i_xx'], outs['i_xx'], atol=1e-6, rtol=0) +def test_si...
["pvlib/tests/test_singlediode.py::test_singlediode_lambert_negative_voc"]
["pvlib/tests/test_singlediode.py::test_method_spr_e20_327[brentq]", "pvlib/tests/test_singlediode.py::test_method_spr_e20_327[newton]", "pvlib/tests/test_singlediode.py::test_newton_fs_495[brentq]", "pvlib/tests/test_singlediode.py::test_newton_fs_495[newton]", "pvlib/tests/test_singlediode.py::test_singlediode_precis...
null
true
2023-06-26T14:46:54Z
1
7
1
3,599
0
0.8
1
0.92
1
0.523333
92.49
2,958
swe_bench::test::1115
swe_bench
test
1,115
matplotlib__matplotlib-26249
matplotlib/matplotlib
matplotlib/matplotlib
python
f017315dd5e56c367e43fc7458fd0ed5fd9482a2
[Bug]: ax.scatter (projection='3d') - incorrect handling of NaN ### Bug summary In axis 3D projection NaN values are not handled correctly, apparently the values are masked out (as it should be) but the mask is not applied to a color array that may not have NaN in the same position. ### Code for reproduction ```pyth...
Thank you for your clear report and diagnosis @2sn. I have reproduced this with our `main` development branch. Change this: https://github.com/matplotlib/matplotlib/blob/f017315dd5e56c367e43fc7458fd0ed5fd9482a2/lib/mpl_toolkits/mplot3d/axes3d.py#L2252 to ``` if kwargs.get('color', None): xs, ys, zs, s...
diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -2249,7 +2249,11 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True, *[np.ravel(np.ma.filled(t, np.nan)) for t in...
diff --git a/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py b/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py --- a/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py @@ -2226,3 +2226,29 @@ def test_mutating_input_arrays_y_and_z(fig_test, fig_ref): y = [0.0, 0.0, 0.0] ...
["lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_scatter_masked_color"]
["lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invisible_axes[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_grid_off[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_invisible_ticks_axis[png]", "lib/mpl_toolkits/mplot3d/tests/test_axes3d.py::test_aspects[png]", "lib/mpl_toolkits/mplot3d/...
null
true
2023-07-04T07:17:41Z
1
6
1
3,838
0
0.8
1
0.92
1
0.52
92.48
2,959
swe_bench::test::1710
swe_bench
test
1,710
scikit-learn__scikit-learn-26400
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
1e8a5b833d1b58f3ab84099c4582239af854b23a
PowerTransformer fails with unhelpful stack trace with all-nan feature and method='box-cox' ### Describe the bug `PowerTransformer("box-cox").fit(x)` throws a difficult-to-debug error if x contains an all-nan column. ### Steps/Code to Reproduce ```python import pandas as pd import numpy as np from sklearn.preproces...
Thank you for opening the issue. I agree this is a bug. It is reasonable to return all nans to be consistent with `yeo-johnson`. Would the following approach be neat enough? ```python def _box_cox_optimize(self, x):     # The computation of lambda is influenced by NaNs so we need to     # get rid of them     x =...
diff --git a/sklearn/preprocessing/_data.py b/sklearn/preprocessing/_data.py --- a/sklearn/preprocessing/_data.py +++ b/sklearn/preprocessing/_data.py @@ -3311,9 +3311,13 @@ def _box_cox_optimize(self, x): We here use scipy builtins which uses the brent optimizer. """ + mask = np.isnan(x) + ...
diff --git a/sklearn/preprocessing/tests/test_data.py b/sklearn/preprocessing/tests/test_data.py --- a/sklearn/preprocessing/tests/test_data.py +++ b/sklearn/preprocessing/tests/test_data.py @@ -2527,6 +2527,21 @@ def test_power_transformer_copy_False(method, standardize): assert X_trans is X_inv_trans +def te...
["sklearn/preprocessing/tests/test_data.py::test_power_transformer_box_cox_raise_all_nans_col"]
["sklearn/preprocessing/tests/test_data.py::test_raises_value_error_if_sample_weights_greater_than_1d", "sklearn/preprocessing/tests/test_data.py::test_standard_scaler_sample_weight[array-Xw0-X0-sample_weight0]", "sklearn/preprocessing/tests/test_data.py::test_standard_scaler_sample_weight[array-Xw1-X1-sample_weight1]"...
null
true
2023-05-19T00:35:48Z
1
6
1
3,297
0
0.8
1
0.92
1
0.52
92.48
2,960
swe_bench::test::1550
swe_bench
test
1,550
scikit-learn__scikit-learn-12471
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
02dc9ed680e7f53f1b0d410dcdd37341c7958eb1
OneHotEncoder ignore unknown error when categories are strings #### Description This bug is very specific, but it happens when you set OneHotEncoder to ignore unknown entries. and your labels are strings. The memory of the arrays is not handled safely and it can lead to a ValueError Basically, when you call the trans...
diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py --- a/sklearn/preprocessing/_encoders.py +++ b/sklearn/preprocessing/_encoders.py @@ -110,7 +110,14 @@ def _transform(self, X, handle_unknown='error'): # continue `The rows are marked `X_mask` and will be ...
diff --git a/sklearn/preprocessing/tests/test_encoders.py b/sklearn/preprocessing/tests/test_encoders.py --- a/sklearn/preprocessing/tests/test_encoders.py +++ b/sklearn/preprocessing/tests/test_encoders.py @@ -273,6 +273,23 @@ def test_one_hot_encoder_no_categorical_features(): assert enc.categories_ == [] +d...
["sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_handle_unknown_strings"]
["sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_sparse", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_dense", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_deprecationwarnings", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_force_ne...
null
true
2018-10-27T10:43:48Z
1
9
1
2,073
0
0.8
1
1
1
0.3755
92.3265
2,961
swe_bench::test::1594
swe_bench
test
1,594
scikit-learn__scikit-learn-13363
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
eda99f3cec70ba90303de0ef3ab7f988657fadb9
return_intercept==True in ridge_regression raises an exception #### Description #### Steps/Code to Reproduce ```python from sklearn.linear_model import ridge_regression ridge_regression([[0], [1], [3]], [0, 1, 3], 1, solver='auto', return_intercept=True) ``` #### Expected Results `(array([1]), 0)` (the values can ...
diff --git a/sklearn/linear_model/ridge.py b/sklearn/linear_model/ridge.py --- a/sklearn/linear_model/ridge.py +++ b/sklearn/linear_model/ridge.py @@ -368,12 +368,25 @@ def _ridge_regression(X, y, alpha, sample_weight=None, solver='auto', return_n_iter=False, return_intercept=False, ...
diff --git a/sklearn/linear_model/tests/test_ridge.py b/sklearn/linear_model/tests/test_ridge.py --- a/sklearn/linear_model/tests/test_ridge.py +++ b/sklearn/linear_model/tests/test_ridge.py @@ -7,6 +7,7 @@ from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_e...
["sklearn/linear_model/tests/test_ridge.py::test_raises_value_error_if_solver_not_supported", "sklearn/linear_model/tests/test_ridge.py::test_ridge_fit_intercept_sparse", "sklearn/linear_model/tests/test_ridge.py::test_ridge_regression_check_arguments_validity[auto-array-None-True]", "sklearn/linear_model/tests/test_ri...
["sklearn/linear_model/tests/test_ridge.py::test_ridge[svd]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[sparse_cg]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[cholesky]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[lsqr]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[sag]", "s...
null
true
2019-03-01T16:25:10Z
1
36
20
1,365
0
0.8
1
1
1
0.3475
92.2425
2,962
swe_bench::dev::131
swe_bench
dev
131
pylint-dev__astroid-1196
pylint-dev/astroid
pylint-dev/astroid
python
39c2a9805970ca57093d32bbaf0e6a63e05041d8
getitem does not infer the actual unpacked value When trying to call `Dict.getitem()` on a context where we have a dict unpacking of anything beside a real dict, astroid currently raises an `AttributeError: 'getitem'`, which has 2 problems: - The object might be a reference against something constant, this pattern is ...
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -2346,24 +2346,33 @@ def itered(self): """ return [key for (key, _) in self.items] - def getitem(self, index, context=None): + def getitem( + ...
diff --git a/tests/unittest_python3.py b/tests/unittest_python3.py --- a/tests/unittest_python3.py +++ b/tests/unittest_python3.py @@ -5,7 +5,9 @@ import unittest from textwrap import dedent -from astroid import nodes +import pytest + +from astroid import exceptions, nodes from astroid.builder import AstroidBuilde...
["tests/unittest_python3.py::Python3TC::test_unpacking_in_dict_getitem_uninferable", "tests/unittest_python3.py::Python3TC::test_unpacking_in_dict_getitem_with_ref"]
["tests/unittest_python3.py::Python3TC::test_annotation_as_string", "tests/unittest_python3.py::Python3TC::test_annotation_support", "tests/unittest_python3.py::Python3TC::test_as_string", "tests/unittest_python3.py::Python3TC::test_async_comprehensions", "tests/unittest_python3.py::Python3TC::test_async_comprehensions...
null
true
2021-10-03T15:58:07Z
1
15
2
1,737
0
0.8
1
1
1
0.3395
92.2185
2,963
swe_bench::test::1706
swe_bench
test
1,706
scikit-learn__scikit-learn-26242
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
b747bacfa1d706bf3c52680566590bfaf0d74363
AdaBoost: deprecation of "base_estimator" does not handle "base_estimator=None" setting properly ### Describe the bug Scikit-learn 1.2 deprecated `AdaBoostClassifier` 's `base_estimator` in favour of `estimator` (see #23819). Because there are also validators in place, old code that explicitly defined `base_estimator=...
diff --git a/sklearn/ensemble/_base.py b/sklearn/ensemble/_base.py --- a/sklearn/ensemble/_base.py +++ b/sklearn/ensemble/_base.py @@ -157,7 +157,7 @@ def _validate_estimator(self, default=None): if self.estimator is not None: self.estimator_ = self.estimator - elif self.base_estimator no...
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 @@ -613,6 +613,27 @@ def test_base_estimator_argument_deprecated(AdaBoost, Estimator): model.fit...
["sklearn/ensemble/tests/test_weight_boosting.py::test_base_estimator_argument_deprecated_none[AdaBoostClassifier]", "sklearn/ensemble/tests/test_weight_boosting.py::test_base_estimator_argument_deprecated_none[AdaBoostRegressor]"]
["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
2023-04-21T12:20:43Z
2
13
2
1,583
0
0.8
1
1
1
0.307167
92.1215
2,964
swe_bench::dev::124
swe_bench
dev
124
pydicom__pydicom-965
pydicom/pydicom
pydicom/pydicom
python
ee775c8a137cd8e0b69b46dc24c23648c31fe34c
Empty data elements with value representation SQ are set to None **Describe the bug** In the current `master`, empty data elements are not read correctly from files. The attribute value is set to `None` instead of `[]`. **Expected behavior** Create empty list `[]` for empty sequence, i.e., a sequence with zero items. ...
diff --git a/pydicom/config.py b/pydicom/config.py --- a/pydicom/config.py +++ b/pydicom/config.py @@ -87,9 +87,10 @@ def DS_decimal(use_Decimal_boolean=True): """ use_none_as_empty_text_VR_value = False -""" If ``True``, the value of decoded empty data element is always ``None``. -If ``False`` (the default), the v...
diff --git a/pydicom/tests/test_dataelem.py b/pydicom/tests/test_dataelem.py --- a/pydicom/tests/test_dataelem.py +++ b/pydicom/tests/test_dataelem.py @@ -503,6 +503,23 @@ def check_empty_binary_element(value): check_empty_binary_element(MultiValue(int, [])) check_empty_binary_element(None) ...
["pydicom/tests/test_dataelem.py::TestDataElement::test_empty_sequence_is_handled_as_array"]
["pydicom/tests/test_dataelem.py::TestDataElement::test_VM_1", "pydicom/tests/test_dataelem.py::TestDataElement::test_VM_2", "pydicom/tests/test_dataelem.py::TestDataElement::test_DSFloat_conversion", "pydicom/tests/test_dataelem.py::TestDataElement::test_backslash", "pydicom/tests/test_dataelem.py::TestDataElement::te...
null
true
2019-11-01T14:43:06Z
2
21
1
1,211
0
0.8
1
1
1
0.271833
92.0155
2,965
swe_bench::dev::106
swe_bench
dev
106
pydicom__pydicom-793
pydicom/pydicom
pydicom/pydicom
python
897fe092ae3ef282a21c894b47134233bdd5cdd0
Print byte values for unknown VR during read #### Description If the dataset read fails due to an unknown VR then the exception message prints the VR bytes in a format that isn't useful for debugging. #### Steps/Code to Reproduce ```python from io import BytesIO from pydicom.filereader import read_dataset ds = read_da...
diff --git a/pydicom/values.py b/pydicom/values.py --- a/pydicom/values.py +++ b/pydicom/values.py @@ -310,7 +310,12 @@ def convert_UR_string(byte_string, is_little_endian, struct_format=None): def convert_value(VR, raw_data_element, encodings=None): """Return the converted value (from raw bytes) for the given VR...
diff --git a/pydicom/tests/test_filereader.py b/pydicom/tests/test_filereader.py --- a/pydicom/tests/test_filereader.py +++ b/pydicom/tests/test_filereader.py @@ -15,7 +15,7 @@ import pydicom.config from pydicom.dataset import Dataset, FileDataset from pydicom.data import get_testdata_files -from pydicom.filereader ...
["pydicom/tests/test_filereader.py::TestUnknownVR::test_fail_decode_msg[\\x00A-0x00", "pydicom/tests/test_filereader.py::TestUnknownVR::test_fail_decode_msg[@A-0x40", "pydicom/tests/test_filereader.py::TestUnknownVR::test_fail_decode_msg[[A-0x5b", "pydicom/tests/test_filereader.py::TestUnknownVR::test_fail_decode_msg[`...
["pydicom/tests/test_filereader.py::ReaderTests::testCT", "pydicom/tests/test_filereader.py::ReaderTests::testCTPixelData", "pydicom/tests/test_filereader.py::ReaderTests::testDeflate", "pydicom/tests/test_filereader.py::ReaderTests::testDir", "pydicom/tests/test_filereader.py::ReaderTests::testEmptyNumbersTag", "pydic...
null
true
2019-01-20T02:31:42Z
1
7
13
1,352
0
0.8
1
1
1
0.248667
91.946
2,966
swe_bench::dev::32
swe_bench
dev
32
pvlib__pvlib-python-1224
pvlib/pvlib-python
pvlib/pvlib-python
python
50dcc7fe412d9e27fe06670b8057e3d8e9ce5b19
It should be impossible to instantiate a PVSystem with no Arrays **Describe the bug** It should be impossible to instantiate a `PVSystem` with no `Arrays`. Currently this is possible via `PVSystem(arrays=[])`. **To Reproduce** Steps to reproduce the behavior: ```python from pvlib import pvsystem pvsystem.PVSystem(arra...
diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -98,8 +98,9 @@ class PVSystem: arrays : iterable of Array, optional List of arrays that are part of the system. If not specified a single array is created from the other parameters (e.g. - ...
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 @@ -2084,6 +2084,12 @@ def test_PVSystem_num_arrays(): assert system_two.num_arrays == 2 +def test_PVSystem_at_least_one_array(): + with pytest.raises(ValueError, + ...
["pvlib/tests/test_pvsystem.py::test_PVSystem_at_least_one_array"]
["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
2021-05-10T15:35:18Z
1
16
1
715
0
0.8
1
1
1
0.1725
91.7175
2,967
swe_bench::dev::189
swe_bench
dev
189
sqlfluff__sqlfluff-2849
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
0bbd70f38a3318b9a488d988d06e8005e222d6ac
Lint and fix throws exception when having jinja for loop inside set ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened To reproduce the error, create test.template.sql ``` {% set whitelisted= [ {'name': 'COL_1'}, ...
diff --git a/plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py b/plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py --- a/plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py +++ b/plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py @@ -522,17 +522,21 @@ def...
diff --git a/test/core/templaters/base_test.py b/test/core/templaters/base_test.py --- a/test/core/templaters/base_test.py +++ b/test/core/templaters/base_test.py @@ -134,6 +134,7 @@ def test__templated_file_get_line_pos_of_char_pos( templated_str=templated_str, sliced_file=file_slices, fname...
["test/core/templaters/base_test.py::test__templated_file_get_line_pos_of_char_pos[01234\\n6789{{foo}}fo\\nbarss-01234\\n6789x\\nfo\\nbarfss-file_slices0-0-1-1]", "test/core/templaters/base_test.py::test__templated_file_get_line_pos_of_char_pos[01234\\n6789{{foo}}fo\\nbarss-01234\\n6789x\\nfo\\nbarfss-file_slices1-20-3...
["test/core/templaters/base_test.py::test__indices_of_newlines[-positions0]", "test/core/templaters/base_test.py::test__indices_of_newlines[foo-positions1]", "test/core/templaters/base_test.py::test__indices_of_newlines[foo\\nbar-positions2]", "test/core/templaters/base_test.py::test__indices_of_newlines[\\nfoo\\n\\nba...
null
true
2022-03-12T21:48:15Z
3
126
18
4,618
0
0.8
1
0.92
1
0.92
91.68
2,968
swe_bench::dev::132
swe_bench
dev
132
pylint-dev__astroid-1262
pylint-dev/astroid
pylint-dev/astroid
python
e840a7c54d3d8b5be2db1e66f34a5368c64fc3f7
``nodes.Module`` don't have a ``end_lineno`` and ``end_col_offset`` ### Steps to reproduce ```python import astroid code = """ print("a module") """ module = astroid.parse(code) print(module.end_lineno) print(module.end_col_offset) ``` ### Current behavior `AttributeError` on both of the last lines. ### E...
diff --git a/astroid/nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes.py --- a/astroid/nodes/scoped_nodes.py +++ b/astroid/nodes/scoped_nodes.py @@ -389,10 +389,8 @@ class Module(LocalsDictNodeNG): :type: int or None """ - lineno = 0 + lineno: Literal[0] = 0 """The line that this node appears o...
diff --git a/tests/unittest_nodes_lineno.py b/tests/unittest_nodes_lineno.py --- a/tests/unittest_nodes_lineno.py +++ b/tests/unittest_nodes_lineno.py @@ -2,6 +2,7 @@ import pytest +import astroid from astroid import builder, nodes from astroid.const import PY38_PLUS, PY39_PLUS, PY310_PLUS @@ -1221,3 +1222,14 ...
["tests/unittest_nodes_lineno.py::TestLinenoColOffset::test_end_lineno_module"]
["tests/unittest_nodes_lineno.py::TestLinenoColOffset::test_end_lineno_container", "tests/unittest_nodes_lineno.py::TestLinenoColOffset::test_end_lineno_name", "tests/unittest_nodes_lineno.py::TestLinenoColOffset::test_end_lineno_attribute", "tests/unittest_nodes_lineno.py::TestLinenoColOffset::test_end_lineno_call", "...
null
true
2021-11-19T16:46:31Z
1
8
1
639
0
0.8
1
1
1
0.133167
91.5995
2,969
swe_bench::test::1699
swe_bench
test
1,699
scikit-learn__scikit-learn-25752
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
b397b8f2d952a26344cc062ff912c663f4afa6d5
KMeans initialization does not use sample weights ### Describe the bug Clustering by KMeans does not weight the input data. ### Steps/Code to Reproduce ```py import numpy as np from sklearn.cluster import KMeans x = np.array([1, 1, 5, 5, 100, 100]) w = 10**np.array([8.,8,8,8,-8,-8]) # large weights for 1 and 5, smal...
Thanks for the reproducible example. `KMeans` **does** weight the data, but your example is an extreme case. Because `Kmeans` is a non-convex problem, the algorithm can get stuck in a local minimum, and not find the true minimum of the optimization landscape. This is the reason why the code proposes to use multiple...
diff --git a/sklearn/cluster/_bicluster.py b/sklearn/cluster/_bicluster.py --- a/sklearn/cluster/_bicluster.py +++ b/sklearn/cluster/_bicluster.py @@ -487,7 +487,7 @@ class SpectralBiclustering(BaseSpectral): >>> clustering.row_labels_ array([1, 1, 1, 0, 0, 0], dtype=int32) >>> clustering.column_labels_ ...
diff --git a/sklearn/cluster/tests/test_bisect_k_means.py b/sklearn/cluster/tests/test_bisect_k_means.py --- a/sklearn/cluster/tests/test_bisect_k_means.py +++ b/sklearn/cluster/tests/test_bisect_k_means.py @@ -4,34 +4,33 @@ from sklearn.utils._testing import assert_array_equal, assert_allclose from sklearn.cluster...
["sklearn/cluster/tests/test_k_means.py::test_sample_weight_init[42-k-means++]", "sklearn/cluster/tests/test_k_means.py::test_sample_weight_init[42-random]", "sklearn/cluster/tests/test_k_means.py::test_sample_weight_zero[42-k-means++]", "sklearn/cluster/tests/test_k_means.py::test_sample_weight_zero[42-random]"]
["sklearn/cluster/tests/test_bisect_k_means.py::test_three_clusters[k-means++-biggest_inertia]", "sklearn/cluster/tests/test_bisect_k_means.py::test_three_clusters[k-means++-largest_cluster]", "sklearn/cluster/tests/test_bisect_k_means.py::test_three_clusters[random-biggest_inertia]", "sklearn/cluster/tests/test_bisect...
null
true
2023-03-03T09:07:31Z
3
123
4
2,152
0
0.8
1
0.85
1
0.768667
91.231
2,970
swe_bench::test::1346
swe_bench
test
1,346
pylint-dev__pylint-6358
pylint-dev/pylint
pylint-dev/pylint
python
1de6da157c260c5a1398bc59c5f2b57abc4912a6
`ignore-imports` option ignored ### Bug description The `ignore-imports=yes` option is ignored in 2.14. Place two files that both read like this (ideally in their own dir so you can just run that dir): ```python import os import sys import argparse import random import math ``` ### Configuration ```ini I reproduced...
I think we put some option in the global configuration namespace but the name is now misleading and should be something like "ignore-import-for-similarity" Edit: It's not has bad as I thought we're still talking about the similarity checker here.. I think I know what is causing this. `set_option` of `Similar` sets the ...
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -19,6 +19,7 @@ from __future__ import annotations +import argparse import copy import functools import itertools @@ -49,7 +50,7 @@ from pylint.checkers import BaseChecker, M...
diff --git a/tests/regrtest_data/duplicate_code/ignore_imports/__init__.py b/tests/regrtest_data/duplicate_code/ignore_imports/__init__.py new file mode 100644 diff --git a/tests/regrtest_data/duplicate_code/ignore_imports/file_one.py b/tests/regrtest_data/duplicate_code/ignore_imports/file_one.py new file mode 100644 ...
["tests/test_similar.py::TestSimilarCodeChecker::test_ignore_imports"]
["tests/test_similar.py::TestSimilarCodeChecker::test_duplicate_code_raw_strings_all", "tests/test_similar.py::TestSimilarCodeChecker::test_duplicate_code_raw_strings_disable_file", "tests/test_similar.py::TestSimilarCodeChecker::test_duplicate_code_raw_strings_disable_file_double", "tests/test_similar.py::TestSimilarC...
null
true
2022-04-16T15:48:16Z
1
80
1
2,211
0
0.8
1
0.85
1
0.635167
90.8305
2,971
swe_bench::test::341
swe_bench
test
341
django__django-12518
django/django
django/django
python
370628673b98ada302c3930865c4bfde2d8ed5a1
sqlmigrate doesn't allow inspecting migrations that have been squashed Description This project for another ticket can be used to reproduce: ​https://github.com/adamchainz/django-unique-together-bug When running sqlmigrate to pick up migration 0001 in this project, it complains that two migrations have that prefix: $ ...
Hi! This seems quite relevant to me, as in the company I work for, we'll probably start using squashed migration soon-ish and we use sqlmigrate extensively. I'd like to tackle this change :) It does not seem too complicated to allowed inspecting the SQL of replaced migrations. I already wrote a small test that reproduc...
diff --git a/django/core/management/commands/sqlmigrate.py b/django/core/management/commands/sqlmigrate.py --- a/django/core/management/commands/sqlmigrate.py +++ b/django/core/management/commands/sqlmigrate.py @@ -1,8 +1,7 @@ from django.apps import apps from django.core.management.base import BaseCommand, CommandEr...
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -695,6 +695,32 @@ def test_sqlmigrate_for_non_transactional_databases(self): self.assertNotIn(start_transaction_sql.lower(), queries) ...
["test_sqlmigrate_replaced_migration (migrations.test_commands.MigrateTests)"]
["test_makemigrations_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests)", "test_makemigrations_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests)", "test_migrate_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests)", "test_migrate_nonexistent_app_label (migr...
null
true
2020-03-01T22:17:19Z
3
97
1
1,850
0
0.8
1
0.85
1
0.631667
90.82
2,972
swe_bench::test::1105
swe_bench
test
1,105
matplotlib__matplotlib-26078
matplotlib/matplotlib
matplotlib/matplotlib
python
fc350ea5343cf96e231656d97d4b7ac2f32c97d8
[Bug]: parasite_axes does not properly handle units ### Bug summary When plotting on a parasite axis using `axes_grid1.parasite_axes`, units are not automatically applied to the parasite axis. ### Code for reproduction ```python #!/usr/bin/env python3 from mpl_toolkits.axes_grid1 import host_subplot from mpl_toolki...
Have you tried this with the standard `axes.twinx`? If this didn't work there, it is likely to get more support than in the axes_grid toolkit. AFAICT this bug is specific to `axes_grid1` (and is caused by the line of code identified above). Edit: I start working on this issue and submit a PR by the end of today. Pleas...
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 @@ -1720,7 +1720,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs): (``'green'``) or hex strings (``'#008000'``). """ kwargs =...
diff --git a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py --- a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py +++ b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py @@ -27,7 +27,6 @@ zoomed_inset_axes, mark_inset, inset_axes, BboxConnectorPa...
["lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_twin_axes_both_with_units"]
["lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_divider_append_axes", "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_twin_axes_empty_and_removed[png]", "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_axesgrid_colorbar_log_smoketest", "lib/mpl_toolkits/axes_grid1/tests/test_axes_gri...
null
true
2023-06-05T17:05:05Z
3
44
1
2,898
0
0.8
1
0.85
1
0.629667
90.814
2,973
swe_bench::dev::87
swe_bench
dev
87
pydicom__pydicom-1255
pydicom/pydicom
pydicom/pydicom
python
59be4993000cc8af2cd9a4176f15398b6a7875d7
Mypy errors **Describe the bug** Several of the type hints are problematic and result in mypy errors. One example: ```none cat << EOF > /tmp/test.py from pydicom import Dataset, dcmread dataset = Dataset() dataset.Rows = 10 dataset.Columns = 20 dataset.NumberOfFrames = "5" assert int(dataset.NumberOfFrames) == 5 f...
I ran into multiple other errors and would suggest removing `py.typed` until the type annotations have been properly tested. @hackermd, just for my education, since I have only dabbled in 'typing' so far - does this break your workflow somehow? Is it not possible to exclude pydicom from forcing errors? (other than r...
diff --git a/pydicom/_version.py b/pydicom/_version.py --- a/pydicom/_version.py +++ b/pydicom/_version.py @@ -3,7 +3,7 @@ from typing import Tuple -__version__: str = '2.1.0' +__version__: str = '2.1.1' __version_info__: Tuple[str, str, str] = tuple( re.match(r'(\d+\.\d+\.\d+).*', __version__).group(1).spli...
diff --git a/pydicom/tests/test_json.py b/pydicom/tests/test_json.py --- a/pydicom/tests/test_json.py +++ b/pydicom/tests/test_json.py @@ -354,3 +354,25 @@ def bulk_data_reader(tag, vr, value): ds = Dataset().from_json(json.dumps(json_data), bulk_data_reader) assert b'xyzzy' == ds[0x00091002].value ...
["pydicom/tests/test_json.py::TestBinary::test_bulk_data_reader_is_called_within_SQ"]
["pydicom/tests/test_json.py::TestPersonName::test_json_pn_from_file", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_to_json", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_from_json", "pydicom/tests/test_json.py::TestPersonName::test_empty_value", "pydicom/tests/test_json.py::TestPe...
null
true
2020-11-04T20:55:23Z
4
16
1
2,023
0
0.8
1
1
0.85
0.3905
90.809
2,974
swe_bench::test::1157
swe_bench
test
1,157
pallets__flask-4642
pallets/flask
pallets/flask
python
97298e06fe19298c3ff9d2e0ed9ba70bb3fda2c8
FlaskGroup does not work when nested in a click.group ### Expected Behavior When using Flask CLI, I came to the case that we have a group of commands for a big program that uses `click`. ```python # main group @click.group() @click.pass_context def my_big_cli_group(ctx): pass # sub group @my_big_cli_group.group() ...
There are some bootstrap code in `FlaskGroup.main()`, so I think it is not allowed to nest it in another group, because the function is never called. Ah, interesting. Could there be any workaround for this to be allowed? I guess at the end `Flask` should be fully compatible with all `click` functionalities (group `nest...
diff --git a/src/flask/app.py b/src/flask/app.py --- a/src/flask/app.py +++ b/src/flask/app.py @@ -10,6 +10,7 @@ from threading import Lock from types import TracebackType +import click from werkzeug.datastructures import Headers from werkzeug.datastructures import ImmutableDict from werkzeug.exceptions import A...
diff --git a/tests/test_cli.py b/tests/test_cli.py --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -388,6 +388,19 @@ def test(): assert result.output == f"{not set_debug_flag}\n" +def test_flaskgroup_nested(app, runner): + cli = click.Group("cli") + flask_group = FlaskGroup(name="flask", create_app=la...
["tests/test_cli.py::test_flaskgroup_nested"]
["tests/test_cli.py::test_cli_name", "tests/test_cli.py::test_find_best_app", "tests/test_cli.py::test_prepare_import[test-path0-test]", "tests/test_cli.py::test_prepare_import[test.py-path1-test]", "tests/test_cli.py::test_prepare_import[a/test-path2-test]", "tests/test_cli.py::test_prepare_import[test/__init__.py-pat...
null
true
2022-06-15T21:14:32Z
3
76
1
2,232
0
0.8
1
0.85
1
0.625333
90.801
2,975
swe_bench::dev::118
swe_bench
dev
118
pydicom__pydicom-916
pydicom/pydicom
pydicom/pydicom
python
a94cc9996d2c716298c846f2dbba84f9f901e0a7
To_Json 'str' object has no attribute 'components' #### Description When converting a dataset to json the following error occurs. ``` Traceback (most recent call last): File "/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/anaconda3/lib/python3.6/threading.py", line 864...
Thanks for the report! For some reason, the value is not a `PersonName3` instance, as expected, but a string - this is obviously a bug. No need to provide a test dataset, as this is reproducible with existing test data. I will have a look tonight. Awesome. Thank you very much. This is the last hurdle for our project....
diff --git a/pydicom/dataelem.py b/pydicom/dataelem.py --- a/pydicom/dataelem.py +++ b/pydicom/dataelem.py @@ -329,41 +329,60 @@ def from_json(cls, dataset_class, tag, vr, value, value_key, # Some DICOMweb services get this wrong, so we # workaround the issue and warn the user ...
diff --git a/pydicom/tests/test_json.py b/pydicom/tests/test_json.py --- a/pydicom/tests/test_json.py +++ b/pydicom/tests/test_json.py @@ -1,89 +1,226 @@ # -*- coding: utf-8 -*- # Copyright 2008-2019 pydicom authors. See LICENSE file for details. +import json + import pytest + +from pydicom import dcmread, compat f...
["pydicom/tests/test_json.py::TestPersonName::test_PN_components_to_json", "pydicom/tests/test_json.py::TestPersonName::test_PN_components_from_json", "pydicom/tests/test_json.py::TestPersonName::test_empty_value", "pydicom/tests/test_json.py::TestPersonName::test_multi_value_to_json", "pydicom/tests/test_json.py::Test...
["pydicom/tests/test_json.py::TestPersonName::test_json_PN_from_file", "pydicom/tests/test_json.py::TestPersonName::test_dataelem_from_json", "pydicom/tests/test_json.py::TestDataSetToJson::test_json_private_DS_VM"]
null
true
2019-08-06T19:27:04Z
3
133
9
973
0
0.8
1
0.85
1
0.6055
90.7415
2,976
swe_bench::test::1636
swe_bench
test
1,636
scikit-learn__scikit-learn-14237
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
ecea98f9c965fbb25d2dfb1fdc23784364aa5657
Named col indexing fails with ColumnTransformer remainder on changing DataFrame column ordering #### Description I am using ColumnTransformer to prepare (impute etc.) heterogenous data. I use a DataFrame to have more control on the different (types of) columns by their name. I had some really cryptic problems when dow...
We have problems with column reordering in all estimators, but this is the only one where we directly support access by name, so I agree this is a priority to fix. I think raising an error if`columns` differs between fit and transform, and 'remainder' is used, would be a reasonable behaviour. Pull request welcome. I've...
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 @@ -19,6 +19,7 @@ from ..utils import Bunch from ..utils import safe_indexing from ..utils import _get_column_indices +from ..utils im...
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 @@ -492,6 +492,17 @@ def test_column_transformer_invalid_columns(remainder): assert_rais...
["sklearn/compose/tests/test_column_transformer.py::test_column_transformer_invalid_columns[drop]", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_invalid_columns[passthrough]", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_reordered_column_names_remainder[first]...
["sklearn/compose/tests/test_column_transformer.py::test_column_transformer", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_dataframe", "sklearn/compose/tests/test_column_transformer.py::test_column_transformer_empty_columns[list-pandas]", "sklearn/compose/tests/test_column_transformer.py::...
null
true
2019-07-02T18:11:20Z
1
34
4
2,924
0
0.8
1
0.85
1
0.600667
90.727
2,977
swe_bench::test::1518
swe_bench
test
1,518
scikit-learn__scikit-learn-10899
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
12cdb8323c1a4018fcc97dc5a0014a0ba7b44593
Setting idf_ is impossible #### Context Rather than a bug i guess that would go as a sort of "enhancement proposition" ? I'm currently trying to persist a `TfidfTransformer` by basically saving its parameters in a mongoDB database and then rebuilding it alike. This technique works for `CountVectorizer` but simply bl...
I'd be happy to see a setter for idf_. > I'd be happy to see a setter for idf_. But that's not what the TfidfTransformer uses internally. Shouldn't the user be setting the _idf_diag matrix rather? I agree that setting a private attribute is ugly, so the question is: shouldn't we make it public? What's wrong with pr...
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 @@ -1062,6 +1062,12 @@ class TfidfTransformer(BaseEstimator, TransformerMixin): sublinear_tf : boolean, default=False Apply sublinear tf sc...
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 @@ -942,6 +942,35 @@ def test_pickling_transformer(): orig.fit_transform(X).toarray()) +def test...
["sklearn/feature_extraction/tests/test_text.py::test_transformer_idf_setter", "sklearn/feature_extraction/tests/test_text.py::test_tfidf_vectorizer_setter", "sklearn/feature_extraction/tests/test_text.py::test_tfidfvectorizer_invalid_idf_attr"]
["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-04-01T02:58:12Z
1
29
3
2,999
0
0.8
1
0.85
1
0.5965
90.7145
2,978
swe_bench::test::1296
swe_bench
test
1,296
pydata__xarray-6999
pydata/xarray
pydata/xarray
python
1f4be33365573da19a684dd7f2fc97ace5d28710
[Bug]: rename_vars to dimension coordinate does not create an index ### What happened? We used `Data{set,Array}.rename{_vars}({coord: dim_coord})` to make a coordinate a dimension coordinate (instead of `set_index`). This results in the coordinate correctly being displayed as a dimension coordinate (with the *) but it...
This has been discussed in #4825. A third option for `rename{_vars}` would be to rename the coordinate and its index (if any), regardless of whether the old and new names correspond to existing dimensions. We plan to drop the concept of a "dimension coordinate" with an implicit index in favor of indexes explicitly p...
diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2032,11 +2032,11 @@ def rename( if utils.is_dict_like(new_name_or_name_dict) or new_name_or_name_dict is None: # change dims/coords name_dict = either_dic...
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 @@ -1742,6 +1742,23 @@ def test_rename(self) -> None: ) assert_identical(renamed_all, expected_all) + def test_rename_dimension_coord_warnings(sel...
["xarray/tests/test_dataarray.py::TestDataArray::test_rename_dimension_coord_warnings", "xarray/tests/test_dataset.py::TestDataset::test_rename_dimension_coord_warnings"]
["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-06T16:16:17Z
2
59
2
2,382
0
0.8
1
0.85
1
0.593667
90.706
2,979
swe_bench::test::1014
swe_bench
test
1,014
matplotlib__matplotlib-23288
matplotlib/matplotlib
matplotlib/matplotlib
python
047254dd0c5fcf602a19b245e3b14a38d1af1614
[Bug]: URL-area not rotated in PDFs ### Bug summary The URL-sensitive area is not rotated in the PDF output ### Code for reproduction ```python import matplotlib.pyplot as plt plt.text(0.5, 0.5, "Long text with link", rotation=45, url="https://matplotlib.org") plt.savefig("link.pdf") ``` ### Actual outcome Note t...
This illustrates the problem. ![image](https://user-images.githubusercontent.com/8114497/172552528-5870a43c-689a-407b-8bee-627f70cdd46e.png) The green dashed box is the current clickable Rect. It should be the black box, which can be specified using QuadPoints. However, the new Rect should be the dotted blue. T...
diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py --- a/lib/matplotlib/backends/backend_pdf.py +++ b/lib/matplotlib/backends/backend_pdf.py @@ -250,6 +250,68 @@ def _datetime_to_pdf(d): return r +def _calculate_quad_point_coordinates(x, y, width, height, angle=0): + ...
diff --git a/lib/matplotlib/tests/test_backend_pdf.py b/lib/matplotlib/tests/test_backend_pdf.py --- a/lib/matplotlib/tests/test_backend_pdf.py +++ b/lib/matplotlib/tests/test_backend_pdf.py @@ -243,10 +243,37 @@ def test_text_urls(): (a for a in annots if a.A.URI == f'{test_url}{fragment}'), ...
["lib/matplotlib/tests/test_backend_pdf.py::test_text_rotated_urls"]
["lib/matplotlib/tests/test_backend_pdf.py::test_use14corefonts[pdf]", "lib/matplotlib/tests/test_backend_pdf.py::test_embed_fonts[3-DejaVu", "lib/matplotlib/tests/test_backend_pdf.py::test_embed_fonts[42-DejaVu", "lib/matplotlib/tests/test_backend_pdf.py::test_multipage_pagecount", "lib/matplotlib/tests/test_backend_p...
null
true
2022-06-16T09:26:53Z
1
101
1
1,537
0
0.8
1
0.85
1
0.592833
90.7035
2,980
swe_bench::test::1247
swe_bench
test
1,247
pydata__xarray-4684
pydata/xarray
pydata/xarray
python
0f1eb96c924bad60ea87edd9139325adabfefa33
Millisecond precision is lost on datetime64 during IO roundtrip I have millisecond-resolution time data as a coordinate on a DataArray. That data loses precision when round-tripping through disk. #### MCVE Code Sample [bug_data.p.zip](https://github.com/pydata/xarray/files/4595145/bug_data.p.zip) Unzip the data. It...
This has something to do with the time values at some point being a float: ```python >>> import numpy as np >>> np.datetime64("2017-02-22T16:24:10.586000000").astype("float64").astype(np.dtype('<M8[ns]')) numpy.datetime64('2017-02-22T16:24:10.585999872') ``` It looks like this is happening somewhere in the [c...
diff --git a/xarray/coding/times.py b/xarray/coding/times.py --- a/xarray/coding/times.py +++ b/xarray/coding/times.py @@ -26,6 +26,7 @@ _STANDARD_CALENDARS = {"standard", "gregorian", "proleptic_gregorian"} _NS_PER_TIME_DELTA = { + "ns": 1, "us": int(1e3), "ms": int(1e6), "s": int(1e9), @@ -35,7 ...
diff --git a/xarray/tests/test_coding_times.py b/xarray/tests/test_coding_times.py --- a/xarray/tests/test_coding_times.py +++ b/xarray/tests/test_coding_times.py @@ -6,7 +6,7 @@ import pytest from pandas.errors import OutOfBoundsDatetime -from xarray import DataArray, Dataset, Variable, coding, decode_cf +from xar...
["xarray/tests/test_coding_times.py::test_infer_datetime_units[N-nanoseconds]", "xarray/tests/test_coding_times.py::test_infer_datetime_units[U-microseconds]", "xarray/tests/test_coding_times.py::test_infer_datetime_units[L-milliseconds]", "xarray/tests/test_coding_times.py::test_cf_timedelta[1ns-nanoseconds-numbers5]"...
["xarray/tests/test_coding_times.py::test_cf_datetime[num_dates0-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates1-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates2-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates3-days", "xarray/tests/test_coding_times.py:...
null
true
2020-12-12T21:43:57Z
1
70
15
2,137
0
0.8
1
0.85
1
0.5895
90.6935
2,981
swe_bench::dev::184
swe_bench
dev
184
sqlfluff__sqlfluff-2509
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
5c104a71c54ce4ed83401d62dfaaa86be38e5aff
noqa is ignored for jinja templated lines ## Expected Behaviour Line with `noqa: TMP` should be ignored (despite of evaluation error) ## Observed Behaviour trying to lint airflow sql-template for AWS Athena query setting up inline `-- noqa` or `--noqa: TMP` for jinja templated line not silenting templating error (type...
As discussed on slack: Checking a few versions back your example has never worked. I think the templating ignoring is pretty basic (it's not included in our documentation). So this works: ```sql SELECT {{ test }} --noqa: TMP FROM table1 ``` But think anything beyond that simple use case, it strugg...
diff --git a/src/sqlfluff/core/linter/common.py b/src/sqlfluff/core/linter/common.py --- a/src/sqlfluff/core/linter/common.py +++ b/src/sqlfluff/core/linter/common.py @@ -42,6 +42,7 @@ class RenderedFile(NamedTuple): time_dict: Dict[str, float] fname: str encoding: str + source_str: str class Par...
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 @@ -708,18 +708,42 @@ def test_linter_noqa_with_templating(): assert not result.get_violations() +def test_linter_noqa_template_errors(): + """Similar to test_linter_noqa, but uses ...
["test/core/linter_test.py::test_linter_noqa_template_errors", "test/core/linter_test.py::test_linter_noqa_prs"]
["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-01-29T20:32:14Z
3
70
2
2,094
0
0.8
1
0.85
1
0.582333
90.672
2,982
swe_bench::test::467
swe_bench
test
467
django__django-13484
django/django
django/django
python
292b3be698ef58aff9c215d62a444f66ead578c3
Queryset crashes when recreated from a pickled query with FilteredRelation used in aggregation. Description I am pickling query objects (queryset.query) for later re-evaluation as per ​https://docs.djangoproject.com/en/2.2/ref/models/querysets/#pickling-querysets. However, when I tried to rerun a query that contains a...
Thanks for this ticket, I was able to reproduce this issue. Tests. Just a note, the failing queryset does not have to be constructed by setting the query param of a newly created queryset - like this: qs2 = Publication.objects.all() qs2.query = pickle.loads(pickle.dumps(qs.query)) The same problem occurs even if the wh...
diff --git a/django/db/models/fields/reverse_related.py b/django/db/models/fields/reverse_related.py --- a/django/db/models/fields/reverse_related.py +++ b/django/db/models/fields/reverse_related.py @@ -11,6 +11,7 @@ from django.core import exceptions from django.utils.functional import cached_property +from django...
diff --git a/tests/queryset_pickle/tests.py b/tests/queryset_pickle/tests.py --- a/tests/queryset_pickle/tests.py +++ b/tests/queryset_pickle/tests.py @@ -219,6 +219,40 @@ def test_pickle_subquery_queryset_not_evaluated(self): with self.assertNumQueries(0): self.assert_pickles(groups) + def t...
["test_pickle_filteredrelation (queryset_pickle.tests.PickleabilityTestCase)", "test_pickle_filteredrelation_m2m (queryset_pickle.tests.PickleabilityTestCase)"]
["test_in_lookup_query_evaluation (queryset_pickle.tests.InLookupTests)", "test_in_lookup_queryset_evaluation (queryset_pickle.tests.InLookupTests)", "test_annotation_values (queryset_pickle.tests.PickleabilityTestCase)", "test_annotation_values_list (queryset_pickle.tests.PickleabilityTestCase)", "test_annotation_with...
null
true
2020-10-03T18:50:41Z
1
35
2
2,777
0
0.8
1
0.85
1
0.5795
90.6635
2,983
swe_bench::test::1127
swe_bench
test
1,127
matplotlib__matplotlib-26479
matplotlib/matplotlib
matplotlib/matplotlib
python
04492d95a12328373161d7b8ffc8c2f4b0575974
Postscript backend gives wrong page sizes ### Bug report **Bug summary** When creating a Figure of exactly A4 size, the PS backend chooses "letter" as document type, leading to additional borders of the output in x direction and undesired cropping in y direction. **Code for reproduction** ```python import matplotli...
This appears to have been added in 8b01579 without explaining why (before that commit, ps simply did not set the DocumentPaperSize entry). I agree there's no particular reason to restrict postscript output to a fixed number of sizes; conversely other output formats (in particular, pdf) may benefit from this kind of si...
diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -841,7 +841,7 @@ def _print_ps( if papertype is None: papertype = mpl.rcParams['ps.papersize'] papertype = ...
diff --git a/lib/matplotlib/tests/test_backend_ps.py b/lib/matplotlib/tests/test_backend_ps.py --- a/lib/matplotlib/tests/test_backend_ps.py +++ b/lib/matplotlib/tests/test_backend_ps.py @@ -20,6 +20,7 @@ # This tests tends to hit a TeX cache lock on AppVeyor. @pytest.mark.flaky(reruns=3) +@pytest.mark.parametrize(...
["lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps-portrait-figure]", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps-landscape-figure]", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[eps-portrait-figure]", "lib/matplotlib/tests/test_backend_ps.py::test_sav...
["lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps-portrait-letter]", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps-landscape-letter]", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[ps", "lib/matplotlib/tests/test_backend_ps.py::test_savefig_to_stringio[e...
null
true
2023-08-09T09:45:45Z
2
55
4
2,375
0
0.8
1
0.85
1
0.579167
90.6625
2,984
swe_bench::test::1396
swe_bench
test
1,396
pytest-dev__pytest-5205
pytest-dev/pytest
pytest-dev/pytest
python
3a4a815c41badd1a6bac958aa18ddeb0c16cd202
Invalid XML schema for <properties> tags in JUnit reports The problem: JUnit breaks when it reads an XML generated by pytest if plugins make use of `record-property`. This behavior happens with newer versions of hypothesis (https://github.com/HypothesisWorks/hypothesis/issues/1935). ``` [xUnit] [ERROR] - The result...
cc @nicoddemus Thanks @danilomendesdias!
diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -345,6 +345,45 @@ def add_attr_noop(name, value): return attr_func +def _check_record_param_type(param, v): + """Used by record_testsuite_property to check that the given parameter n...
diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1243,6 +1243,53 @@ class Report(BaseReport): ), "The URL did not get written to the xml" +def test_record_testsuite_property(testdir): + testdir.makepyfile( + """ + ...
["testing/test_junitxml.py::test_record_testsuite_property", "testing/test_junitxml.py::test_record_testsuite_property_junit_disabled", "testing/test_junitxml.py::test_record_testsuite_property_type_checking[True]", "testing/test_junitxml.py::test_record_testsuite_property_type_checking[False]"]
["testing/test_junitxml.py::test_mangle_test_address", "testing/test_junitxml.py::test_dont_configure_on_slaves", "testing/test_junitxml.py::test_invalid_xml_escape", "testing/test_junitxml.py::test_logxml_path_expansion", "testing/test_junitxml.py::TestPython::test_summing_simple", "testing/test_junitxml.py::TestPytho...
null
true
2019-05-03T19:34:15Z
1
44
4
2,531
0
0.8
1
0.85
1
0.5685
90.6305
2,985
swe_bench::test::996
swe_bench
test
996
matplotlib__matplotlib-22926
matplotlib/matplotlib
matplotlib/matplotlib
python
e779b97174ff3ab2737fbdffb432ef8689201602
[Bug]: cannot give init value for RangeSlider widget ### Bug summary I think `xy[4] = .25, val[0]` should be commented in /matplotlib/widgets. py", line 915, in set_val as it prevents to initialized value for RangeSlider ### Code for reproduction ```python import numpy as np import matplotlib.pyplot as plt from matp...
Huh, the polygon object must have changed inadvertently. Usually, you have to "close" the polygon by repeating the first vertex, but we make it possible for polygons to auto-close themselves. I wonder how (when?) this broke? On Tue, Mar 22, 2022 at 10:29 PM vpicouet ***@***.***> wrote: > Bug summary > > I think xy[4]...
diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -19,7 +19,7 @@ from . import (_api, _docstring, backend_tools, cbook, colors, ticker, transforms) from .lines import Line2D -from .patches import Circle, Rectangle, Ell...
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 @@ -1161,6 +1161,23 @@ def handle_positions(slider): assert_allclose(handle_positions(slider), (0.1, 0.34)) +@pytest.mark.parametrize("o...
["lib/matplotlib/tests/test_widgets.py::test_range_slider_same_init_values[horizontal]"]
["lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-0-10-data]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-0-10-pixels]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-1-10.5-data]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_minspan[0-10-1-10.5-p...
null
true
2022-04-28T13:39:16Z
1
67
1
3,391
0.04
0.8
1
0.92
1
0.723333
90.60024
2,986
swe_bench::test::1621
swe_bench
test
1,621
scikit-learn__scikit-learn-13910
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
eb93420e875ba14673157be7df305eb1fac7adce
Untreated overflow (?) for float32 in euclidean_distances new in sklearn 21.1 #### Description I am using euclidean distances in a project and after updating, the result is wrong for just one of several datasets. When comparing it to scipy.spatial.distance.cdist one can see that in version 21.1 it behaves substantially...
So it is because of the dtype, so it is probably some overflow. It does not give any warning or error though, and this did not happen before. [float32.pdf](https://github.com/scikit-learn/scikit-learn/files/3194307/float32.pdf) ```python from sklearn.metrics.pairwise import euclidean_distances import sklear...
diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -283,7 +283,7 @@ def euclidean_distances(X, Y=None, Y_norm_squared=None, squared=False, return distances if squared else np.sqrt(distances, out=distances) -def _euclidea...
diff --git a/sklearn/metrics/tests/test_pairwise.py b/sklearn/metrics/tests/test_pairwise.py --- a/sklearn/metrics/tests/test_pairwise.py +++ b/sklearn/metrics/tests/test_pairwise.py @@ -48,6 +48,7 @@ from sklearn.metrics.pairwise import paired_distances from sklearn.metrics.pairwise import paired_euclidean_distances...
["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/metrics/tests/test_pairwise.py::test_pairwise_distances", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[dice]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[jaccard]", "sklearn/metrics/tests/test_pairwise.py::test_pairwise_boolean_distance[kulsinski]", "skl...
null
true
2019-05-20T08:47:11Z
1
48
24
2,375
0
0.8
1
0.85
1
0.555833
90.5925
2,987
swe_bench::test::30
swe_bench
test
30
astropy__astropy-13477
astropy/astropy
astropy/astropy
python
c40b75720a64186b57ad1de94ad7f21fa7728880
Comparing Frame with data and SkyCoord with same data raises exception ### Description `SkyCoord` instances and `Frame` instances with data are somewhat used interchangebly and I am still not sure after all this time spending with astropy what is preferable when... So it's a bit surprising to me, that comparing a f...
diff --git a/astropy/coordinates/baseframe.py b/astropy/coordinates/baseframe.py --- a/astropy/coordinates/baseframe.py +++ b/astropy/coordinates/baseframe.py @@ -1650,6 +1650,9 @@ def __eq__(self, value): This implements strict equality and requires that the frames are equivalent and that the represe...
diff --git a/astropy/coordinates/tests/test_frames.py b/astropy/coordinates/tests/test_frames.py --- a/astropy/coordinates/tests/test_frames.py +++ b/astropy/coordinates/tests/test_frames.py @@ -1507,3 +1507,28 @@ class Test: # This subclassing is the test! class NewFrame(ICRS, Test): pass + + +def t...
["astropy/coordinates/tests/test_frames.py::test_frame_coord_comparison"]
["astropy/coordinates/tests/test_frames.py::test_frame_attribute_descriptor", "astropy/coordinates/tests/test_frames.py::test_frame_subclass_attribute_descriptor", "astropy/coordinates/tests/test_frames.py::test_frame_multiple_inheritance_attribute_descriptor", "astropy/coordinates/tests/test_frames.py::test_differenti...
null
true
2022-07-22T07:51:19Z
2
14
1
3,956
0
0.8
1
0.92
1
0.546667
90.56
2,988
swe_bench::test::1637
swe_bench
test
1,637
scikit-learn__scikit-learn-14309
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
f7e082d24ef9f3f9dea14ad82a9a8b2351715f54
plot_partial_dependence() fails when used on DecisionTreeRegressor #### Description ```sklearn.inspection.plot_partial_dependence()``` fails when using a ```sklearn.tree.DecisionTreeRegressor``` as the estimator. The problem appears to be related to the presence of a ```classes_``` attribute (with a value of ```None``...
diff --git a/sklearn/inspection/partial_dependence.py b/sklearn/inspection/partial_dependence.py --- a/sklearn/inspection/partial_dependence.py +++ b/sklearn/inspection/partial_dependence.py @@ -286,9 +286,15 @@ def partial_dependence(estimator, X, features, response_method='auto', raise ValueError( ...
diff --git a/sklearn/inspection/tests/test_partial_dependence.py b/sklearn/inspection/tests/test_partial_dependence.py --- a/sklearn/inspection/tests/test_partial_dependence.py +++ b/sklearn/inspection/tests/test_partial_dependence.py @@ -21,6 +21,7 @@ from sklearn.linear_model import LinearRegression from sklearn.li...
["sklearn/inspection/tests/test_partial_dependence.py::test_output_shape[features0-5-DecisionTreeRegressor-brute-data6]", "sklearn/inspection/tests/test_partial_dependence.py::test_output_shape[features0-10-DecisionTreeRegressor-brute-data6]", "sklearn/inspection/tests/test_partial_dependence.py::test_output_shape[feat...
["sklearn/inspection/tests/test_partial_dependence.py::test_output_shape[features0-5-GradientBoostingClassifier-recursion-data0]", "sklearn/inspection/tests/test_partial_dependence.py::test_output_shape[features0-5-GradientBoostingClassifier-recursion-data1]", "sklearn/inspection/tests/test_partial_dependence.py::test_...
null
true
2019-07-12T13:54:08Z
1
12
4
3,272
0
0.8
1
0.92
1
0.54
90.54
2,989
swe_bench::test::921
swe_bench
test
921
django__django-16952
django/django
django/django
python
d6e9ec40145b9edc65e8d0c65bd3f4ef8a7a27bb
Creating objects with nested MTI crashes. Description (last modified by Mariusz Felisiak) Checking ​PR I noticed that creating objects with more complicated multi-table inheritance crashes. For example: tests/model_inheritance/models.py diff --git a/tests/model_inheritance/models.py b/tests/model_inheritance/models...
​PR ​Separate PR Assertions fail. Opened a ​google group discussion Possible MTI Scenarios with two bases in Django Example Model: class CommonChild(FirstParent, SecondParent): pass Case 1 -- FirstParent and Secondparent are does not have a common ancestor This scenario shows no regression Case 2 -- FirstParent and Sec...
diff --git a/django/db/models/base.py b/django/db/models/base.py --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1775,6 +1775,21 @@ def _check_field_name_clashes(cls): if f not in used_fields: used_fields[f.name] = f + # Check that parent links in diamond...
diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py --- a/tests/invalid_models_tests/test_models.py +++ b/tests/invalid_models_tests/test_models.py @@ -1070,6 +1070,31 @@ class GrandChild(Child): ], ) + def test_diamond_mti_common_parent(self): +...
["test_diamond_mti_common_parent (invalid_models_tests.test_models.ShadowingFieldsTests.test_diamond_mti_common_parent)", "test_create_diamond_mti_common_parent (model_inheritance.tests.ModelInheritanceTests.test_create_diamond_mti_common_parent)"]
["test_multiple_autofields (invalid_models_tests.test_models.MultipleAutoFieldsTests.test_multiple_autofields)", "test_unique (model_inheritance.tests.InheritanceUniqueTests.test_unique)", "test_unique_together (model_inheritance.tests.InheritanceUniqueTests.test_unique_together)", "test_abstract_fk_related_name (model...
null
true
2023-06-07T04:38:25Z
2
39
2
2,423
0
0.8
1
0.85
1
0.533833
90.5265
2,990
swe_bench::test::1632
swe_bench
test
1,632
scikit-learn__scikit-learn-14092
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
df7dd8391148a873d157328a4f0328528a0c4ed9
NCA fails in GridSearch due to too strict parameter checks NCA checks its parameters to have a specific type, which can easily fail in a GridSearch due to how param grid is made. Here is an example: ```python import numpy as np from sklearn.pipeline import Pipeline from sklearn.model_selection import GridSearchCV fro...
I have developed a framework, experimenting with parameter verification: https://github.com/thomasjpfan/skconfig (Don't expect the API to be stable) Your idea of using a simple dict for union types is really nice! Edit: I am currently trying out another idea. I'll update this issue when it becomes something prese...
diff --git a/sklearn/neighbors/nca.py b/sklearn/neighbors/nca.py --- a/sklearn/neighbors/nca.py +++ b/sklearn/neighbors/nca.py @@ -13,6 +13,7 @@ import numpy as np import sys import time +import numbers from scipy.optimize import minimize from ..utils.extmath import softmax from ..metrics import pairwise_distance...
diff --git a/sklearn/neighbors/tests/test_nca.py b/sklearn/neighbors/tests/test_nca.py --- a/sklearn/neighbors/tests/test_nca.py +++ b/sklearn/neighbors/tests/test_nca.py @@ -129,7 +129,7 @@ def test_params_validation(): # TypeError assert_raises(TypeError, NCA(max_iter='21').fit, X, y) assert_raises(Typ...
["sklearn/neighbors/tests/test_nca.py::test_parameters_valid_types[n_components-value0]", "sklearn/neighbors/tests/test_nca.py::test_parameters_valid_types[max_iter-value1]", "sklearn/neighbors/tests/test_nca.py::test_parameters_valid_types[tol-value2]"]
["sklearn/neighbors/tests/test_nca.py::test_simple_example", "sklearn/neighbors/tests/test_nca.py::test_toy_example_collapse_points", "sklearn/neighbors/tests/test_nca.py::test_finite_differences", "sklearn/neighbors/tests/test_nca.py::test_params_validation", "sklearn/neighbors/tests/test_nca.py::test_transformation_d...
null
true
2019-06-14T14:16:17Z
1
10
3
2,993
0
0.8
1
0.85
1
0.532167
90.5215
2,991
swe_bench::test::195
swe_bench
test
195
django__django-11423
django/django
django/django
python
ea6e684f344e5c2ed5a2be1cf2420725c2f88405
GenericRelation and prefetch_related: wrong caching with cyclic prefetching. Description Hello @all! I encountered an issue with GenericRelations. Here is an example to reproduce this issue: ​https://github.com/FinnStutzenstein/GenericRelatedPrefetch Just do a migrate and runserver. The code showing the error is start...
Thanks for the report. This is definitely related with prefetch_related(), because get() and first() works properly. Reproduced at 519016e5f25d7c0a040015724f9920581551cab0. ​PR
diff --git a/django/contrib/contenttypes/fields.py b/django/contrib/contenttypes/fields.py --- a/django/contrib/contenttypes/fields.py +++ b/django/contrib/contenttypes/fields.py @@ -1,3 +1,6 @@ +import functools +import itertools +import operator from collections import defaultdict from django.contrib.contenttypes...
diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py --- a/tests/generic_relations/tests.py +++ b/tests/generic_relations/tests.py @@ -546,6 +546,24 @@ def test_add_then_remove_after_prefetch(self): platypus.tags.remove(weird_tag) self.assertSequenceEqual(platypus.tags.all(...
["test_prefetch_related_different_content_types (generic_relations.tests.GenericRelationsTests)"]
["test_none_allowed (generic_relations.tests.TestInitWithNoneArgument)", "test_default_behavior (generic_relations.tests.ProxyRelatedModelTest)", "test_generic_relation (generic_relations.tests.ProxyRelatedModelTest)", "test_generic_relation_set (generic_relations.tests.ProxyRelatedModelTest)", "test_proxy_is_returned ...
null
true
2019-05-28T07:50:36Z
1
41
1
2,360
0
0.8
1
0.85
1
0.53
90.515
2,992
swe_bench::test::325
swe_bench
test
325
django__django-12453
django/django
django/django
python
b330b918e979ea39a21d47b61172d112caf432c3
`TransactionTestCase.serialized_rollback` fails to restore objects due to ordering constraints Description I hit this problem in a fairly complex projet and haven't had the time to write a minimal reproduction case. I think it can be understood just by inspecting the code so I'm going to describe it while I have it in...
I've run into a problem related to this one (just reported as #31051), so I ended up looking into this problem as well. The original report still seems accurate to me, with the proposed solution valid. I've been working on a fix and (most of the work), testcase for this problem. I'll do some more testing and provide a ...
diff --git a/django/db/backends/base/creation.py b/django/db/backends/base/creation.py --- a/django/db/backends/base/creation.py +++ b/django/db/backends/base/creation.py @@ -6,6 +6,7 @@ from django.conf import settings from django.core import serializers from django.db import router +from django.db.transaction impo...
diff --git a/tests/backends/base/test_creation.py b/tests/backends/base/test_creation.py --- a/tests/backends/base/test_creation.py +++ b/tests/backends/base/test_creation.py @@ -7,6 +7,8 @@ ) from django.test import SimpleTestCase +from ..models import Object, ObjectReference + def get_connection_copy(): #...
["test_circular_reference (backends.base.test_creation.TestDeserializeDbFromString)"]
["test_custom_test_name (backends.base.test_creation.TestDbSignatureTests)", "test_custom_test_name_with_test_prefix (backends.base.test_creation.TestDbSignatureTests)", "test_default_name (backends.base.test_creation.TestDbSignatureTests)", "test_migrate_test_setting_false (backends.base.test_creation.TestDbCreationTe...
null
true
2020-02-13T20:03:27Z
1
13
1
2,902
0
0.8
1
0.85
1
0.527
90.506
2,993
swe_bench::test::1054
swe_bench
test
1,054
matplotlib__matplotlib-24849
matplotlib/matplotlib
matplotlib/matplotlib
python
75e2d2202dc19ee39c8b9a80b01475b90f07c75c
[Bug]: gapcolor not supported for LineCollections ### Bug summary [LineCollection](https://github.com/matplotlib/matplotlib/blob/509315008ce383f7fb5b2dbbdc2a5a966dd83aad/lib/matplotlib/collections.py#L1351) doesn't have a `get_gapcolor` or `set_gapcolor`, so gapcolor doesn't work in plotting methods that return LineCo...
I had a look at this. Although the `LineCollection` docstring states that it “Represents a sequence of Line2Ds”, it doesn’t seem to use the `Line2D` object (unless I’m missing something). So I think we might need to modify the `Collection.draw` method in an analogous way to how we did the `Line2D.draw` method at #2...
diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -9,6 +9,7 @@ line segments). """ +import itertools import math from numbers import Number import warnings @@ -163,6 +164,9 @@ def __init__(self, # list of...
diff --git a/lib/matplotlib/tests/test_collections.py b/lib/matplotlib/tests/test_collections.py --- a/lib/matplotlib/tests/test_collections.py +++ b/lib/matplotlib/tests/test_collections.py @@ -1,5 +1,6 @@ from datetime import datetime import io +import itertools import re from types import SimpleNamespace @@ -1...
["lib/matplotlib/tests/test_collections.py::test_striped_lines[png-orange]", "lib/matplotlib/tests/test_collections.py::test_striped_lines[png-gapcolor1]"]
["lib/matplotlib/tests/test_collections.py::test__EventCollection__get_props[png]", "lib/matplotlib/tests/test_collections.py::test__EventCollection__get_props[pdf]", "lib/matplotlib/tests/test_collections.py::test__EventCollection__set_positions[png]", "lib/matplotlib/tests/test_collections.py::test__EventCollection__...
null
true
2022-12-31T10:19:18Z
2
90
2
1,362
0
0.8
1
0.85
1
0.527
90.506
2,994
swe_bench::test::759
swe_bench
test
759
django__django-15613
django/django
django/django
python
1ed8ca43f61138b8f8d6f92106c27060753ed4e7
Inconsistent / Unexpected handling of assigning unsaved model to Generic Foreign Key Description https://code.djangoproject.com/ticket/10811 addresses the issue of assigned an unsaved model to a ForeignKey or OneToOneField (raises error when save() called), however the same logic / pattern does not apply to GFKs. Give...
Agreed, assigning unsaved objects should raise an error for GenericForeignKey. It was added in 5643a3b51be338196d0b292d5626ad43648448d3 but reverted later in 5980b05c1fad69eef907e0076aa2dc837edab529. It looks like an unintended change as ​release notes still claim that an error is raised in this case. I think verificat...
diff --git a/django/db/models/base.py b/django/db/models/base.py --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1072,8 +1072,9 @@ def _do_insert(self, manager, using, fields, returning_fields, raw): def _prepare_related_fields_for_save(self, operation_name, fields=None): # Ensure that...
diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py --- a/tests/generic_relations/tests.py +++ b/tests/generic_relations/tests.py @@ -1,8 +1,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError -from django.db import IntegrityError ...
["test_unsaved_generic_foreign_key_parent_bulk_create (generic_relations.tests.GenericRelationsTests)", "test_unsaved_generic_foreign_key_parent_save (generic_relations.tests.GenericRelationsTests)"]
["test_none_allowed (generic_relations.tests.TestInitWithNoneArgument)", "The default for for_concrete_model should be True", "test_generic_relation (generic_relations.tests.ProxyRelatedModelTest)", "test_generic_relation_set (generic_relations.tests.ProxyRelatedModelTest)", "Instances of the proxy should be returned w...
null
true
2022-04-19T11:27:01Z
1
20
2
2,760
0
0.8
1
0.85
1
0.526667
90.505
2,995
swe_bench::test::1879
swe_bench
test
1,879
sphinx-doc__sphinx-9309
sphinx-doc/sphinx
sphinx-doc/sphinx
python
01970059760dd59d22cd6efaa17dbf0e0efbc60f
Linkcheck Reports Broken Link when Remote Server Closes on HEAD Request **Describe the bug** Running `make linkcheck` on a document that contains an external link to a website may report the link is broken when a web browser may successfully open the link. Specifically, if the website closes its connection when receivi...
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -26,7 +26,7 @@ from docutils import nodes from docutils.nodes import Element from requests import Response -from requests.exceptions import HTTPError, TooManyRedirects +fr...
diff --git a/tests/test_build_linkcheck.py b/tests/test_build_linkcheck.py --- a/tests/test_build_linkcheck.py +++ b/tests/test_build_linkcheck.py @@ -579,3 +579,29 @@ def test_limit_rate_bails_out_after_waiting_max_time(app): rate_limits) next_check = worker.limit_ra...
["tests/test_build_linkcheck.py::test_get_after_head_raises_connection_error"]
["tests/test_build_linkcheck.py::test_defaults_json", "tests/test_build_linkcheck.py::test_raises_for_invalid_status", "tests/test_build_linkcheck.py::test_auth_header_uses_first_match", "tests/test_build_linkcheck.py::test_auth_header_no_match", "tests/test_build_linkcheck.py::test_linkcheck_request_headers", "tests/t...
null
true
2021-06-07T21:55:57Z
1
6
1
3,533
0
0.8
1
0.92
1
0.52
90.48
2,996
swe_bench::test::1259
swe_bench
test
1,259
pydata__xarray-4939
pydata/xarray
pydata/xarray
python
eb7e112d45a9edebd8e5fb4f873e3e6adb18824a
DataArrayCoarsen does not have a map or reduce function I'm trying to count unique samples when resampling to a square kilometre from a 5x5m input grid. I'd like to be able to apply the `Dask.array.unique()` function with `return_counts=True` to give me a new dimension with the original integer values and their counts....
👍 that would be super useful! coarsen is pretty similar to rolling AFAIR so it may not be too hard to implement a `.reduce` method. As a workaround, it's possible to use rolling and .sel to keep only adjacent windows: ```python ds <xarray.Dataset> Dimensions: (x: 237, y: 69, z: 2) Coordinates: * x (...
diff --git a/xarray/core/rolling.py b/xarray/core/rolling.py --- a/xarray/core/rolling.py +++ b/xarray/core/rolling.py @@ -836,7 +836,9 @@ class DataArrayCoarsen(Coarsen): _reduce_extra_args_docstring = """""" @classmethod - def _reduce_method(cls, func: Callable, include_skipna: bool, numeric_only: bool...
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 @@ -6382,6 +6382,22 @@ def test_coarsen_keep_attrs(): xr.testing.assert_identical(da, da2) +@pytest.mark.parametrize("da", (1, 2), indirect=True) +@pytest.mark....
["xarray/tests/test_dataarray.py::test_coarsen_reduce[sum-1-1]", "xarray/tests/test_dataarray.py::test_coarsen_reduce[sum-2-1]", "xarray/tests/test_dataarray.py::test_coarsen_reduce[sum-2-2]", "xarray/tests/test_dataarray.py::test_coarsen_reduce[sum-3-1]", "xarray/tests/test_dataarray.py::test_coarsen_reduce[sum-3-2]",...
["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-02-21T18:49:47Z
1
62
84
1,867
0
0.8
1
0.85
1
0.517833
90.4785
2,997
swe_bench::test::1275
swe_bench
test
1,275
pydata__xarray-5731
pydata/xarray
pydata/xarray
python
5db40465955a30acd601d0c3d7ceaebe34d28d11
Dask error on xarray.corr **What happened**: When I use xarray.corr on two Dataarrays I get a `NameError: name 'dask' is not defined` error. Notice that dask is not installed in my environement. **What you expected to happen**: Obtain the correlation values without dask interfering (as it should be optional in my unde...
Thanks @Gijom , I can repro. I think the fix should be fairly easy, if someone wants to take a swing. I'm not sure why the existing tests don't cover it. The responsible code for the error originally comes from the call to `da_a = da_a.map_blocks(_get_valid_values, args=[da_b])`, which aim is to remove nan values fr...
diff --git a/xarray/core/computation.py b/xarray/core/computation.py --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1359,7 +1359,8 @@ def _get_valid_values(da, other): da = da.where(~missing_vals) return da else: - return da + # ensure cons...
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 @@ -24,8 +24,6 @@ from . import has_dask, raise_if_dask_computes, requires_dask -dask = pytest.importorskip("dask") - def assert_identical(a, b): ""...
["xarray/tests/test_computation.py::test_cov[None-da_a0-da_b0-0]", "xarray/tests/test_computation.py::test_cov[None-da_a0-da_b0-1]", "xarray/tests/test_computation.py::test_cov[None-da_a1-da_b1-0]", "xarray/tests/test_computation.py::test_cov[None-da_a1-da_b1-1]", "xarray/tests/test_computation.py::test_cov[None-da_a2-...
["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
2021-08-23T08:53:04Z
3
16
65
2,785
0
0.8
1
0.85
1
0.5175
90.4775
2,998
swe_bench::dev::218
swe_bench
dev
218
sqlfluff__sqlfluff-5074
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
7b7fd603a19755a9f3707ebbf95d18ee635716d8
Inconsistent output depending on --processes flag when --ignore linting is used ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened Depending on the value you set for the `--processes` flag when also using `--ignore lintin...
This is _very_ interesting! I'll pick this one up 👍 It's worth calling out that I think part of the problem here is that the docs are also out of date - but you're still right that the return codes should be _the same_ regardless of the `processes` setting.
diff --git a/src/sqlfluff/core/errors.py b/src/sqlfluff/core/errors.py --- a/src/sqlfluff/core/errors.py +++ b/src/sqlfluff/core/errors.py @@ -47,9 +47,15 @@ def __init__( self.line_pos = line_pos super().__init__(self.desc()) + def __eq__(self, other) -> bool: + """Errors compare equa...
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 @@ -379,6 +379,20 @@ def test__cli__command_render_stdin(): "test/fixtures/linter/operator_errors.sql", ], ), + # Check ignoring linting (multi...
["test/cli/commands_test.py::test__cli__command_lint_parse[command19]", "test/core/errors_test.py::test__lex_error_pickle[True]", "test/core/errors_test.py::test__lex_error_pickle[False]", "test/core/errors_test.py::test__parse_error_pickle[True]", "test/core/errors_test.py::test__parse_error_pickle[False]", "test/core...
["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
2023-08-08T23:31:59Z
2
53
7
2,043
0
0.8
1
0.85
1
0.517167
90.4765
2,999
swe_bench::test::1614
swe_bench
test
1,614
scikit-learn__scikit-learn-13704
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
57726672b52421aca17123cc313136a340344d0d
VarianceThreshold doesn't remove feature with zero variance #### Description When calling VarianceThreshold().fit_transform() on certain inputs, it fails to remove a column that has only one unique value. #### Steps/Code to Reproduce ```python import numpy as np from sklearn.feature_selection import VarianceThreshold ...
On closer inspection this is just caused by floating point error in calculating the variance, and therefore not a bug with sklearn. It is resolvable by setting the variance threshold to e.g. 1e-33 rather than 0. We should probably avoid 0 as a default. I'd be happy to deprecate the current default and change it to np.f...
diff --git a/sklearn/feature_selection/variance_threshold.py b/sklearn/feature_selection/variance_threshold.py --- a/sklearn/feature_selection/variance_threshold.py +++ b/sklearn/feature_selection/variance_threshold.py @@ -5,7 +5,7 @@ from ..base import BaseEstimator from .base import SelectorMixin from ..utils impo...
diff --git a/sklearn/feature_selection/tests/test_variance_threshold.py b/sklearn/feature_selection/tests/test_variance_threshold.py --- a/sklearn/feature_selection/tests/test_variance_threshold.py +++ b/sklearn/feature_selection/tests/test_variance_threshold.py @@ -1,3 +1,6 @@ +import numpy as np +import pytest + fro...
["sklearn/feature_selection/tests/test_variance_threshold.py::test_zero_variance_floating_point_error"]
["sklearn/feature_selection/tests/test_variance_threshold.py::test_zero_variance", "sklearn/feature_selection/tests/test_variance_threshold.py::test_variance_threshold"]
null
true
2019-04-23T15:57:53Z
1
12
1
2,859
0
0.8
1
0.85
1
0.5165
90.4745