selection_rank
int64
0
10k
uid
stringlengths
17
29
source
stringclasses
7 values
split
stringclasses
3 values
row_idx
int64
0
58.9k
instance_id
stringlengths
14
120
repo
stringclasses
246 values
repo_canon
stringclasses
232 values
language
stringclasses
8 values
base_commit
stringlengths
40
40
⌀
problem_statement
stringlengths
84
23.6k
extra_context
stringclasses
626 values
hints
stringlengths
0
59.3k
patch
stringlengths
252
175k
test_patch
stringlengths
0
358k
f2p
stringlengths
10
155k
⌀
p2p
stringlengths
2
1.75M
⌀
env_image
stringlengths
41
154
⌀
env_available
bool
1 class
created_at
stringlengths
10
20
⌀
n_src_files
int64
1
15
src_lines
int64
1
1.48k
n_f2p
float64
1
1.87k
⌀
ps_chars
int64
84
23.6k
leak_ratio
float64
0
0.6
s_prior
float64
0.6
1
s_verif
float64
0.75
1
s_ps
float64
0.04
1
s_patch
float64
0.07
1
s_tiebreak
float64
0.02
1
score
float64
47.9
98.6
3,100
swe_bench::test::1032
swe_bench
test
1,032
matplotlib__matplotlib-24088
matplotlib/matplotlib
matplotlib/matplotlib
python
0517187b9c91061d2ec87e70442615cf4f47b6f3
[Bug]: ValueError: Unable to determine Axes to steal space for Colorbar. ### Bug summary `matplotlib==3.6.0` started raising an error when trying to add a colorbar to `plt.hist()`: ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, ...
The error disappears in 3.6.0 by following the error message and passing `cax=ax.inset_axes([0.95, 0.1, 0.05, 0.8])`. If it is ambiguous what axes to use, pass in the axes directly: ``` cbar = plt.colorbar( plt.cm.ScalarMappable(cmap=color_map), ax=plt.gca() ) ``` You _could_ make an axes, and use t...
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1253,11 +1253,13 @@ def colorbar( # Store the value of gca so that we can set it back later on. if cax is None: if ax is None: - raise ValueErr...
diff --git a/lib/matplotlib/tests/test_colorbar.py b/lib/matplotlib/tests/test_colorbar.py --- a/lib/matplotlib/tests/test_colorbar.py +++ b/lib/matplotlib/tests/test_colorbar.py @@ -1,10 +1,12 @@ import numpy as np import pytest +from matplotlib import _api from matplotlib import cm import matplotlib.colors as m...
["lib/matplotlib/tests/test_colorbar.py::test_parentless_mappable"]
["lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_shape[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_length[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_inverted_axis[min-expected0-horizontal]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_exte...
null
true
2022-10-03T22:25:59Z
1
6
1
1,232
0
0.8
1
0.85
1
0.225333
89.601
3,101
swe_bench::test::1774
swe_bench
test
1,774
sphinx-doc__sphinx-7501
sphinx-doc/sphinx
sphinx-doc/sphinx
python
50d2d289e150cb429de15770bdd48a723de8c45d
glossary duplicate term with a different case **Describe the bug** ``` Warning, treated as error: doc/glossary.rst:243:duplicate term description of mysql, other instance in glossary ``` **To Reproduce** Steps to reproduce the behavior: [.travis.yml#L168](https://github.com/phpmyadmin/phpmyadmin/blob/f7cc383674b709919...
Sorry for the inconvenience. Indeed, this must be a bug. I'll take a look this later. Thank you for fixing it, let me know when a release it done so I can restart my builds @williamdes Please follow #7453. I'll work for release maybe tomorrow. Thank you :rocket: From the PR I could see linked, did you add a test cas...
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -789,6 +789,8 @@ def resolve_xref(self, env: "BuildEnvironment", fromdocname: str, builder: "Buil RemovedInSphinx40Warning) domain = env.get_domain('citation') ...
diff --git a/tests/test_domain_std.py b/tests/test_domain_std.py --- a/tests/test_domain_std.py +++ b/tests/test_domain_std.py @@ -141,12 +141,23 @@ def test_glossary(app): [nodes.definition, nodes.paragraph, "description"]) # index - objects = list(app.env.get_domain("std").get_objects()) + ...
["tests/test_domain_std.py::test_glossary"]
["tests/test_domain_std.py::test_process_doc_handle_figure_caption", "tests/test_domain_std.py::test_process_doc_handle_table_title", "tests/test_domain_std.py::test_get_full_qualified_name", "tests/test_domain_std.py::test_glossary_warning", "tests/test_domain_std.py::test_glossary_comment", "tests/test_domain_std.py:...
null
true
2020-04-18T09:28:50Z
1
24
1
868
0
0.8
1
0.85
1
0.224667
89.599
3,102
swe_bench::dev::152
swe_bench
dev
152
pylint-dev__astroid-2309
pylint-dev/astroid
pylint-dev/astroid
python
29b42e5e9745b172d5980511d14efeac745a5a82
Regression in Astroid version 2.15.7 in handling subscriptable type parameters Astroid version 2.15.7 fails to correctly handle a subscriptable type parameter most likely due to the change in this [PR](https://github.com/pylint-dev/astroid/pull/2239). ### Steps to reproduce ```python from collections.abc import Mapp...
Thanks for the report. @mbyrnepr2 Would you be willing to take a look?
diff --git a/astroid/brain/brain_typing.py b/astroid/brain/brain_typing.py --- a/astroid/brain/brain_typing.py +++ b/astroid/brain/brain_typing.py @@ -15,6 +15,7 @@ from astroid.builder import _extract_single_node from astroid.const import PY38_PLUS, PY39_PLUS from astroid.exceptions import ( + AstroidSyntaxError...
diff --git a/tests/brain/test_typing.py b/tests/brain/test_typing.py --- a/tests/brain/test_typing.py +++ b/tests/brain/test_typing.py @@ -5,7 +5,10 @@ # For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE # Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt -from astroi...
["tests/brain/test_typing.py::test_infer_typevar"]
[]
null
true
2023-09-26T12:05:24Z
1
13
1
1,078
0
0.8
1
0.85
1
0.223
89.594
3,103
swe_bench::test::1525
swe_bench
test
1,525
scikit-learn__scikit-learn-11042
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
f049ec72eb70443ec8d7826066c4246035677c11
OneHotEncoder does not output scipy sparse matrix of given dtype #### Description OneHotEncoder ignores the specified dtype in the construction of the sparse array when mixed input data are passed, i.e with both categorical and real data type #### Steps/Code to Reproduce ```python import numpy as np from sklearn.prep...
Thanks for the report. Please provide [a minimal reproducible example](http://scikit-learn.org/dev/faq.html#what-s-the-best-way-to-get-help-on-scikit-learn-usage). @rth, I have just finished editing the issue. This seems like a bug which happens when `categorical_features != 'all'`, quickly looking at this, this comes...
diff --git a/sklearn/preprocessing/data.py b/sklearn/preprocessing/data.py --- a/sklearn/preprocessing/data.py +++ b/sklearn/preprocessing/data.py @@ -1825,7 +1825,7 @@ def add_dummy_feature(X, value=1.0): return np.hstack((np.ones((n_samples, 1)) * value, X)) -def _transform_selected(X, transform, selecte...
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 @@ -1909,40 +1909,45 @@ def test_one_hot_encoder_dense(): [1., 0., 1., 0., 1.]])) -def _che...
["sklearn/preprocessing/tests/test_data.py::test_transform_selected[int32-int32]", "sklearn/preprocessing/tests/test_data.py::test_transform_selected[int32-float32]", "sklearn/preprocessing/tests/test_data.py::test_transform_selected[int32-float64]", "sklearn/preprocessing/tests/test_data.py::test_transform_selected[fl...
["sklearn/preprocessing/tests/test_data.py::test_polynomial_features", "sklearn/preprocessing/tests/test_data.py::test_polynomial_feature_names", "sklearn/preprocessing/tests/test_data.py::test_polynomial_features_sparse_X[1-True-False-int]", "sklearn/preprocessing/tests/test_data.py::test_polynomial_features_sparse_X[...
null
true
2018-04-28T11:35:27Z
1
14
28
1,047
0
0.8
1
0.85
1
0.221167
89.5885
3,104
swe_bench::test::978
swe_bench
test
978
matplotlib__matplotlib-21443
matplotlib/matplotlib
matplotlib/matplotlib
python
d448de31b7deaec8310caaf8bba787e097bf9211
[Bug]: axes(position = [...]) behavior ### Bug summary when setting axes position with `ax = plt.axes(position = [...])` the position data is not being incorporated. ### Code for reproduction ```python import matplotlib.pyplot as plt fig = plt.figure() pos1 = [0.1, 0.1, 0.3, 0.8] pos2 = [0.5, 0.1, 0.4, 0.6] ax1 =...
Tried updating to 3.4.3 and got the same plotting result. ``` The following NEW packages will be INSTALLED: charls pkgs/main/win-64::charls-2.2.0-h6c2663c_0 giflib pkgs/main/win-64::giflib-5.2.1-h62dcd97_0 imagecodecs pkgs/main/win-64::imagecodecs-2021.6.8-py38he57d016_1 ...
diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1059,8 +1059,12 @@ def axes(arg=None, **kwargs): plt.axes((left, bottom, width, height), facecolor='w') """ fig = gcf() + pos = kwargs.pop('position', None) if ar...
diff --git a/lib/matplotlib/tests/test_pyplot.py b/lib/matplotlib/tests/test_pyplot.py --- a/lib/matplotlib/tests/test_pyplot.py +++ b/lib/matplotlib/tests/test_pyplot.py @@ -1,4 +1,5 @@ import difflib +import numpy as np import subprocess import sys from pathlib import Path @@ -320,3 +321,17 @@ def test_polar_seco...
["lib/matplotlib/tests/test_pyplot.py::test_fallback_position"]
["lib/matplotlib/tests/test_pyplot.py::test_pyplot_up_to_date", "lib/matplotlib/tests/test_pyplot.py::test_copy_docstring_and_deprecators", "lib/matplotlib/tests/test_pyplot.py::test_pyplot_box", "lib/matplotlib/tests/test_pyplot.py::test_stackplot_smoke", "lib/matplotlib/tests/test_pyplot.py::test_nrows_error", "lib/m...
null
true
2021-10-23T18:27:39Z
1
6
1
1,182
0
0.8
1
0.85
1
0.217
89.576
3,105
swe_bench::dev::116
swe_bench
dev
116
pydicom__pydicom-901
pydicom/pydicom
pydicom/pydicom
python
3746878d8edf1cbda6fbcf35eec69f9ba79301ca
pydicom should not define handler, formatter and log level. The `config` module (imported when pydicom is imported) defines a handler and set the log level for the pydicom logger. This should not be the case IMO. It should be the responsibility of the client code of pydicom to configure the logging module to its conven...
In addition, I don't understand what the purpose of the `config.debug` function since the default behavor of the logging module in absence of configuartion seems to already be the one you want. From https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library: > If the using application does not...
diff --git a/pydicom/config.py b/pydicom/config.py --- a/pydicom/config.py +++ b/pydicom/config.py @@ -62,10 +62,7 @@ def DS_decimal(use_Decimal_boolean=True): # Logging system and debug function to change logging level logger = logging.getLogger('pydicom') -handler = logging.StreamHandler() -formatter = logging.Fo...
diff --git a/pydicom/tests/test_config.py b/pydicom/tests/test_config.py new file mode 100644 --- /dev/null +++ b/pydicom/tests/test_config.py @@ -0,0 +1,107 @@ +# Copyright 2008-2019 pydicom authors. See LICENSE file for details. +"""Unit tests for the pydicom.config module.""" + +import logging +import sys + +import ...
["pydicom/tests/test_config.py::TestDebug::test_default", "pydicom/tests/test_config.py::TestDebug::test_debug_on_handler_null", "pydicom/tests/test_config.py::TestDebug::test_debug_off_handler_null", "pydicom/tests/test_config.py::TestDebug::test_debug_on_handler_stream", "pydicom/tests/test_config.py::TestDebug::test...
[]
null
true
2019-07-27T00:18:11Z
1
28
5
732
0
0.8
1
0.85
1
0.215333
89.571
3,106
swe_bench::test::1789
swe_bench
test
1,789
sphinx-doc__sphinx-7831
sphinx-doc/sphinx
sphinx-doc/sphinx
python
b56772102e138b0a5d83f02e0031eb075c854921
regression in 3.1.0 for methods which are `contextmanager`s and have a type comment **Describe the bug** methods decorated with `@contextmanager` trigger errors similar to this when built with sphinx 3.1.0 (this worked in 3.0.4): ``` error while formatting arguments for flake8.options.manager.OptionManager.group: ```...
Might have similar cause to @classproperty issue described in #7805 Note: I confirmed with following Dockerfile: ``` FROM python:3.8-slim RUN apt update; apt install -y git make build-essential vim RUN git clone https://github.com/pycqa/flake8 WORKDIR /flake8 RUN git checkout 181bb46098dddf7e2d45319ea654b4b4d5...
diff --git a/sphinx/ext/autodoc/type_comment.py b/sphinx/ext/autodoc/type_comment.py --- a/sphinx/ext/autodoc/type_comment.py +++ b/sphinx/ext/autodoc/type_comment.py @@ -128,6 +128,9 @@ def update_annotations_using_type_comments(app: Sphinx, obj: Any, bound_method: if 'return' not in obj.__annotations__...
diff --git a/tests/roots/test-ext-autodoc/target/wrappedfunction.py b/tests/roots/test-ext-autodoc/target/wrappedfunction.py --- a/tests/roots/test-ext-autodoc/target/wrappedfunction.py +++ b/tests/roots/test-ext-autodoc/target/wrappedfunction.py @@ -1,8 +1,15 @@ -# for py32 or above +from contextlib import contextmana...
["tests/test_ext_autodoc_autofunction.py::test_wrapped_function_contextmanager"]
["tests/test_ext_autodoc_autofunction.py::test_classes", "tests/test_ext_autodoc_autofunction.py::test_callable", "tests/test_ext_autodoc_autofunction.py::test_method", "tests/test_ext_autodoc_autofunction.py::test_builtin_function", "tests/test_ext_autodoc_autofunction.py::test_methoddescriptor", "tests/test_ext_autod...
null
true
2020-06-13T16:20:46Z
2
20
1
876
0
0.8
1
0.85
1
0.212667
89.563
3,107
swe_bench::test::71
swe_bench
test
71
astropy__astropy-14991
astropy/astropy
astropy/astropy
python
edf7493ec141a9072b5ce3e33071dff66e58bf49
Error in distance calculations for w0wz Cosmologies ### Description I believe that the equation used to calculate the de_density_scale in `w0wzcdm.py `is incorrect. Line 205 has `return zp1 ** (3.0 * (1.0 + self._w0 - self._wz)) * exp(-3.0 * self._wz * z)` ### Expected behavior After manually calculating the integr...
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/cosmology/flrw/w0wzcdm.py b/astropy/cosmology/flrw/w0wzcdm.py --- a/astropy/cosmology/flrw/w0wzcdm.py +++ b/astropy/cosmology/flrw/w0wzcdm.py @@ -190,19 +190,25 @@ def de_density_scale(self, z): The scaling of the energy density of dark energy with redshift. Returns `float...
diff --git a/astropy/cosmology/flrw/tests/test_w0wzcdm.py b/astropy/cosmology/flrw/tests/test_w0wzcdm.py --- a/astropy/cosmology/flrw/tests/test_w0wzcdm.py +++ b/astropy/cosmology/flrw/tests/test_w0wzcdm.py @@ -10,7 +10,7 @@ import astropy.units as u from astropy.cosmology import Flatw0wzCDM, w0wzCDM from astropy.co...
["astropy/cosmology/flrw/tests/test_w0wzcdm.py::Testw0wzCDM::test_Otot_overflow"]
["astropy/cosmology/flrw/tests/test_w0wzcdm.py::Testw0wzCDM::test_to_yaml", "astropy/cosmology/flrw/tests/test_w0wzcdm.py::Testw0wzCDM::test_from_yaml_default", "astropy/cosmology/flrw/tests/test_w0wzcdm.py::Testw0wzCDM::test_from_yaml_autoidentify", "astropy/cosmology/flrw/tests/test_w0wzcdm.py::Testw0wzCDM::test_is_e...
null
true
2023-06-27T01:24:50Z
1
14
1
988
0
0.8
1
0.85
1
0.211333
89.559
3,108
swe_bench::dev::21
swe_bench
dev
21
pvlib__pvlib-python-1157
pvlib/pvlib-python
pvlib/pvlib-python
python
0b8f24c265d76320067a5ee908a57d475cd1bb24
ModelChainResult.cell_temperature is not always a pandas.Series For a `ModelChain` configured as below, the `cell_temperature` when running the model chain with a list of data like `ModelChain.run_model([data])` is a tuple with a single number instead of the expected Series **To Reproduce** ```python import pandas as ...
Confirmed. This is a bug in `pvlib.modelchain.ModelChain._prepare_temperature` not all inputs are tuples and aren't being converted. @wfvining fyi and lmk if you want to fix it. Definitely a bug, but I think the correct behavior is slightly different than you expect. Because you pass a list to `ModelChain.run_model()` ...
diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -268,22 +268,47 @@ class ModelChainResult: _T = TypeVar('T') PerArray = Union[_T, Tuple[_T, ...]] """Type for fields that vary between arrays""" + + # these attributes are used in __setattr__ ...
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 @@ -1080,6 +1080,54 @@ def test_run_model_from_effective_irradiance_missing_poa( (data_complete, data_incomplete)) +def test_run_model_singleton_weather...
["pvlib/tests/test_modelchain.py::test_run_model_singleton_weather_single_array", "pvlib/tests/test_modelchain.py::test_run_model_from_poa_singleton_weather_single_array", "pvlib/tests/test_modelchain.py::test_run_model_from_effective_irradiance_weather_single_array", "pvlib/tests/test_modelchain.py::test_aoi_models_si...
["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-02T17:17:56Z
2
141
14
3,128
0
0.8
1
0.77
1
0.97
89.555
3,109
swe_bench::dev::192
swe_bench
dev
192
sqlfluff__sqlfluff-2998
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
47c8bb29104761474e455ef2e6fdaa7a8cc20a56
BigQuery: Accessing `STRUCT` elements evades triggering L027 ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened Accessing unreferenced `STRUCT` elements using BigQuery dot notation in a multi table query does not trigger ...
This is tricky. Basicaly L026 works to make sure qualified columns only use tables in the from clause. This doesn’t really work for `STRUCT`s as impossible to know if it’s a qualified column or a `STRUCT`, so is off by default for languages that support them - like BigQuery. L027 works to make sure columns are qu...
diff --git a/src/sqlfluff/rules/L027.py b/src/sqlfluff/rules/L027.py --- a/src/sqlfluff/rules/L027.py +++ b/src/sqlfluff/rules/L027.py @@ -73,4 +73,21 @@ def _lint_references_and_aliases( ) ) + all_table_aliases = [t.ref_str for t in table_aliases] + standalone_aliases...
diff --git a/test/fixtures/rules/std_rule_cases/L027.yml b/test/fixtures/rules/std_rule_cases/L027.yml --- a/test/fixtures/rules/std_rule_cases/L027.yml +++ b/test/fixtures/rules/std_rule_cases/L027.yml @@ -220,3 +220,40 @@ test_pass_rowtype_with_join: configs: core: dialect: hive + +test_fail_column_nam...
["test/rules/std_test.py::test__rules__std_file[L027-column_references.sql-violations16]"]
["test/rules/std_test.py::test__rules__std_file[L001-indentation_errors.sql-violations0]", "test/rules/std_test.py::test__rules__std_file[L002-indentation_errors.sql-violations1]", "test/rules/std_test.py::test__rules__std_file[L003-indentation_errors.sql-violations2]", "test/rules/std_test.py::test__rules__std_file[L0...
null
true
2022-04-04T20:29:42Z
1
17
1
915
0
0.8
1
0.85
1
0.209167
89.5525
3,110
swe_bench::test::1937
swe_bench
test
1,937
sympy__sympy-12301
sympy/sympy
sympy/sympy
python
5155b7641fa389e10aeb5cfebcbefba02cb9221c
Test failure in Travis ``` ______________ sympy/simplify/tests/test_cse.py:test_issue_11230 _______________ File "/home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages/sympy-1.0.1.dev0-py3.5.egg/sympy/simplify/tests/test_cse.py", line 433, in test_issue_11230 assert not any(i.is_Mul for a in C for i in ...
Log is here, https://travis-ci.org/sympy/sympy/jobs/163790187 Permanent link, https://gist.github.com/isuruf/9410c21df1be658d168727018007a63a ping @smichr Seeing jobs failing frequently now https://travis-ci.org/sympy/sympy/jobs/164977570 https://travis-ci.org/sympy/sympy/jobs/164880234 It seems that the failure is...
diff --git a/sympy/simplify/cse_main.py b/sympy/simplify/cse_main.py --- a/sympy/simplify/cse_main.py +++ b/sympy/simplify/cse_main.py @@ -310,10 +310,18 @@ def update(k): # remove it if Func is Add: take = min(func_dicts[k][i] for i in com_dict) - com_func_take...
diff --git a/sympy/simplify/tests/test_cse.py b/sympy/simplify/tests/test_cse.py --- a/sympy/simplify/tests/test_cse.py +++ b/sympy/simplify/tests/test_cse.py @@ -422,6 +422,13 @@ def test_issue_8891(): def test_issue_11230(): + # a specific test that always failed + a, b, f, k, l, i = symbols('a b f k l i')...
["test_issue_11230"]
["test_numbered_symbols", "test_preprocess_for_cse", "test_postprocess_for_cse", "test_cse_single", "test_cse_single2", "test_cse_not_possible", "test_nested_substitution", "test_subtraction_opt", "test_multiple_expressions", "test_bypass_non_commutatives", "test_issue_10228", "test_issue_4498", "test_issue_4020", "tes...
null
true
2017-03-13T01:22:47Z
1
27
1
703
0
0.8
1
0.85
1
0.207167
89.5465
3,111
swe_bench::test::1726
swe_bench
test
1,726
sphinx-doc__sphinx-10191
sphinx-doc/sphinx
sphinx-doc/sphinx
python
301c7bdf57eee47426c9ad4d96392bff623ee6c3
Alternating multiply referred footnotes produce a ? in pdf output ### Describe the bug In some circumstances footnote mark is rendered as `?` and there is no hyperlink ### How to Reproduce file `index.rst`: ``` Test ==== Explicitly numbered footnotes ----------------------------- First reference to first footnote...
The #8832 mechanism fixed some problems with explicitly numbered footnotes (and #10169 extended this to named footnotes). But this mechanism is flawed when new named or explicitly numbered footnotes occur in-between multiple references to same original one.
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -814,16 +814,14 @@ def depart_rubric(self, node: Element) -> None: def visit_footnote(self, node: Element) -> None: self.in_footnote += 1 label = cast(nodes.label, node[0]...
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -723,13 +723,9 @@ def test_footnote(app, status, warning): assert '\\sphinxcite{footnote:bar}' in result assert ('\\bibitem[bar]{footnote:bar}\n\\sphinxAtStartPar\ncite\n') in ...
["tests/test_build_latex.py::test_footnote", "tests/test_build_latex.py::test_reference_in_caption_and_codeblock_in_footnote", "tests/test_build_latex.py::test_footnote_referred_multiple_times", "tests/test_build_latex.py::test_latex_show_urls_is_inline", "tests/test_build_latex.py::test_latex_show_urls_is_footnote", "...
["tests/test_build_latex.py::test_writer", "tests/test_build_latex.py::test_latex_warnings", "tests/test_build_latex.py::test_latex_basic", "tests/test_build_latex.py::test_latex_basic_manual", "tests/test_build_latex.py::test_latex_basic_howto", "tests/test_build_latex.py::test_latex_basic_manual_ja", "tests/test_buil...
null
true
2022-02-13T20:19:28Z
1
10
7
1,026
0
0.8
1
0.85
1
0.204333
89.538
3,112
swe_bench::test::23
swe_bench
test
23
astropy__astropy-13404
astropy/astropy
astropy/astropy
python
16743c6faf5cb8433bf9f7702ae70d002a96caaf
Masked ``_array2string`` doesn't work on some structured arrays ### Description The dispatch function ``_array2string `` in ``masked.function_helpers`` doesn't work on arrays with strutcured dtypes. ### Expected behavior Masked arrays with structured dtypes can be printed no prob, like their non-masked counterparts....
@mhvk, I encountered this while looking to see how Masked and Distribution combine. They sort of do, but the subclass generation is not very robust. @nstarman - does `Masked` work with a regular structured array? (It really should!) If this is `Distribution` specific, I think the issue is the rather lame override of `_...
diff --git a/astropy/utils/masked/function_helpers.py b/astropy/utils/masked/function_helpers.py --- a/astropy/utils/masked/function_helpers.py +++ b/astropy/utils/masked/function_helpers.py @@ -877,13 +877,19 @@ class MaskedFormat: """ def __init__(self, format_function): self.format_function = form...
diff --git a/astropy/utils/masked/tests/test_masked.py b/astropy/utils/masked/tests/test_masked.py --- a/astropy/utils/masked/tests/test_masked.py +++ b/astropy/utils/masked/tests/test_masked.py @@ -50,6 +50,16 @@ def setup_class(self): self.sb = np.array([(1., 2.), (-3., 4.)], dtype=self.sdt) self.ma...
["astropy/utils/masked/tests/test_masked.py::TestMaskedArrayRepr::test_array_str", "astropy/utils/masked/tests/test_masked.py::TestMaskedArrayRepr::test_scalar_str", "astropy/utils/masked/tests/test_masked.py::TestMaskedArrayRepr::test_array_repr", "astropy/utils/masked/tests/test_masked.py::TestMaskedArrayRepr::test_s...
["astropy/utils/masked/tests/test_masked.py::TestMaskedArrayInitialization::test_simple", "astropy/utils/masked/tests/test_masked.py::TestMaskedArrayInitialization::test_structured", "astropy/utils/masked/tests/test_masked.py::test_masked_ndarray_init", "astropy/utils/masked/tests/test_masked.py::test_cannot_initialize...
null
true
2022-06-27T21:58:57Z
1
15
8
921
0
0.8
1
0.85
1
0.2035
89.5355
3,113
swe_bench::test::1406
swe_bench
test
1,406
pytest-dev__pytest-5495
pytest-dev/pytest
pytest-dev/pytest
python
1aefb24b37c30fba8fd79a744829ca16e252f340
Confusing assertion rewriting message with byte strings The comparison with assertion rewriting for byte strings is confusing: ``` def test_b(): > assert b"" == b"42" E AssertionError: assert b'' == b'42' E Right contains more items, first extra item: 52 E Full diff: E - b'' E ...
hmmm yes, this ~kinda makes sense as `bytes` objects are sequences of integers -- we should maybe just omit the "contains more items" messaging for bytes objects?
diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -254,17 +254,38 @@ def _compare_eq_iterable(left, right, verbose=0): def _compare_eq_sequence(left, right, verbose=0): + comparing_bytes = isinstance(left, bytes)...
diff --git a/testing/test_assertion.py b/testing/test_assertion.py --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -331,6 +331,27 @@ def test_multiline_text_diff(self): assert "- spam" in diff assert "+ eggs" in diff + def test_bytes_diff_normal(self): + """Check special...
["testing/test_assertion.py::TestAssert_reprcompare::test_bytes_diff_normal", "testing/test_assertion.py::TestAssert_reprcompare::test_bytes_diff_verbose"]
["testing/test_assertion.py::TestImportHookInstallation::test_register_assert_rewrite_checks_types", "testing/test_assertion.py::TestAssert_reprcompare::test_different_types", "testing/test_assertion.py::TestAssert_reprcompare::test_summary", "testing/test_assertion.py::TestAssert_reprcompare::test_text_diff", "testing...
null
true
2019-06-25T23:41:16Z
1
25
2
710
0
0.8
1
0.85
1
0.201667
89.53
3,114
swe_bench::test::292
swe_bench
test
292
django__django-12185
django/django
django/django
python
5708327c3769262b845730996ca2784245ada4d1
Window expression are not allowed in conditional statements used only in the SELECT clause. Description Django raises NotSupportedError when using window expressions in conditional statements used only in the SELECT clause, e.g. Employee.objects.annotate( lag=Window( expression=Lag(expression='salary', offset=1), ...
So it seems a bugfix would envolve moving the raise from build_filter to add_q. And we would have to propagate the necessity of the raise somehow, in WhereNode or as an additional return param. Given build_filter now calls _add_q on the master branch the solution will probably involve adding a new kwarg to disable the ...
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -100,7 +100,10 @@ def __invert__(self): def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False): # W...
diff --git a/tests/expressions_window/tests.py b/tests/expressions_window/tests.py --- a/tests/expressions_window/tests.py +++ b/tests/expressions_window/tests.py @@ -4,8 +4,8 @@ from django.core.exceptions import FieldError from django.db import NotSupportedError, connection from django.db.models import ( - F, F...
["test_conditional_annotation (expressions_window.tests.NonQueryWindowTests)"]
["test_unsupported_backend (expressions_window.tests.WindowUnsupportedTests)", "test_empty_group_by_cols (expressions_window.tests.NonQueryWindowTests)", "test_frame_empty_group_by_cols (expressions_window.tests.NonQueryWindowTests)", "test_frame_window_frame_notimplemented (expressions_window.tests.NonQueryWindowTests...
null
true
2019-12-05T16:13:43Z
2
21
1
767
0
0.8
1
0.85
1
0.197833
89.5185
3,115
swe_bench::test::234
swe_bench
test
234
django__django-11692
django/django
django/django
python
f37face331f21cb8af70fc4ec101ec7b6be1f63e
Can't use OuterRef in union Subquery Description When you make a QuerySet using the union method or the | operator, the QuerySet passed into the union method cannot reference OuterRef even when wrapped with Subquery. For example: cls = Document.objects.filter( checklist__isnull=False, part=OuterRef('id') ).values('c...
Are you sure that generating some sensible SQL for this queryset is possible? Yes, it is possible to generate SQL for this query. I tried it myself. ...I suppose "sensible" is a subjective term. I just tried using an __in lookup, but that was getting to be a struggle. Maybe Subquery wasn't originally intended to be use...
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -503,7 +503,10 @@ def get_combinator_sql(self, combinator, all): part_sql = 'SELECT * FROM ({})'.format(part_sql) ...
diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py --- a/tests/queries/test_qs_combinators.py +++ b/tests/queries/test_qs_combinators.py @@ -1,11 +1,11 @@ import operator from django.db import DatabaseError, NotSupportedError, connection -from django.db.models import Exists, F,...
["test_union_in_subquery (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_union_in_subquery_related_outerref (queries.test_qs_combinators.QuerySetSetOperationTests)"]
["test_combining_multiple_models (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_difference (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_intersection (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_union (queries.test_qs_combinators.QuerySetSetOperati...
null
true
2019-08-21T08:09:45Z
2
15
2
886
0
0.8
1
0.85
1
0.197667
89.518
3,116
swe_bench::test::1613
swe_bench
test
1,613
scikit-learn__scikit-learn-13641
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
badaa153e67ffa56fb1a413b3b7b5b8507024291
CountVectorizer with custom analyzer ignores input argument Example: ``` py cv = CountVectorizer(analyzer=lambda x: x.split(), input='filename') cv.fit(['hello world']).vocabulary_ ``` Same for `input="file"`. Not sure if this should be fixed or just documented; I don't like changing the behavior of the vectorizers y...
To be sure, the current docstring says: ``` If a callable is passed it is used to extract the sequence of features out of the raw, unprocessed input. ``` "Unprocessed" seems to mean that even `input=` is ignored, but this is not obvious. I'll readily agree that's the wrong behaviour even with that docstring. On 20 ...
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 @@ -31,6 +31,7 @@ from ..utils.validation import check_is_fitted, check_array, FLOAT_DTYPES from ..utils import _IS_32BIT from ..utils.fixes import _a...
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 @@ -29,6 +29,7 @@ from numpy.testing import assert_array_almost_equal from numpy.testing import assert_arra...
["sklearn/feature_extraction/tests/test_text.py::test_callable_analyzer_error[filename-FileNotFoundError--CountVectorizer]", "sklearn/feature_extraction/tests/test_text.py::test_callable_analyzer_error[filename-FileNotFoundError--TfidfVectorizer]", "sklearn/feature_extraction/tests/test_text.py::test_callable_analyzer_...
["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-04-14T21:20:41Z
1
42
16
331
0
0.8
1
0.85
1
0.195167
89.5105
3,117
swe_bench::dev::188
swe_bench
dev
188
sqlfluff__sqlfluff-2846
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
f37dc1410cefc4e08ed8110f820c9071bc4b0c7d
ValueError: Position Not Found for lint/parse/fix, not clear why ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened I have admittedly messy dbt sql model that gets the following error when I try to lint, parse or fix it w...
> Proprietary concerns prevent me from sharing the query itself, I could try to boil it down to a mock version that replicates the error. This would be needed before we can make any progress on this I'm afraid. The stack trace is good, and will help us identify the area of code, but without the SQL we can't know why...
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 @@ -185,6 +185,23 @@ def next_slice_id(self) -> str: self.slice_id += 1 return result ...
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 @@ -756,7 +756,6 @@ def test__templater_jinja_slice_template(test, result): ("block_start", slice(0, 25, None), slice(0, 0, None)), ...
["test/core/templaters/jinja_test.py::test__templater_jinja_slice_file[{%", "test/core/templaters/jinja_test.py::test__templater_jinja_slice_file[select\\n"]
["test/core/templaters/jinja_test.py::test__templater_jinja[simple]", "test/core/templaters/jinja_test.py::test__templater_jinja[unboundlocal_bugfix]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[basic_block]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[strip_left_block]", "...
null
true
2022-03-11T21:52:54Z
1
51
2
11,436
0
0.8
1
0.8
1
0.67
89.51
3,118
swe_bench::test::222
swe_bench
test
222
django__django-11605
django/django
django/django
python
194d1dfc186cc8d2b35dabf64f3ed38b757cbd98
Filter by window expression should raise a descriptive error. Description Django has a check that filter does not contain window expressions. But it is shallow, neither right side of the expression nor combined expressions are checked. class Employee(models.Model): grade = models.IntegerField() # raises NotSupportedE...
Thanks for this report. Agreed, we should raise a helpful message because it is currently unsupported (see also a ticket #28333 to support this feature). ​PR
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -500,8 +500,6 @@ def as_sql(self, compiler, connection): @deconstructible class F(Combinable): """An object capable of resolving references to existing que...
diff --git a/tests/expressions_window/tests.py b/tests/expressions_window/tests.py --- a/tests/expressions_window/tests.py +++ b/tests/expressions_window/tests.py @@ -4,7 +4,8 @@ from django.core.exceptions import FieldError from django.db import NotSupportedError, connection from django.db.models import ( - F, O...
["test_invalid_filter (expressions_window.tests.NonQueryWindowTests)"]
["test_unsupported_backend (expressions_window.tests.WindowUnsupportedTests)", "test_empty_group_by_cols (expressions_window.tests.NonQueryWindowTests)", "test_frame_empty_group_by_cols (expressions_window.tests.NonQueryWindowTests)", "test_frame_window_frame_notimplemented (expressions_window.tests.NonQueryWindowTests...
null
true
2019-07-29T11:52:50Z
2
21
1
736
0
0.8
1
0.85
1
0.192667
89.503
3,119
swe_bench::test::549
swe_bench
test
549
django__django-14031
django/django
django/django
python
ceb4b9ee68dffc6ab0398886f1758f15f037c472
Ticket #29138 breaks autocomplete for inherited models Description Unfortunately, Closed ticket #29138 breaks autocomplete for the case of inherited models. For example, we have the following code: # models.py from django.db import models class Tag(models.Model): pass class Foo(models.Model): tags = models.ManyToMan...
Thanks for testing out the Django 3.2 beta. Regression in 3071660acfbdf4b5c59457c8e9dc345d5e8894c5. Thanks, good find. I am on it. Hi there, I tested the reported error first on my projects, where I use MTI and then on the example (which is incomplete). Both didn't yield the error or the to_field_value that was describ...
diff --git a/django/contrib/admin/views/autocomplete.py b/django/contrib/admin/views/autocomplete.py --- a/django/contrib/admin/views/autocomplete.py +++ b/django/contrib/admin/views/autocomplete.py @@ -90,7 +90,8 @@ def process_request(self, request): type(model_admin).__qualname__ ) - ...
diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py --- a/tests/admin_views/models.py +++ b/tests/admin_views/models.py @@ -338,6 +338,24 @@ def clean(self): raise ValidationError('invalid') +class PKChild(models.Model): + """ + Used to check autocomplete to_field resolution wh...
["test_render_options_fk_as_pk (admin_widgets.test_autocomplete_widget.AutocompleteMixinTests)", "Empty option isn't present if the field isn't required.", "Empty option is present if the field isn't required.", "test_to_field_resolution_with_fk_pk (admin_views.test_autocomplete_view.AutocompleteJsonViewTests)", "to_fi...
["test_CharField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_DateField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_DateTimeField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_EmailField (admin_widgets.tests.AdminFormfieldForDBFieldTests)", "test_FileField (admin_widgets.tes...
null
true
2021-02-22T11:58:03Z
2
7
5
998
0
0.8
1
0.85
1
0.189667
89.494
3,120
swe_bench::dev::135
swe_bench
dev
135
pylint-dev__astroid-1351
pylint-dev/astroid
pylint-dev/astroid
python
cfd9e74f7b4cbac08357cadec03c736501368afa
Decorator.toline is off by 1 ### Steps to reproduce I came across this inconsistency while debugging why pylint reports `missing-docstring` on the wrong line for the `g2` function in the example. As it turns out, the `toline` of the decorator seems to point to `b=3,` instead of `)`. ```python import ast import astroi...
Actually, it seems a decorator is a red herring here, because I get the same off by one issue simply parsing a call ```python source = """\ f(a=2, b=3, ) """ [call] = ast.parse(source).body print("ast", call.lineno, call.end_lineno) [call] = astroid.parse(source).body print("astroid", call.fromlineno...
diff --git a/astroid/nodes/node_ng.py b/astroid/nodes/node_ng.py --- a/astroid/nodes/node_ng.py +++ b/astroid/nodes/node_ng.py @@ -438,6 +438,8 @@ def fromlineno(self) -> Optional[int]: @decorators.cachedproperty def tolineno(self) -> Optional[int]: """The last line that this node appears on in the s...
diff --git a/tests/unittest_builder.py b/tests/unittest_builder.py --- a/tests/unittest_builder.py +++ b/tests/unittest_builder.py @@ -71,11 +71,14 @@ def test_callfunc_lineno(self) -> None: strarg = callfunc.args[0] self.assertIsInstance(strarg, nodes.Const) if hasattr(sys, "pypy_version_inf...
["tests/unittest_builder.py::FromToLineNoTest::test_callfunc_lineno", "tests/unittest_nodes_lineno.py::TestLinenoColOffset::test_end_lineno_try", "tests/unittest_scoped_nodes.py::ClassNodeTest::test_function_with_decorator_lineno"]
["tests/unittest_builder.py::FromToLineNoTest::test_class_lineno", "tests/unittest_builder.py::FromToLineNoTest::test_decorated_function_lineno", "tests/unittest_builder.py::FromToLineNoTest::test_for_while_lineno", "tests/unittest_builder.py::FromToLineNoTest::test_if_lineno", "tests/unittest_builder.py::FromToLineNoT...
null
true
2022-01-14T21:14:48Z
2
16
3
787
0
0.8
1
0.85
1
0.1845
89.4785
3,121
swe_bench::test::1683
swe_bench
test
1,683
scikit-learn__scikit-learn-25299
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
d9cfe3f6b1c58dd253dc87cb676ce5171ff1f8a1
BUG log_loss renormalizes the predictions ### Describe the bug `log_loss(y_true, y_pred)` renormalizes `y_pred` internally such that it sums to 1. This way, a really bad model, the predictions of which do not sum to 1, gets a better loss then it actually has. ### Steps/Code to Reproduce ```python from scipy.special ...
can u share me the refernce of the code where the bug was there @TomDLT I'd be interested in you opinion. We hit this in https://github.com/scikit-learn/scikit-learn/pull/24365#discussion_r976815764. I feel like computing a log loss with probabilities not summing to one does not make sense, so I am ok with the renormal...
diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py --- a/sklearn/metrics/_classification.py +++ b/sklearn/metrics/_classification.py @@ -2622,6 +2622,9 @@ def log_loss( The default value changed from `1e-15` to `"auto"` that is equivalent to `np.finfo(y_pred.dty...
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 @@ -2477,19 +2477,29 @@ def test_log_loss(): loss = log_loss(y_true, y_pred, normalize=False) assert_al...
["sklearn/metrics/tests/test_classification.py::test_log_loss", "sklearn/metrics/tests/test_classification.py::test_log_loss_pandas_input"]
["sklearn/metrics/tests/test_classification.py::test_classification_report_dictionary_output", "sklearn/metrics/tests/test_classification.py::test_classification_report_output_dict_empty_input", "sklearn/metrics/tests/test_classification.py::test_classification_report_zero_division_warning[warn]", "sklearn/metrics/test...
null
true
2023-01-05T07:16:22Z
1
20
2
698
0
0.8
1
0.85
1
0.183
89.474
3,122
swe_bench::dev::222
swe_bench
dev
222
sqlfluff__sqlfluff-884
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
c0bad78f3fa9549591738c77f869724f721e6830
Whitespace token is_whitespace is False I expect segment.is_whitespace of a Whitespace token is True, however, it is set to False. ## Expected Behaviour segment.is_whitespace return True ## Observed Behaviour segment.is_whitespace return False ## Steps to Reproduce ## Version Include the output of `sqlfluff --versio...
To triage this issue, I searched the SQLFluff code to find all uses of `is_whitespace`. This is the only one I found: ``` src/sqlfluff/core/parser/segments/base.py:72: is_whitespace = False ``` @alanmcruickshank: What's the purpose of `is_whitespace`? I see that long ago (2019), there was a class `Whitespac...
diff --git a/src/sqlfluff/core/dialects/dialect_ansi.py b/src/sqlfluff/core/dialects/dialect_ansi.py --- a/src/sqlfluff/core/dialects/dialect_ansi.py +++ b/src/sqlfluff/core/dialects/dialect_ansi.py @@ -50,7 +50,7 @@ ansi_dialect.set_lexer_struct( [ # name, type, pattern, kwargs - ("whitespace", "...
diff --git a/test/core/dialects/ansi_test.py b/test/core/dialects/ansi_test.py --- a/test/core/dialects/ansi_test.py +++ b/test/core/dialects/ansi_test.py @@ -162,3 +162,14 @@ def test__dialect__ansi_specific_segment_not_parse(raw, err_locations, caplog): assert len(parsed.violations) > 0 locs = [(v.line_no()...
["test/core/dialects/ansi_test.py::test__dialect__ansi_is_whitespace"]
["test/core/dialects/ansi_test.py::test__dialect__ansi__file_lex[a", "test/core/dialects/ansi_test.py::test__dialect__ansi__file_lex[b.c-res1]", "test/core/dialects/ansi_test.py::test__dialect__ansi__file_lex[abc", "test/core/dialects/ansi_test.py::test__dialect__ansi_specific_segment_parses[SelectKeywordSegment-select...
null
true
2021-03-23T21:28:49Z
2
33
1
420
0
0.8
1
0.85
1
0.18
89.465
3,123
swe_bench::test::38
swe_bench
test
38
astropy__astropy-13803
astropy/astropy
astropy/astropy
python
192be538570db75f1f3bf5abe0c7631750e6addc
float32 representation of pi/2 is rejected by `Latitude` ### Description The closest float32 value to pi/2 is by accident slightly larger than pi/2: ``` In [5]: np.pi/2 Out[5]: 1.5707963267948966 In [6]: np.float32(np.pi/2) Out[6]: 1.5707964 ``` Astropy checks using float64 precision, rejecting "valid" alt values ...
> Be lenient? E.g. only make the comparison up to float 32 precision? Instead, we could make the comparison based on the precision of the ``dtype``, using something like https://numpy.org/doc/stable/reference/generated/numpy.finfo.html?highlight=finfo#numpy.finfo That's a funny one! I think @nstarman's suggestion wo...
diff --git a/astropy/coordinates/angles.py b/astropy/coordinates/angles.py --- a/astropy/coordinates/angles.py +++ b/astropy/coordinates/angles.py @@ -573,8 +573,8 @@ def _validate_angles(self, angles=None): # objects, for speed. if angles is None: angles = self - lower = u.degree....
diff --git a/astropy/coordinates/tests/test_angles.py b/astropy/coordinates/tests/test_angles.py --- a/astropy/coordinates/tests/test_angles.py +++ b/astropy/coordinates/tests/test_angles.py @@ -1097,3 +1097,54 @@ def test_str_repr_angles_nan(cls, input, expstr, exprepr): # Deleting whitespaces since repr appears ...
["astropy/coordinates/tests/test_angles.py::test_latitude_limits[value2-expected_value2-None-float32--1]", "astropy/coordinates/tests/test_angles.py::test_latitude_limits[value2-expected_value2-None-float32-1]", "astropy/coordinates/tests/test_angles.py::test_latitude_limits[value3-expected_value3-float32-float32--1]",...
["astropy/coordinates/tests/test_angles.py::test_create_angles", "astropy/coordinates/tests/test_angles.py::test_angle_from_view", "astropy/coordinates/tests/test_angles.py::test_angle_ops", "astropy/coordinates/tests/test_angles.py::test_angle_methods", "astropy/coordinates/tests/test_angles.py::test_angle_convert", "...
null
true
2022-10-06T12:48:27Z
1
4
4
1,950
0
0.8
1
1
0.8
0.338333
89.465
3,124
swe_bench::test::1524
swe_bench
test
1,524
scikit-learn__scikit-learn-11040
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
96a02f3934952d486589dddd3f00b40d5a5ab5f2
Missing parameter validation in Neighbors estimator for float n_neighbors ```python from sklearn.neighbors import NearestNeighbors from sklearn.datasets import make_blobs X, y = make_blobs() neighbors = NearestNeighbors(n_neighbors=3.) neighbors.fit(X) neighbors.kneighbors(X) ``` ``` ~/checkout/scikit-learn/sklearn/nei...
Hello, I would like to take this as my first issue. Thank you. @amueller I added a simple check for float inputs for n_neighbors in order to throw ValueError if that's the case. @urvang96 Did say he was working on it first @Alfo5123 .. @amueller I think there is a lot of other estimators and Python functions i...
diff --git a/sklearn/neighbors/base.py b/sklearn/neighbors/base.py --- a/sklearn/neighbors/base.py +++ b/sklearn/neighbors/base.py @@ -258,6 +258,12 @@ def _fit(self, X): "Expected n_neighbors > 0. Got %d" % self.n_neighbors ) + else: + ...
diff --git a/sklearn/neighbors/tests/test_neighbors.py b/sklearn/neighbors/tests/test_neighbors.py --- a/sklearn/neighbors/tests/test_neighbors.py +++ b/sklearn/neighbors/tests/test_neighbors.py @@ -18,6 +18,7 @@ from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_in from sklear...
["sklearn/neighbors/tests/test_neighbors.py::test_n_neighbors_datatype"]
["sklearn/neighbors/tests/test_neighbors.py::test_unsupervised_kneighbors", "sklearn/neighbors/tests/test_neighbors.py::test_unsupervised_inputs", "sklearn/neighbors/tests/test_neighbors.py::test_precomputed", "sklearn/neighbors/tests/test_neighbors.py::test_precomputed_cross_validation", "sklearn/neighbors/tests/test_...
null
true
2018-04-28T07:18:33Z
1
17
1
726
0
0.8
1
0.85
1
0.177667
89.458
3,125
swe_bench::test::1052
swe_bench
test
1,052
matplotlib__matplotlib-24749
matplotlib/matplotlib
matplotlib/matplotlib
python
84cc898d6475a6bd1f14bd60d53e914484768ca3
[Bug]: contour raises IndexError if Z is specified as keyword argument ### Bug summary `pyplot.contour` raises `IndexError` when `Z` is specified as `Z=a`. ### Code for reproduction ```python import matplotlib.pyplot as plt plt.contour(Z=np.random.rand(30, 30)) ``` ### Actual outcome <img width="1675" alt="Screen ...
Similar to #14084, AFAICT.
diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1381,7 +1381,7 @@ def _process_args(self, *args, corner_mask=None, algorithm=None, **kwargs): """ Process args and kwargs. """ - if isinstance(args[0],...
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 @@ -693,6 +693,13 @@ def test_contour_remove(): assert ax.get_children() == orig_children +def test_contour_no_args(): + fig, ax = pl...
["lib/matplotlib/tests/test_contour.py::test_contour_no_args"]
["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-12-16T16:04:15Z
1
8
1
904
0
0.8
1
0.85
1
0.177333
89.457
3,126
swe_bench::test::1498
swe_bench
test
1,498
scikit-learn__scikit-learn-10397
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
2eb731b375fa0b48f6902daa839ff6a8477b48fd
integers in RidgeCV alpha ```python from sklearn.linear_model import RidgeCV from sklearn.datasets import make_regression X, y = make_regression() ridge = RidgeCV(alphas=[1, 10, 100, 1000]).fit(X, y) ``` > ValueError: Integers to negative integer powers are not allowed. making one of the alphas a float fixes the pro...
Can I take this? I think so, but maybe after that you should have a go at non "good first issue"s! Can I take this? I think so, but maybe after that you should have a go at non "good first issue"s!
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 @@ -778,6 +778,7 @@ class RidgeClassifier(LinearClassifierMixin, _BaseRidge): a one-versus-all approach. Concretely, this is implemented by taking advantage of the...
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 @@ -11,6 +11,7 @@ from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_raises from sklear...
["sklearn/linear_model/tests/test_ridge.py::test_ridgecv_int_alphas", "sklearn/linear_model/tests/test_ridge.py::test_ridgecv_negative_alphas"]
["sklearn/linear_model/tests/test_ridge.py::test_ridge", "sklearn/linear_model/tests/test_ridge.py::test_primal_dual_relationship", "sklearn/linear_model/tests/test_ridge.py::test_ridge_singular", "sklearn/linear_model/tests/test_ridge.py::test_ridge_regression_sample_weights", "sklearn/linear_model/tests/test_ridge.py...
null
true
2018-01-03T18:27:12Z
1
13
2
741
0
0.8
1
0.85
1
0.166833
89.4255
3,127
swe_bench::test::1017
swe_bench
test
1,017
matplotlib__matplotlib-23332
matplotlib/matplotlib
matplotlib/matplotlib
python
6e5a5415ddc513606eac5c116fde492370a3f7f6
Certain non-hashable parameters to text() give cryptic error messages ### Bug report **Bug summary** Per the title. See https://discourse.matplotlib.org/t/cryptic-exception-when-axes-parameters-are-not-as-expected/ as well. **Code for reproduction** ```python figtext(.5, .5, "foo", rotation=[90]) # or figtext(.5,...
Here's a full example and error trace: ```python import matplotlib.pyplot as plt fig = plt.figure() plt.figtext(.5, .5, "foo", rotation=[90]) plt.show() ``` ```python Traceback (most recent call last): File "/Users/dstansby/github/matplotlib/lib/matplotlib/backends/backend_macosx.py", line 45, in _draw ...
diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -5,7 +5,7 @@ import functools import logging import math -import numbers +from numbers import Real import weakref import numpy as np @@ -181,7 +181,7 @@ def __init__(self, self._rend...
diff --git a/lib/matplotlib/tests/test_text.py b/lib/matplotlib/tests/test_text.py --- a/lib/matplotlib/tests/test_text.py +++ b/lib/matplotlib/tests/test_text.py @@ -519,8 +519,8 @@ def test_two_2line_texts(spacing1, spacing2): fig = plt.figure() renderer = fig.canvas.get_renderer() - text1 = plt.text(0...
["lib/matplotlib/tests/test_text.py::test_validate_linespacing"]
["lib/matplotlib/tests/test_text.py::test_font_styles[png]", "lib/matplotlib/tests/test_text.py::test_font_styles[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline[png]", "lib/matplotlib/tests/test_text.py::test_multiline[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline2[png]", "lib/matplotlib/tests/te...
null
true
2022-06-23T16:30:18Z
1
7
1
835
0
0.8
1
0.85
1
0.1625
89.4125
3,128
swe_bench::test::2065
swe_bench
test
2,065
sympy__sympy-15678
sympy/sympy
sympy/sympy
python
31c68eef3ffef39e2e792b0ec92cd92b7010eb2a
Some issues with idiff idiff doesn't support Eq, and it also doesn't support f(x) instead of y. Both should be easy to correct. ``` >>> idiff(Eq(y*exp(y), x*exp(x)), y, x) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "./sympy/geometry/util.py", line 582, in idiff yp = solve(eq.di...
Hi i am a beginner and i would like to work on this issue. @krishna-akula are you still working on this?... I'd like to work on it too
diff --git a/sympy/geometry/util.py b/sympy/geometry/util.py --- a/sympy/geometry/util.py +++ b/sympy/geometry/util.py @@ -570,12 +570,19 @@ def idiff(eq, y, x, n=1): y = y[0] elif isinstance(y, Symbol): dep = {y} + elif isinstance(y, Function): + pass else: - raise ValueErr...
diff --git a/sympy/geometry/tests/test_util.py b/sympy/geometry/tests/test_util.py --- a/sympy/geometry/tests/test_util.py +++ b/sympy/geometry/tests/test_util.py @@ -1,5 +1,5 @@ -from sympy import Symbol, sqrt, Derivative, S -from sympy.geometry import Point, Point2D, Line, Circle ,Polygon, Segment, convex_hull, inter...
["test_idiff"]
["test_intersection", "test_convex_hull", "test_centroid"]
null
true
2018-12-20T18:11:56Z
1
11
1
754
0
0.8
1
0.85
1
0.162333
89.412
3,129
swe_bench::test::49
swe_bench
test
49
astropy__astropy-14295
astropy/astropy
astropy/astropy
python
15cc8f20a4f94ab1910bc865f40ec69d02a7c56c
Presence of SIP keywords leads to ignored PV keywords. ### Description I am working on updating the fits header for one of our telescopes. We wanted to represent the distortions in SIP convention and the projection to be 'CAR'. While working on this, I noticed if SIP coefficients are present in the header and/or '-SIP...
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/wcs/wcs.py b/astropy/wcs/wcs.py --- a/astropy/wcs/wcs.py +++ b/astropy/wcs/wcs.py @@ -534,6 +534,8 @@ def __init__( det2im = self._read_det2im_kw(header, fobj, err=minerr) cpdis = self._read_distortion_kw(header, fobj, dist="CPDIS", err=minerr) + self._fix_pre...
diff --git a/astropy/wcs/tests/test_wcs.py b/astropy/wcs/tests/test_wcs.py --- a/astropy/wcs/tests/test_wcs.py +++ b/astropy/wcs/tests/test_wcs.py @@ -785,11 +785,16 @@ def test_validate_faulty_wcs(): def test_error_message(): header = get_pkg_data_contents("data/invalid_header.hdr", encoding="binary") + # m...
["astropy/wcs/tests/test_wcs.py::test_tpv_ctype_tpv", "astropy/wcs/tests/test_wcs.py::test_tpv_ctype_tan", "astropy/wcs/tests/test_wcs.py::test_car_sip_with_pv"]
["astropy/wcs/tests/test_wcs.py::TestMaps::test_consistency", "astropy/wcs/tests/test_wcs.py::TestMaps::test_maps", "astropy/wcs/tests/test_wcs.py::TestSpectra::test_consistency", "astropy/wcs/tests/test_wcs.py::TestSpectra::test_spectra", "astropy/wcs/tests/test_wcs.py::test_fixes", "astropy/wcs/tests/test_wcs.py::tes...
null
true
2023-01-23T06:51:46Z
1
126
3
5,882
0
0.8
1
0.77
1
0.92
89.405
3,130
swe_bench::test::945
swe_bench
test
945
matplotlib__matplotlib-13859
matplotlib/matplotlib
matplotlib/matplotlib
python
acad890afb1da7d071049d44ec655e0ae5b79e53
Zero-width figure crashes libpng ### Bug report **Bug summary** Zero-width figure crashes libpng. This happens when using ``%matplotlib inline`` or saving to png. **Code for reproduction** ```python import matplotlib.pyplot as plt plt.subplots(1, 1, figsize=(3, 0)) plt.savefig("test.png") ``` **Actual outcome** ``...
My vote is to raise BlackHoleSingularityError. On Tue, Apr 2, 2019 at 8:58 PM Andreas Mueller <notifications@github.com> wrote: > Bug report > > *Bug summary* > > Zero-width figure crashes libpng. > This happens when using %matplotlib inline or saving to png. > > *Code for reproduction* > > import matplotlib.pyplot a...
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -345,9 +345,9 @@ def __init__(self, if frameon is None: frameon = rcParams['figure.frameon'] - if not np.isfinite(figsize).all(): - raise ValueError...
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 @@ -325,14 +325,23 @@ def test_change_dpi(): assert fig.canvas.renderer.width == 200 -def test_invalid_figure_size(): +@pytest.mark.parametr...
["lib/matplotlib/tests/test_figure.py::test_invalid_figure_size[0-1]", "lib/matplotlib/tests/test_figure.py::test_invalid_figure_size[-1-1]"]
["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/matplotlib/tests/test_figure.py::test_gca", "lib/matplotlib/tests/test_figure.py::test_suptitle_fontproperties", "lib/matplotlib/tests/test_...
null
true
2019-04-03T06:40:32Z
1
12
2
662
0
0.8
1
0.85
1
0.150333
89.376
3,131
swe_bench::test::2234
swe_bench
test
2,234
sympy__sympy-21476
sympy/sympy
sympy/sympy
python
f6b0190377be37f93f5e431951e66b562ef5dc35
diffgeom.CoordSystem.transform with indirect relation raises KeyError Below code is a minimal example for an indirect transform via a temporary intermediate coordinate system. `parabolic2D.transform(poloidal)` raises a KeyError. MWE: ``` """ 2D manifold coordinate systems """ import sympy import sympy.diffgeom CARTES...
I started looking into this, I noticed another bug in addition to the type mismatch in the Dijkstra algorithm. Your example only gives the forward transformation from parabolic2D to cartesian2D, so in order to solve `poloidal.transform(parabolic2D)` the `transform `method will need to calculate the inverse transformat...
diff --git a/sympy/diffgeom/diffgeom.py b/sympy/diffgeom/diffgeom.py --- a/sympy/diffgeom/diffgeom.py +++ b/sympy/diffgeom/diffgeom.py @@ -193,8 +193,9 @@ class CoordSystem(Basic): relations : dict, optional Key is a tuple of two strings, who are the names of the systems where - the coordinates t...
diff --git a/sympy/diffgeom/tests/test_diffgeom.py b/sympy/diffgeom/tests/test_diffgeom.py --- a/sympy/diffgeom/tests/test_diffgeom.py +++ b/sympy/diffgeom/tests/test_diffgeom.py @@ -1,10 +1,10 @@ +from sympy.core import Lambda, Symbol, symbols from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r, R3_c, R3_s, R2_origin ...
["test_coordsys_transform"]
["test_R2", "test_R3", "test_point", "test_commutator", "test_differential", "test_products", "test_lie_derivative", "test_intcurve_diffequ", "test_helpers_and_coordinate_dependent", "test_correct_arguments"]
null
true
2021-05-16T07:53:41Z
2
123
1
3,905
0
0.8
1
0.77
1
0.91
89.375
3,132
swe_bench::test::24
swe_bench
test
24
astropy__astropy-13417
astropy/astropy
astropy/astropy
python
7539d76ceae146f930d4473107d9940d2fc0b74f
FITS problem reading binary table with variable length columns I want to read a certain FITS file ([P190mm-PAFBE-FEBEPAR.fits.zip](https://github.com/astropy/astropy/files/2370673/P190mm-PAFBE-FEBEPAR.fits.zip)), which is part of a Multi-Beam-FITS measurement set ([MBFITS](http://www.mpifr-bonn.mpg.de/staff/dmuders/APE...
It took me a bit of time to figure out the issue, as I know almost nothing about VLA, and the `io.fits` code is so simple :grin: , but in the end I think that the issue is with your file: at the end of the header there are TDIM keywords for the 3 columns with VLA, and this mess up the representation of the data: ``` ...
diff --git a/astropy/io/fits/column.py b/astropy/io/fits/column.py --- a/astropy/io/fits/column.py +++ b/astropy/io/fits/column.py @@ -1212,7 +1212,11 @@ def _verify_keywords( ) if dims_tuple: - if reduce(operator.mul, dims_tuple) > format.repeat: + if isins...
diff --git a/astropy/io/fits/tests/test_table.py b/astropy/io/fits/tests/test_table.py --- a/astropy/io/fits/tests/test_table.py +++ b/astropy/io/fits/tests/test_table.py @@ -3270,6 +3270,72 @@ def test_empty_vla_raw_data(self): [np.array([], dtype=np.int32), np.array([], dtype=np.int32)], ...
["astropy/io/fits/tests/test_table.py::TestVLATables::test_multidim_VLA_tables"]
["astropy/io/fits/tests/test_table.py::TestTableFunctions::test_constructor_copies_header", "astropy/io/fits/tests/test_table.py::TestTableFunctions::test_open[]", "astropy/io/fits/tests/test_table.py::TestTableFunctions::test_open[home_is_data]", "astropy/io/fits/tests/test_table.py::TestTableFunctions::test_open[home...
null
true
2022-07-01T08:50:37Z
2
35
1
6,903
0
0.8
1
0.8
1
0.616667
89.35
3,133
swe_bench::test::1349
swe_bench
test
1,349
pylint-dev__pylint-6506
pylint-dev/pylint
pylint-dev/pylint
python
0a4204fd7555cfedd43f43017c94d24ef48244a5
Traceback printed for unrecognized option ### Bug description A traceback is printed when an unrecognized option is passed to pylint. ### Configuration _No response_ ### Command used ```shell pylint -Q ``` ### Pylint output ```shell ************* Module Command line Command line:1:0: E0015: Unrecognized option f...
@Pierre-Sassoulas Agreed that this is a blocker for `2.14` but not necessarily for the beta. This is just a "nice-to-have". Thanks @mbyrnepr2 for reporting though! 👍 the blocker are for the final release only. We could add a 'beta-blocker' label, that would be very humorous !
diff --git a/pylint/config/config_initialization.py b/pylint/config/config_initialization.py --- a/pylint/config/config_initialization.py +++ b/pylint/config/config_initialization.py @@ -81,8 +81,7 @@ def _config_initialization( unrecognized_options.append(opt[1:]) if unrecognized_options: ms...
diff --git a/tests/config/test_config.py b/tests/config/test_config.py --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -10,7 +10,6 @@ import pytest from pytest import CaptureFixture -from pylint.config.exceptions import _UnrecognizedOptionError from pylint.lint import Run as LintRun from py...
["tests/config/test_config.py::test_unknown_option_name", "tests/config/test_config.py::test_unknown_short_option_name"]
["tests/config/test_config.py::test_can_read_toml_env_variable", "tests/config/test_config.py::test_unknown_message_id", "tests/config/test_config.py::test_unknown_confidence", "tests/config/test_config.py::test_unknown_yes_no", "tests/config/test_config.py::test_unknown_py_version", "tests/config/test_config.py::test_...
null
true
2022-05-05T13:01:41Z
1
3
2
1,671
0
0.8
1
1
0.8
0.2885
89.3155
3,134
swe_bench::dev::157
swe_bench
dev
157
pylint-dev__astroid-983
pylint-dev/astroid
pylint-dev/astroid
python
53a20335357bbd734d74c3bfe22e3518f74f4d11
Cannot infer empty functions ### Steps to reproduce ```python import astroid astroid.extract_node(""" def f(): pass f() """).inferred() ``` ### Current behavior raises `StopIteration` ### Expected behavior Returns `[const.NoneType]` ### ``python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"`` o...
Makes sense. This happens because the inference for functions looks through each return value here (https://github.com/PyCQA/astroid/blob/629c92db2dc1b016f4bf47645c95c42e65fd3bd6/astroid/scoped_nodes.py#L1558) and tries to infer the result from there. But since functions like this don't have an explicit return value...
diff --git a/astroid/bases.py b/astroid/bases.py --- a/astroid/bases.py +++ b/astroid/bases.py @@ -329,6 +329,12 @@ def getitem(self, index, context=None): raise exceptions.InferenceError( "Could not find __getitem__ for {node!r}.", node=self, context=context ) + if len...
diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py --- a/tests/unittest_inference.py +++ b/tests/unittest_inference.py @@ -706,14 +706,6 @@ class InvalidGetitem2(object): NoGetitem()[4] #@ InvalidGetitem()[5] #@ InvalidGetitem2()[10] #@ - """ - ) - for...
["tests/unittest_scoped_nodes.py::FunctionNodeTest::test_abstract_methods_are_not_implicitly_none", "tests/unittest_scoped_nodes.py::FunctionNodeTest::test_no_returns_is_implicitly_none", "tests/unittest_scoped_nodes.py::FunctionNodeTest::test_only_raises_is_not_implicitly_none"]
["tests/unittest_inference.py::InferenceUtilsTest::test_path_wrapper", "tests/unittest_inference.py::InferenceTest::test__new__", "tests/unittest_inference.py::InferenceTest::test__new__bound_methods", "tests/unittest_inference.py::InferenceTest::test_advanced_tupleassign_name_inference1", "tests/unittest_inference.py:...
null
true
2021-05-01T03:28:27Z
2
18
3
417
0
0.8
1
0.85
1
0.1295
89.3135
3,135
swe_bench::dev::109
swe_bench
dev
109
pydicom__pydicom-811
pydicom/pydicom
pydicom/pydicom
python
7d0889e7143f5d4773fa74606efa816ed4e54c9f
0 byte file causes traceback on dcmreader #### Description Trying to open a 0 byte file with dcmreader causes a traceback originating in the read_partial method. The problem is line 692 in filereader.py (GitHub): ` fileobj.seek(-1, 1)` Changing this to: ` if peek != b'': fileobj.seek(-1, 1)` Appears to s...
Good catch! There is actually a test for this, but it tests a byte stream instead of a file, and seeking back past begin in a byte stream seems not to be a problem.
diff --git a/pydicom/filereader.py b/pydicom/filereader.py --- a/pydicom/filereader.py +++ b/pydicom/filereader.py @@ -689,7 +689,8 @@ def read_partial(fileobj, stop_when=None, defer_size=None, # Check to see if there's anything left to read peek = fileobj.read(1) - fileobj.seek(-1, 1) + if peek != b'...
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 @@ -672,6 +672,14 @@ def test_no_dataset(self): self.assertEqual(ds.file_meta, Dataset()) self.assertEqual(ds[:], Dataset()) + def test_em...
["pydicom/tests/test_filereader.py::ReaderTests::test_empty_file"]
["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-03-05T20:48:34Z
1
3
1
1,658
0
0.8
1
1
0.8
0.286333
89.309
3,136
swe_bench::dev::102
swe_bench
dev
102
pydicom__pydicom-1633
pydicom/pydicom
pydicom/pydicom
python
98ac88706e7ab17cd279c94949ac6af4e87f341d
OverflowError "VR of 'DS' must be <= 16 characters long" triggered when element is 16 characters long **Describe the bug** `OverflowError` triggered while accessing `PixelData`, which the values compliant with the standard. In the sample referenced in the example below, we have this, which satisfies DS VR: ``` (0028,...
For reference, a possibly similar issue came up in dcmjs: https://github.com/dcmjs-org/dcmjs/issues/175 I had a quick look, and the problem seems to be that the length is not taken from the original string, but from the string representation, which in this case adds a leading zero... This check has been introduced in p...
diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py --- a/pydicom/valuerep.py +++ b/pydicom/valuerep.py @@ -874,7 +874,7 @@ def __init__( if (validation_mode == config.RAISE and not self.auto_format): - if len(repr(self)[1:-1]) > 16: + if len(str(self)) > 16: ...
diff --git a/pydicom/tests/test_valuerep.py b/pydicom/tests/test_valuerep.py --- a/pydicom/tests/test_valuerep.py +++ b/pydicom/tests/test_valuerep.py @@ -603,6 +603,13 @@ def test_enforce_valid_values_length(self): valuerep.DSfloat('3.141592653589793', validation_mode=config....
["pydicom/tests/test_valuerep.py::TestDSfloat::test_handle_missing_leading_zero"]
["pydicom/tests/test_valuerep.py::TestTM::test_pickling", "pydicom/tests/test_valuerep.py::TestTM::test_pickling_tm_from_time", "pydicom/tests/test_valuerep.py::TestTM::test_str_and_repr", "pydicom/tests/test_valuerep.py::TestTM::test_new_empty_str", "pydicom/tests/test_valuerep.py::TestTM::test_new_str_conversion", "p...
null
true
2022-04-14T18:26:56Z
1
4
1
1,587
0
0.8
1
1
0.8
0.277833
89.2835
3,137
swe_bench::test::1873
swe_bench
test
1,873
sphinx-doc__sphinx-9246
sphinx-doc/sphinx
sphinx-doc/sphinx
python
630e5bd15f43c6cd91e61723f40b6c94ef622060
Unknown node: `pending_xref_condition` ### To Reproduce ```sh python -m venv .venv . .venv/bin/activate pip install sphinx==4.0.1 sphinx-qt-documentation==0.3 PyQt5==5.15.4 mkdir docs ``` `foo.py`: ```python from PyQt5 import QtGui def bar() -> QtGui.QIcon: pass ``` `docs/conf.py`: ```python import os import sy...
Thank you for reporting. I guess Sphinx's post processing has a bug when 3rd party extension resolves a missing-reference. Could you check this patch works fine? ``` diff --git a/sphinx/transforms/post_transforms/__init__.py b/sphinx/transforms/post_transforms/__init__.py index e2899d994..54cab4ed6 100644 --- a/...
diff --git a/sphinx/transforms/post_transforms/__init__.py b/sphinx/transforms/post_transforms/__init__.py --- a/sphinx/transforms/post_transforms/__init__.py +++ b/sphinx/transforms/post_transforms/__init__.py @@ -8,10 +8,10 @@ :license: BSD, see LICENSE for details. """ -from typing import Any, Dict, List, Op...
diff --git a/tests/roots/test-transforms-post_transforms-missing-reference/conf.py b/tests/roots/test-transforms-post_transforms-missing-reference/conf.py new file mode 100644 --- /dev/null +++ b/tests/roots/test-transforms-post_transforms-missing-reference/conf.py @@ -0,0 +1 @@ +nitpicky = True diff --git a/tests/root...
["tests/test_transforms_post_transforms.py::test_missing_reference_conditional_pending_xref"]
["tests/test_transforms_post_transforms.py::test_nitpicky_warning", "tests/test_transforms_post_transforms.py::test_missing_reference"]
null
true
2021-05-17T16:13:07Z
1
28
1
6,889
0
0.8
1
0.8
1
0.593333
89.28
3,138
swe_bench::dev::179
swe_bench
dev
179
sqlfluff__sqlfluff-1763
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
a10057635e5b2559293a676486f0b730981f037a
dbt postgres fix command errors with UnicodeEncodeError and also wipes the .sql file _If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant._ ## Expected Behaviour Vi...
I get a dbt-related error -- can you provide your project file as well? Also, what operating system are you running this on? I tested a simplified (non-dbt) version of your file on my Mac, and it worked okay. ``` dbt.exceptions.DbtProjectError: Runtime Error no dbt_project.yml found at expected path /Users/bhart...
diff --git a/src/sqlfluff/core/linter/linted_file.py b/src/sqlfluff/core/linter/linted_file.py --- a/src/sqlfluff/core/linter/linted_file.py +++ b/src/sqlfluff/core/linter/linted_file.py @@ -7,6 +7,8 @@ import os import logging +import shutil +import tempfile from typing import ( Any, Iterable, @@ -493,7...
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 @@ -641,3 +641,56 @@ def test__attempt_to_change_templater_warning(caplog): assert "Attempt to set templater to " in caplog.text finally: logger.propagate = original_prop...
["test/core/linter_test.py::test_safe_create_replace_file[utf8_create]", "test/core/linter_test.py::test_safe_create_replace_file[utf8_update]", "test/core/linter_test.py::test_safe_create_replace_file[utf8_special_char]"]
["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
2021-10-26T17:28:28Z
1
25
3
6,520
0
0.8
1
0.8
1
0.583333
89.25
3,139
swe_bench::test::1608
swe_bench
test
1,608
scikit-learn__scikit-learn-13554
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
c903d71c5b06aa4cf518de7e3676c207519e0295
Numerical precision of euclidean_distances with float32 #### Description I noticed that sklearn.metrics.pairwise.pairwise_distances function agrees with np.linalg.norm when using np.float64 arrays, but disagrees when using np.float32 arrays. See the code snippet below. #### Steps/Code to Reproduce ```python import n...
Same results with python 3.5 : ``` Darwin-15.6.0-x86_64-i386-64bit Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] NumPy 1.11.0 SciPy 0.18.1 Scikit-Learn 0.17.1 ``` It happens only with euclidean distance and can be reproduced using directly `sklearn.m...
diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -193,6 +193,7 @@ def euclidean_distances(X, Y=None, Y_norm_squared=None, squared=False, Y_norm_squared : array-like, shape (n_samples_2, ), optional Pre-computed do...
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 @@ -584,41 +584,115 @@ def test_pairwise_distances_chunked(): assert_raises(StopIteration, next, gen) -def test_euclidean_distan...
["sklearn/metrics/tests/test_pairwise.py::test_euclidean_distances_with_norms[dense-float32]", "sklearn/metrics/tests/test_pairwise.py::test_euclidean_distances_with_norms[sparse-float32]", "sklearn/metrics/tests/test_pairwise.py::test_euclidean_distances[dense-dense-float32]", "sklearn/metrics/tests/test_pairwise.py::...
["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-04-01T14:41:03Z
1
109
10
3,819
0
0.8
1
0.77
1
0.863333
89.235
3,140
swe_bench::dev::193
swe_bench
dev
193
sqlfluff__sqlfluff-3066
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
2b93a26e6f15129fd1846bee52f51077eef7ca0c
Jinja: sqlfluff fails in the presence of assignments with multiple targets ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. I did search, and I think this _may_ be related, but since no more information was provided I cannot confirm it: h...
Heh, I didn't know this syntax was possible, but not surprising since it's valid in Python itself. I have wondered if we could potentially run the Python parser on the text inside the brackets. Jinja syntax is mostly the same as Python. Perhaps we can leverage [this](https://github.com/pallets/jinja/blob/main/src/ji...
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 @@ -10,6 +10,7 @@ from jinja2 import Environment from jinja2.environment import Template +from jinja2...
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 @@ -335,6 +335,58 @@ class RawTemplatedTestCase(NamedTuple): "\n", ], ), + RawTemplatedTestCase( + ...
["test/core/templaters/jinja_test.py::test__templater_jinja_slices[set_multiple_variables_and_define_macro]"]
["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-04-10T19:20:47Z
1
20
1
6,990
0
0.8
1
0.8
1
0.566667
89.2
3,141
swe_bench::test::1625
swe_bench
test
1,625
scikit-learn__scikit-learn-13974
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
0bdd92036dcc3daac5ab5fb8cd668d54eab43390
Design of add_indicator in SimpleImputer may fail when running cross validation #### Description The design of `add_indicator` depends on missing values exist in the training data. This will break cross validation. #### Steps/Code to Reproduce ```py import numpy as np from sklearn.impute import SimpleImputer from s...
Is that MissingIndicator failing? Shouldn't it be silent if a feature has nan in test but is not one of the features or provides indicators for? If we set `MissingIndicator`'s `error_on_new=False`, then it will be silent. Currently, there is not a way to directly set this from `SimpleImputer`'s API. We should have err...
diff --git a/sklearn/impute/_base.py b/sklearn/impute/_base.py --- a/sklearn/impute/_base.py +++ b/sklearn/impute/_base.py @@ -269,7 +269,7 @@ def fit(self, X, y=None): if self.add_indicator: self.indicator_ = MissingIndicator( - missing_values=self.missing_values) + ...
diff --git a/sklearn/impute/tests/test_impute.py b/sklearn/impute/tests/test_impute.py --- a/sklearn/impute/tests/test_impute.py +++ b/sklearn/impute/tests/test_impute.py @@ -445,6 +445,16 @@ def test_imputation_constant_pandas(dtype): assert_array_equal(X_trans, X_true) +@pytest.mark.parametrize('Imputer', (S...
["sklearn/impute/tests/test_impute.py::test_imputation_missing_value_in_test_array[SimpleImputer]", "sklearn/impute/tests/test_impute.py::test_imputation_missing_value_in_test_array[IterativeImputer]"]
["sklearn/impute/tests/test_impute.py::test_imputation_shape", "sklearn/impute/tests/test_impute.py::test_imputation_error_invalid_strategy[const]", "sklearn/impute/tests/test_impute.py::test_imputation_error_invalid_strategy[101]", "sklearn/impute/tests/test_impute.py::test_imputation_error_invalid_strategy[None]", "s...
null
true
2019-05-29T01:34:39Z
2
4
2
1,386
0
0.8
1
1
0.8
0.244333
89.183
3,142
swe_bench::dev::163
swe_bench
dev
163
pyvista__pyvista-4225
pyvista/pyvista
pyvista/pyvista
python
18694fa1a4e95027a055a958fef61ffdc5dba4d7
Cell wise and dimension reducing filters do not work for PointSet ### Describe the bug, what's wrong, and what you expected. `PointSet` is an odd data type as it has no cells and simply represents a 0-dimensional geometry: point clouds. This means that two common types of operations are not possible on this data type...
diff --git a/doc/source/conf.py b/doc/source/conf.py --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -209,6 +209,8 @@ # Type alias r'\.ColorLike$', r'\.Chart$', + # PointSet *args and **kwargs for wrapped parameters + r'\.PointSet(\.|$)', # Mixin methods from collections.abc r'\.Mult...
diff --git a/tests/test_pointset.py b/tests/test_pointset.py --- a/tests/test_pointset.py +++ b/tests/test_pointset.py @@ -5,6 +5,11 @@ import vtk import pyvista +from pyvista.core.errors import ( + PointSetCellOperationError, + PointSetDimensionReductionError, + PointSetNotSupported, +) # skip all test...
["tests/test_pointset.py::test_pointset_basic", "tests/test_pointset.py::test_pointset_from_vtk", "tests/test_pointset.py::test_pointset_wrap", "tests/test_pointset.py::test_pointset", "tests/test_pointset.py::test_save", "tests/test_pointset.py::test_cast_to_polydata[True]", "tests/test_pointset.py::test_cast_to_polyd...
[]
null
true
2023-04-03T23:24:53Z
3
142
27
1,652
0
0.8
1
0.85
1
0.748667
89.171
3,143
swe_bench::test::1068
swe_bench
test
1,068
matplotlib__matplotlib-25281
matplotlib/matplotlib
matplotlib/matplotlib
python
5aee26d0a52c237c5b4fafcb843e392907ab45b3
[Bug]: Validation not performed for `loc` argument to `legend` ### Bug summary When passing non-str `loc` values to `legend`, validation is not performed. So even for invalid inputs, errors are raised only when we call `show()` ### Code for reproduction ```python >>> import matplotlib.pyplot as plt >>> import matplo...
The work here is to : - sort out what the validation _should be_ (read the code where the above traceback starts) - add logic to `Legend.__init__` to validate loc - add tests - update docstring to legend (in both `Legend` and `Axes.legend`) This is a good first issue because it should only require understa...
diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -23,6 +23,7 @@ import itertools import logging +import numbers import time import numpy as np @@ -517,6 +518,9 @@ def val_or_rc(val, rc_name): if not self.isaxes and loc...
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -1219,3 +1219,79 @@ def test_ncol_ncols(fig_test, fig_ref): ncols = 3 fig_test.legend(strings, ncol=ncols) fig_ref.legend(strings, ...
["lib/matplotlib/tests/test_legend.py::test_loc_invalid_tuple_exception", "lib/matplotlib/tests/test_legend.py::test_loc_invalid_list_exception", "lib/matplotlib/tests/test_legend.py::test_loc_invalid_type", "lib/matplotlib/tests/test_legend.py::test_loc_validation_numeric_value"]
["lib/matplotlib/tests/test_legend.py::test_legend_ordereddict", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[png]", "lib/matplotlib/tests/test_legend.py::test_legend_auto1[pdf]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[png]", "lib/matplotlib/tests/test_legend.py::test_legend_auto2[pdf]", "li...
null
true
2023-02-22T05:06:30Z
1
17
4
7,297
0
0.8
1
0.8
1
0.556667
89.17
3,144
swe_bench::test::1164
swe_bench
test
1,164
psf__requests-1339
psf/requests
psf/requests
python
ab36f3cc6f91f1e4903a3f4b31501cb7fefe4555
CaseInsensitiveDict __setitem__ faulty for differing-case keys I think I figured out the cause of the issue described here: https://github.com/kennethreitz/requests/pull/59 It appears that if one isn't careful to use a common case convention when assigning a header after it has been assigned before, the header will fa...
The same issue arises when initializing a CaseInsensitiveDict using a dictionary of differing-case keys or differing-case keyword arguments. Example: ``` >>> from requests.structures import CaseInsensitiveDict >>> CaseInsensitiveDict(a=1, A=2, B=3) {'A': 2, 'a': 1, 'B': 3} >>> CaseInsensitiveDict({'a': 1, 'A': 2, 'B':...
diff --git a/requests/structures.py b/requests/structures.py --- a/requests/structures.py +++ b/requests/structures.py @@ -9,6 +9,7 @@ """ import os +import collections from itertools import islice @@ -33,43 +34,79 @@ def read(self, n): return "".join(islice(self.i, None, n)) -class CaseInsensitiv...
diff --git a/test_requests.py b/test_requests.py --- a/test_requests.py +++ b/test_requests.py @@ -13,6 +13,7 @@ from requests.auth import HTTPDigestAuth from requests.compat import str, cookielib from requests.cookies import cookiejar_from_dict +from requests.structures import CaseInsensitiveDict try: impor...
["test_requests.py::TestCaseInsensitiveDict::test_equality", "test_requests.py::TestCaseInsensitiveDict::test_fixes_649", "test_requests.py::TestCaseInsensitiveDict::test_len", "test_requests.py::TestCaseInsensitiveDict::test_lower_items", "test_requests.py::TestCaseInsensitiveDict::test_preserve_last_key_case", "test_...
["test_requests.py::RequestsTestCase::test_basic_building", "test_requests.py::RequestsTestCase::test_cannot_send_unprepared_requests", "test_requests.py::RequestsTestCase::test_cookie_parameters", "test_requests.py::RequestsTestCase::test_entry_points", "test_requests.py::RequestsTestCase::test_get_auth_from_url", "te...
null
true
2013-04-30T20:05:30Z
2
94
7
3,046
0
0.8
1
0.77
1
0.813333
89.085
3,145
swe_bench::test::39
swe_bench
test
39
astropy__astropy-13838
astropy/astropy
astropy/astropy
python
a6c712375ed38d422812e013566a34f928677acd
Printing tables doesn't work correctly with 0-length array cells ### Description I have data in form of a list of dictionaries. Each dictionary contains some items with an integer value and some of these items set the length for 1 or more array values. I am creating a Table using the `rows` attribute and feeding to ...
The root cause of this is that astropy delegates to numpy to convert a list of values into a numpy array. Notice the differences in output `dtype` here: ``` In [25]: np.array([[], []]) Out[25]: array([], shape=(2, 0), dtype=float64) In [26]: np.array([[], [], [1, 2]]) Out[26]: array([list([]), list([]), list([1,...
diff --git a/astropy/table/pprint.py b/astropy/table/pprint.py --- a/astropy/table/pprint.py +++ b/astropy/table/pprint.py @@ -392,7 +392,8 @@ def _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, if multidims: multidim0 = tuple(0 for n in multidims) multidim1 = tupl...
diff --git a/astropy/table/tests/test_pprint.py b/astropy/table/tests/test_pprint.py --- a/astropy/table/tests/test_pprint.py +++ b/astropy/table/tests/test_pprint.py @@ -972,3 +972,18 @@ def test_embedded_newline_tab(): r' a b \n c \t \n d', r' x y\n'] assert t.pformat_all() == ex...
["astropy/table/tests/test_pprint.py::test_multidims_with_zero_dim"]
["astropy/table/tests/test_pprint.py::TestMultiD::test_multidim[False]", "astropy/table/tests/test_pprint.py::TestMultiD::test_multidim[True]", "astropy/table/tests/test_pprint.py::TestMultiD::test_fake_multidim[False]", "astropy/table/tests/test_pprint.py::TestMultiD::test_fake_multidim[True]", "astropy/table/tests/te...
null
true
2022-10-15T11:03:12Z
1
8
1
12,796
0
0.8
1
0.8
1
0.526667
89.08
3,146
swe_bench::test::1691
swe_bench
test
1,691
scikit-learn__scikit-learn-25601
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
c991e30c96ace1565604b429de22e36ed6b1e7bd
RandomForestClassifier class_weight/max_samples interaction can lead to ungraceful and nondescriptive failure ### Describe the bug The acceptable values for `max_samples` are `(0, 1]`. One possible option for `class_weight` is `balanced_subsample`. However, for values of `max_samples` near zero and `class_weight='bala...
We should probably add a check before launching the actual `fit` to be sure that the condition is met to do so. A nice error message is indeed what we need here. @swight-prc are you interested to submit a bugfix and add your snippet of code as a non-regression test? > @swight-prc are you interested to submit a bugfix...
diff --git a/sklearn/ensemble/_forest.py b/sklearn/ensemble/_forest.py --- a/sklearn/ensemble/_forest.py +++ b/sklearn/ensemble/_forest.py @@ -117,7 +117,7 @@ def _get_n_samples_bootstrap(n_samples, max_samples): return max_samples if isinstance(max_samples, Real): - return round(n_samples * max_...
diff --git a/sklearn/ensemble/tests/test_forest.py b/sklearn/ensemble/tests/test_forest.py --- a/sklearn/ensemble/tests/test_forest.py +++ b/sklearn/ensemble/tests/test_forest.py @@ -1807,3 +1807,16 @@ def test_read_only_buffer(monkeypatch): clf = RandomForestClassifier(n_jobs=2, random_state=rng) cross_val...
["sklearn/ensemble/tests/test_forest.py::test_round_samples_to_one_when_samples_too_low[balanced_subsample]"]
["sklearn/ensemble/tests/test_forest.py::test_classification_toy[ExtraTreesClassifier]", "sklearn/ensemble/tests/test_forest.py::test_classification_toy[RandomForestClassifier]", "sklearn/ensemble/tests/test_forest.py::test_iris[gini-ExtraTreesClassifier]", "sklearn/ensemble/tests/test_forest.py::test_iris[gini-RandomF...
null
true
2023-02-13T21:42:21Z
1
6
1
6,158
0
0.8
1
0.8
1
0.52
89.06
3,147
swe_bench::test::967
swe_bench
test
967
matplotlib__matplotlib-20679
matplotlib/matplotlib
matplotlib/matplotlib
python
27ab013fe72967e9a9e1f7566a0aa6910aed4c9c
Interactive SpanSelector no longer notifies when the selector is removed by an "empty" click ### Bug report **Bug summary** Previously, when a `span_stays` SpanSelector was interactively removed by clicking and immediately releasing the button, the `onselect` callback would be fired (with `vmin = vmax = <the clicked...
diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -1807,6 +1807,9 @@ def __init__(self, ax, onselect, useblit=False, button=None, else: self.validButtons = button + # Set to True when a selection is comple...
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 @@ -190,6 +190,63 @@ def onselect(epress, erelease): tool._corner_handles.artist.get_markeredgecolor(), 'b') +@pytest.mark.parametri...
["lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_ignore_outside[True]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector_ignore_outside[False]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_onselect[True]", "lib/matplotlib/tests/test_widgets.py::test_span_selector_onselect[Fals...
["lib/matplotlib/tests/test_widgets.py::test_rectangle_drag[True-new_center0]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_drag[False-new_center1]", "lib/matplotlib/tests/test_widgets.py::test_ellipse", "lib/matplotlib/tests/test_widgets.py::test_rectangle_handles", "lib/matplotlib/tests/test_widgets.py::tes...
null
true
2021-07-19T13:55:49Z
1
130
6
1,419
0
0.8
1
0.85
1
0.669833
88.9345
3,148
swe_bench::test::1589
swe_bench
test
1,589
scikit-learn__scikit-learn-13283
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
12705bb4371c294db4461882007f40a101d74a81
Isolation forest - decision_function & average_path_length method are memory inefficient #### Description Isolation forest consumes too much memory due to memory ineffecient implementation of anomoly score calculation. Due to this the parallelization with n_jobs is also impacted as anomoly score cannot be calculated in...
Thank you for the report and the detailed analysis. A pull request to improve the memory usage in `IsolationForest` would be very much appreciated! Also if possible please use code formatting in Github comments -- it really helps readability (I edited your comment above) , and it possible to use some other format...
diff --git a/sklearn/ensemble/iforest.py b/sklearn/ensemble/iforest.py --- a/sklearn/ensemble/iforest.py +++ b/sklearn/ensemble/iforest.py @@ -9,9 +9,14 @@ from warnings import warn from ..tree import ExtraTreeRegressor -from ..utils import check_random_state, check_array +from ..utils import ( + check_random_st...
diff --git a/sklearn/ensemble/tests/test_iforest.py b/sklearn/ensemble/tests/test_iforest.py --- a/sklearn/ensemble/tests/test_iforest.py +++ b/sklearn/ensemble/tests/test_iforest.py @@ -29,6 +29,7 @@ from sklearn.metrics import roc_auc_score from scipy.sparse import csc_matrix, csr_matrix +from unittest.mock impor...
["sklearn/ensemble/tests/test_iforest.py::test_iforest_chunks_works1[0.25-3]", "sklearn/ensemble/tests/test_iforest.py::test_iforest_chunks_works1[auto-2]", "sklearn/ensemble/tests/test_iforest.py::test_iforest_chunks_works2[0.25-3]", "sklearn/ensemble/tests/test_iforest.py::test_iforest_chunks_works2[auto-2]"]
["sklearn/ensemble/tests/test_iforest.py::test_iforest", "sklearn/ensemble/tests/test_iforest.py::test_iforest_sparse", "sklearn/ensemble/tests/test_iforest.py::test_iforest_error", "sklearn/ensemble/tests/test_iforest.py::test_recalculate_max_depth", "sklearn/ensemble/tests/test_iforest.py::test_max_samples_attribute"...
null
true
2019-02-26T14:44:46Z
1
85
4
2,644
0.035714
0.8
1
0.85
1
0.724
88.923875
3,149
swe_bench::dev::38
swe_bench
dev
38
pvlib__pvlib-python-1368
pvlib/pvlib-python
pvlib/pvlib-python
python
93e84041387c80bf8738fe96409a0cfd5852c29a
`read_crn` returns -99999 instead of `NaN` **Describe the bug** `read_crn` fails to map -99999 to `NaN` **To Reproduce** ```python from pvlib.iotools import read_crn crn = read_crn('https://www.ncei.noaa.gov/pub/data/uscrn/products/subhourly01/2021/CRNS0101-05-2021-NY_Millbrook_3_W.txt') crn.loc['2021-12-14 0930':'202...
diff --git a/pvlib/iotools/crn.py b/pvlib/iotools/crn.py --- a/pvlib/iotools/crn.py +++ b/pvlib/iotools/crn.py @@ -2,15 +2,14 @@ """ import pandas as pd -import numpy as np -HEADERS = ( - 'WBANNO UTC_DATE UTC_TIME LST_DATE LST_TIME CRX_VN LONGITUDE LATITUDE ' - 'AIR_TEMPERATURE PRECIPITATION SOLAR_RADIATI...
diff --git a/pvlib/tests/iotools/test_crn.py b/pvlib/tests/iotools/test_crn.py --- a/pvlib/tests/iotools/test_crn.py +++ b/pvlib/tests/iotools/test_crn.py @@ -3,11 +3,11 @@ from numpy import dtype, nan import pytest from pvlib.iotools import crn -from ..conftest import DATA_DIR, assert_frame_equal +from ..conftest i...
["pvlib/tests/iotools/test_crn.py::test_read_crn_map_variables"]
["pvlib/tests/iotools/test_crn.py::test_read_crn"]
null
true
2022-01-05T22:59:26Z
1
85
1
2,155
0
0.8
1
0.85
1
0.6425
88.8525
3,150
swe_bench::test::1716
swe_bench
test
1,716
scikit-learn__scikit-learn-9274
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
faa940608befaeca99db501609c6db796739f30f
Training MLP using l-bfgs limited to default l-bfgs maxiter value #### Description Training an MLP regressor (or classifier) using l-bfgs currently cannot run for more than (approx) 15000 iterations. This artificial limit is caused by the call site to l-bfgs passing the MLP argument value "max_iters" to the argument f...
diff --git a/sklearn/neural_network/multilayer_perceptron.py b/sklearn/neural_network/multilayer_perceptron.py --- a/sklearn/neural_network/multilayer_perceptron.py +++ b/sklearn/neural_network/multilayer_perceptron.py @@ -51,7 +51,7 @@ def __init__(self, hidden_layer_sizes, activation, solver, max_it...
diff --git a/sklearn/neural_network/tests/test_mlp.py b/sklearn/neural_network/tests/test_mlp.py --- a/sklearn/neural_network/tests/test_mlp.py +++ b/sklearn/neural_network/tests/test_mlp.py @@ -48,6 +48,8 @@ Xboston = StandardScaler().fit_transform(boston.data)[: 200] yboston = boston.target[:200] +regression_data...
["sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification_maxfun[X0-y0]", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification_maxfun[X1-y1]", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_regression_maxfun[X0-y0]"]
["sklearn/neural_network/tests/test_mlp.py::test_alpha", "sklearn/neural_network/tests/test_mlp.py::test_fit", "sklearn/neural_network/tests/test_mlp.py::test_gradient", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification[X0-y0]", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification[X1-...
null
true
2017-07-03T22:39:22Z
1
55
3
2,605
0
0.8
1
0.85
1
0.6175
88.7775
3,151
swe_bench::test::1830
swe_bench
test
1,830
sphinx-doc__sphinx-8539
sphinx-doc/sphinx
sphinx-doc/sphinx
python
e888a4424939fd34590e5443838709d00d8d8874
autodoc_typehints='description' does not combine well with autoclass_content='class' With this configuration: ~~~~~~~~ python extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autodoc.typehints', ] autodoc_default_options = { 'members': True, 'special-members': '__init__', } autoclass_content = 'class' ...
The bug reported in #7329 was that, when `autodoc_typehints="description"`, `autoclass_content="class"`, and `__init__` is documented separately from the class because `special-members` includes `__init__`, the constructor parameters would be duplicated in both the class documentation and the `__init__` method documen...
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -2656,6 +2656,8 @@ def setup(app: Sphinx) -> Dict[str, Any]: app.add_config_value('autodoc_mock_imports', [], True) app.add_config_value('autodoc_typehints'...
diff --git a/tests/roots/test-ext-autodoc/target/typehints.py b/tests/roots/test-ext-autodoc/target/typehints.py --- a/tests/roots/test-ext-autodoc/target/typehints.py +++ b/tests/roots/test-ext-autodoc/target/typehints.py @@ -68,3 +68,13 @@ def missing_attr(c, ): # type: (...) -> str return...
["tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_no_undoc", "tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_with_documented_init", "tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_with_documented_init_no_undoc"]
["tests/test_ext_autodoc_configs.py::test_autoclass_content_class", "tests/test_ext_autodoc_configs.py::test_autoclass_content_init", "tests/test_ext_autodoc_configs.py::test_autoclass_content_both", "tests/test_ext_autodoc_configs.py::test_autodoc_inherit_docstrings", "tests/test_ext_autodoc_configs.py::test_autodoc_d...
null
true
2020-12-15T01:06:47Z
2
57
3
3,094
0
0.8
1
0.77
1
0.69
88.715
3,152
swe_bench::test::961
swe_bench
test
961
matplotlib__matplotlib-20374
matplotlib/matplotlib
matplotlib/matplotlib
python
d385b2caa8fae238fafd7d2a6ba493703b100b8c
plot_directive is confused by include directives, part 2 (context option) ### Bug summary Whenever a file `b.rst` is included in `a.rst` via the RST `include` directive, Sphinx rebuilds the `a.html` page; but in plot_directive, `a.rst` is not considered 'out of date' (as judged by the `out_of_date()` function), becaus...
I should say that I'm happy to fix this in the PR I'm working on (#20374), I'm just detailing this as a separate issue for good measure!
diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -429,14 +429,26 @@ def filenames(self): return [self.filename(fmt) for fmt in self.formats] -def out_of_d...
diff --git a/lib/matplotlib/tests/test_sphinxext.py b/lib/matplotlib/tests/test_sphinxext.py --- a/lib/matplotlib/tests/test_sphinxext.py +++ b/lib/matplotlib/tests/test_sphinxext.py @@ -3,6 +3,7 @@ import filecmp import os from pathlib import Path +import shutil from subprocess import Popen, PIPE import sys @@ ...
["lib/matplotlib/tests/test_sphinxext.py::test_tinypages"]
[]
null
true
2021-06-06T01:19:36Z
1
55
1
4,080
0
0.8
1
0.77
1
0.683333
88.695
3,153
swe_bench::test::1345
swe_bench
test
1,345
pylint-dev__pylint-6357
pylint-dev/pylint
pylint-dev/pylint
python
cb37ae4fc24a8756a5f965cdc6ab9c472f909ab0
Crash ``Parsing Python code failed: expected an indented block after function definition`` ### Bug description When parsing the following file: ```python #!/usr/bin/python import os def bug(): # pylint:disable=R if not os.path.exists('/bug'): os.mkdir("/bug") ``` pylint crashed with a ``AstroidSynt...
Unfortunately, I cannot reproduce the error. Please make sure the indentation is correct. `AstroidSyntaxError` is usually emitted if the Python AST parsing failed. The syntax is correct (Python can execute the code just fine). Did you call pylint with `--ignore-imports=y`? for some reason, `lines` in https://github....
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -28,7 +28,7 @@ import sys import warnings from collections import defaultdict -from collections.abc import Generator, Iterable +from collections.abc import Callable, Generator, It...
diff --git a/tests/test_similar.py b/tests/test_similar.py --- a/tests/test_similar.py +++ b/tests/test_similar.py @@ -35,7 +35,13 @@ def _runtest(self, args: list[str], code: int) -> None: @staticmethod def _run_pylint(args: list[str], out: TextIO) -> int: """Runs pylint with a patched output.""" - ...
["tests/test_similar.py::TestSimilarCodeChecker::test_duplicate_code_raw_strings_disable_line_disable_all", "tests/test_similar.py::TestSimilarCodeChecker::test_duplicate_code_raw_strings_disable_scope", "tests/test_similar.py::TestSimilarCodeChecker::test_duplicate_code_raw_strings_disable_scope_double", "tests/test_s...
["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-16T13:12:44Z
1
53
4
4,811
0
0.8
1
0.77
1
0.676667
88.675
3,154
swe_bench::dev::22
swe_bench
dev
22
pvlib__pvlib-python-1160
pvlib/pvlib-python
pvlib/pvlib-python
python
47654a073e0eb2b48b2ccdadb5cade9be0484b73
ValueError: SingleAxisTracker, Array, and running the model on a tuple/list of weather **Describe the bug** I know a refactoring of the Array with single axis tracking is in the works #1146. In the meantime, a `ValueError` is raised when trying to run a SingleAxisTracker defined with an array and supplying (ghi, dni, d...
diff --git a/pvlib/tracking.py b/pvlib/tracking.py --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -2,7 +2,7 @@ import pandas as pd from pvlib.tools import cosd, sind, tand -from pvlib.pvsystem import PVSystem +from pvlib.pvsystem import PVSystem, _unwrap_single_value from pvlib import irradiance, atmosphere ...
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 @@ -726,6 +726,29 @@ def test_run_model_tracker(sapm_dc_snl_ac_system, location, weather, mocker): 'surface_tilt']).all() ...
["pvlib/tests/test_modelchain.py::test_run_model_tracker_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-05T03:27:29Z
1
36
1
2,501
0
0.8
1
0.85
1
0.536833
88.5355
3,155
swe_bench::test::1721
swe_bench
test
1,721
sphinx-doc__sphinx-10021
sphinx-doc/sphinx
sphinx-doc/sphinx
python
8ddf3f09c62e2a4651458759fcc97e751ca63063
autodoc_unqualified_typehints does not work well with autodoc_typehints="description" ### Describe the bug autodoc_unqualified_typehints does not work well with autodoc_typehints="description". ### How to Reproduce ``` autodoc_unqualified_typehints = True autodoc_typehints = "description" ``` ### Expected behavior ...
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -80,45 +80,53 @@ class ModuleEntry(NamedTuple): deprecated: bool -def type_to_xref(target: str, env: BuildEnvironment = None, suppress_prefix: bool = False - ) -> ad...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -1196,7 +1196,9 @@ def test_type_field(app): text = (".. py:data:: var1\n" " :type: .int\n" ".. py:data:: var2\n" - " :type: ~builtins.int\n") + ...
["tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description", "tests/test_ext_autodoc_configs.py::test_autodoc_typehints_description_no_undoc", "tests/test_ext_autodoc_configs.py::test_autodoc_typehints_both"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f...
null
true
2021-12-26T17:01:29Z
2
123
3
660
0
0.8
1
0.85
1
0.52
88.485
3,156
swe_bench::test::999
swe_bench
test
999
matplotlib__matplotlib-22945
matplotlib/matplotlib
matplotlib/matplotlib
python
89b21b517df0b2a9c378913bae8e1f184988b554
[Bug]: Regression in animation from #22175 ### Bug summary On a9dd8b999a74d7cefc92f3c599bee6c11958d05a things are fine, on the next commit 396a010a6147e232d7ab101db9e4b5c6a48d0b36 from #22175 we get an error with previously working animation code. ### Code for reproduction ```python import numpy as np import matplot...
Okay the minimal example wasn't so bad, updated top comment. Argh actually on main `git revert f93a0fc251f7aa0a8da71f92e97e54faa25b8cd7` (f93a0fc251f7aa0a8da71f92e97e54faa25b8cd7) seems to fix it, not `git revert 396a010`. Apparently I am bad at `git bisect`. So maybe it's actually #22476? I can confirm it started fail...
diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -195,8 +195,9 @@ def __init__(self, # default to zeros self._offsets = np.zeros((1, 2)) + self._has_offsets = offsets is not None - if...
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 @@ -9,6 +9,7 @@ import matplotlib.pyplot as plt import matplotlib.collections as mcollections import matplotlib.colors as mcol...
["lib/matplotlib/tests/test_collections.py::test_no_offsets_datalim"]
["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-04-30T03:59:59Z
1
30
1
5,036
0
0.8
1
0.77
1
0.6
88.445
3,157
swe_bench::test::1063
swe_bench
test
1,063
matplotlib__matplotlib-25085
matplotlib/matplotlib
matplotlib/matplotlib
python
af8a046c2cc2077cd8f2379e437d18e47941340c
[Bug]: Widget blitting broken when saving as PDF ### Bug summary When running a test doc build for 3.7.0rc1, I build the PDF, which runs everything with the PDF backend. So either the PDF backend does not correctly mark itself as not supporting blitting, or the blitting is not turned off correctly in the button widget...
Further investigation shows that this is not directly about the PDF backend. Rather, it occurs when _changing_ to the PDF backend to save as a `.pdf`. If you start directly with the PDF backend, then the Widget will see that the canvas doesn't support blitting and disable it. So this might affect anything which uses bl...
diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -90,6 +90,22 @@ def ignore(self, event): """ return not self.active + def _changed_canvas(self): + """ + Someone has switched the canvas on us! + + ...
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 @@ -1,4 +1,5 @@ import functools +import io from unittest import mock from matplotlib._api.deprecation import MatplotlibDeprecationWarning @...
["lib/matplotlib/tests/test_widgets.py::test_save_blitted_widget_as_pdf"]
["lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs0]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs1]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs2]", "lib/matplotlib/tests/test_widgets.py::test_rectangle_selector[kwargs3]", "lib/matplotlib/tests/t...
null
true
2023-01-25T21:22:06Z
1
28
1
3,291
0
0.8
1
0.77
1
0.593333
88.425
3,158
swe_bench::test::1853
swe_bench
test
1,853
sphinx-doc__sphinx-8729
sphinx-doc/sphinx
sphinx-doc/sphinx
python
a71028bf9e18cf9fb6314c8a13a467d724cd9328
sphinx-apidoc on namespaces with only subpackages/namespaces **Describe the bug** --implicit-namespaces allows us to use namespaces in our project tree. At the current deployed implementation (3.4.3) it makes a difference if i have a submodule in my module_path (root python namespace) or only subpackages/namespaces. R...
diff --git a/sphinx/ext/apidoc.py b/sphinx/ext/apidoc.py --- a/sphinx/ext/apidoc.py +++ b/sphinx/ext/apidoc.py @@ -24,7 +24,7 @@ from fnmatch import fnmatch from importlib.machinery import EXTENSION_SUFFIXES from os import path -from typing import Any, List, Tuple +from typing import Any, Generator, List, Tuple i...
diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py --- a/tests/test_ext_apidoc.py +++ b/tests/test_ext_apidoc.py @@ -216,6 +216,8 @@ def test_trailing_underscore(make_app, apidoc): def test_excludes(apidoc): outdir = apidoc.outdir assert (outdir / 'conf.py').isfile() + assert (outdir / 'a.rs...
["tests/test_ext_apidoc.py::test_excludes", "tests/test_ext_apidoc.py::test_excludes_subpackage_should_be_skipped", "tests/test_ext_apidoc.py::test_excludes_module_should_be_skipped", "tests/test_ext_apidoc.py::test_excludes_module_should_not_be_skipped"]
["tests/test_ext_apidoc.py::test_simple", "tests/test_ext_apidoc.py::test_pep_0420_enabled", "tests/test_ext_apidoc.py::test_pep_0420_enabled_separate", "tests/test_ext_apidoc.py::test_pep_0420_disabled", "tests/test_ext_apidoc.py::test_pep_0420_disabled_top_level_verify", "tests/test_ext_apidoc.py::test_trailing_under...
null
true
2021-01-22T15:43:04Z
1
68
4
1,620
0
0.8
1
0.85
1
0.496667
88.415
3,159
swe_bench::dev::28
swe_bench
dev
28
pvlib__pvlib-python-1193
pvlib/pvlib-python
pvlib/pvlib-python
python
684b2478e4e174c5eeb10d49a709bbe947921abc
TypeError: running ModelChain with Arrays and module_temperature **Describe the bug** Another bug using Arrays. This time a TypeError is raised in `pvlib.modelchain._get_cell_temperature` because `self.system.temperature_model_parameters` is zipped with dataframe tuples but is never a tuple itself https://github.com/pv...
diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1519,10 +1519,14 @@ def _prepare_temperature(self, data=None): if not isinstance(data, tuple): # broadcast data to all arrays data = (data,) * self.system.num_arrays + ...
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 @@ -830,6 +830,38 @@ def test__prepare_temperature(sapm_dc_snl_ac_system, location, weather, assert_series_equal(mc.results.cell_temperature, data['cell_temperature...
["pvlib/tests/test_modelchain.py::test__prepare_temperature_len1_weather_tuple"]
["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_run_model_with_irradiance", "pvlib/tests/test_modelchain.py::test_run_model_from_irradiance_arrays_no_loss", "pvlib/te...
null
true
2021-03-12T03:55:07Z
1
8
1
2,801
0
0.8
1
0.85
1
0.4935
88.4055
3,160
swe_bench::test::1842
swe_bench
test
1,842
sphinx-doc__sphinx-8633
sphinx-doc/sphinx
sphinx-doc/sphinx
python
0f1fcdc1137e9f1e954d349f4721744af1e82828
building psf/requests documentation fails with AttributeError: 'LookupDict' object has no attribute '__name__' **Describe the bug** Since sphinx 3.4.1 building [psf/requests](https://github.com/psf/requests/) documentation fails with the following: ``` sphinx-build -b html -d _build/doctrees . _build/html Running Sp...
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1193,6 +1193,8 @@ def _find_signature(self, encoding: str = None) -> Tuple[str, str]: valid_names.extend(cls.__name__ for cls in self.object.__mro__...
diff --git a/tests/test_ext_autodoc_events.py b/tests/test_ext_autodoc_events.py --- a/tests/test_ext_autodoc_events.py +++ b/tests/test_ext_autodoc_events.py @@ -34,6 +34,23 @@ def on_process_docstring(app, what, name, obj, options, lines): ] +@pytest.mark.sphinx('html', testroot='ext-autodoc') +def test_proc...
["tests/test_ext_autodoc_events.py::test_process_docstring_for_nondatadescriptor"]
["tests/test_ext_autodoc_events.py::test_process_docstring", "tests/test_ext_autodoc_events.py::test_cut_lines", "tests/test_ext_autodoc_events.py::test_between", "tests/test_ext_autodoc_events.py::test_between_exclude", "tests/test_ext_autodoc_events.py::test_skip_module_member"]
null
true
2020-12-31T12:38:41Z
1
35
1
2,250
0
0.8
1
0.85
1
0.491667
88.4
3,161
swe_bench::test::1641
swe_bench
test
1,641
scikit-learn__scikit-learn-14464
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
5936ae356ce3385cb393384928ca9c6783f18bd8
Cloning custom transform replaces values in __init__ dictionary #### Description Let us say we have a custom transform `A` that has some arguments. When the `A` is instantiated, these arguments are set in the init. When we clone `A` (as happens in `cross_val_score`, for example), the arguments get copied successfull...
`__init__` should only set the attributes, not modify or validate the inputs. See our documentation. MyTransformA would not pass check_estimator. If you mean that a Pipeline would not fit_predict with this issue, that is not the case. I ran into this problem with an end-to-end pipeline that kept returning random proba...
diff --git a/sklearn/base.py b/sklearn/base.py --- a/sklearn/base.py +++ b/sklearn/base.py @@ -193,7 +193,15 @@ def get_params(self, deep=True): """ out = dict() for key in self._get_param_names(): - value = getattr(self, key, None) + try: + value = getatt...
diff --git a/sklearn/gaussian_process/tests/test_kernels.py b/sklearn/gaussian_process/tests/test_kernels.py --- a/sklearn/gaussian_process/tests/test_kernels.py +++ b/sklearn/gaussian_process/tests/test_kernels.py @@ -14,7 +14,7 @@ from sklearn.gaussian_process.kernels \ import (RBF, Matern, RationalQuadratic, E...
["sklearn/gaussian_process/tests/test_kernels.py::test_warns_on_get_params_non_attribute", "sklearn/tests/test_base.py::test_warns_on_get_params_non_attribute"]
["sklearn/gaussian_process/tests/test_kernels.py::test_kernel_gradient[kernel0]", "sklearn/gaussian_process/tests/test_kernels.py::test_kernel_gradient[kernel1]", "sklearn/gaussian_process/tests/test_kernels.py::test_kernel_gradient[kernel2]", "sklearn/gaussian_process/tests/test_kernels.py::test_kernel_gradient[kernel...
null
true
2019-07-25T00:34:02Z
3
24
2
3,290
0
0.8
1
0.77
1
0.58
88.385
3,162
swe_bench::test::1720
swe_bench
test
1,720
scikit-learn__scikit-learn-9939
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
f247ad5adfe86b2ee64a4a3db1b496c8bf1c9dff
Incorrect predictions when fitting a LogisticRegression model on binary outcomes with `multi_class='multinomial'`. #### Description Incorrect predictions when fitting a LogisticRegression model on binary outcomes with `multi_class='multinomial'`. #### Steps/Code to Reproduce ```python from sklearn.linear_model imp...
Yes, just taking the coef for one class indeed seems incorrect. Is there any way to adjust the coef of one class (and the intercept) given the other to get the right probabilities? > This is essentially a difference between softmax (redundancy allowed) and logistic regression. Indeed, there is a difference in the w...
diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -1101,14 +1101,18 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin, coef_ : array, shape (1, n_features) or (n_classes, n_features) ...
diff --git a/sklearn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py --- a/sklearn/linear_model/tests/test_logistic.py +++ b/sklearn/linear_model/tests/test_logistic.py @@ -198,6 +198,23 @@ def test_multinomial_binary(): assert_greater(np.mean(pred == target), .9) +def tes...
["sklearn/linear_model/tests/test_logistic.py::test_multinomial_binary_probabilities"]
["sklearn/linear_model/tests/test_logistic.py::test_predict_2_classes", "sklearn/linear_model/tests/test_logistic.py::test_error", "sklearn/linear_model/tests/test_logistic.py::test_lr_liblinear_warning", "sklearn/linear_model/tests/test_logistic.py::test_predict_3_classes", "sklearn/linear_model/tests/test_logistic.py...
null
true
2017-10-17T10:52:38Z
1
22
1
3,059
0
0.8
1
0.77
1
0.573333
88.365
3,163
swe_bench::test::1827
swe_bench
test
1,827
sphinx-doc__sphinx-8481
sphinx-doc/sphinx
sphinx-doc/sphinx
python
a82b06f2abb1226d82b18e3f85bdf19be7b9eb3f
autoattribute could not create document for __slots__ attributes correctly **Describe the bug** autoattribute could not create document for __slots__ attributes correctly **To Reproduce** ``` # example.py class Foo: __slots__ = {'attr': 'docstring'} ``` ``` # index.rst .. autoattribute:: example.Foo.attr ``` The...
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1702,7 +1702,9 @@ def can_document_member(cls, member: Any, membername: str, isattr: bool, parent: class DataDocumenterMixinBase: # define types of instance ...
diff --git a/tests/test_ext_autodoc_autoattribute.py b/tests/test_ext_autodoc_autoattribute.py --- a/tests/test_ext_autodoc_autoattribute.py +++ b/tests/test_ext_autodoc_autoattribute.py @@ -72,6 +72,41 @@ def test_autoattribute_instance_variable(app): ] +@pytest.mark.sphinx('html', testroot='ext-autodoc') +de...
["tests/test_ext_autodoc_autoattribute.py::test_autoattribute_slots_variable_dict"]
["tests/test_ext_autodoc_autoattribute.py::test_autoattribute", "tests/test_ext_autodoc_autoattribute.py::test_autoattribute_novalue", "tests/test_ext_autodoc_autoattribute.py::test_autoattribute_typed_variable", "tests/test_ext_autodoc_autoattribute.py::test_autoattribute_instance_variable", "tests/test_ext_autodoc_au...
null
true
2020-11-23T07:55:33Z
2
108
1
685
0
0.8
1
0.85
1
0.474167
88.3475
3,164
swe_bench::test::1392
swe_bench
test
1,392
pytest-dev__pytest-11160
pytest-dev/pytest
pytest-dev/pytest
python
6995257cf470d2143ad1683824962de4071c0eb7
WarningsRecorder.pop() improperly matches warning When trying to pop a specific warning from a WarningsRecorder instance, the wrong warning is returned. I believe the issue is that pop uses issubclass https://github.com/pytest-dev/pytest/blob/3c1534944cbd34e8a41bc9e76818018fadefc9a1/src/_pytest/recwarn.py#L210 I belie...
Yeah, it looks like this code never anticipated the possibility that a later warning might be a better match than the current warning. That said, we need to preserve the current behavior of matching if the warning was a subclass, so instead of the current ```python for i, w in enumerate(self._list): if issubc...
diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -206,10 +206,21 @@ def __len__(self) -> int: return len(self._list) def pop(self, cls: Type[Warning] = Warning) -> "warnings.WarningMessage": - """Pop the first recorded warni...
diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -1,5 +1,7 @@ import warnings +from typing import List from typing import Optional +from typing import Type import pytest from _pytest.pytester import Pytester @@ -37,6 +39,47 @@ def test_r...
["testing/test_recwarn.py::TestSubclassWarningPop::test_pop_finds_exact_match", "testing/test_recwarn.py::TestSubclassWarningPop::test_pop_finds_best_inexact_match"]
["testing/test_recwarn.py::test_recwarn_stacklevel", "testing/test_recwarn.py::test_recwarn_captures_deprecation_warning", "testing/test_recwarn.py::TestSubclassWarningPop::test_pop_raises_if_no_match", "testing/test_recwarn.py::TestWarningsRecorderChecker::test_recording", "testing/test_recwarn.py::TestWarningsRecorde...
null
true
2023-07-02T12:19:27Z
1
17
2
4,014
0
0.8
1
0.77
1
0.556667
88.315
3,165
swe_bench::dev::7
swe_bench
dev
7
marshmallow-code__marshmallow-1810
marshmallow-code/marshmallow
marshmallow-code/marshmallow
python
23d0551569d748460c504af85996451edd685371
3.12 no longer supports fields named `parent` Pretty sure that #1631 broke it. Reproducible example: ```py from marshmallow import INCLUDE from marshmallow.fields import Nested from sqlalchemy import Column, DATE, create_engine, ForeignKey from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.orm import decl...
Thanks @flying-sheep. This looks correct. Do you have time to write a regression test for this? If not, I can do it myself when I'm off the clock (this weekend, probably). Let me know either way
diff --git a/src/marshmallow/base.py b/src/marshmallow/base.py --- a/src/marshmallow/base.py +++ b/src/marshmallow/base.py @@ -15,6 +15,7 @@ class FieldABC: parent = None name = None + root = None def serialize(self, attr, obj, accessor=None): raise NotImplementedError diff --git a/src/ma...
diff --git a/tests/test_fields.py b/tests/test_fields.py --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -187,6 +187,14 @@ class Meta: for field_name in ("bar", "qux"): assert schema.fields[field_name].tuple_fields[0].format == "iso8601" + # Regression test for https://github.com/mar...
["tests/test_fields.py::TestParentAndName::test_field_named_parent_has_root"]
["tests/test_fields.py::test_field_aliases[Integer-Integer]", "tests/test_fields.py::test_field_aliases[String-String]", "tests/test_fields.py::test_field_aliases[Boolean-Boolean]", "tests/test_fields.py::test_field_aliases[Url-Url]", "tests/test_fields.py::TestField::test_repr", "tests/test_fields.py::TestField::test_...
null
true
2021-05-10T18:53:41Z
2
17
1
3,069
0
0.8
1
0.77
1
0.556667
88.315
3,166
swe_bench::test::1729
swe_bench
test
1,729
sphinx-doc__sphinx-10321
sphinx-doc/sphinx
sphinx-doc/sphinx
python
4689ec6de1241077552458ed38927c0e713bb85d
autodoc_preserve_defaults=True does not work for mixture of keyword only arguments with/without defaults ### Describe the bug If I understand [PEP 0570](https://peps.python.org/pep-0570/) correctly, the following is a valid signature of a class method: ``` class Thing: def __init__( self, ...
diff --git a/sphinx/ext/autodoc/preserve_defaults.py b/sphinx/ext/autodoc/preserve_defaults.py --- a/sphinx/ext/autodoc/preserve_defaults.py +++ b/sphinx/ext/autodoc/preserve_defaults.py @@ -79,7 +79,11 @@ def update_defvalue(app: Sphinx, obj: Any, bound_method: bool) -> None: kw_defaults = list(function.a...
diff --git a/tests/roots/test-ext-autodoc/target/preserve_defaults.py b/tests/roots/test-ext-autodoc/target/preserve_defaults.py --- a/tests/roots/test-ext-autodoc/target/preserve_defaults.py +++ b/tests/roots/test-ext-autodoc/target/preserve_defaults.py @@ -8,7 +8,10 @@ def foo(name: str = CONSTANT, sentinel...
["tests/test_ext_autodoc_preserve_defaults.py::test_preserve_defaults"]
[]
null
true
2022-04-02T07:57:50Z
1
6
1
2,657
0
0.8
1
0.85
1
0.462833
88.3135
3,167
swe_bench::test::1228
swe_bench
test
1,228
pydata__xarray-3905
pydata/xarray
pydata/xarray
python
fb5fe79a2881055065cc2c0ed3f49f5448afdf32
Truncate array repr based on line count #### MCVE Code Sample I thought we might have had an issue (and maybe solved it?) but couldn't find it anywhere. Forgive me if I'm duplicating. ```python xr.DataArray(np.random.rand(100,5,1)) <xarray.DataArray (dim_0: 100, dim_1: 5, dim_2: 1)> array([[[0.71333665], [0....
Hmm, that does look pretty bad. We do have some existing heuristics for shortening up NumPy’s repr but perhaps they could use some tweaking: https://github.com/pydata/xarray/blob/master/xarray/core/formatting.py#L416
diff --git a/xarray/core/formatting.py b/xarray/core/formatting.py --- a/xarray/core/formatting.py +++ b/xarray/core/formatting.py @@ -3,7 +3,7 @@ import contextlib import functools from datetime import datetime, timedelta -from itertools import zip_longest +from itertools import chain, zip_longest from typing impo...
diff --git a/xarray/tests/test_formatting.py b/xarray/tests/test_formatting.py --- a/xarray/tests/test_formatting.py +++ b/xarray/tests/test_formatting.py @@ -405,10 +405,19 @@ def test_short_numpy_repr(): np.random.randn(20, 20), np.random.randn(5, 10, 15), np.random.randn(5, 10, 15, 3), + ...
["xarray/tests/test_formatting.py::test_large_array_repr_length"]
["xarray/tests/test_formatting.py::TestFormatting::test_get_indexer_at_least_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_first_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_last_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_last_item", "xarray/tests/test_format...
null
true
2020-03-27T20:45:08Z
1
15
1
3,224
0
0.8
1
0.77
1
0.55
88.295
3,168
swe_bench::test::1360
swe_bench
test
1,360
pylint-dev__pylint-7228
pylint-dev/pylint
pylint-dev/pylint
python
d597f252915ddcaaa15ccdfcb35670152cb83587
rxg include '\p{Han}' will throw error ### Bug description config rxg in pylintrc with \p{Han} will throw err ### Configuration .pylintrc: ```ini function-rgx=[\p{Han}a-z_][\p{Han}a-z0-9_]{2,30}$ ``` ### Command used ```shell pylint ``` ### Pylint output ```shell (venvtest) tsung-hande-MacBook-Pro:robot_is_commi...
This doesn't seem like it is a `pylint` issue? `re.compile("[\p{Han}a-z_]")` also raises normally. `\p` also isn't documented: https://docs.python.org/3/howto/regex.html Is this a supported character? I think this could be improved! Similar to the helpful output when passing an unrecognized option to Pylint, we cou...
diff --git a/pylint/config/argument.py b/pylint/config/argument.py --- a/pylint/config/argument.py +++ b/pylint/config/argument.py @@ -99,11 +99,20 @@ def _py_version_transformer(value: str) -> tuple[int, ...]: return version +def _regex_transformer(value: str) -> Pattern[str]: + """Return `re.compile(value...
diff --git a/tests/config/test_config.py b/tests/config/test_config.py --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -111,6 +111,36 @@ def test_unknown_py_version(capsys: CaptureFixture) -> None: assert "the-newest has an invalid format, should be a version string." in output.err +def ...
["tests/config/test_config.py::test_regex_error", "tests/config/test_config.py::test_csv_regex_error"]
["tests/config/test_config.py::test_can_read_toml_env_variable", "tests/config/test_config.py::test_unknown_message_id", "tests/config/test_config.py::test_unknown_option_name", "tests/config/test_config.py::test_unknown_short_option_name", "tests/config/test_config.py::test_unknown_confidence", "tests/config/test_conf...
null
true
2022-07-25T17:19:11Z
1
13
2
4,025
0
0.8
1
0.77
1
0.543333
88.275
3,169
swe_bench::test::1440
swe_bench
test
1,440
pytest-dev__pytest-7352
pytest-dev/pytest
pytest-dev/pytest
python
0821c5c81d115c161a081fc048e4cf59521fe17e
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-jenkins/pytest-1681/.lock' Same issue as in #4181 . I think there are still some edge cases where this is not handled correctly. I am running a series of concurrent pytest processes and was able to reproduce the issue. Here is the stack trace: ```...
As a workaround I'm currently explicitly setting `basetemp` for every test process. Experiencing similar issue. Here's my environment: `platform linux -- Python 3.6.8, pytest-4.0.2, py-1.8.0, pluggy-0.9.0` `plugins: xdist-1.25.0, ordering-0.6, forked-1.0.2` For people looking for a workaround, I found creating a fixt...
diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -1,4 +1,5 @@ import atexit +import contextlib import fnmatch import itertools import os @@ -290,10 +291,14 @@ def ensure_deletable(path: Path, consider_lock_dead_if_created_before: float) -> ...
diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -1,9 +1,11 @@ import os.path import sys +import unittest.mock import py import pytest +from _pytest.pathlib import ensure_deletable from _pytest.pathlib import fnmatch_ex from _pytest....
["testing/test_pathlib.py::test_suppress_error_removing_lock"]
["testing/test_pathlib.py::TestPort::test_matching[pathlib-*.py-foo.py]", "testing/test_pathlib.py::TestPort::test_matching[pathlib-*.py-bar/foo.py]", "testing/test_pathlib.py::TestPort::test_matching[pathlib-test_*.py-foo/test_foo.py]", "testing/test_pathlib.py::TestPort::test_matching[pathlib-tests/*.py-tests/foo.py]...
null
true
2020-06-11T19:54:52Z
1
13
1
5,935
0
0.8
1
0.77
1
0.543333
88.275
3,170
swe_bench::dev::145
swe_bench
dev
145
pylint-dev__astroid-1962
pylint-dev/astroid
pylint-dev/astroid
python
fe058bff95745371df5796286d33677c21137847
v2.13.x regression: Crash when inspecting `PyQt5.QtWidgets` due to `RuntimeError` during `hasattr` ### Steps to reproduce Install PyQt5, run `pylint --extension-pkg-whitelist=PyQt5 x.py` over a file containing `from PyQt5 import QtWidgets` ### Current behavior With astroid 2.12.13 and pylint 2.15.10, this works fine...
Thank you for the investigation @The-Compiler ! I'm going to revert the offending commit seeing it's only a cleanup. Let's do something more elegant later on if required. The commit you linked is from a fork, so I tried to reproduce locally to bisect on pylint main repo but I cannot ``` pip3 install PyQt5 Collecting...
diff --git a/astroid/raw_building.py b/astroid/raw_building.py --- a/astroid/raw_building.py +++ b/astroid/raw_building.py @@ -324,6 +324,17 @@ def _build_from_function( object_build_function(node, member, name) +def _safe_has_attribute(obj, member: str) -> bool: + """Required because unexpected RunTime...
diff --git a/tests/testdata/python3/data/fake_module_with_broken_getattr.py b/tests/testdata/python3/data/fake_module_with_broken_getattr.py new file mode 100644 --- /dev/null +++ b/tests/testdata/python3/data/fake_module_with_broken_getattr.py @@ -0,0 +1,7 @@ +class Broken: + + def __getattr__(self, name): + ...
["tests/unittest_raw_building.py::RawBuildingTC::test_module_object_with_broken_getattr"]
["tests/unittest_raw_building.py::RawBuildingTC::test_attach_dummy_node", "tests/unittest_raw_building.py::RawBuildingTC::test_build_class", "tests/unittest_raw_building.py::RawBuildingTC::test_build_from_import", "tests/unittest_raw_building.py::RawBuildingTC::test_build_function", "tests/unittest_raw_building.py::Raw...
null
true
2023-01-10T22:18:32Z
1
13
1
3,017
0
0.8
1
0.77
1
0.543333
88.275
3,171
swe_bench::test::970
swe_bench
test
970
matplotlib__matplotlib-20788
matplotlib/matplotlib
matplotlib/matplotlib
python
89645b86300a82ea769a80929d61a14afea13759
[Bug]: Colorbar creation from pcolormesh with cell specific alpha values ### Bug summary When I try to take advantage of the new ability to set cell specific alpha values in pcolormesh - https://matplotlib.org/stable/users/whats_new.html#transparency-alpha-can-be-set-as-an-array-in-collections and then use the resul...
xref: #19843, but from a different collection object. Colorbars do a 1d mapping. This is a 2d mapping. What do we want the colorbar to look like? The use case I have in mind is using the color to encode the estimated value and the alpha to encode pvlaue so the colorbar can just display the colors as it would have bef...
diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -427,7 +427,9 @@ def __init__(self, ax, mappable=None, *, cmap=None, extend = norm.extend else: extend = 'neither' - self.alpha ...
diff --git a/lib/matplotlib/tests/test_colorbar.py b/lib/matplotlib/tests/test_colorbar.py --- a/lib/matplotlib/tests/test_colorbar.py +++ b/lib/matplotlib/tests/test_colorbar.py @@ -604,6 +604,18 @@ def test_mappable_no_alpha(): plt.draw() +def test_mappable_2d_alpha(): + fig, ax = plt.subplots() + x = ...
["lib/matplotlib/tests/test_colorbar.py::test_mappable_2d_alpha"]
["lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_shape[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_extension_length[png]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_positioning[png-True]", "lib/matplotlib/tests/test_colorbar.py::test_colorbar_positioning[png-False]", "lib/ma...
null
true
2021-08-04T01:43:27Z
1
13
1
4,069
0
0.8
1
0.77
1
0.543333
88.275
3,172
swe_bench::test::1715
swe_bench
test
1,715
scikit-learn__scikit-learn-8554
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
a320c085b75b8d18b3d10e7283a5e7695806bc1a
Isomap and LocallyLinearEmbedding do not accept sparse matrix input (contrary to documentation) The [documentation](http://scikit-learn.org/stable/modules/generated/sklearn.manifold.locally_linear_embedding.html) mentions that `sklearn.manifold.LocallyLinearEmbedding` should support sparse matrix. The error comes from...
Go ahead, submit a PR. On 21 February 2017 at 12:12, Mamy Ratsimbazafy <notifications@github.com> wrote: > The documentation > <http://scikit-learn.org/stable/modules/generated/sklearn.manifold.locally_linear_embedding.html> > mentions that sklearn.manifold.LocallyLinearEmbedding should support > sparse matrix. > > T...
diff --git a/sklearn/manifold/isomap.py b/sklearn/manifold/isomap.py --- a/sklearn/manifold/isomap.py +++ b/sklearn/manifold/isomap.py @@ -100,7 +100,7 @@ def __init__(self, n_neighbors=5, n_components=2, eigen_solver='auto', self.n_jobs = n_jobs def _fit_transform(self, X): - X = check_array(X) ...
diff --git a/sklearn/manifold/tests/test_isomap.py b/sklearn/manifold/tests/test_isomap.py --- a/sklearn/manifold/tests/test_isomap.py +++ b/sklearn/manifold/tests/test_isomap.py @@ -10,6 +10,8 @@ from sklearn import preprocessing from sklearn.utils.testing import assert_less +from scipy.sparse import rand as spars...
["sklearn/manifold/tests/test_isomap.py::test_sparse_input"]
["sklearn/manifold/tests/test_isomap.py::test_isomap_simple_grid", "sklearn/manifold/tests/test_isomap.py::test_isomap_reconstruction_error", "sklearn/manifold/tests/test_isomap.py::test_transform", "sklearn/manifold/tests/test_isomap.py::test_pipeline", "sklearn/manifold/tests/test_isomap.py::test_isomap_clone_bug"]
null
true
2017-03-07T23:11:25Z
2
12
1
4,133
0
0.8
1
0.77
1
0.54
88.265
3,173
swe_bench::test::1182
swe_bench
test
1,182
psf__requests-2153
psf/requests
psf/requests
python
3eb69be879063de4803f7f0152b83738a1c95ca4
Uncaught socket.timeout during post Hallo requests devs (and thanks for an awesome lib) During a specific `requests.post` I most of the time get a `requests.exceptions.Timeout` (on timeouts) but I also sometimes get a `socket.timeout` exception. Since there is a requests exception for it, I assume that the socket exce...
Thanks so much for this! :cake: This looks like a good catch. I think the generator created in `Response.iter_content` should probably be looking for Timeout errors, both from urllib3 and from the socket module, and should catch and wrap them. @sigmavirus24? Sounds like a good idea to me i think this is the underlyi...
diff --git a/requests/compat.py b/requests/compat.py --- a/requests/compat.py +++ b/requests/compat.py @@ -92,7 +92,6 @@ from Cookie import Morsel from StringIO import StringIO from .packages.urllib3.packages.ordered_dict import OrderedDict - from httplib import IncompleteRead builtin_str = str...
diff --git a/test_requests.py b/test_requests.py --- a/test_requests.py +++ b/test_requests.py @@ -720,18 +720,6 @@ def read_mock(amt, decode_content=None): assert next(iter(r)) io.close() - def test_iter_content_handles_socket_error(self): - r = requests.Response() - import socket ...
["test_requests.py::RequestsTestCase::test_HTTP_200_OK_HEAD", "test_requests.py::RequestsTestCase::test_cookie_sent_on_redirect", "test_requests.py::RequestsTestCase::test_different_encodings_dont_break_post", "test_requests.py::RequestsTestCase::test_manual_redirect_with_partial_body_read", "test_requests.py::Requests...
["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::Requ...
null
true
2014-07-30T03:32:34Z
2
12
8
3,083
0
0.8
1
0.77
1
0.54
88.265
3,174
swe_bench::test::1438
swe_bench
test
1,438
pytest-dev__pytest-7314
pytest-dev/pytest
pytest-dev/pytest
python
d5843f89d3c008ddcb431adbc335b080a79e617e
pytest~=4.6: `UnboundLocalError: local variable 'letter' referenced before assignment` While implementing a test for https://github.com/pytest-dev/pytest-forked/issues/33 I've hit this: ```python INTERNALERROR> File "~/src/github/pytest-dev/pytest-forked/.tox/py27-pytest46/lib/python2.7/site-packages/_pytest/terminal...
diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -166,7 +166,11 @@ def getreportopt(config): reportchars += "w" elif config.option.disable_warnings and "w" in reportchars: reportchars = reportchars.replace("w", "") + ...
diff --git a/testing/test_terminal.py b/testing/test_terminal.py --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -759,6 +759,35 @@ def test(i): result = testdir.runpytest(*params) result.stdout.fnmatch_lines(["collected 3 items", "hello from hook: 3 items"]) + def test_summary_f_...
["testing/test_terminal.py::TestTerminalFunctional::test_summary_f_alias", "testing/test_terminal.py::TestTerminalFunctional::test_summary_s_alias"]
["test_pass_extra_reporting.py::test_this", "test_pass_output_reporting.py::test_pass_has_output", "test_pass_output_reporting.py::test_pass_no_output", "testing/test_terminal.py::test_plugin_nameversion[normal]", "testing/test_terminal.py::test_plugin_nameversion[prefix-strip]", "testing/test_terminal.py::test_plugin_...
null
true
2020-06-03T15:00:51Z
1
19
2
2,280
0
0.8
1
0.85
1
0.443333
88.255
3,175
swe_bench::dev::216
swe_bench
dev
216
sqlfluff__sqlfluff-4834
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
e884df2d00473a6ab166cb92a68d0b500a89d159
Running `lint` on an empty file fails with critical Exception ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened This is a bit of an odd one. When running `sqlfluff lint` on an empty file it fails with (Python) exception....
I'll pick up this one - I've been in the "empty" file code recently and might have influenced this outcome. I'll pick up this one - I've been in the "empty" file code recently and might have influenced this outcome.
diff --git a/src/sqlfluff/rules/layout/LT12.py b/src/sqlfluff/rules/layout/LT12.py --- a/src/sqlfluff/rules/layout/LT12.py +++ b/src/sqlfluff/rules/layout/LT12.py @@ -124,6 +124,10 @@ def _eval(self, context: RuleContext) -> Optional[LintResult]: # We only care about the final segment of the parse tree. ...
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 @@ -251,6 +251,14 @@ def test__cli__command_lint_stdin(command): invoke_assert_code(args=[lint, ("--dialect=ansi",) + command], cli_input=sql) +def test__cli__command_lint_empty_st...
["test/cli/commands_test.py::test__cli__command_lint_empty_stdin"]
["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-05-02T06:58:53Z
2
9
1
3,034
0
0.8
1
0.77
1
0.53
88.235
3,176
swe_bench::test::1481
swe_bench
test
1,481
pytest-dev__pytest-9279
pytest-dev/pytest
pytest-dev/pytest
python
86446edc869f14de4d9e32d9f1fa4d8cd1df8cb6
Unexpected keyword argument 'path' from plugins While troubleshooting #8332, I stumbled onto a new error, a `TypeError` that occurs when using pytest-black against the current main HEAD (32ad70d), easily reproducible with an empty test file and pip-run: ``` draft $ touch test_something.py draft $ pip-run -q git+https:...
Hey @jaraco, I'm making a quick guess as I don't have time to delve deep into the code, but perhaps `from_parent` in `pytest_checkdocs/__init__.py:52` needs to receive `**kw` and pass that on to `super()`? cc @RonnyPfannschmidt That's about it, I wonder if i can make this one a warning for the next releases > ...
diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -669,9 +669,13 @@ def __init__( nodeid: Optional[str] = None, **kw, ) -> None: + # The first two arguments are intentionally passed positionally, + # to keep plugins who...
diff --git a/testing/test_nodes.py b/testing/test_nodes.py --- a/testing/test_nodes.py +++ b/testing/test_nodes.py @@ -71,7 +71,7 @@ def test_subclassing_both_item_and_collector_deprecated( ), ): - class SoWrong(nodes.File, nodes.Item): + class SoWrong(nodes.Item, nodes.File): ...
["testing/test_nodes.py::test_subclassing_both_item_and_collector_deprecated"]
["testing/test_nodes.py::test_iterparentnodeids[-expected0]", "testing/test_nodes.py::test_iterparentnodeids[a-expected1]", "testing/test_nodes.py::test_iterparentnodeids[aa/b-expected2]", "testing/test_nodes.py::test_iterparentnodeids[a/b/c-expected3]", "testing/test_nodes.py::test_iterparentnodeids[a/bbb/c::D-expecte...
null
true
2021-11-08T07:19:11Z
1
8
1
5,898
0
0.8
1
0.77
1
0.526667
88.225
3,177
swe_bench::test::1218
swe_bench
test
1,218
pydata__xarray-3406
pydata/xarray
pydata/xarray
python
fb0cf7b5fe56519a933ffcecbce9e9327fe236a6
groupby().apply() on variable with NaNs raises IndexError #### Code Sample ```python import xarray as xr import numpy as np def standardize(x): return (x - x.mean()) / x.std() ds = xr.Dataset() ds["variable"] = xr.DataArray(np.random.rand(4,3,5), {"lat":np.arange(4), "lon":np.ara...
I agree, this is definitely confusing. We should probably drop these groups automatically, like pandas.
diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -361,6 +361,13 @@ def __init__( group_indices = [slice(i, i + 1) for i in group_indices] unique_coord = group else: + if group.isnull().any(): + ...
diff --git a/xarray/tests/test_groupby.py b/xarray/tests/test_groupby.py --- a/xarray/tests/test_groupby.py +++ b/xarray/tests/test_groupby.py @@ -5,7 +5,7 @@ import xarray as xr from xarray.core.groupby import _consolidate_slices -from . import assert_allclose, assert_identical, raises_regex +from . import assert_...
["xarray/tests/test_groupby.py::test_groupby_drops_nans"]
["xarray/tests/test_groupby.py::test_consolidate_slices", "xarray/tests/test_groupby.py::test_groupby_dims_property", "xarray/tests/test_groupby.py::test_multi_index_groupby_apply", "xarray/tests/test_groupby.py::test_multi_index_groupby_sum", "xarray/tests/test_groupby.py::test_groupby_da_datetime", "xarray/tests/test...
null
true
2019-10-16T04:04:46Z
1
7
1
4,062
0
0.8
1
0.77
1
0.523333
88.215
3,178
swe_bench::test::1549
swe_bench
test
1,549
scikit-learn__scikit-learn-12462
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
9ec5a15823dcb924a5cca322f9f97357f9428345
SkLearn `.score()` method generating error with Dask DataFrames When using Dask Dataframes with SkLearn, I used to be able to just ask SkLearn for the score of any given algorithm. It would spit out a nice answer and I'd move on. After updating to the newest versions, all metrics that compute based on (y_true, y_predic...
Some context: dask DataFrame doesn't know it's length. Previously, it didn't have a `shape` attribute. Now dask DataFrame has a shape that returns a `Tuple[Delayed, int]` for the number of rows and columns. > Work-around shown below, but it's not ideal because it requires me to cast from Dask Arrays to numpy arra...
diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -140,7 +140,12 @@ def _num_samples(x): if len(x.shape) == 0: raise TypeError("Singleton array %r cannot be considered" " a vali...
diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py --- a/sklearn/utils/tests/test_validation.py +++ b/sklearn/utils/tests/test_validation.py @@ -41,6 +41,7 @@ check_memory, check_non_negative, LARGE_SPARSE_SUPPORTED, + _num_samples ) import sklearn @@ -786...
["sklearn/utils/tests/test_validation.py::test_retrieve_samples_from_non_standard_shape"]
["sklearn/utils/tests/test_validation.py::test_as_float_array", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X0]", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X1]", "sklearn/utils/tests/test_validation.py::test_np_matrix", "sklearn/utils/tests/test_validation.py::test_memmap", "...
null
true
2018-10-25T21:53:00Z
1
7
1
4,132
0
0.8
1
0.77
1
0.523333
88.215
3,179
swe_bench::test::1460
swe_bench
test
1,460
pytest-dev__pytest-8033
pytest-dev/pytest
pytest-dev/pytest
python
66311ff702d98450f29a448a47c0cd5fd0c51081
Class cleanups in Python 3.8+ are not called https://docs.python.org/3/library/unittest.html#unittest.TestCase.addClassCleanup Did not see `doClassCleanups` mentioned anywhere in this repo, which is the method that should be called. See https://github.com/python/cpython/blob/0f221d09cad46bee38d1b7a7822772df66c53028/Li...
diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -99,26 +99,48 @@ def _inject_setup_teardown_fixtures(self, cls: type) -> None: """Injects a hidden auto-use fixture to invoke setUpClass/setup_method and corresponding teardown...
diff --git a/testing/test_unittest.py b/testing/test_unittest.py --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1260,3 +1260,163 @@ def test_plain_unittest_does_not_support_async(testdir): "*1 passed*", ] result.stdout.fnmatch_lines(expected_lines) + + +@pytest.mark.skipif(...
["testing/test_unittest.py::test_do_class_cleanups_on_success", "testing/test_unittest.py::test_do_class_cleanups_on_setupclass_failure", "testing/test_unittest.py::test_do_class_cleanups_on_teardownclass_failure"]
["testing/test_unittest.py::test_simple_unittest", "testing/test_unittest.py::test_runTest_method", "testing/test_unittest.py::test_isclasscheck_issue53", "testing/test_unittest.py::test_setup", "testing/test_unittest.py::test_setUpModule", "testing/test_unittest.py::test_setUpModule_failing_no_teardown", "testing/test...
null
true
2020-11-13T10:29:33Z
1
58
3
1,418
0
0.8
1
0.85
1
0.429667
88.214
3,180
swe_bench::test::1898
swe_bench
test
1,898
sphinx-doc__sphinx-9798
sphinx-doc/sphinx
sphinx-doc/sphinx
python
4c91c038b220d07bbdfe0c1680af42fe897f342c
Nitpick flags Literal annotation values as missing py:class (with type hints in description) ### Describe the bug This is basically the same issue as #9576, which was fixed in #9602. However, I still get this issue when using `autodoc_typehints = 'description'`. ### How to Reproduce ``` $ unzip attachment.zip $ pyt...
@tk0miya is there any additional info I can provide? Or any suggestions you can make to help me narrow down the source of this issue within the code base. I ran it also with -vvv and it provide the traceback, but it doesn't really provide any additional insight to me. Thank you for reporting. I reproduce the same err...
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -353,17 +353,21 @@ def make_xrefs(self, rolename: str, domain: str, target: str, split_contnode = bool(contnode and contnode.astext() == target) + in_literal = False ...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -1110,6 +1110,42 @@ def test_info_field_list_piped_type(app): **{"py:module": "example", "py:class": "Class"}) +def test_info_field_list_Literal(app): + text = (".. py:mo...
["tests/test_domain_py.py::test_info_field_list_Literal"]
["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-10-30T07:41:41Z
1
6
1
3,206
0
0.8
1
0.77
1
0.52
88.205
3,181
swe_bench::dev::215
swe_bench
dev
215
sqlfluff__sqlfluff-4778
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
e3f77d58f56149f9c8db3b790ef263b9853a9cb5
2.0.2 - LT02 issues when query contains "do" statement. ### Search before asking - [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues. ### What Happened SQLFluff v2.0.2 gives LT02 indentation errors for the Jinja `if`-block when `template_blocks_indent` is set to `Tr...
I think think this is almost certainly about the `do` statement, hopefully this should be very solvable. Any pointers on where I should start looking if I would work on a fix @alanmcruickshank? @fredriv - great question. I just had a quick look and this is a very strange bug, but hopefully one with a satisfying solutio...
diff --git a/src/sqlfluff/core/linter/linter.py b/src/sqlfluff/core/linter/linter.py --- a/src/sqlfluff/core/linter/linter.py +++ b/src/sqlfluff/core/linter/linter.py @@ -189,7 +189,7 @@ def _lex_templated_file( getattr(elem, "indent_val", 0) for elem in cast(Tuple[BaseSegment, ...], t...
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 @@ -1091,6 +1091,23 @@ def _load_result(*args, **kwargs): ("literal", slice(132, 133, None), slice(34, 35, None)), ], ...
["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
2023-04-18T04:35:29Z
2
6
1
3,052
0
0.8
1
0.77
1
0.52
88.205
3,182
swe_bench::test::55
swe_bench
test
55
astropy__astropy-14413
astropy/astropy
astropy/astropy
python
34d79ea59b3ba25820dfe7fc9782e9014826e8b0
Unicode and console unit representations sometimes include an extraneous space ### Description As noted in #14407, for units typset in `unicode` or `console` format, a space is included in front, unlike for regular units, yet it is sometimes omitted if a unit scale factor is present. ### Expected behavior `unit.to_s...
diff --git a/astropy/units/format/console.py b/astropy/units/format/console.py --- a/astropy/units/format/console.py +++ b/astropy/units/format/console.py @@ -17,7 +17,7 @@ class Console(base.Base): >>> import astropy.units as u >>> print(u.Ry.decompose().to_string('console')) # doctest: +FLOAT_CMP - ...
diff --git a/astropy/units/tests/test_format.py b/astropy/units/tests/test_format.py --- a/astropy/units/tests/test_format.py +++ b/astropy/units/tests/test_format.py @@ -425,38 +425,55 @@ def test_latex_scale(): def test_latex_inline_scale(): fluxunit = u.Unit(1.0e-24 * u.erg / (u.cm**2 * u.s * u.Hz)) - lat...
["astropy/units/tests/test_format.py::test_format_styles[console-erg", "astropy/units/tests/test_format.py::test_format_styles[unicode-erg", "astropy/units/tests/test_format.py::test_format_styles_inline[console-False-", "astropy/units/tests/test_format.py::test_format_styles_inline[unicode-False-", "astropy/units/test...
["astropy/units/tests/test_format.py::test_unit_grammar[strings0-unit0]", "astropy/units/tests/test_format.py::test_unit_grammar[strings1-unit1]", "astropy/units/tests/test_format.py::test_unit_grammar[strings2-unit2]", "astropy/units/tests/test_format.py::test_unit_grammar[strings3-unit3]", "astropy/units/tests/test_f...
null
true
2023-02-18T01:17:04Z
3
74
7
1,058
0
0.8
1
0.85
1
0.423
88.194
3,183
swe_bench::test::1782
swe_bench
test
1,782
sphinx-doc__sphinx-7686
sphinx-doc/sphinx
sphinx-doc/sphinx
python
752d3285d250bbaf673cff25e83f03f247502021
autosummary: The members variable for module template contains imported members **Describe the bug** autosummary: The members variable for module template contains imported members even if autosummary_imported_members is False. **To Reproduce** ``` # _templates/autosummary/module.rst {{ fullname | escape | underline ...
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -18,6 +18,7 @@ """ import argparse +import inspect import locale import os import pkgutil @@ -176,6 +177,56 @@ def render(self, template_name: ...
diff --git a/tests/roots/test-ext-autosummary/autosummary_dummy_module.py b/tests/roots/test-ext-autosummary/autosummary_dummy_module.py --- a/tests/roots/test-ext-autosummary/autosummary_dummy_module.py +++ b/tests/roots/test-ext-autosummary/autosummary_dummy_module.py @@ -1,4 +1,4 @@ -from os import * # NOQA +from o...
["tests/test_ext_autosummary.py::test_autosummary_generate_content_for_module", "tests/test_ext_autosummary.py::test_autosummary_generate_content_for_module_skipped"]
["tests/test_ext_autosummary.py::test_mangle_signature", "tests/test_ext_autosummary.py::test_escaping", "tests/test_ext_autosummary.py::test_autosummary_generate", "tests/test_ext_autosummary.py::test_autosummary_generate_overwrite1", "tests/test_ext_autosummary.py::test_autosummary_generate_overwrite2", "tests/test_e...
null
true
2020-05-17T14:09:10Z
1
54
2
1,252
0
0.8
1
0.85
1
0.388667
88.091
3,184
swe_bench::dev::187
swe_bench
dev
187
sqlfluff__sqlfluff-2641
sqlfluff/sqlfluff
sqlfluff/sqlfluff
python
b0ad239095b3cefb294c1b12c73c41e9f229aa81
L045: Unused CTEs are not automatically detected when using jinja/dbt as a templater ## Expected Behaviour When unused CTEs are used with jinja or dbt as a templater, these are detected by L045. ## Observed Behaviour When ref() statements are included in a SQL file and dbt is used as a templater, these seem to interf...
diff --git a/src/sqlfluff/core/rules/analysis/select_crawler.py b/src/sqlfluff/core/rules/analysis/select_crawler.py --- a/src/sqlfluff/core/rules/analysis/select_crawler.py +++ b/src/sqlfluff/core/rules/analysis/select_crawler.py @@ -129,6 +129,7 @@ class Query: parent: Optional["Query"] = field(default=None) ...
diff --git a/test/fixtures/rules/std_rule_cases/L045.yml b/test/fixtures/rules/std_rule_cases/L045.yml --- a/test/fixtures/rules/std_rule_cases/L045.yml +++ b/test/fixtures/rules/std_rule_cases/L045.yml @@ -224,3 +224,13 @@ test_pass_spark3_values_clause_cte_2: configs: core: dialect: spark3 + +test_fail...
["test/rules/std_L045_test.py::test__rules__std_L045_multiple_unused_ctes"]
[]
null
true
2022-02-14T20:13:17Z
2
40
1
1,519
0
0.8
1
0.85
1
0.3865
88.0845
3,185
swe_bench::test::1372
swe_bench
test
1,372
pylint-dev__pylint-8929
pylint-dev/pylint
pylint-dev/pylint
python
f40e9ffd766bb434a0181dd9db3886115d2dfb2f
Exporting to JSON does not honor score option ### Steps to reproduce 1. Run pylint on some random Python file or module: ``` pylint ~/Desktop/pylint_test.py ``` As you can see this outputs some warnings/scoring: ``` ************* Module pylint_test /home/administrator/Desktop/pylint_test.py:1:0: C0111: Missing module...
Thank you for the report, I can reproduce this bug. I have a fix, but I think this has the potential to break countless continuous integration and annoy a lot of persons, so I'm going to wait for a review by someone else before merging. The fix is not going to be merged before a major version see https://github.com/Py...
diff --git a/pylint/interfaces.py b/pylint/interfaces.py --- a/pylint/interfaces.py +++ b/pylint/interfaces.py @@ -35,3 +35,4 @@ class Confidence(NamedTuple): CONFIDENCE_LEVELS = [HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED] CONFIDENCE_LEVEL_NAMES = [i.name for i in CONFIDENCE_LEVELS] +CONFIDENCE_MA...
diff --git a/tests/reporters/unittest_json_reporter.py b/tests/reporters/unittest_json_reporter.py --- a/tests/reporters/unittest_json_reporter.py +++ b/tests/reporters/unittest_json_reporter.py @@ -8,15 +8,16 @@ import json from io import StringIO +from pathlib import Path from typing import Any import pytest ...
["tests/reporters/unittest_json_reporter.py::test_simple_json_output_no_score", "tests/reporters/unittest_json_reporter.py::test_simple_json_output_no_score_with_end_line", "tests/reporters/unittest_json_reporter.py::test_serialize_deserialize[everything-defined]", "tests/reporters/unittest_json_reporter.py::test_simpl...
[]
null
true
2023-08-05T16:56:45Z
5
148
156
2,427
0
0.8
1
0.85
0.85
0.897833
88.056
3,186
swe_bench::test::1401
swe_bench
test
1,401
pytest-dev__pytest-5281
pytest-dev/pytest
pytest-dev/pytest
python
c0e53a61e65cb919bd29f62b756dfd57dfeef59a
Invalid unicode in _pytest/terminal.py with Jython With: Jython 2.7.1 and pytest 4.5.0, I'm having the error below: ``` Traceback (most recent call last): File "C:\bin\jython2.7.1\Lib\runpy.py", line 161, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\bin\jython2.7.1\Lib\runpy.py", ...
diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -447,6 +447,10 @@ def name(self): """Ensure that file.name is a string.""" return repr(self.buffer) + @property + def mode(self): + return self.buffer.mode.replace("...
diff --git a/testing/test_capture.py b/testing/test_capture.py --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1051,6 +1051,9 @@ def test_simple_resume_suspend(self, tmpfile): cap.done() pytest.raises(AttributeError, cap.suspend) + def test_capfd_sys_stdout_mode(self, capf...
["testing/test_capture.py::TestFDCapture::test_capfd_sys_stdout_mode"]
["[100%]", "testing/test_capture.py::TestCaptureManager::test_getmethod_default_no_fd", "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]", ...
null
true
2019-05-16T23:11:47Z
2
14
1
1,967
0
0.8
1
0.85
1
0.3745
88.0485
3,187
swe_bench::test::1801
swe_bench
test
1,801
sphinx-doc__sphinx-8020
sphinx-doc/sphinx
sphinx-doc/sphinx
python
bb65ea7930205ff54986136cd519c32a83407087
3.1.2 introduces WARNING: py:class reference target not found: Callable[[...], Awaitable[None]] **Describe the bug** ```python @decorator.decorator def host( func: typing.Callable[..., typing.Awaitable[None]], timeout: float = 3, *args, **kwargs ): ``` My project, including the above function definitio...
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -11,6 +11,7 @@ import builtins import inspect import re +import sys import typing import warnings from inspect import Parameter @@ -134,6 +135,19 @@ def unparse(node: ast.AST) -> List[...
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -262,6 +262,14 @@ def test_parse_annotation(app): [desc_sig_punctuation, ")"], [desc_sig_punctuation, "]"])) + doctree = _parse_annotat...
["tests/test_domain_py.py::test_parse_annotation"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam...
null
true
2020-07-29T16:43:16Z
1
14
1
1,899
0
0.8
1
0.85
1
0.363167
88.0145
3,188
swe_bench::test::2260
swe_bench
test
2,260
sympy__sympy-22740
sympy/sympy
sympy/sympy
python
44588dbb8c7ab833a8acb0cad94e395db82685e5
lambdifying Heaviside(Min(x, y)) not working When the original issue in #22726, the following becomes a problem ``` from sympy import * x, y = symbols('x y') f = Heaviside(Min(x, y)) g = lambdify((x, y), f, 'numpy') g(1, 2) ``` leads to ``` Traceback (most recent call last): File "C:\Users\Oscar\AppData\Local\Temp...
diff --git a/sympy/printing/numpy.py b/sympy/printing/numpy.py --- a/sympy/printing/numpy.py +++ b/sympy/printing/numpy.py @@ -149,8 +149,15 @@ def _print_DiagonalMatrix(self, expr): def _print_Piecewise(self, expr): "Piecewise function printer" + from sympy.logic.boolalg import ITE, simplify_log...
diff --git a/sympy/printing/tests/test_numpy.py b/sympy/printing/tests/test_numpy.py --- a/sympy/printing/tests/test_numpy.py +++ b/sympy/printing/tests/test_numpy.py @@ -14,6 +14,7 @@ from sympy.codegen.matrix_nodes import MatrixSolve from sympy.codegen.numpy_nodes import logaddexp, logaddexp2 from sympy.codegen.cf...
["test_numpy_array"]
["test_numpy_piecewise_regression", "test_numpy_logaddexp", "test_numpy_known_funcs_consts", "test_scipy_known_funcs_consts", "test_numpy_print_methods", "test_no_args", "test_single_arg", "test_list_args", "test_nested_args", "test_str_args", "test_own_namespace_1", "test_own_namespace_2", "test_own_module", "test_bad...
null
true
2021-12-21T19:45:34Z
1
17
1
1,815
0
0.8
1
0.85
1
0.359167
88.0025
3,189
swe_bench::test::1532
swe_bench
test
1,532
scikit-learn__scikit-learn-11264
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
a4f8e3d2a266fe4a253b449214806562ab83dda5
randomized_svd is slow for dok_matrix and lil_matrix #### Description `sklearn.utils.extmath.randomized_svd` (and its object-oriented interface, `sklearn.decomposition.TruncatedSVD`) is extremely slow for certain types of sparse matrix. #### Steps/Code to Reproduce ``` >>> import numpy as np >>> import scipy.sparse ...
diff --git a/sklearn/utils/extmath.py b/sklearn/utils/extmath.py --- a/sklearn/utils/extmath.py +++ b/sklearn/utils/extmath.py @@ -15,8 +15,7 @@ import warnings import numpy as np -from scipy import linalg -from scipy.sparse import issparse, csr_matrix +from scipy import linalg, sparse from . import check_random...
diff --git a/sklearn/utils/tests/test_extmath.py b/sklearn/utils/tests/test_extmath.py --- a/sklearn/utils/tests/test_extmath.py +++ b/sklearn/utils/tests/test_extmath.py @@ -365,6 +365,21 @@ def test_randomized_svd_power_iteration_normalizer(): assert_greater(15, np.abs(error_2 - error)) +def test_ran...
["sklearn/utils/tests/test_extmath.py::test_randomized_svd_sparse_warnings"]
["sklearn/utils/tests/test_extmath.py::test_density", "sklearn/utils/tests/test_extmath.py::test_uniform_weights", "sklearn/utils/tests/test_extmath.py::test_random_weights", "sklearn/utils/tests/test_extmath.py::test_logsumexp", "sklearn/utils/tests/test_extmath.py::test_randomized_svd_low_rank_all_dtypes[int32]", "sk...
null
true
2018-06-14T18:10:41Z
1
21
1
1,725
0
0.8
1
0.85
1
0.3575
87.9975
3,190
swe_bench::test::1766
swe_bench
test
1,766
sphinx-doc__sphinx-7351
sphinx-doc/sphinx
sphinx-doc/sphinx
python
c75470f9b79046f6d32344be5eacf60a4e1c1b7d
Files with same name but different extensions leads to unexpected behaviour **Describe the bug** If there are multiple files with the same name but different file extensions; sphinx will silently choose only one to parse: **To Reproduce** Steps to reproduce the behavior: Given I have an extension installed to parse ...
diff --git a/sphinx/project.py b/sphinx/project.py --- a/sphinx/project.py +++ b/sphinx/project.py @@ -9,6 +9,7 @@ """ import os +from glob import glob from sphinx.locale import __ from sphinx.util import get_matching_files @@ -55,7 +56,13 @@ def discover(self, exclude_paths=[]): for filename in get_ma...
diff --git a/tests/test_util_logging.py b/tests/test_util_logging.py --- a/tests/test_util_logging.py +++ b/tests/test_util_logging.py @@ -103,6 +103,17 @@ def test_nonl_info_log(app, status, warning): assert 'message1message2\nmessage3' in status.getvalue() +def test_once_warning_log(app, status, warning): + ...
["tests/test_util_logging.py::test_once_warning_log"]
["tests/test_util_logging.py::test_info_and_warning", "tests/test_util_logging.py::test_verbosity_filter", "tests/test_util_logging.py::test_nonl_info_log", "tests/test_util_logging.py::test_is_suppressed_warning", "tests/test_util_logging.py::test_suppress_warnings", "tests/test_util_logging.py::test_warningiserror", ...
null
true
2020-03-21T11:47:35Z
2
44
1
1,180
0
0.8
1
0.85
1
0.343333
87.955
3,191
swe_bench::test::1651
swe_bench
test
1,651
scikit-learn__scikit-learn-14764
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
af2bad4f34e938cb16ada0ae19cc713a275682d6
datasets :: make_classification() weights parameter should be a sequence (not just a list). ### `weights` should be passed as list or array (not just list) in `sklearn\datasets\samples_generator.py :: make_classification`: If there is a pertinent reason that `weights` must be a list, while *all other iterable paramete...
tests are failing. Fit returns self, so you have to add that output. Also there's a pep8 error.
diff --git a/sklearn/datasets/samples_generator.py b/sklearn/datasets/samples_generator.py --- a/sklearn/datasets/samples_generator.py +++ b/sklearn/datasets/samples_generator.py @@ -91,7 +91,8 @@ def make_classification(n_samples=100, n_features=20, n_informative=2, n_clusters_per_class : int, optional (default=2...
diff --git a/sklearn/datasets/tests/test_samples_generator.py b/sklearn/datasets/tests/test_samples_generator.py --- a/sklearn/datasets/tests/test_samples_generator.py +++ b/sklearn/datasets/tests/test_samples_generator.py @@ -146,6 +146,36 @@ def test_make_classification_informative_features(): n_cluster...
["sklearn/datasets/tests/test_samples_generator.py::test_make_classification_weights_type[weights0-ValueError-Weights", "sklearn/datasets/tests/test_samples_generator.py::test_make_classification_weights_type[weights2-ValueError-Weights", "sklearn/datasets/tests/test_samples_generator.py::test_make_classification_weigh...
["sklearn/datasets/tests/test_samples_generator.py::test_make_classification", "sklearn/datasets/tests/test_samples_generator.py::test_make_classification_informative_features", "sklearn/datasets/tests/test_samples_generator.py::test_make_classification_weights_type[weights1-ValueError-Weights", "sklearn/datasets/tests...
null
true
2019-08-24T17:02:34Z
1
32
6
3,690
0.076923
0.8
1
0.92
1
0.606667
87.952
3,192
swe_bench::test::1219
swe_bench
test
1,219
pydata__xarray-3520
pydata/xarray
pydata/xarray
python
8b240376fd91352a80b068af606850e8d57d1090
selection from MultiIndex does not work properly #### MCVE Code Sample ```python da = xr.DataArray([0, 1], dims=['x'], coords={'x': [0, 1], 'y': 'a'}) db = xr.DataArray([2, 3], dims=['x'], coords={'x': [0, 1], 'y': 'b'}) data = xr.concat([da, db], dim='x').set_index(xy=['x', 'y']) data.sel(y='a') >>> <xarray.DataArray...
diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -48,7 +48,7 @@ assert_coordinate_consistent, remap_label_indexers, ) -from .dataset import Dataset, merge_indexes, split_indexes +from .dataset import Dataset, split_indexes from...
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 @@ -1182,6 +1182,16 @@ def test_selection_multiindex_remove_unused(self): expected = expected.set_index(xy=["x", "y"]).unstack() assert_identical(expec...
["xarray/tests/test_dataarray.py::TestDataArray::test_selection_multiindex_from_level"]
["xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray::test_data_property", "xarray/tests/test_dataarray.py::TestDataArray::test_indexes", "xarray/tests/test_dataarray.py::TestDataArray::test_get_index", "xarray/tests/test_dataarray.py::TestDataArray::test_get...
null
true
2019-11-13T16:06:50Z
2
22
1
1,485
0
0.8
1
0.85
1
0.320833
87.8875
3,193
swe_bench::test::1810
swe_bench
test
1,810
sphinx-doc__sphinx-8117
sphinx-doc/sphinx
sphinx-doc/sphinx
python
667a188e25cb70a1c673081b066a8a90c6e8eea7
"Invalid C declaration" on C function with macro after function arguments **Describe the bug** I have a C function definition with a trailing macro which specifies the function as "noreturn" and this gives an error during build, even when this keyword is defined in `c_id_attributes`. **To Reproduce** I have the follow...
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -32,7 +32,7 @@ from sphinx.transforms.post_transforms import ReferencesResolver from sphinx.util import logging from sphinx.util.cfamily import ( - NoOldIdError, ASTBaseBase, ASTBaseParenExprList, + No...
diff --git a/tests/test_domain_c.py b/tests/test_domain_c.py --- a/tests/test_domain_c.py +++ b/tests/test_domain_c.py @@ -497,17 +497,16 @@ def test_attributes(): parse('member', 'paren_attr({]}) int f') # position: decl specs - check('function', 'static inline __attribute__(()) void f()', - ...
["tests/test_domain_c.py::test_attributes", "tests/test_domain_cpp.py::test_attributes"]
["tests/test_domain_c.py::test_expressions", "tests/test_domain_c.py::test_type_definitions", "tests/test_domain_c.py::test_macro_definitions", "tests/test_domain_c.py::test_member_definitions", "tests/test_domain_c.py::test_function_definitions", "tests/test_domain_c.py::test_nested_name", "tests/test_domain_c.py::tes...
null
true
2020-08-13T16:42:12Z
3
42
2
1,061
0
0.8
1
0.85
1
0.316833
87.8755
3,194
swe_bench::test::1450
swe_bench
test
1,450
pytest-dev__pytest-7535
pytest-dev/pytest
pytest-dev/pytest
python
7ec6401ffabf79d52938ece5b8ff566a8b9c260e
pytest 6: Traceback in pytest.raises contains repr of py.path.local The [werkzeug](https://github.com/pallets/werkzeug) tests fail with pytest 6: ```python def test_import_string_provides_traceback(tmpdir, monkeypatch): monkeypatch.syspath_prepend(str(tmpdir)) # Couple of packages dir_a = t...
diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -262,7 +262,15 @@ def __str__(self) -> str: raise except BaseException: line = "???" - return " File %r:%d in %s\n %s\n" % (self.path, self.li...
diff --git a/testing/code/test_code.py b/testing/code/test_code.py --- a/testing/code/test_code.py +++ b/testing/code/test_code.py @@ -1,3 +1,4 @@ +import re import sys from types import FrameType from unittest import mock @@ -170,6 +171,15 @@ def test_getsource(self) -> None: assert len(source) == 6 ...
["testing/code/test_code.py::TestTracebackEntry::test_tb_entry_str"]
["testing/code/test_code.py::test_ne", "testing/code/test_code.py::test_code_gives_back_name_for_not_existing_file", "testing/code/test_code.py::test_code_with_class", "testing/code/test_code.py::test_code_fullsource", "testing/code/test_code.py::test_code_source", "testing/code/test_code.py::test_frame_getsourcelineno...
null
true
2020-07-23T14:15:26Z
1
10
1
1,648
0
0.8
1
0.85
1
0.308
87.849
3,195
swe_bench::dev::96
swe_bench
dev
96
pydicom__pydicom-1458
pydicom/pydicom
pydicom/pydicom
python
8da0b9b215ebfad5756051c891def88e426787e7
Pixel Representation attribute should be optional for pixel data handler **Describe the bug** The NumPy pixel data handler currently [requires the Pixel Representation attribute](https://github.com/pydicom/pydicom/blob/8da0b9b215ebfad5756051c891def88e426787e7/pydicom/pixel_data_handlers/numpy_handler.py#L46). This is p...
diff --git a/pydicom/pixel_data_handlers/numpy_handler.py b/pydicom/pixel_data_handlers/numpy_handler.py --- a/pydicom/pixel_data_handlers/numpy_handler.py +++ b/pydicom/pixel_data_handlers/numpy_handler.py @@ -43,7 +43,9 @@ | (0028,0100) | BitsAllocated | 1 | 1, 8, 16, 32, | Required | | |...
diff --git a/pydicom/tests/test_numpy_pixel_data.py b/pydicom/tests/test_numpy_pixel_data.py --- a/pydicom/tests/test_numpy_pixel_data.py +++ b/pydicom/tests/test_numpy_pixel_data.py @@ -26,6 +26,8 @@ * PlanarConfiguration """ +from copy import deepcopy + import pytest from pydicom import config @@ -1068,6 +107...
["pydicom/tests/test_numpy_pixel_data.py::TestNumpy_GetPixelData::test_missing_required_elem_pixel_data_monochrome", "pydicom/tests/test_numpy_pixel_data.py::TestNumpy_GetPixelData::test_missing_conditionally_required_elem_pixel_data_color"]
["pydicom/tests/test_numpy_pixel_data.py::test_unsupported_syntaxes", "pydicom/tests/test_numpy_pixel_data.py::TestNumpy_NoNumpyHandler::test_environment", "pydicom/tests/test_numpy_pixel_data.py::TestNumpy_NoNumpyHandler::test_can_access_supported_dataset", "pydicom/tests/test_numpy_pixel_data.py::TestNumpy_NoNumpyHan...
null
true
2021-08-04T15:22:07Z
1
18
2
1,423
0
0.8
1
0.85
1
0.297167
87.8165
3,196
swe_bench::test::1849
swe_bench
test
1,849
sphinx-doc__sphinx-8707
sphinx-doc/sphinx
sphinx-doc/sphinx
python
d5d072bc3a561b0d462aa27b9f85662da1a5bd93
viewcode does not work when `make singlehtml html` **Describe the bug** viewcode does not work when `make clean html` **To Reproduce** ``` $ make clean singlehtml html ``` **Expected behavior** Always enabled for HTML builds (except singlehtml and epub) **Your project** No **Screenshots** No **Environment info** ...
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -10,6 +10,7 @@ import posixpath import traceback +import warnings from os import path from typing import Any, Dict, Generator, Iterable, Optional, Set, Tuple, cast @@ -19,10 +20,13 @@ impor...
diff --git a/tests/test_ext_viewcode.py b/tests/test_ext_viewcode.py --- a/tests/test_ext_viewcode.py +++ b/tests/test_ext_viewcode.py @@ -55,6 +55,9 @@ def test_viewcode_epub_default(app, status, warning): assert not (app.outdir / '_modules/spam/mod1.xhtml').exists() + result = (app.outdir / 'index.xhtml')...
["tests/test_ext_viewcode.py::test_viewcode_epub_default"]
["tests/test_ext_viewcode.py::test_viewcode_epub_enabled", "tests/test_ext_viewcode.py::test_linkcode", "tests/test_ext_viewcode.py::test_local_source_files"]
null
true
2021-01-19T17:04:10Z
1
64
1
469
0
0.8
1
0.85
1
0.2915
87.7995
3,197
swe_bench::dev::77
swe_bench
dev
77
pydicom__pydicom-1050
pydicom/pydicom
pydicom/pydicom
python
00c248441ffb8b7d46c6d855b723e696a8f5aada
LUT Descriptor tag with no value yields TypeError **Describe the bug** I have a DICOM image with the following tag (copied from ImageJ) ``` 0028,1101 Red Palette Color Lookup Table Descriptor: ``` which corresponds to the raw data element, produced by [`DataElement_from_raw`](https://github.com/pydicom/pydicom/blob/...
diff --git a/pydicom/dataelem.py b/pydicom/dataelem.py --- a/pydicom/dataelem.py +++ b/pydicom/dataelem.py @@ -741,9 +741,13 @@ def DataElement_from_raw(raw_data_element, encoding=None): except NotImplementedError as e: raise NotImplementedError("{0:s} in tag {1!r}".format(str(e), raw.tag)) - if raw....
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 @@ -674,6 +674,27 @@ def test_lut_descriptor(self): assert elem.VR == 'SS' assert elem.value == [62720, -2048, 16] + def test_lut_...
["pydicom/tests/test_filereader.py::TestReader::test_lut_descriptor_empty", "pydicom/tests/test_filereader.py::TestReader::test_lut_descriptor_singleton"]
["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
2020-02-10T10:54:28Z
1
8
2
1,582
0
0.8
1
0.85
1
0.290333
87.796
3,198
swe_bench::test::1521
swe_bench
test
1,521
scikit-learn__scikit-learn-10949
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
3b5abf76597ce6aff76192869f92647c1b5259e7
warn_on_dtype with DataFrame #### Description ``warn_on_dtype`` has no effect when input is a pandas ``DataFrame`` #### Steps/Code to Reproduce ```python from sklearn.utils.validation import check_array import pandas as pd df = pd.DataFrame([[1, 2, 3], [2, 3, 4]], dtype=object) checked = check_array(df, warn_on_dtype...
diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -466,6 +466,12 @@ def check_array(array, accept_sparse=False, accept_large_sparse=True, # not a data type (e.g. a column named dtype in a pandas DataFrame) dtyp...
diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py --- a/sklearn/utils/tests/test_validation.py +++ b/sklearn/utils/tests/test_validation.py @@ -7,6 +7,7 @@ from itertools import product import pytest +from pytest import importorskip import numpy as np import scipy.sparse...
["sklearn/utils/tests/test_validation.py::test_check_dataframe_warns_on_dtype"]
["sklearn/utils/tests/test_validation.py::test_as_float_array", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X0]", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X1]", "sklearn/utils/tests/test_validation.py::test_np_matrix", "sklearn/utils/tests/test_validation.py::test_memmap", "...
null
true
2018-04-10T15:30:56Z
1
16
1
1,414
0
0.8
1
0.85
1
0.289
87.792
3,199
swe_bench::dev::111
swe_bench
dev
111
pydicom__pydicom-839
pydicom/pydicom
pydicom/pydicom
python
da9e0df8da28a35596f830379341a379de8ac439
Ambiguous VR element could be read in <=1.1.0 but is broken in >=1.2.0 #### Description Attribute Error thrown when printing (0x0028, 0x0120) PixelPaddingValue #### Steps/Code to Reproduce Using pydicom 1.2.2 and above (including master branch as of issue creation date): ``` from pydicom import dcmread ds = dcmread(...
Hm, in this case `PixelPadding` doesn't make sense, as there is no `PixelData` present, so we could just ignore it (e.g. use some default VR). With `PixelData` present, a missing `PixelRepresentation` would be a real DICOM violation, that would justify an exception as with the current behavior in my opinion. The same...
diff --git a/pydicom/filewriter.py b/pydicom/filewriter.py --- a/pydicom/filewriter.py +++ b/pydicom/filewriter.py @@ -72,7 +72,10 @@ def _correct_ambiguous_vr_element(elem, ds, is_little_endian): # PixelRepresentation is usually set in the root dataset while 'PixelRepresentation' not in ds and ds.par...
diff --git a/pydicom/tests/test_filewriter.py b/pydicom/tests/test_filewriter.py --- a/pydicom/tests/test_filewriter.py +++ b/pydicom/tests/test_filewriter.py @@ -671,9 +671,15 @@ def test_pixel_representation_vm_one(self): assert 1 == ds.SmallestValidPixelValue assert 'SS' == ds[0x00280104].VR - ...
["pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVR::test_pixel_representation_vm_one", "pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVR::test_pixel_representation_vm_three", "pydicom/tests/test_filewriter.py::TestCorrectAmbiguousVRElement::test_correct_ambiguous_data_element"]
["pydicom/tests/test_filewriter.py::TestWriteFile::testRTPlan", "pydicom/tests/test_filewriter.py::TestWriteFile::testRTDose", "pydicom/tests/test_filewriter.py::TestWriteFile::testCT", "pydicom/tests/test_filewriter.py::TestWriteFile::testMR", "pydicom/tests/test_filewriter.py::TestWriteFile::testUnicode", "pydicom/te...
null
true
2019-04-28T18:27:57Z
1
5
3
3,212
0
0.8
1
0.92
0.8
0.516667
87.72