instance_id
stringlengths
21
53
repo
stringclasses
188 values
language
stringclasses
1 value
pull_number
int64
20
148k
title
stringlengths
6
144
body
stringlengths
0
83.4k
created_at
stringdate
2015-09-25 03:17:17
2025-07-10 16:50:35
problem_statement
stringlengths
188
240k
hints_text
stringlengths
0
145k
resolved_issues
listlengths
1
6
base_commit
stringlengths
40
40
commit_to_review
dict
reference_review_comments
listlengths
1
62
merged_commit
stringlengths
40
40
merged_patch
stringlengths
297
9.87M
metadata
dict
pandas-dev__pandas-18884@8e856d1
pandas-dev/pandas
Python
18,884
Fix Series[timedelta64]+DatetimeIndex[tz] bugs
ser + index lost timezone index + ser retained timezone but returned a DatetimeIndex - [x] closes #13905 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-12-20T22:22:45Z
DatetimeIndex + TimeDelta gives wrong results when timezone is set When I add a time delta to a DatetimeIndex which is tz-aware, the results appear as UTC, but sometimes claim to be in the original non-UTC timezone. #### Code ``` import pandas as pd index = pd.DatetimeIndex(['2016-06-28 05:30', '2016-06-28 05:31'], dt...
yep, thought we had an issue about this, but can't seem to find it.
[ { "body": "When I add a time delta to a DatetimeIndex which is tz-aware, the results appear as UTC, but sometimes claim to be in the original non-UTC timezone.\n#### Code\n\n```\nimport pandas as pd\nindex = pd.DatetimeIndex(['2016-06-28 05:30', '2016-06-28 05:31'], dtype='datetime64[ns, America/Chicago]')\noff...
c19bdc98fa3f856e2e6b3495bbab88b587801987
{ "head_commit": "8e856d1f145b299a40018422676ebcaba9244236", "head_commit_message": "Fix Series[timedelta64]+DatetimeIndex[tz] bugs\n\nser + index lossed timezone\ncloses #13905\n\nindex + ser retained timezone but returned a DatetimeIndex", "patch_to_review": "diff --git a/pandas/core/indexes/datetimes.py b/pand...
[ { "diff_hunk": "@@ -709,6 +709,15 @@ def wrapper(left, right, name=name, na_op=na_op):\n \n left, right = _align_method_SERIES(left, right)\n \n+ if is_timedelta64_dtype(left) and isinstance(right, pd.DatetimeIndex):\n+ # GH#13905\n+ # Defer to DatetimeIndex/TimedeltaIndex o...
190197cd91c4ae6461a1aa0514291f567ee6dd08
diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt index 5fd7c3e217928..119dd894abe4c 100644 --- a/doc/source/whatsnew/v0.23.0.txt +++ b/doc/source/whatsnew/v0.23.0.txt @@ -370,6 +370,7 @@ Numeric - Bug in :func:`Series.__sub__` subtracting a non-nanosecond ``np.datetime64`` object from a...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-18831@4821f05
pandas-dev/pandas
Python
18,831
BUG: fix Series[timedelta64] arithmetic with Timedelta scalars
closes #18846 Before: ``` >>> ser = pd.Series([pd.Timedelta(minutes=5, seconds=3)] * 3) >>> ser.iloc[-1] = np.nan >>> scalar = pd.Timedelta(minutes=5, seconds=4) >>> ser // scalar [...] TypeError: can only operate on a timedeltas for addition, subtraction, and division, but the operator [__floordiv__] was ...
2017-12-19T02:21:05Z
BUG: Timedelta.__floordiv__ - need historical context ``` >>> pd.Timedelta(days=3, hours=4) // np.datetime64('NaT') -1 ``` `Timedelta.__floordiv__` and `__rfloordiv__` begin with: ``` if hasattr(other, 'dtype'): # work with i8 other = other.astype('m8[ns]').astype('i8') ``` ...
yes I think this is ok (to fix), maybe some prior version . numpy issues we were working around
[ { "body": "```\r\n>>> pd.Timedelta(days=3, hours=4) // np.datetime64('NaT')\r\n-1\r\n```\r\n\r\n`Timedelta.__floordiv__` and `__rfloordiv__` begin with:\r\n\r\n```\r\n if hasattr(other, 'dtype'):\r\n # work with i8\r\n other = other.astype('m8[ns]').astype('i8')\r\n```\r\n\r\nI _thi...
21f2412cf1c3bcbde04c1a53e6ecc597b5e871dd
{ "head_commit": "4821f05b43f93bb143c3fadc5f875097e7a16c08", "head_commit_message": "floordiv example in timedeltas.rst, move whatsnew note to conversion section", "patch_to_review": "diff --git a/doc/source/timedeltas.rst b/doc/source/timedeltas.rst\nindex d055c49dc4721..778db17a56b58 100644\n--- a/doc/source/ti...
[ { "diff_hunk": "@@ -976,16 +984,24 @@ def run_ops(ops, get_ser, test_ser):\n # ## timedelta64 ###\n td1 = Series([timedelta(minutes=5, seconds=3)] * 3)\n td1.iloc[2] = np.nan\n- td2 = timedelta(minutes=5, seconds=4)\n- ops = ['__mul__', '__floordiv__', '__pow__', '__rmul__'...
729d2402cd386baca20fa09dd2f36d74cc551906
diff --git a/doc/source/timedeltas.rst b/doc/source/timedeltas.rst index d055c49dc4721..778db17a56b58 100644 --- a/doc/source/timedeltas.rst +++ b/doc/source/timedeltas.rst @@ -267,6 +267,14 @@ yields another ``timedelta64[ns]`` dtypes Series. td * -1 td * pd.Series([1, 2, 3, 4]) +Rounded division (floor-divi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
networkx__networkx-5583@9c51c46
networkx/networkx
Python
5,583
Add examples to compose operation
Closes #4485 I added examples that show how to update node/edge attributes after `compose` operation. @dschult @rossbar
2022-04-26T15:45:00Z
Have `compose` offer an option to sum attributes. This will need a bit of thought about how best to handle this... Right now in `compose` where there are nodes with the same name or edges between the same nodes in both graphs and the attributes are in conflict, it takes the attributes of one of them over the other. ...
Wouldn’t that complicate the composition operation? It is defined as “the simple union of the node sets and edge sets” in [binary operations](https://github.com/networkx/networkx/blob/master/networkx/algorithms/operators/binary.py). There's some choice about how to interpret the union of the two graphs both with edges ...
[ { "body": "This will need a bit of thought about how best to handle this...\r\n\r\nRight now in `compose` where there are nodes with the same name or edges between the same nodes in both graphs and the attributes are in conflict, it takes the attributes of one of them over the other.\r\n\r\nI can imagine many s...
12c1a00cd116701a763f7c57c230b8739d2ed085
{ "head_commit": "9c51c46934e2f18740022995a0ad5697ac43f8a7", "head_commit_message": "Add examples to doc_string", "patch_to_review": "diff --git a/networkx/algorithms/operators/binary.py b/networkx/algorithms/operators/binary.py\nindex a3bbab36cce..2f8f4c95d4e 100644\n--- a/networkx/algorithms/operators/binary.py...
[ { "diff_hunk": "@@ -309,6 +309,30 @@ def compose(G, H):\n NodeView((0, 1, 2))\n >>> R.edges\n EdgeView([(0, 1), (0, 2), (1, 2)])\n+\n+ As indicated above, the attributes from H take precedent over attributes from G.\n+ If you prefer another way of combining attributes, you can update them afte...
3c94167da8f04682cca37c001539ee79021702e5
diff --git a/networkx/algorithms/operators/binary.py b/networkx/algorithms/operators/binary.py index a3bbab36cce..fcd5933eaaa 100644 --- a/networkx/algorithms/operators/binary.py +++ b/networkx/algorithms/operators/binary.py @@ -309,6 +309,35 @@ def compose(G, H): NodeView((0, 1, 2)) >>> R.edges EdgeView...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
networkx__networkx-5550@2f6dbef
networkx/networkx
Python
5,550
fix greedy_modularity when multiple components exist.
Fixes #5530 After the community merging iteration stops, we have to check whether the number of communities is still too many for the `best_n` criteria. If so, merge the biggest 2 components repeatedly to keep modularity as big as we can.
2022-04-17T20:42:01Z
greedy_modularity_communities raises StopIteration for unconnected (?) graph <!--- Provide a general summary of the issue in the Title above --> After an update of `networkx` from 2.6.3 to 2.8, one of my tests suddenly failed with ``` Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line ...
Thanks for the report @Anaphory - you are correct, there indeed has been a behavior changed for unconnected graphs. Your suggestions as to what to do about it seem sensible, though I'm not sure which approach we should take (i.e. document the new behavior or treat this as a regression). I'd like to know what others thi...
[ { "body": "<!--- Provide a general summary of the issue in the Title above -->\r\n\r\nAfter an update of `networkx` from 2.6.3 to 2.8, one of my tests suddenly failed with\r\n```\r\nTraceback (most recent call last):\r\n File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\r\n return _run...
1e5f0bde4cf4cbe4b65bf6e7be775a49556dcf23
{ "head_commit": "2f6dbefbe6268853bf733371427e85b4c5bc2faa", "head_commit_message": "fix greedy_modularity when multiple components exist.\n\nAfter merging iteration stops, have to check whether number\nof communities is still too many for the `best_n` criteria.\nIf so, merge the components with biggest first to ke...
[ { "diff_hunk": "@@ -44,6 +44,17 @@ def test_modularity_communities_categorical_labels(func):\n assert set(func(G)) == expected\n \n \n+def test_greedy_modularity_communities_components():\n+ # Test for gh-5530\n+ G = nx.Graph([(0, 1), (2, 3), (4, 5), (5, 6)])\n+ # usual case with 3 components\n+ ...
03c9617afb782c4a643fb9c2168274f759f60160
diff --git a/networkx/algorithms/community/modularity_max.py b/networkx/algorithms/community/modularity_max.py index 264a0dc0735..ca1cfb9e259 100644 --- a/networkx/algorithms/community/modularity_max.py +++ b/networkx/algorithms/community/modularity_max.py @@ -326,6 +326,8 @@ def greedy_modularity_communities( ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
python-telegram-bot__python-telegram-bot-1724@0f9a5f9
python-telegram-bot/python-telegram-bot
Python
1,724
Make (most) objects comparable
Closes #1708 Added `_id_attrs` to most of the telegram objects (more or less) by the following paradigm: 1. If object has some sort of ID, just use that 2. If object has only optional args, use all of them 3. If object has required arg, use that 4. If object hast required arg and exactly one of the optionals mus...
2020-01-23T19:59:39Z
[FEATURE] Add _id_attrs #### Is your feature request related to a problem? Please describe. `InlineKeyboardMarkup` and `InlineKeyboardButton` objects are currently not really testable for equality because the `_id_attrs` are not set. We should add all attributes of `IKB` to the `_id_attr` and `inline_keyboard` for `IK...
[ { "body": "#### Is your feature request related to a problem? Please describe.\r\n`InlineKeyboardMarkup` and `InlineKeyboardButton` objects are currently not really testable for equality because the `_id_attrs` are not set. We should add all attributes of `IKB` to the `_id_attr` and `inline_keyboard` for `IKM`....
21f6fbf2cf7169a0d6b9b23c6564eaff79a1ec69
{ "head_commit": "0f9a5f9208d11e0f6cf3c86abbf844e5c01eb8e4", "head_commit_message": "Update for API 4.8", "patch_to_review": "diff --git a/telegram/base.py b/telegram/base.py\nindex 3431396c95c..1fb0ba61d8e 100644\n--- a/telegram/base.py\n+++ b/telegram/base.py\n@@ -23,6 +23,8 @@\n except ImportError:\n impor...
[ { "diff_hunk": "@@ -78,6 +80,9 @@ def to_dict(self):\n \n def __eq__(self, other):\n if isinstance(other, self.__class__):\n+ if self._id_attrs == ():", "line": 78, "original_line": 83, "original_start_line": null, "path": "telegram/base.py", "start_line": null, "t...
81cbf673e66bb1b2440d4aa7f555d467cf4ab419
diff --git a/telegram/base.py b/telegram/base.py index 444d30efc2b..d93233002bd 100644 --- a/telegram/base.py +++ b/telegram/base.py @@ -23,6 +23,8 @@ except ImportError: import json +import warnings + class TelegramObject: """Base class for most telegram objects.""" @@ -73,6 +75,12 @@ def to_dict(self)...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
networkx__networkx-5371@b446ef1
networkx/networkx
Python
5,371
Simplify DelayedImportErrorModule
Closes #5367
2022-03-02T06:19:07Z
Error when importing networkx: "module 'importlib' has no attribute 'machinery'" When importing networkx, the error `AttributeError: module 'importlib' has no attribute 'machinery'` occurs. It seems like networkx is not importing `importlib.machinery`. ### Steps to Reproduce ``` $ sudo docker run -it --rm fedor...
Very strange - maybe something is wrong with the `python3` package in the fedora image? It seems weird that you're getting 3.10rc2 (without specifying that explicitly). FWIW I can't reproduce locally and CI never caught anything w/ Debian-based linux, macos, or windows. I think this is due to which modules are loade...
[ { "body": "When importing networkx, the error `AttributeError: module 'importlib' has no attribute 'machinery'` occurs.\r\n\r\nIt seems like networkx is not importing `importlib.machinery`.\r\n\r\n### Steps to Reproduce\r\n```\r\n$ sudo docker run -it --rm fedora:35\r\n# dnf install -y python3 python3-pip\r\n# ...
2b01a30d6967cc94a0f8caca2252bce7817b2b1c
{ "head_commit": "b446ef128ee25c420c6c1e8707e24cc1dfff6f94", "head_commit_message": "Simplify DelayedImportErrorModule", "patch_to_review": "diff --git a/networkx/lazy_imports.py b/networkx/lazy_imports.py\nindex 248f3b43c4e..9c4d8befe04 100644\n--- a/networkx/lazy_imports.py\n+++ b/networkx/lazy_imports.py\n@@ -...
[ { "diff_hunk": "@@ -81,6 +81,18 @@ def __dir__():\n return __getattr__, __dir__, list(__all__)\n \n \n+class DelayedImportErrorModule(types.ModuleType):\n+ def __init__(self, import_name, *args, **kwargs):\n+ self.__import_name = import_name\n+ super().__init__(*args, **kwargs)\n+\n+ def...
e05a1811e9d94606a55266241f67df2398f20da7
diff --git a/networkx/lazy_imports.py b/networkx/lazy_imports.py index 248f3b43c4e..9a88ed6dc29 100644 --- a/networkx/lazy_imports.py +++ b/networkx/lazy_imports.py @@ -1,5 +1,6 @@ import importlib import importlib.util +import inspect import types import os import sys @@ -81,6 +82,24 @@ def __dir__(): return...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
networkx__networkx-5394@6dc4191
networkx/networkx
Python
5,394
Fix min_weight_matching to convert edge weights without reciprocal
Fixes #5388 Add test and then fix code and docs. Discussion point: I think we need to remove the `maxcardinality` parameter because it doesn't make sense in a minimum weight matching to allow edges to not be included. You would return a matching with no edges. That would certainly minimize the edge weights. In...
2022-03-15T22:32:49Z
min_weight_matching gives incorrect results <!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion --> <!--- Provide a general summary of the issue in the Title above --> Consider the following graph: ```python G = nx.Graph() G.add_edge(1, 4, weight=2) G....
Thanks! You are correct. That is a faulty way of thinking about turning a min problem into a max problem. Maximizing over sums of reciprocal weights does not minimizing correctly. Other options include negating (if the problem doesn't have trouble with negative weights -- which min_weight_matching does not... b...
[ { "body": "<!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion -->\r\n\r\n<!--- Provide a general summary of the issue in the Title above -->\r\n\r\nConsider the following graph:\r\n```python\r\nG = nx.Graph()\r\nG.add_edge(1, 4, weight=2)\r\nG.add_edge(...
c39511522b272bf65b6a415169cd48d1bf3ff5c1
{ "head_commit": "6dc419174119bef27bd9fc8531c58306002e6a9d", "head_commit_message": "Add test and then fix code and docs", "patch_to_review": "diff --git a/networkx/algorithms/matching.py b/networkx/algorithms/matching.py\nindex 2a57e9a13bc..10417aa4351 100644\n--- a/networkx/algorithms/matching.py\n+++ b/network...
[ { "diff_hunk": "@@ -246,9 +250,14 @@ def min_weight_matching(G, maxcardinality=False, weight=\"weight\"):\n G : NetworkX graph\n Undirected graph\n \n- maxcardinality: bool, optional (default=False)\n- If maxcardinality is True, compute the maximum-cardinality matching\n- with minimum w...
a6812ed9f7faf5c084a334fc833dd2c99a8f4815
diff --git a/doc/developer/deprecations.rst b/doc/developer/deprecations.rst index 77d814532b0..a155ab76548 100644 --- a/doc/developer/deprecations.rst +++ b/doc/developer/deprecations.rst @@ -114,3 +114,4 @@ Version 3.0 * In ``algorithms/distance_measures.py`` remove ``extrema_bounding``. * In ``utils/misc.py`` remo...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
networkx__networkx-5474@022c40f
networkx/networkx
Python
5,474
Updated networkx/classes/function.py . Solves Issue #5463
Fixes #5463
2022-04-05T16:22:30Z
Improve Examples Section of ```set_edge_attributes``` <!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion --> <!--- Provide a general summary of the issue in the Title above --> <!--- Tell us what happens instead of the expected behavior --> While looki...
I agree that a multigraph example would be a nice improvement. The fact that `values` expects the dict keyed by 3-tuples is definitely worth highlighting. Okay thanks! I will try to include an example and add a PR. Can you guide me on which file in the repo to be edited? > Can you guide me on which file in the repo to...
[ { "body": "<!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion -->\r\n\r\n<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n\r\n<!--- Tell us what happens instead of the expected behavior -->\r\nWhile looking at the ```set_edge_a...
7e17ff9007d2e71c2ea2a6d340889c331689343c
{ "head_commit": "022c40f9e14bcff055ff81784e9e957fb5518817", "head_commit_message": "Update networkx/classes/function.py\n\nCo-authored-by: Ross Barnowski <rossbar@berkeley.edu>", "patch_to_review": "diff --git a/networkx/classes/function.py b/networkx/classes/function.py\nindex 6b9027fcfc9..eb3b1b0b081 100644\n-...
[ { "diff_hunk": "@@ -793,6 +793,20 @@ def set_edge_attributes(G, values, name=None):\n >>> (1, 2) in G.edges()\n False\n \n+ For multigraphs, the `values` dict is expected to be keyed by 3-tuples\n+ including the edge key::\n+\n+ >>> G = nx.MultiGraph()\n+ >>> edges = [(0,1), ...
8baf707c4dc2cee8b7ae6f60bdee59342be2cfee
diff --git a/networkx/classes/function.py b/networkx/classes/function.py index e026a8033ee..cb1c9d181e5 100644 --- a/networkx/classes/function.py +++ b/networkx/classes/function.py @@ -787,6 +787,11 @@ def set_edge_attributes(G, values, name=None): >>> G[1][2]["attr2"] 3 + The attributes of one G...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
pandas-dev__pandas-18629@d8a27e1
pandas-dev/pandas
Python
18,629
ENH: support non default indexes in writing to Parquet
- [x] closes #18581 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-12-04T13:43:05Z
Support non-default indexes in to_parquet Calling `to_parquet` on a DataFrame with a non-default index results in the error below: ```python-traceback ValueError: parquet does not support serializing a non-default index for the index; you can .reset_index() to make the index into column(s) ``` While, you can work-a...
If I remove the checking code (this is with pyarrow 0.7.1) ``` In [2]: df = pd.DataFrame({'A': list('abc')}, index=[2, 3, 4]) In [3]: df Out[3]: A 2 a 3 b 4 c In [4]: df.to_parquet('foo.parquet') In [5]: pd.read_parquet('foo.parquet') Out[5]: A 2 a 3 b 4 c ``` ``` diff --git a/...
[ { "body": "Calling `to_parquet` on a DataFrame with a non-default index results in the error below:\r\n```python-traceback\r\nValueError: parquet does not support serializing a non-default index for the index; you can .reset_index() to make the index into column(s)\r\n```\r\nWhile, you can work-around this by c...
37086a0d82a6492d9903ba763059948889638de7
{ "head_commit": "d8a27e16d8bc6f87047e9de00501ceadc4143b0d", "head_commit_message": "move whatsnew note to parquet section", "patch_to_review": "diff --git a/ci/requirements-2.7.sh b/ci/requirements-2.7.sh\nindex e3bd5e46026c5..9e59f3e5eeb55 100644\n--- a/ci/requirements-2.7.sh\n+++ b/ci/requirements-2.7.sh\n@@ -...
[ { "diff_hunk": "@@ -4,4 +4,4 @@ source activate pandas\n \n echo \"install 27\"\n \n-conda install -n pandas -c conda-forge feather-format pyarrow=0.4.1 fastparquet\n+conda install -n pandas -c conda-forge feather-format pyarrow=0.7.0 fastparquet", "line": null, "original_line": 7, "original_start_l...
0fbdc14ac336f3a29fe531fffd7b4b5b7c766691
diff --git a/doc/source/io.rst b/doc/source/io.rst index 54e7a11c5f2b1..2cbd64bf5186b 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -4504,11 +4504,8 @@ dtypes, including extension dtypes such as datetime with tz. Several caveats. -- The format will NOT write an ``Index``, or ``MultiIndex`` for the - `...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
python-telegram-bot__python-telegram-bot-1723@7d25d19
python-telegram-bot/python-telegram-bot
Python
1,723
4.6 API update
docs need to be built and checked. Tests should run through now. - [x] When #1508 is merged to master, merge master and update `Message._parse_*` to handle the `MessageEntities.language` attribute correctly. Doesn't actually do anything yet, but we should still add it to `Message.text_html` and friends - [x] Make `...
2020-01-23T19:58:39Z
API 4.6 - [x] Polls 2.0 - [x] New parameters for `sendPoll` - [x] New object `KeyboardButtonPollType` and corresponding field for `KeyboardButton` - [x] Hew object `PollAnswer` and corresponding field for `Update` - [x] New fields for `Poll` - [x] New fields for the `User` object - [x] New field `language...
Id like to do something. Edit: Gonna check what I have done so far.
[ { "body": "- [x] Polls 2.0\r\n - [x] New parameters for `sendPoll`\r\n - [x] New object `KeyboardButtonPollType` and corresponding field for `KeyboardButton`\r\n - [x] Hew object `PollAnswer` and corresponding field for `Update`\r\n - [x] New fields for `Poll`\r\n- [x] New fields for the `User` object\r\n- ...
8d2c7af1f3d8ba5d918b2c635e5ef10f38500263
{ "head_commit": "7d25d1951af079591da59d0d321dded3ccf45c21", "head_commit_message": "added poll_answer + poll filter tests", "patch_to_review": "diff --git a/docs/source/telegram.keyboardbuttonpolltype.rst b/docs/source/telegram.keyboardbuttonpolltype.rst\nnew file mode 100644\nindex 00000000000..fa4315abd71\n---...
[ { "diff_hunk": "@@ -739,6 +739,16 @@ def test_update_type_edited_channel_post(self, update):\n assert Filters.update.channel_posts(update)\n assert Filters.update(update)\n \n+ def test_update_type_poll(self, update):\n+ update.poll = True", "line": null, "original_line": 743, ...
472d981b4ac1a70b943aa939006058d28dc9734b
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6adfcb47771..d20e92885d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,7 +90,6 @@ jobs: run: | pytest -v tests/test_official.py exit $? - continue-on-error: True en...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
networkx__networkx-5305@072b960
networkx/networkx
Python
5,305
refactor: modifications and additional tests for weighted distance
Fixes #5257 Additional tests have been added for weighted graph distance computations.
2022-02-05T00:16:48Z
Distance_measures.py functions should work for weighted graphs too. Many of the functions in `distance_measures.py` work for unweighted graphs, but have straightforward definitions for weighted graphs too. We should go through this module and upgrade each function to work for weighted graphs. It should be a straightf...
To be clear, we mean `distance_measures.py`, right? Or is `distance_measurements.py` somewhere and I'm just not seeing it? Thanks -- Yes -- I mean `distance_measures.py`. I'll correct it by editing my statement. Can i work on this issue Hey @dschult I would like to work on it. Thanks. Hi All, I would also be in...
[ { "body": "Many of the functions in `distance_measures.py` work for unweighted graphs, but have straightforward definitions for weighted graphs too. We should go through this module and upgrade each function to work for weighted graphs. It should be a straightforward fix with a keyword \"weight\" input which ...
98060487ad192918cfc2415fc0b5c309ff2d3565
{ "head_commit": "072b9603adf143579de1fb79fcb50ec52d0b5a8c", "head_commit_message": "docs: correct formatting of references\n\nimpacted: resistance_distance and __extrema_bounding", "patch_to_review": "diff --git a/networkx/algorithms/distance_measures.py b/networkx/algorithms/distance_measures.py\nindex 5edd3962...
[ { "diff_hunk": "@@ -14,7 +14,7 @@\n ]\n \n \n-def _extrema_bounding(G, compute=\"diameter\"):\n+def _extrema_bounding(G, compute=\"diameter\", weight=\"weight\"):", "line": null, "original_line": 17, "original_start_line": null, "path": "networkx/algorithms/distance_measures.py", "start_line...
5fef21e3eac881735d2193ff81db1b7484e284b3
diff --git a/networkx/algorithms/distance_measures.py b/networkx/algorithms/distance_measures.py index 5edd3962152..4cb08e8cdbe 100644 --- a/networkx/algorithms/distance_measures.py +++ b/networkx/algorithms/distance_measures.py @@ -14,7 +14,7 @@ ] -def _extrema_bounding(G, compute="diameter"): +def _extrema_bound...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
pandas-dev__pandas-18618@4459c9f
pandas-dev/pandas
Python
18,618
handle DST appropriately in Timestamp.replace
``` ts = pd.Timestamp('2017-12-03 16:03:24', tz='US/Eastern') # Timestamp('2017-12-03 16:03:24-0500', tz='US/Eastern') ts2 = ts.replace(month=6) # <-- across DST boundary # master --> Timestamp('2017-06-03 16:03:24-0500', tz='US/Eastern') # PR --> Timestamp('2017-06-03 16:03:24-0400', tz='US/Easter...
2017-12-04T00:59:44Z
Timestamp.replace should handle DST transition gracefully In fairness, datetime doesn't handle this any better, and differing from that behavior could be considered a drawback. ``` >>> ts = pd.Timestamp('1929-05-05', tz='US/Eastern') >>> res = ts.replace(month=4) >>> expected = pd.Timestamp('1929-04-05', tz='US/E...
[ { "body": "In fairness, datetime doesn't handle this any better, and differing from that behavior could be considered a drawback.\r\n\r\n```\r\n>>> ts = pd.Timestamp('1929-05-05', tz='US/Eastern')\r\n>>> res = ts.replace(month=4)\r\n>>> expected = pd.Timestamp('1929-04-05', tz='US/Eastern')\r\n>>> res == expect...
2dac79303297ea8cab9e11596159bff6f5e4738b
{ "head_commit": "4459c9fa2be74a849cb206f1fa181419e6c9d66c", "head_commit_message": "fixup merge messup", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt\nindex 0301bf0a23dd5..6f518b153245d 100644\n--- a/doc/source/whatsnew/v0.23.0.txt\n+++ b/doc/source/whatsnew/...
[ { "diff_hunk": "@@ -1228,6 +1228,27 @@ def f():\n dt = Timestamp('2013-11-03 01:59:59.999999-0400', tz='US/Eastern')\n assert dt.tz_localize(None) == dt.replace(tzinfo=None)\n \n+ def test_replace_across_dst(self):\n+ # GH#18319 check that 1) timezone is correctly normalized and\n+ ...
dced361da7f44d8c1c47be21b502ce69c0d83ae7
diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt index 92564285bb36a..a670bf2348bfc 100644 --- a/doc/source/whatsnew/v0.23.0.txt +++ b/doc/source/whatsnew/v0.23.0.txt @@ -381,3 +381,4 @@ Other ^^^^^ - Improved error message when attempting to use a Python keyword as an identifier in a ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
python-telegram-bot__python-telegram-bot-1508@0c29ecb
python-telegram-bot/python-telegram-bot
Python
1,508
API 4.5
PR for the API 4.5 changes. Closes #1689 - [x] Two new messageEntities, strikethrough and underline - [x] nested messageEntities - [x] New parsemode, MardownV2 - [x] New file_unique_id for Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNote, Voice, File - [x] small_file_unique_id and...
2019-09-06T07:46:35Z
4.5 bot api update arrived Aint much, but its honest work - [x] Two new messageEntities, strikethrough and underline - [x] nested messageEntities, we have a PR for that somewhere - [x] New parsemode, MardownV2 - [x] New file_unique_id for Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNo...
@dmytrohoi get yourself in here :) Already got started on the MessageEntities & MarkdownV2. Let's make #1508 the PR for API 4.5. I'll push my changes to the [`nested-entities` branch](https://github.com/python-telegram-bot/python-telegram-bot/tree/nested-entities) some time tomorrow. @dmytrohoi could you rebase #169...
[ { "body": "Aint much, but its honest work\r\n- [x] Two new messageEntities, strikethrough and underline\r\n- [x] nested messageEntities, we have a PR for that somewhere\r\n- [x] New parsemode, MardownV2\r\n- [x] New file_unique_id for Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNo...
2d3357bfeb4b145e5a7b07ce433fca922deb9e2f
{ "head_commit": "0c29ecbaf9ae4eec990c793f0a1261a82f2a52b1", "head_commit_message": "Add setChatAdminCstmTitle to Bot", "patch_to_review": "diff --git a/telegram/bot.py b/telegram/bot.py\nindex bb9b3ecf5b2..89d1ba22e16 100644\n--- a/telegram/bot.py\n+++ b/telegram/bot.py\n@@ -2835,6 +2835,44 @@ def set_chat_permi...
[ { "diff_hunk": "@@ -1157,10 +1289,24 @@ def text_markdown_urled(self):\n \"\"\"\n return self._parse_markdown(self.text, self.parse_entities(), urled=True)\n \n+ @property\n+ def text_markdown_urled_v2(self):", "line": null, "original_line": 1293, "original_start_line": null, ...
f5eefcfeea9be7a8d85a53f69e1bf984978e6aa0
diff --git a/README.rst b/README.rst index c7a9d7413aa..28875f2a750 100644 --- a/README.rst +++ b/README.rst @@ -93,7 +93,7 @@ make the development of bots easy and straightforward. These classes are contain Telegram API support ==================== -All types and methods of the Telegram Bot API **4.1** are support...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
networkx__networkx-5264@a16907d
networkx/networkx
Python
5,264
Update `draw_<layout>` docstrings with usage examples
This PR adds to the existing `draw_<layout>` convenience functions to emphasize their intended use-case and highlight using the layout functions explicitly for more involved usages. I've done this primarily by adding a short line to the extended summary explaining what the convenience function wraps, as well as a `Note...
2022-01-15T21:47:46Z
Documentation for `draw_shell` does not explain all arguments <!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion --> <!--- Provide a general summary of the issue in the Title above --> ### Current Behavior I was trying to debug code which assigns `nl...
[ { "body": "<!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion -->\r\n\r\n<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n\r\n\r\n### Current Behavior\r\nI was trying to debug code which assigns `nlist` in `draw_shell`. I didn'...
1620568e36702b1cfeaf1c0277b167b6cb93e48d
{ "head_commit": "a16907dae1189435c59f1aebd801860e5385cb61", "head_commit_message": "Fix links to layout functions (cross-module.", "patch_to_review": "diff --git a/networkx/drawing/nx_pylab.py b/networkx/drawing/nx_pylab.py\nindex 002958b719b..e0d063431e2 100644\n--- a/networkx/drawing/nx_pylab.py\n+++ b/network...
[ { "diff_hunk": "@@ -1192,121 +1191,257 @@ def draw_networkx_edge_labels(\n \n \n def draw_circular(G, **kwargs):\n- \"\"\"Draw the graph G with a circular layout.\n+ \"\"\"Draw the graph `G` with a circular layout.\n+\n+ This is a convenience function equivalent to::\n+\n+ nx.draw(G, pos=nx.circ...
4f77ec09e92194473ad2404cd70365e64cc30432
diff --git a/networkx/drawing/nx_pylab.py b/networkx/drawing/nx_pylab.py index 002958b719b..b66d3d11ba8 100644 --- a/networkx/drawing/nx_pylab.py +++ b/networkx/drawing/nx_pylab.py @@ -27,7 +27,6 @@ random_layout, planar_layout, ) -import warnings __all__ = [ "draw", @@ -1192,7 +1191,11 @@ def draw_n...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
pandas-dev__pandas-18576@ca5d28c
pandas-dev/pandas
Python
18,576
BUG: Series.rank modifies inplace with NaT
- [x] closes #18521 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry Looks like `_ensure_data` converts NaT to -9223372036854775808 then that gets converted back to datetime64.
2017-11-30T13:20:00Z
rank() makes unexpected inplace changes #### Code Sample ```python import pandas as pd dt = pd.Series([pd.Timestamp('2017-01-05 10:20:27.569000'), pd.NaT]) print("\nBefore") print(dt) # Should not modify the object ranks = dt.rank() print("\nAfter") print(dt) ``` ``` Before 0 2017-01-05 10:20:2...
Yikes! I dislike surprises like these as much as the next developer. Patch for this behavior is most welcome!
[ { "body": "#### Code Sample\r\n\r\n```python\r\nimport pandas as pd\r\n\r\ndt = pd.Series([pd.Timestamp('2017-01-05 10:20:27.569000'), pd.NaT])\r\nprint(\"\\nBefore\")\r\nprint(dt)\r\n\r\n# Should not modify the object\r\nranks = dt.rank()\r\n\r\nprint(\"\\nAfter\")\r\nprint(dt)\r\n```\r\n\r\n```\r\nBefore\r\n0...
d2fd22e1f995a638f1e84b0ef091eaf70e171fdc
{ "head_commit": "ca5d28c09f9ba5bb508b55396f50584ad7ddb1f9", "head_commit_message": "Fixed whatsnew; copy value in rank_1d", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt\nindex c2da0c420f643..1e8aa6eaf2ef4 100644\n--- a/doc/source/whatsnew/v0.22.0.txt\n+++ b/d...
[ { "diff_hunk": "@@ -336,4 +336,4 @@ Other\n ^^^^^\n \n - Improved error message when attempting to use a Python keyword as an identifier in a ``numexpr`` backed query (:issue:`18221`)\n--", "line": 339, "original_line": 339, "original_start_line": null, "path": "doc/source/whatsnew/v0.22.0.txt",...
caa3fa96c5aec3525c91e6f85c3fcdbe9eb22eb4
diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index c2da0c420f643..3e9e2bf329674 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -315,7 +315,7 @@ Reshaping - Bug in :func:`DataFrame.stack` which fails trying to sort mixed type levels under Python...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-18524@2d824c8
pandas-dev/pandas
Python
18,524
check for datetime+period addition
- [x] closes #17983 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-11-27T17:45:27Z
Series[Period] and Timestamp binop causes segfault No time to look atm: ``` In [1]: import pandas as pd In [2]: pd.Timestamp('2017') + pd.Series([pd.Period('2017', freq='M')]) Fatal Python error: Cannot recover from stack overflow. Thread 0x00007000053d1000 (most recent call first): File "/usr/local/Cella...
FWIW the segfault appears to be specific to IPython. In the standard interpreter I just get the `RecursionError` in both py2+py3. Should be an easy patch; should I hold off until after the next release? No rush, I don't think this is a major issue. I think we're doing the final release tomorrow or Friday.
[ { "body": "No time to look atm:\r\n\r\n```\r\nIn [1]: import pandas as pd\r\n\r\nIn [2]: pd.Timestamp('2017') + pd.Series([pd.Period('2017', freq='M')])\r\nFatal Python error: Cannot recover from stack overflow.\r\n\r\nThread 0x00007000053d1000 (most recent call first):\r\n File \"/usr/local/Cellar/python3/3.6...
262e8ff367c9291c79c4df0c2daf4713de52abc0
{ "head_commit": "2d824c8a9972bc6cca72fb50886864e53b1b79d1", "head_commit_message": "check for datetime+period addition, closed#17983", "patch_to_review": "diff --git a/pandas/_libs/period.pyx b/pandas/_libs/period.pyx\nindex 2b09e9376bd3d..b95632b5b0eff 100644\n--- a/pandas/_libs/period.pyx\n+++ b/pandas/_libs/p...
[ { "diff_hunk": "@@ -1038,6 +1038,24 @@ def test_add_raises(self):\n with tm.assert_raises_regex(TypeError, msg):\n dt1 + dt2\n \n+ boxes = [lambda x: x, lambda x: pd.Series([x]), lambda x: pd.Index([x])]\n+\n+ @pytest.mark.parametrize('lbox', boxes)\n+ @pytest.mark.parametrize('rbox...
c79ba873986f7419f4d3181011461e1112d96380
diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index 52ca05d9a76a9..beac39cd7c9a0 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -207,4 +207,5 @@ Other - Improved error message when attempting to use a Python keyword as an identifier in a numexpr...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-18586@8a05e3a
pandas-dev/pandas
Python
18,586
BUG: Unwanted conversion from timedelta to float (#18493)
- [ ] closes #18493 - [ ] tests added / passed - [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [ ] whatsnew entry
2017-12-01T08:50:04Z
Unwanted conversion from timedelta to float (but not datetime) In the code below, masked assignment of a timedelta series converts the series values to float64. The same code running against a datetime correctly keeps the series dtype. In [1]: import pandas as pd In [2]: dseries=pd.Series(pd.date_range('1...
show your version of pandas. this was broken in master as well. This will patch, can you do a PR with appropriate tests? ``` (pandas) bash-3.2$ git diff diff --git a/pandas/core/internals.py b/pandas/core/internals.py index e537cb2..7a5877d 100644 --- a/pandas/core/internals.py +++ b/pandas/core/internals.py ...
[ { "body": "In the code below, masked assignment of a timedelta series converts the series values to float64. The same code running against a datetime correctly keeps the series dtype.\r\n\r\n In [1]: import pandas as pd\r\n\r\n In [2]: dseries=pd.Series(pd.date_range('1/1/2011', periods=5, freq='H')); dse...
e1ba19a1fea96726f57415669b57316ba060bc1e
{ "head_commit": "8a05e3a086b75555c923dc225e9a2ce71cb54bf7", "head_commit_message": " BUG: Unwanted conversion from timedelta to float (#18493)", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt\nindex d43d5bec7175f..f22f5a9763e54 100644\n--- a/doc/source/whatsnew...
[ { "diff_hunk": "@@ -2,6 +2,7 @@\n \n import pandas as pd\n from pandas.util import testing as tm\n+from numpy import nan", "line": null, "original_line": 5, "original_start_line": null, "path": "pandas/tests/indexing/test_timedelta.py", "start_line": null, "text": "@user1:\ndon't import ...
492889b5ae5c7ba41183d64c548b3376e5158ce3
diff --git a/doc/source/whatsnew/v0.21.1.txt b/doc/source/whatsnew/v0.21.1.txt index bebfd0ab50e90..3d4850b334ff9 100644 --- a/doc/source/whatsnew/v0.21.1.txt +++ b/doc/source/whatsnew/v0.21.1.txt @@ -74,6 +74,7 @@ Indexing - Bug where a ``MultiIndex`` with more than a million records was not raising ``AttributeError`...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
networkx__networkx-5154@578a5e2
networkx/networkx
Python
5,154
Add option for arrowsize to be a list
This PR fixes #3272 Sample code: ```Python >>> import networkx as nx >>> import matplotlib.pyplot as plt >>> G = nx.DiGraph([(0, 1), (0, 2), (1, 3)]) >>> arrowsize=[10, 20, 30] >>> nx.draw(G, arrowsize=arrowsize) >>> plt.show() ``` Produces: ![image](https://user-images.githubusercontent.com/33282622/1388...
2021-10-26T10:28:56Z
Allow for different arrow sizes In directed graph drawing, it's much clearer to tell edge weights with different arrow sizes. In nx_pylab.py, line 676, arrowsize can easily be input as a list if just a few lines are added: `if len(arrowsize) > 1: mutation_scale = arrowsize[i] else: mutation_scale = arr...
[ { "body": "In directed graph drawing, it's much clearer to tell edge weights with different arrow sizes.\r\n\r\nIn nx_pylab.py, line 676, arrowsize can easily be input as a list if just a few lines are added:\r\n\r\n`if len(arrowsize) > 1:\r\n mutation_scale = arrowsize[i]\r\nelse:\r\n mutation_scale = ar...
cfb4b271166485fda8ebf82f00178f28602383bb
{ "head_commit": "578a5e297cd8437c1c09786053e7014cd2dab74c", "head_commit_message": "Add option for arrowsize to be a list", "patch_to_review": "diff --git a/networkx/drawing/nx_pylab.py b/networkx/drawing/nx_pylab.py\nindex 836ff85ea42..b6073adb242 100644\n--- a/networkx/drawing/nx_pylab.py\n+++ b/networkx/drawi...
[ { "diff_hunk": "@@ -478,6 +478,23 @@ def test_error_invalid_kwds():\n nx.draw(barbell, foo=\"bar\")\n \n \n+def test_draw_networkx_arrowsize_incorrect_size():\n+ G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 3)])\n+ arrowsize = [1, 2, 3]\n+ with pytest.raises(\n+ ValueError, match=\"arrows...
f3f2166ce0853e8095dd6ae16a67b736df79a08e
diff --git a/networkx/drawing/nx_pylab.py b/networkx/drawing/nx_pylab.py index 836ff85ea42..16fc5933777 100644 --- a/networkx/drawing/nx_pylab.py +++ b/networkx/drawing/nx_pylab.py @@ -155,10 +155,11 @@ def draw_networkx(G, pos=None, arrows=None, with_labels=True, **kwds): For directed graphs, choose the style...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
python-telegram-bot__python-telegram-bot-1490@c129a95
python-telegram-bot/python-telegram-bot
Python
1,490
Add default values
Supersedes/Closes #1226 and closes #1527 To meet the requirements stated by @Eldinnie in #1226, I added a new class `DefaultValue` to the `helpers` module. It's purpose is to allow to differentiate check if a value is just the default or was set specifically: With `def f(arg=None)` we don't know, if `arg is None`...
2019-08-28T15:15:59Z
[FEATURE] Enter missing defaults at runtime This was an idea we had in mind (and discussed) somewhere a while back. Users should be able to pass defaults to a convenient method, so all the requests to the bot API which have this paramater defaults to the one the user provided. Examples would be parse mode, disable noti...
So, the referred PR is implementing parse_mode as a default option. This issue will track its succesfull implementing secondarly, but primarly will stay up to track the implementing of other defaults we want to have. Current list: - [x] parse mode - [ ] timeout - [ ] disable notification - [ ] hide link preview
[ { "body": "This was an idea we had in mind (and discussed) somewhere a while back. Users should be able to pass defaults to a convenient method, so all the requests to the bot API which have this paramater defaults to the one the user provided. Examples would be parse mode, disable notification, hide link previ...
d8dcdeea753ed0979afc6867eddb16563bfc1a9f
{ "head_commit": "c129a95939bc6b7b0b823a2544141bfbc9fe5162", "head_commit_message": "Improve handling of def_p_m for Bot methods", "patch_to_review": "diff --git a/telegram/bot.py b/telegram/bot.py\nindex bb9b3ecf5b2..671469b6b4c 100644\n--- a/telegram/bot.py\n+++ b/telegram/bot.py\n@@ -21,6 +21,7 @@\n \"\"\"This...
[ { "diff_hunk": "@@ -82,13 +83,49 @@ class Bot(TelegramObject):\n :obj:`telegram.utils.request.Request`.\n private_key (:obj:`bytes`, optional): Private key for decryption of telegram passport data.\n private_key_password (:obj:`bytes`, optional): Password for above private key.\n+ ...
44535ae552793b05fde0ea2d5b33acce49b71358
diff --git a/docs/source/telegram.ext.defaults.rst b/docs/source/telegram.ext.defaults.rst new file mode 100644 index 00000000000..d08a6ed5c12 --- /dev/null +++ b/docs/source/telegram.ext.defaults.rst @@ -0,0 +1,6 @@ +telegram.ext.Defaults +===================== + +.. autoclass:: telegram.ext.Defaults + :members: + ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-18440@65fbc91
pandas-dev/pandas
Python
18,440
BUG: in Python3 MultiIndex.from_tuples cannot take "zipped" tuples
MultiIndex.from_tuples accept zipped tuples in python 3. Ensures compatibility between 2 and 3. - [x] closes #18434 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-11-23T02:43:00Z
BUG: in Python3 MultiIndex.from_tuples cannot take "zipped" tuples #### Code Sample, a copy-pastable example if possible ```python # This code fails in python 3 import pandas as pd my_index = pd.MultiIndex.from_tuples(zip(['a', 'b'], ['c', 'd'], ['e', 'f']), names=['A','B', 'C']) ``` #### Problem description T...
I'm not sure this is a bug. An iterator is not a list/sequence of tuples. Pandas is supposed to have consistent performance between python2 and python3. If the code works in python2, then it is a bug. zip in Python 2 returns a list. Pandas will work with `list(zip(a,b))`. To put it another way, the "bug" is in zip wh...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n# This code fails in python 3\r\nimport pandas as pd\r\nmy_index = pd.MultiIndex.from_tuples(zip(['a', 'b'], ['c', 'd'], ['e', 'f']), names=['A','B', 'C'])\r\n```\r\n#### Problem description\r\nThe code above gives an Exception...
aaee541b538559f8887881ab23d2734dddd920d3
{ "head_commit": "65fbc91dd7c1e073ee64f947f8edfb3e178e27ea", "head_commit_message": "Make independent test cases for issue 18434", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt\nindex 4bdff1355874e..a32035d0d906f 100644\n--- a/doc/source/whatsnew/v0.22.0.txt\n+...
[ { "diff_hunk": "@@ -681,6 +682,21 @@ def test_from_arrays(self):\n assert result.levels[0].equals(Index([Timestamp('20130101')]))\n assert result.levels[1].equals(Index(['a', 'b']))\n \n+ def test_from_arrays_iterator(self):\n+ # GH 18434\n+ arrays = []\n+ for lev, lab in...
7a220aaa586a047f7dbc8b90989961331efe3a0a
diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index 4bdff1355874e..a32035d0d906f 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -140,6 +140,7 @@ Indexing - Bug in :func:`Series.truncate` which raises ``TypeError`` with a monotonic ``PeriodIndex`` ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-18437@87aae09
pandas-dev/pandas
Python
18,437
Lint rule to catch incorrect sphinx directives
- [x] closes #18425 - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
2017-11-22T23:28:18Z
Lint rule to catch incorrect sphinx directives #### Code Sample, a copy-pastable example if possible None. Documentation / build issue. #### Problem description There are few places where tag "versionadded" misses one semicolon, making it a sphinx comment instead of directive: ``` pandas/core/frame.py 4516: ...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\nNone. Documentation / build issue.\r\n\r\n#### Problem description\r\n\r\nThere are few places where tag \"versionadded\" misses one semicolon, making it a sphinx comment instead of directive:\r\n```\r\npandas/core/frame.py\r\n4516: ...
fedc503f0d25b04850a931398fc0556d892d69ea
{ "head_commit": "87aae09638fcee49de25d8353d510fa548bbd1fd", "head_commit_message": "DOC: fix incorrect sphinx directives", "patch_to_review": "diff --git a/ci/lint.sh b/ci/lint.sh\nindex 4027737900bf9..06a7ac485bfed 100755\n--- a/ci/lint.sh\n+++ b/ci/lint.sh\n@@ -90,13 +90,26 @@ if [ \"$LINT\" ]; then\n #\n ...
[ { "diff_hunk": "@@ -90,13 +90,26 @@ if [ \"$LINT\" ]; then\n #\n # Check the following functions:\n # any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join()\n- grep -R --include=\"*.py*\" -E \"[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\\(\\[.*...
aa936b8e74dcc71ac20d28fcc2fd94bf6c11fd78
diff --git a/ci/lint.sh b/ci/lint.sh index 4027737900bf9..5d9fafe6c9064 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -90,13 +90,26 @@ if [ "$LINT" ]; then # # Check the following functions: # any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join() - grep -R --include=...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Code Style, Linting, Formatting Fixes" }
networkx__networkx-4928@fe1918b
networkx/networkx
Python
4,928
Fix numeric and degree assortativity coefficient calculation
It fixes #4776 and wrong assortativity coefficient calculation in some cases that follow PR #4851. A cause of the issue is in `numeric_ac` in [correlation.py](https://github.com/networkx/networkx/blob/main/networkx/algorithms/assortativity/correlation.py). Before my fixes in `numeric_ac` ```python x = np.arange(nx...
2021-06-25T00:17:46Z
numeric assortativity coefficient only works for nonnegative numeric attributes <!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion --> <!--- Provide a general summary of the issue in the Title above --> ### Current Behavior <!--- Tell us what happens i...
I don't think `mapping = {x: x for x in range(m + 1)}` affects or is affected by the attributes of nodes. This constructs a mapping of nodes to integer indexes in the matrix. In this case it is mapping from the indexes created earlier to the indexes used here -- so it is the identity mapping. The numeric attributes...
[ { "body": "<!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion -->\r\n\r\n<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n\r\n### Current Behavior\r\n<!--- Tell us what happens instead of the expected behavior -->\r\n\r\nIf the...
654611019cb9ec7532edf4f1d3b0b92e630162f0
{ "head_commit": "fe1918b96938977f716832a6660bb7dad30aafe6", "head_commit_message": "Reading node degrees once", "patch_to_review": "diff --git a/networkx/algorithms/assortativity/correlation.py b/networkx/algorithms/assortativity/correlation.py\nindex b885a22ee1b..7fe1b2324a8 100644\n--- a/networkx/algorithms/as...
[ { "diff_hunk": "@@ -254,20 +262,21 @@ def attribute_ac(M):\n return r\n \n \n-def numeric_ac(M):\n+def numeric_ac(M, mapping):\n # M is a numpy matrix or array\n # numeric assortativity coefficient, pearsonr\n import numpy as np\n \n if M.sum() != 1.0:\n M = M / float(M.sum())\n ...
175bfe8e58f73f249b786e749e72f890d1549adc
diff --git a/networkx/algorithms/assortativity/correlation.py b/networkx/algorithms/assortativity/correlation.py index b885a22ee1b..8a244fc7d24 100644 --- a/networkx/algorithms/assortativity/correlation.py +++ b/networkx/algorithms/assortativity/correlation.py @@ -73,8 +73,12 @@ def degree_assortativity_coefficient(G, ...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
python-telegram-bot__python-telegram-bot-1032@69d35ea
python-telegram-bot/python-telegram-bot
Python
1,032
Fix conversationhandler
As found by @nmlorg and described in #1031 Went for the easiest fix. fixes #1031
2018-03-03T21:58:49Z
Repeating job AttributeError Hi! I'm having a small def which is a repeating job, the code actually looks like this: ``` dp = updater.dispatcher j = updater.job_queue j.run_repeating(rss, 300) ``` After upgrading to 10.0.0 I get an exception in logs. ### Configuration **Operating System:** Ubuntu **...
@alexbagirov HI, I would like to investigate what seems to be the problem. Can you please show the code for the Job in question aswell? @Eldinnie Hi, sure, you can find it [here](https://github.com/MoarCatz/nmaps-telegram/blob/ptb10/rss.py). Also my latest suggestion is that this exception is not connected with repeat...
[ { "body": "Hi!\r\n\r\nI'm having a small def which is a repeating job, the code actually looks like this:\r\n```\r\ndp = updater.dispatcher\r\nj = updater.job_queue\r\nj.run_repeating(rss, 300)\r\n```\r\n\r\nAfter upgrading to 10.0.0 I get an exception in logs.\r\n\r\n### Configuration\r\n**Operating System:** ...
0811f566a271a46ab5bbb6b89a3b812af26fe6ad
{ "head_commit": "69d35ea4ba48805adc8ba12daf7463176ad7dfd3", "head_commit_message": "Fix conversationhandler\n\nAs found by @nmlorg and described in #1031\nWent for the easiest fix.\n\nclosen #1031", "patch_to_review": "diff --git a/telegram/ext/conversationhandler.py b/telegram/ext/conversationhandler.py\nindex ...
[ { "diff_hunk": "@@ -305,7 +305,7 @@ def handle_update(self, update, dispatcher):\n new_state = self.current_handler.handle_update(update, dispatcher)\n timeout_job = self.timeout_jobs.get(self.current_conversation)\n \n- if timeout_job is not None or new_state == self.END:\n+ if ti...
2df0d80fb12fdefab53b64de440b0062d3cb9545
diff --git a/telegram/ext/conversationhandler.py b/telegram/ext/conversationhandler.py index c97c5991504..0cc6633f87f 100644 --- a/telegram/ext/conversationhandler.py +++ b/telegram/ext/conversationhandler.py @@ -303,11 +303,10 @@ def handle_update(self, update, dispatcher): """ new_state = self.cur...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
networkx__networkx-4602@b2da108
networkx/networkx
Python
4,602
Remove instances of random.sample from sets (deprecated in Python 3.9)
Closes #4555 I took a conservative approach and used `sorted` to convert sets to lists. This may cause a performance hit, but I figured this was safer from the perspective of reproducibility, though I'm not sure it's necessary. In some circumstances it may be sufficient to simply convert to `list` directly.
2021-02-06T03:15:21Z
Random sampling from set has been deprecated in Python 3.9 Python 3.9 has deprecated calling `random.sample` on sets, so users will now see a warning if they do something like: ```python >>> import networkx as nx >>> G = nx.path_graph(25) >>> import random >>> random.sample(G.nodes(), k=3) DeprecationWarning: S...
Looks like it can also raise a TypeError with input `G`. The suggested fix is `sorted(G)`. ``` >>> random.sample(G, k=3) TypeError: Population must be a sequence. For dicts or sets, use sorted(d). ```
[ { "body": "Python 3.9 has deprecated calling `random.sample` on sets, so users will now see a warning if they do something like:\r\n\r\n```python\r\n>>> import networkx as nx\r\n>>> G = nx.path_graph(25)\r\n>>> import random\r\n>>> random.sample(G.nodes(), k=3)\r\nDeprecationWarning: Sampling from a set depreca...
e8fbdcb90391673132bae043c7e3c45b2cdedeba
{ "head_commit": "b2da108af7f70a507ed9232ea01466e972781d8a", "head_commit_message": "add sorted to random.sample in internet_as_graphs.", "patch_to_review": "diff --git a/networkx/algorithms/approximation/tests/test_maxcut.py b/networkx/algorithms/approximation/tests/test_maxcut.py\nindex 897d25594cc..ec75b59f178...
[ { "diff_hunk": "@@ -120,7 +120,7 @@ def betweenness_centrality(\n if k is None:\n nodes = G\n else:\n- nodes = seed.sample(G.nodes(), k)\n+ nodes = seed.sample(sorted(G.nodes()), k)", "line": null, "original_line": 123, "original_start_line": null, "path": "networkx...
2e2a63eb076e32f00b51915ac6131d74721e5a04
diff --git a/networkx/algorithms/approximation/tests/test_maxcut.py b/networkx/algorithms/approximation/tests/test_maxcut.py index 897d25594cc..ec75b59f178 100644 --- a/networkx/algorithms/approximation/tests/test_maxcut.py +++ b/networkx/algorithms/approximation/tests/test_maxcut.py @@ -39,7 +39,7 @@ def test_one_exch...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Dependency Updates & Env Compatibility" }
pandas-dev__pandas-18117@4281ff8
pandas-dev/pandas
Python
18,117
BLD: list proper deps for tslib
closes #18089
2017-11-04T21:40:38Z
BLD: tslib dependencies not fully specified ``` '_libs.tslib': {'pyxfile': '_libs/tslib', 'pxdfiles': ['_libs/src/util'], 'depends': tseries_depends, 'sources': np_datetime_sources}, ``` is not complete, in fact this directly depends on ``` (p...
@jbrockmendel need to fix this before any other changes. > but rebuilding from a change in one part of the structure will only sometimes work. Do you have an example for how this fails? My understanding is that cython checks the timestamps on other cython files for determining if dependencies have changed. try mak...
[ { "body": "```\r\n '_libs.tslib': {'pyxfile': '_libs/tslib',\r\n 'pxdfiles': ['_libs/src/util'],\r\n 'depends': tseries_depends,\r\n 'sources': np_datetime_sources},\r\n```\r\n\r\nis not complete, in fact this directly depends on \r\n\r\n```\r\n(pandas...
2d6f83654ae62315151466507ae0a3d1e8212104
{ "head_commit": "4281ff8043d7a2555bcf783c0d86636840901a86", "head_commit_message": "BLD: list proper deps for tslib\n\ncloses #18089", "patch_to_review": "diff --git a/setup.py b/setup.py\nindex 3464169e8d8d1..4128051df3e21 100755\n--- a/setup.py\n+++ b/setup.py\n@@ -474,7 +474,8 @@ def pxd(name):\n ...
[ { "diff_hunk": "@@ -535,15 +536,24 @@ def pxd(name):\n 'depends': _pxi_dep['sparse']},\n '_libs.tslib': {\n 'pyxfile': '_libs/tslib',\n- 'pxdfiles': ['_libs/src/util'],\n+ 'pxdfiles': ['_libs/src/util',\n+ '_libs/tslibs/conversion',\n+ '_...
2fa2de522282ddaf2ea33f684ad7fe6d761c0372
diff --git a/setup.py b/setup.py index 3464169e8d8d1..bd7c8f175607c 100755 --- a/setup.py +++ b/setup.py @@ -474,7 +474,8 @@ def pxd(name): 'pandas/_libs/src/datetime/np_datetime_strings.h'] np_datetime_sources = ['pandas/_libs/src/datetime/np_datetime.c', 'pandas/_libs/...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Dependency Updates & Env Compatibility" }
python-telegram-bot__python-telegram-bot-1007@34c1e08
python-telegram-bot/python-telegram-bot
Python
1,007
updater.py: Better handling of timeouts during getUpdates
TimedOut exception is an expected an normal event. To reduce noise and make things more "fluent" we now: - Make sure that we don't sleep after the timeout but rather retry immediately. - Log debug instead of error level. Fixes #802
2018-02-15T16:13:09Z
TimedOut on get_updates Calling get_updates consistently crashes the bot with `telegram.error.TimedOut: Timed out` . The code: updates = self.bot.get_updates( offset=self.update_id, timeout=30, network_delay=1.0 ) The log: Traceback (most recent call last): Fil...
I encounter the same issue/error (socket.timeout). For getUpdates, _timeout_ set to anything but 0 results in errors. They are way less frequent when leaving out the _timeout_ parameter, but they still do occur. FYI the `network_delay` parameter is deprecated (at least in the latest version), so instead you should be u...
[ { "body": "Calling get_updates consistently crashes the bot with `telegram.error.TimedOut: Timed out` .\r\n\r\nThe code:\r\n\r\n updates = self.bot.get_updates(\r\n offset=self.update_id,\r\n timeout=30,\r\n network_delay=1.0\r\n )\r\n\r\nThe log:\r\n\r\n Traceback (most recent cal...
9338dc4697b91216fb87549d5f9f645baf7bc560
{ "head_commit": "34c1e08c609426c280a211ddb278d52b0b1ea5eb", "head_commit_message": "updater.py: Better handling of timeouts during getUpdates\n\nTimedOut exception is an expected an normal event. To reduce noise and\nmake things more \"fluent\" we now:\n - Make sure that we don't sleep after the timeout but rather...
[ { "diff_hunk": "@@ -288,8 +286,12 @@ def _start_polling(self, poll_interval, timeout, read_latency, bootstrap_retries\n except RetryAfter as e:\n self.logger.info(str(e))\n cur_interval = 0.5 + e.retry_after\n+ except TimedOut as toe:\n+ self...
8df0becf46ea64b111de6d8782e9d5a309d2e72f
diff --git a/telegram/ext/updater.py b/telegram/ext/updater.py index 5d286a6a6b6..83c421cc60b 100644 --- a/telegram/ext/updater.py +++ b/telegram/ext/updater.py @@ -30,7 +30,7 @@ from telegram import Bot, TelegramError from telegram.ext import Dispatcher, JobQueue -from telegram.error import Unauthorized, InvalidTo...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-18604@8c9061b
pandas-dev/pandas
Python
18,604
ENH: Raise error for 'sheet' arg in read_excel
- [ ] closes #17994 I was also thinking about the possibility of raising a warning instead, and do something like: ``` if sheet in kwds: sheet_name = sheet ```
2017-12-02T22:09:03Z
read_excel does not raise error with wrong keyword arg For example: ```python pd.read_excel('file_name.xlsx',sheet='mysheet') ``` does not raise any error. The right parameter name is "sheetname" . If "sheet" is passed it defaults to the first sheet and no error is raised. sheetname and sheet are very similar a...
This *may* be little tricky, since IIRC we pass through `**kwargs` to the underlying engine doing the work (though I may be wrong). Can you take a look in `pandas/io/excel.py` to see if there's anything we can do? @TomAugspurger : You are correct regarding `**kwargs`. That is indeed quite unfortunate. Hmm, we could ma...
[ { "body": "For example:\r\n```python\r\npd.read_excel('file_name.xlsx',sheet='mysheet')\r\n```\r\ndoes not raise any error. The right parameter name is \"sheetname\" . If \"sheet\" is passed it defaults to the first sheet and no error is raised.\r\n \r\nsheetname and sheet are very similar and easy to confuse. ...
e84cf2ad20601dc2da58390f36eb96ca0c902bee
{ "head_commit": "8c9061ba40bf615fa49474b6a0d1d9af71403482", "head_commit_message": "ENH: Raise error for read_excel possible \"sheet\" argument in kwargs (#17994)", "patch_to_review": "diff --git a/pandas/io/excel.py b/pandas/io/excel.py\nindex fec916dc52d20..087961ce40e09 100644\n--- a/pandas/io/excel.py\n+++ b...
[ { "diff_hunk": "@@ -225,6 +225,9 @@ def read_excel(io, sheet_name=0, header=0, skiprows=None, skip_footer=0,\n elif 'sheetname' in kwds:\n raise TypeError(\"Cannot specify both `sheet_name` and `sheetname`. \"\n \"Use just `sheet_name`\")\n+ if 'sheet' in kwds:\n+ r...
7e38b46afd596a0f87aa22d0cba96b628db33bde
diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index 7362e11b22189..5d6ed50ca3f26 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -377,7 +377,7 @@ I/O ^^^ - :func:`read_html()` no longer ignores all-whitespace ``<tr>`` within ``<thead>`` when con...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
networkx__networkx-4823@c230cf2
networkx/networkx
Python
4,823
add special processing of `multigraph_input` upon graph init
Fixes: #4720 Adding a keyword argument `multigraph_input=True` to a graph construction call should treat any incoming input data for the graph as a dict-of-dict-of-dict multigraph data structure. This matches the behavior of `nx.to_networkx_graph` which is called by the `__init__` dunder. Previously, the mul...
2021-05-20T07:44:43Z
MultiDiGraph initialised via dict_of_dicts does not maintain class ### Current Behavior If I load in a dict_of_dicts using `nx.MultiDiGraph(dict_of_dicts)` if doesn't pass on the class to the `create_using` parameter, so it doesn't read in multiple edges correctly. ### Expected Behavior `nx.MultiDiGraph(dict_o...
I haven't looked carefully yet, but this looks like a defect and your idea that it could be fixed by passing along the `multigraph_input` parameter seems like a good fix. Thanks!!
[ { "body": "### Current Behavior\r\n\r\nIf I load in a dict_of_dicts using `nx.MultiDiGraph(dict_of_dicts)` if doesn't pass on the class to the `create_using` parameter, so it doesn't read in multiple edges correctly.\r\n\r\n### Expected Behavior\r\n\r\n`nx.MultiDiGraph(dict_of_dicts, multigraph_input=True)` sho...
505d4f42521cb37907336c73750cf85a5ad42edc
{ "head_commit": "c230cf2fe204535c204e65672c08ba032509d02b", "head_commit_message": "add special processing of `multigraph_input` upon graph init\n\nFixes: #4720\n\nAdding a keyword argument `multigraph_input=True`\nto a graph construction call should treat any incoming input data for\nthe graph as a dict-of-dict-o...
[ { "diff_hunk": "@@ -182,6 +182,22 @@ def test_data_input(self):\n expected = [(1, {2: {0: {}}}), (2, {1: {0: {}}})]\n assert sorted(G.adj.items()) == expected\n \n+ def test_data_multigraph_input(self):\n+ G = self.Graph({1: {2: {4: {}}}}, multigraph_input=True)\n+ if G.is_direc...
6bbdc329f970ed708028e985995ac4eaa894036d
diff --git a/networkx/classes/multidigraph.py b/networkx/classes/multidigraph.py index d8903606b61..51e590fe437 100644 --- a/networkx/classes/multidigraph.py +++ b/networkx/classes/multidigraph.py @@ -13,6 +13,7 @@ InMultiDegreeView, ) from networkx.exception import NetworkXError +import networkx.convert as conv...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
networkx__networkx-4570@2f3292e
networkx/networkx
Python
4,570
Unpin pygeos
Fixes #4562 Un-pin pygeos and set lower bound for geopandas to a version that supports pygeos 0.9.
2021-01-25T23:02:17Z
PyGEOS 0.9 breaks gallery examples @brendan-ward @ljwolf PyGEOS 0.9 was released today and it appears to have broken all our geospatial examples. We are now getting errors like: ``` Unexpected failing examples: /home/circleci/repo/examples/geospatial/plot_polygons.py failed leaving traceback: Traceback (most recen...
For now, I've pinned pygeos to version 0.8 #4563. This was fixed in geopandas [#1644](https://github.com/geopandas/geopandas/pull/1644), but has not yet made it into a new geopandas release (coming soon). For now, pinning the combination of geopandas at 0.8.x and pygeos at 0.8 (like you've already done) should fix i...
[ { "body": "@brendan-ward @ljwolf PyGEOS 0.9 was released today and it appears to have broken all our geospatial examples. We are now getting errors like:\r\n```\r\nUnexpected failing examples:\r\n/home/circleci/repo/examples/geospatial/plot_polygons.py failed leaving traceback:\r\nTraceback (most recent call l...
4de666102f28d74240212e202ed9bcf4425715e0
{ "head_commit": "2f3292ed61534f708aa261f14641a11e9a11ae50", "head_commit_message": "Bump geopandas for gallery requirements.", "patch_to_review": "diff --git a/requirements/example.txt b/requirements/example.txt\nindex 5bddd70897c..87ff6d2ccb0 100644\n--- a/requirements/example.txt\n+++ b/requirements/example.tx...
[ { "diff_hunk": "@@ -4,7 +4,7 @@ Cartopy>=0.18\n shapely\n # Required for Cartopy\n osmnx>=0.16\n-pygeos==0.8\n+geopandas>=0.8.2", "line": null, "original_line": 7, "original_start_line": null, "path": "requirements/example.txt", "start_line": null, "text": "@user1:\nNow that's geopandas ...
5024122fed2ec747f52aa683afeb996fe989aaf6
diff --git a/requirements/example.txt b/requirements/example.txt index 5bddd70897c..fe16859476a 100644 --- a/requirements/example.txt +++ b/requirements/example.txt @@ -4,7 +4,6 @@ Cartopy>=0.18 shapely # Required for Cartopy osmnx>=0.16 -pygeos==0.8 momepy>=0.4 contextily>=1.0 mayavi>=4.7
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Dependency Updates & Env Compatibility" }
pandas-dev__pandas-18091@52d4266
pandas-dev/pandas
Python
18,091
BUG: Fix the error when reading the compressed UTF-16 file
- [X] closes #18071 - [X] tests added / passed - [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-11-03T11:42:20Z
Reading zipped utf-16 file: AttributeError: 'UTF8Recoder' object has no attribute 'seek' #### Code Sample, a copy-pastable example if possible ```python df = pd.read_table('myfile.zip', compression='zip', encoding='utf-16') ``` #### Problem description Traceback (m...
Hmmm...that looks kind of odd. Mind sharing the ZIP file for us to reproduce? @gfyoung sorry for delay -- couldn't upload original file, but here's what seems to be a minimal working example [sample.zip](https://github.com/pandas-dev/pandas/files/1439381/sample.zip) Yep, can reproduce this error. Investigation a...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\ndf = pd.read_table('myfile.zip', \r\n compression='zip',\r\n encoding='utf-16')\r\n```\r\n#### Problem description\r\n Traceback (most recent call last):\r\n\r\n File \"<ipython-inpu...
27bbea7ee125f4dc19dca2a7703c9a13ca754f9b
{ "head_commit": "52d4266e3025508a6287358d4b865b23c03f9cf9", "head_commit_message": "TST: Add test for reading the zipped UTF-16 file", "patch_to_review": "diff --git a/pandas/_libs/parsers.pyx b/pandas/_libs/parsers.pyx\nindex a5ce6c560d844..e2d9cdd0540a4 100644\n--- a/pandas/_libs/parsers.pyx\n+++ b/pandas/_lib...
[ { "diff_hunk": "@@ -76,7 +76,7 @@ I/O\n ^^^\n \n - Bug in class:`~pandas.io.stata.StataReader` not converting date/time columns with display formatting addressed (:issue:`17990`). Previously columns with display formatting were normally left as ordinal numbers and not converted to datetime objects.\n-\n+- Bug i...
1a06857f6189d9c147ad4ff9f3b90f5ee8d51e89
diff --git a/doc/source/whatsnew/v0.21.1.txt b/doc/source/whatsnew/v0.21.1.txt index 4adafe7c06450..270d81dda6b45 100644 --- a/doc/source/whatsnew/v0.21.1.txt +++ b/doc/source/whatsnew/v0.21.1.txt @@ -76,7 +76,7 @@ I/O ^^^ - Bug in class:`~pandas.io.stata.StataReader` not converting date/time columns with display f...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-18376@0f2287c
pandas-dev/pandas
Python
18,376
implement assert_tzawareness_compat for DatetimeIndex
closes #18162 ATM comparing tzaware `DatetimeIndex` with tznaive DTI fails to raise. This PR implements `_assert_tzawareness_compa`t (which currently exists in `_Timestamp`) in `DatetimeIndex` to fix that. That in turn causes breakage in `Series.replace`. There's a small edit in `core.internals` to fix that, b...
2017-11-20T00:21:05Z
DatetimeIndex comparison tzaware vs naive should raise ``` >>> dr = pd.date_range('2016-01-01', periods=6) >>> dz = dr.tz_localize('US/Pacific') >>> dr < dz array([ True, True, True, True, True, True], dtype=bool) >>> dr[0] < dz[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> ...
yes this should raise
[ { "body": "```\r\n>>> dr = pd.date_range('2016-01-01', periods=6)\r\n>>> dz = dr.tz_localize('US/Pacific')\r\n>>> dr < dz\r\narray([ True, True, True, True, True, True], dtype=bool)\r\n>>> dr[0] < dz[0]\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"pandas/_lib...
f2d8db1acccd73340988af9ad5874252fd5c3967
{ "head_commit": "0f2287c4f9c69742b8f3a41052a42bf82cd3226a", "head_commit_message": "flake8 fixup", "patch_to_review": "diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py\nindex 111ba0c92aa9b..b5122eecd76af 100644\n--- a/pandas/core/indexes/datetimes.py\n+++ b/pandas/core/indexes/dat...
[ { "diff_hunk": "@@ -248,6 +250,36 @@ def test_append_join_nondatetimeindex(self):\n # it works\n rng.join(idx, how='outer')\n \n+ def test_comparison_tzawareness_compat(self):\n+ # GH#18162\n+ dr = pd.date_range('2016-01-01', periods=6)\n+ dz = dr.tz_localize('US/Pacific'...
31b73367e04ef11edaada670920e7705faf21059
diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt index 77de1851490b2..ea083cfb1cb15 100644 --- a/doc/source/whatsnew/v0.23.0.txt +++ b/doc/source/whatsnew/v0.23.0.txt @@ -342,6 +342,7 @@ Conversion - Bug in :class:`Series`` with ``dtype='timedelta64[ns]`` where addition or subtraction of ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
networkx__networkx-4550@2832e95
networkx/networkx
Python
4,550
update anceestor&descendent doc
Closes #4191
2021-01-21T04:31:05Z
ancestors & descendant documentation appears overly restrictive I'm trying to find the out-component of a node, and it looks like I could use `nx.descendants` and just add the node to the descendants. But the documentation of `descendants` suggests the graph needs to be a DAG, rather than just directed. I don't see...
I agree. For both descendants and ancestors the input graph does not need to be acyclic (or even directed). Also, this code is not taking advantage of python 3 dict.keys capabilities. It should be closer to something like: ```python if source not in G: raise.... return nx.shortest_path_length(G, source).keys...
[ { "body": "I'm trying to find the out-component of a node, and it looks like I could use `nx.descendants` and just add the node to the descendants.\r\n\r\nBut the documentation of `descendants` suggests the graph needs to be a DAG, rather than just directed. I don't see anything in the code that requires that ...
f63e90ba4676fcb4ef74c5bd7ddda56be50d4c90
{ "head_commit": "2832e95ea00af094833e95ed9cb6048cbdb129d5", "head_commit_message": "update anceestor&descendent doc", "patch_to_review": "diff --git a/networkx/algorithms/dag.py b/networkx/algorithms/dag.py\nindex 4c6e0efdf78..16b503522c1 100644\n--- a/networkx/algorithms/dag.py\n+++ b/networkx/algorithms/dag.py...
[ { "diff_hunk": "@@ -46,7 +46,7 @@ def descendants(G, source):\n Parameters\n ----------\n G : NetworkX DiGraph\n- A directed acyclic graph (DAG)\n+ A directed graph", "line": null, "original_line": 49, "original_start_line": null, "path": "networkx/algorithms/dag.py", ...
0d42c1e59b951260ea5926617c92b30de19f1f26
diff --git a/networkx/algorithms/dag.py b/networkx/algorithms/dag.py index 4c6e0efdf78..26a0ff4263e 100644 --- a/networkx/algorithms/dag.py +++ b/networkx/algorithms/dag.py @@ -46,7 +46,7 @@ def descendants(G, source): Parameters ---------- G : NetworkX DiGraph - A directed acyclic graph (DAG) + ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
python-telegram-bot__python-telegram-bot-789@10fdcc4
python-telegram-bot/python-telegram-bot
Python
789
remove de_json()
Remove unneeded and unused de_json and de_list methods from our library. The only usages for these methods in our lib were within each other's de_json methods and our tests. Expect Travis to fail, let it run again when #788 is merged. Fixes #778
2017-08-11T18:28:24Z
Remove de_json from object that never use them We have a lot of objects in the library that will only ever be sent, never received. But they still do have a de_json method. I propose to remove all de_json methods from objects that are never sent by tg. Below you'll find a list of the objects involved - [x] Bot - [x...
The only case where this would be bad is if someone is serializing telegram objects as json and then deserializing them afterwards, but I don't believe that should be a usecase we should support since 1) We don't use it in the library internally anywhere 2) Pickle exists @bomjacob it's even worse, de_json doesn't acc...
[ { "body": "We have a lot of objects in the library that will only ever be sent, never received. But they still do have a de_json method. I propose to remove all de_json methods from objects that are never sent by tg. Below you'll find a list of the objects involved\r\n\r\n- [x] Bot\r\n- [x] ForceReply\r\n- [x] ...
5d7c6ad541f8baa3c275206482c3d370f32fab07
{ "head_commit": "10fdcc497514d33aad4bdf8185e66304e579011b", "head_commit_message": "Remove or rename obsolete tests", "patch_to_review": "diff --git a/telegram/bot.py b/telegram/bot.py\nindex 5570382c69d..9bc06c5d79a 100644\n--- a/telegram/bot.py\n+++ b/telegram/bot.py\n@@ -2801,12 +2801,6 @@ def delete_sticker_...
[ { "diff_hunk": "@@ -19,46 +19,22 @@\n \n import pytest\n \n-from telegram import InputMessageContent, InputLocationMessageContent\n-\n-\n-@pytest.fixture(scope='function')\n-def json_dict():\n- return {\n- 'longitude': TestInputLocationMessageContent.longitude,\n- 'latitude': TestInputLocationM...
3ae0f28d92b42ea684194c98ad41f0de08c2f859
diff --git a/telegram/bot.py b/telegram/bot.py index 5570382c69d..9bc06c5d79a 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -2801,12 +2801,6 @@ def delete_sticker_from_set(self, sticker, timeout=None, **kwargs): return result - @classmethod - def de_json(cls, data, bot): - data = super...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
pandas-dev__pandas-18082@a81d9dc
pandas-dev/pandas
Python
18,082
Fix 18068: Updates merge_asof error, now outputs datatypes
- [ ] closes #18068 - [ ] tests added / passed - [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [ ] whatsnew entry
2017-11-02T16:32:22Z
ERR: better error message on merging for incompat types would be nice to have the types outputted in the error message ``` In [23]: left = pd.DataFrame({'a': [1, 5, 10], ...: 'left_val': ['a', 'b', 'c']}) ...: right = pd.DataFrame({'a': [1, 2, 3, 6, 7], .....
Hi, I'm new to contributing to pandas and would love to take a crack at this!
[ { "body": "would be nice to have the types outputted in the error message\r\n\r\n```\r\nIn [23]: left = pd.DataFrame({'a': [1, 5, 10],\r\n ...: 'left_val': ['a', 'b', 'c']})\r\n ...: right = pd.DataFrame({'a': [1, 2, 3, 6, 7],\r\n ...: ...
0fd3bd73e17e4123f1d334f4ebd305e33cd75fe1
{ "head_commit": "a81d9dc2c6de9d73593b462afea4a0227c91f123", "head_commit_message": "Release notes for 0.21.1 updated with fix 18068", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.1.txt b/doc/source/whatsnew/v0.21.1.txt\nindex 4adafe7c06450..b7b8240a8d77e 100644\n--- a/doc/source/whatsnew/v0.21.1.tx...
[ { "diff_hunk": "@@ -1253,10 +1253,12 @@ def _get_merge_keys(self):\n join_names) = super(_AsOfMerge, self)._get_merge_keys()\n \n # validate index types are the same\n- for lk, rk in zip(left_join_keys, right_join_keys):\n+ for i, (lk, rk) in enumerate(zip(left_join_keys, right_jo...
c532b3bf333d2dd95161c19cda3dc0f667d110e2
diff --git a/doc/source/whatsnew/v0.21.1.txt b/doc/source/whatsnew/v0.21.1.txt index 4adafe7c06450..b7b8240a8d77e 100644 --- a/doc/source/whatsnew/v0.21.1.txt +++ b/doc/source/whatsnew/v0.21.1.txt @@ -102,7 +102,7 @@ Sparse Reshaping ^^^^^^^^^ -- +- Error message in ``pd.merge_asof()`` for key datatype mismatch now...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
networkx__networkx-4176@c567b52
networkx/networkx
Python
4,176
fix issue #4173: cytoscape_graph(input_data) did modify the original data
I added a test that failed before this change. Fixes #4173.
2020-08-21T07:15:22Z
readwrite.cytoscape_graph(data) removes "source" and "target" fields from edges Hi, I realized the function to get a graph from cytoscape data modifies the data that is received as argument. Is there any reason for that? I couldn't find that in the documentation, and I found it when browsing the code. Thank you i...
> I realized the function to get a graph from cytoscape data modifies the data that is received as argument. Is there any reason for that? This looks like a defect to me, I don't think the input data dict should be modified. An MRE: ```python >>> G = nx.path_graph(4) >>> data_dict = nx.cytoscape_data(G) >>> da...
[ { "body": "Hi,\r\n\r\nI realized the function to get a graph from cytoscape data modifies the data that is received as argument. Is there any reason for that? I couldn't find that in the documentation, and I found it when browsing the code.\r\n\r\nThank you in advance!\r\n", "number": 4173, "title": "re...
bf9da3d098a015d01e23d6135e9905393ef5e814
{ "head_commit": "c567b52ab8b16155cd51138abe2ac6fed29aa892", "head_commit_message": "fix issue #4173: readwrite.json_graph.cytoscape_graph(input_data) did modify the original data", "patch_to_review": "diff --git a/networkx/readwrite/json_graph/cytoscape.py b/networkx/readwrite/json_graph/cytoscape.py\nindex 1a6f...
[ { "diff_hunk": "@@ -10,6 +10,16 @@ def test_graph(self):\n H = cytoscape_graph(cytoscape_data(G))\n nx.is_isomorphic(G, H)\n \n+ def test_input_data_is_not_modified_when_building_graph(self):\n+ G = nx.path_graph(4)\n+ input_data = cytoscape_data(G)\n+ first_edge = input_...
e12e849f31bee393193d593dbf5d391669157998
diff --git a/networkx/readwrite/json_graph/cytoscape.py b/networkx/readwrite/json_graph/cytoscape.py index 1a6f0c06c7e..5e0e3b3debb 100644 --- a/networkx/readwrite/json_graph/cytoscape.py +++ b/networkx/readwrite/json_graph/cytoscape.py @@ -98,8 +98,8 @@ def cytoscape_graph(data, attrs=None): for d in data["elem...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
python-telegram-bot__python-telegram-bot-608@ef95f77
python-telegram-bot/python-telegram-bot
Python
608
Allow edited as seperate input
In short made it possible to tune messagehandler more to your wishes. and choose exactly what updates to receive. messages, edited_message or channel_post or a combination. - Added the edited_updates argument to MessageHandler - Added DeprecationWarning when using allow_edited - replaced _is_allowed_message and _i...
2017-05-15T20:14:15Z
add ability to handle only edited messages updates Actually if you want to develop a bot where when a user edits his message it replies "you edited this message" or a bot that in groups kicks users that edit their messages (let's imagine a strange rule), there is not a handler to handle only edited messages. message...
[ { "body": "Actually if you want to develop a bot where when a user edits his message it replies \"you edited this message\" or a bot that in groups kicks users that edit their messages (let's imagine a strange rule), there is not a handler to handle only edited messages.\r\n\r\nmessagehandler just handles any m...
9a2d5e041089a0525895b9aa6ce09f8f9e57b3e8
{ "head_commit": "ef95f7782c51429c9e4a8aea3e004956bb4787b8", "head_commit_message": "Python 2 does not have assertWarns.", "patch_to_review": "diff --git a/telegram/ext/messagehandler.py b/telegram/ext/messagehandler.py\nindex f19778da4b7..944d3e16c07 100644\n--- a/telegram/ext/messagehandler.py\n+++ b/telegram/e...
[ { "diff_hunk": "@@ -88,17 +95,14 @@ def __init__(self,\n 'deprecated, please use bitwise operators (& and |) '\n 'instead. More info: https://git.io/vPTbc.')\n \n- def _is_allowed_message(self, update):\n- return (self.message_updates\n- ...
b46c20612da1ea4b43a50b44cbf9cfc8f561c3c7
diff --git a/telegram/ext/messagehandler.py b/telegram/ext/messagehandler.py index f19778da4b7..347d29ee8bf 100644 --- a/telegram/ext/messagehandler.py +++ b/telegram/ext/messagehandler.py @@ -37,8 +37,6 @@ class MessageHandler(Handler): callback (function): A function that takes ``bot, update`` as ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
python-telegram-bot__python-telegram-bot-751@a2f8d79
python-telegram-bot/python-telegram-bot
Python
751
fix-750
fixes #750
2017-07-26T13:02:36Z
RegexHandler error with stickers, voices, images... RegexHandler does not check if update.effective_message.text exists. ### Steps to reproduce 1. Add a RegexHandler 2. Run the bot 3. Send a sticker ### Expected behaviour The handler should not capture the sticker ### Actual behaviour The handler capture ...
[ { "body": "RegexHandler does not check if update.effective_message.text exists.\r\n\r\n### Steps to reproduce\r\n1. Add a RegexHandler\r\n2. Run the bot\r\n3. Send a sticker\r\n\r\n### Expected behaviour\r\nThe handler should not capture the sticker\r\n\r\n### Actual behaviour\r\nThe handler capture the sticker...
2aae60208247d88b477ac9f39dec2a499ec64e89
{ "head_commit": "a2f8d798bf6b16f20e2f71279e3e168f3aab0818", "head_commit_message": "fix-750", "patch_to_review": "diff --git a/telegram/ext/regexhandler.py b/telegram/ext/regexhandler.py\nindex 40df9de7a0a..3a76628c27e 100644\n--- a/telegram/ext/regexhandler.py\n+++ b/telegram/ext/regexhandler.py\n@@ -146,7 +146...
[ { "diff_hunk": "@@ -146,7 +146,7 @@ def check_update(self, update):\n if any([(self.message_updates and update.message),\n (self.edited_updates and update.edited_message),\n (self.channel_post_updates and update.channel_post)]) and (\n- isinstance(update, U...
07b4c3ef5ed2a8d6960141b4b4e5c1ce68168474
diff --git a/telegram/ext/regexhandler.py b/telegram/ext/regexhandler.py index 40df9de7a0a..4b14ccf5159 100644 --- a/telegram/ext/regexhandler.py +++ b/telegram/ext/regexhandler.py @@ -142,11 +142,12 @@ def check_update(self, update): Returns: :obj:`bool` """ - + if not isinstance(...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
python-telegram-bot__python-telegram-bot-698@eedcd03
python-telegram-bot/python-telegram-bot
Python
698
Bot api 3.1
See #697 for changes This should implement everything. Missing tests (how much can we even test?) Closes #697
2017-06-30T19:29:38Z
API changes - v3.1 - June 30, 2017 This issue is to keep track of development process. - [x] New method `restrictChatMember`. - [ ] unitest - [x] New method `promoteChatMember`. - [ ] unitest - [x] New parameter `until_date` added to `kickChatMember` for temporary bans. - [x] New method `exportChatInviteLin...
[ { "body": "This issue is to keep track of development process.\r\n\r\n- [x] New method `restrictChatMember`.\r\n - [ ] unitest\r\n- [x] New method `promoteChatMember`.\r\n - [ ] unitest\r\n- [x] New parameter `until_date` added to `kickChatMember` for temporary bans.\r\n- [x] New method `exportChatInviteLink`...
cbafdc289fd33f5da1d5fe1ac621ed91bc8dd1ed
{ "head_commit": "eedcd032b7fdde9c868da4d4d9b473ace63fe64c", "head_commit_message": "Use to_timestamp from utils.helpers in kick and restrict methods in bot\n\nThis makes it actually works on python < 3.3", "patch_to_review": "diff --git a/telegram/bot.py b/telegram/bot.py\nindex 25850064eae..5d378016247 100644\n...
[ { "diff_hunk": "@@ -2051,3 +2426,12 @@ def __reduce__(self):\n sendInvoice = send_invoice\n answerShippingQuery = answer_shipping_query\n answerPreCheckoutQuery = answer_pre_checkout_query\n+ restrictChatMember = restrict_chat_member\n+ promoteChatMemmber = promote_chat_member", "line": nu...
4190fa04caa5da22d1cc2821a50c899bed6576a8
diff --git a/CHANGES.rst b/CHANGES.rst index abdad2ab6d3..b53b1e605c1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,13 @@ Changes ======= +**DATE TBD** +*WIP 6.2.0* +- Improved filters for user_id/username/chat. +- Internal restructure of files. +- Improved unitests. +- Fully support Bot API 3.1. + **2017-...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
networkx__networkx-4134@3b27fe2
networkx/networkx
Python
4,134
CI: Configure circleCI to deploy docs.
Closes #4118 - configure CircleCI to deploy the development documentation. Largely drawn from the doc deployment configuration for [scipy](https://github.com/scipy/scipy/blob/master/.circleci/config.yml). Other tasks (beyond reviewing the proposed configuration) to be done before removing draft status: - [x] remov...
2020-08-05T23:46:11Z
Viewable documentation builds for PRs Travis CI supports uploading artifacts, but > Note that the artifacts addon is not available for pull request builds. So I think going with Circle CI to build the docs on PRs seems like a good solution. Since you are familiar with how NumPy does it, it should be straightfo...
You will likely have to fuss around to get gdal installed. Every time I try to install it on a different OS, I have to follow different steps to get it to work. Here are the most likely things you may need to do: ``` export CPLUS_INCLUDE_PATH=/usr/include/gdal export C_INCLUDE_PATH=/usr/include/gdal ``` You ...
[ { "body": "Travis CI supports uploading artifacts, but\r\n\r\n> Note that the artifacts addon is not available for pull request builds.\r\n\r\nSo I think going with Circle CI to build the docs on PRs seems like a\r\ngood solution. Since you are familiar with how NumPy does it, it should\r\nbe straightforward. ...
123fc2be585c6ebbf46b7fe876ba85dd34f92b2e
{ "head_commit": "3b27fe2fb9cd1cc8baaadb8d9d840c75f8685680", "head_commit_message": "Apply changes from code review\n\n * rm ghp-import\n * add step to rm current latest before cp", "patch_to_review": "diff --git a/.circleci/config.yml b/.circleci/config.yml\nindex 487ac9b82d3..8bc77c131f0 100644\n--- a/.circleci...
[ { "diff_hunk": "@@ -47,3 +47,48 @@ jobs:\n \n - store_artifacts:\n path: doc/build/html\n+\n+ - persist_to_workspace:\n+ root: doc/build\n+ paths:\n+ - html\n+\n+ deploy:\n+ working_directory: ~/repo\n+ docker:\n+ - image: circleci/python:3.8.3-buste...
fafba0c6c30af9cc783a80a88f60ae2e3dbf963f
diff --git a/.circleci/config.yml b/.circleci/config.yml index 487ac9b82d3..ab1e3302b66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,3 +47,47 @@ jobs: - store_artifacts: path: doc/build/html + + - persist_to_workspace: + root: doc/build + paths: + ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
pandas-dev__pandas-17822@a787c20
pandas-dev/pandas
Python
17,822
TST: Add the default separator test for PythonParser
- [x] closes #17333 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [ ] whatsnew entry
2017-10-09T02:41:49Z
Problem detecting separator (sep=None) with a DataFrame with a single column #### Code Sample ``` from io import StringIO import pandas as pd TESTDATA=StringIO("""col1 val1 val2d val3 val4 """) df = pd.read_csv(TESTDATA, sep=None, engine='python') print(df) ``` returns: ``` ...
@Leobouloc : Thanks for reporting this! A little odd, especially since you somehow drop an "o" from `col1`. As a workaround, you should pass in `delim_whitespace=True`, and you should get the table that you expect. I can't tell at the moment whether this error is stemming from Python's native `csv` parsing or our ow...
[ { "body": "#### Code Sample\r\n\r\n```\r\nfrom io import StringIO\r\n\r\nimport pandas as pd\r\n\r\nTESTDATA=StringIO(\"\"\"col1\r\n val1\r\n val2d\r\n val3\r\n val4\r\n \"\"\")\r\n\r\ndf = pd.read_csv(TESTDATA, sep=None, engine='python')\r\nprint(df)\r\n```\r\nreturns:\r\n\r\n```\r\n c...
727ea20bdb72ff4a5b8380d7f613d4aff058e28a
{ "head_commit": "a787c20a7c8cd68fdc96a899c0541d61029ec08e", "head_commit_message": "TST: Add the default separator test for PythonParser", "patch_to_review": "diff --git a/pandas/tests/io/parser/python_parser_only.py b/pandas/tests/io/parser/python_parser_only.py\nindex a0784d3aeae2d..220825782ae26 100644\n--- a...
[ { "diff_hunk": "@@ -21,6 +21,7 @@ class PythonParserTests(object):\n \n def test_default_separator(self):\n # GH17333\n+ # The csv parser in Python treats 'o' as separator.", "line": null, "original_line": 24, "original_start_line": null, "path": "pandas/tests/io/parser/python...
c273d9b765a5651c3d224d882762602ccf60b072
diff --git a/doc/source/io.rst b/doc/source/io.rst index e6b51b7e2f45c..a7f8d9da15328 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -84,7 +84,8 @@ filepath_or_buffer : various sep : str, defaults to ``','`` for :func:`read_csv`, ``\t`` for :func:`read_table` Delimiter to use. If sep is ``None``, the C e...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17819@1b03b66
pandas-dev/pandas
Python
17,819
ERR: Raise ValueError when week is passed in to_datetime format witho…
…ut day or year (#16774) - [x] closes #16774 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-10-08T20:28:55Z
to_datetime parses dates incorrectly when the format includes '%W' and does not include day of week plus calendar year #### Code Sample, a copy-pastable example if possible ```python import pandas as pd # I'm not sure how a bare week should be interpreted. But the result should # probably still be of the same ...
In the docs for [datetime.datetime.strptime](https://docs.python.org/3.6/library/datetime.html#datetime.datetime.strptime): > When used with the strptime() method, %U and %W are only used in calculations when the day of the week and the calendar year (%Y) are specified. Turns out this is true with to_datetime, to...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nimport pandas as pd\r\n\r\n# I'm not sure how a bare week should be interpreted. But the result should\r\n# probably still be of the same week number\r\nprint(pd.to_datetime('20', format='%W').strftime('%W')) # 01\r\n\r\n# Pa...
f9ba6fed36d79485174fd12d07afdca9ed786471
{ "head_commit": "1b03b667727012347dd18696f6fc3184fd9a8e7d", "head_commit_message": "ERR: Raise ValueError when week is passed in to_datetime format without day or year (#16774)", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 1e9c402dac73e..033e428bcbbb0...
[ { "diff_hunk": "@@ -372,6 +372,19 @@ def test_datetime_invalid_datatype(self):\n with pytest.raises(TypeError):\n pd.to_datetime(pd.to_datetime)\n \n+ @pytest.mark.parametrize('date, format',\n+ [('2017-20', '%Y-%W'),\n+ ('20 Sunday...
c2c8810f4c1ed9327285249552ee72830571a67c
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 1e9c402dac73e..033e428bcbbb0 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -701,6 +701,7 @@ Other API Changes - :func:`Series.argmin` and :func:`Series.argmax` will now raise a ``TypeError`` whe...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17755@b2a281a
pandas-dev/pandas
Python
17,755
BUG: Implement PeriodEngine to fix PeriodIndex truncate bug
- [x] closes #17717 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-10-02T23:35:04Z
.truncate() fails on PeriodIndexes with duplicate values Truncating a series with a PeriodIndex with unique entries works fine: ```python In [4]: pdi = pd.PeriodIndex([pd.Period('2017-09-01'), ...: pd.Period('2017-09-02'), ...: pd.Period('2017-09-03')]) ...: ser...
Looks to be caused by a shortath of `_get_loc_duplicates`. Non-monotonic duplicates looks work. ``` pdi3 = pd.PeriodIndex([pd.Period('2017-09-03'), pd.Period('2017-09-02'), pd.Period('2017-09-03')]) ser3 = pd.Series([1,2,3], index=pdi2) ser3.truncate(after='2017-09-...
[ { "body": "Truncating a series with a PeriodIndex with unique entries works fine:\r\n```python\r\nIn [4]: pdi = pd.PeriodIndex([pd.Period('2017-09-01'),\r\n ...: pd.Period('2017-09-02'),\r\n ...: pd.Period('2017-09-03')])\r\n ...: ser = pd.Series([1,2,3], index=...
27bbea7ee125f4dc19dca2a7703c9a13ca754f9b
{ "head_commit": "b2a281aaad66342731b9f7db7ddccc86ef1059d7", "head_commit_message": "Remove duplicate codes", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt\nindex c41da4d67afe5..5c64b0a55c09b 100644\n--- a/doc/source/whatsnew/v0.22.0.txt\n+++ b/doc/source/whats...
[ { "diff_hunk": "@@ -3,10 +3,11 @@\n import pytest\n \n import numpy as np\n+from numpy import testing as ntm", "line": null, "original_line": 6, "original_start_line": null, "path": "pandas/tests/indexes/period/test_indexing.py", "start_line": null, "text": "@user1:\nNO, we never use num...
ec608001111df27b2d30cd7e5ca99bbc7310e593
diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index c41da4d67afe5..5c64b0a55c09b 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -100,7 +100,7 @@ Conversion Indexing ^^^^^^^^ -- +- Bug in :func:`PeriodIndex.truncate` which raises ``TypeError`` w...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
nerfstudio-project__nerfstudio-1919@386af40
nerfstudio-project/nerfstudio
Python
1,919
fix pytorch 2.0 optimizer no inf check error
fix #1883 #1613. The reason why there's no inf check is because proposal network did not compute gradient at some iteration step. And there is no need to do optimizer.step for proposal network's parameter.
2023-05-14T06:11:00Z
Pytorch 2.0 nerfacto optimizer inf check error **Describe the bug** Nerfacto fails under PyTorch 2.0 with the `no inf checks error`. **Error** ``` Traceback (most recent call last): File "/home/kulhajon/.conda/envs/nerfstudio-torch20/bin/ns-train", line 8, in <module> sys.exit(entrypoint()) File "/home...
[ { "body": "**Describe the bug**\r\nNerfacto fails under PyTorch 2.0 with the `no inf checks error`.\r\n\r\n**Error**\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/kulhajon/.conda/envs/nerfstudio-torch20/bin/ns-train\", line 8, in <module>\r\n sys.exit(entrypoint())\r\n File \"/home/kulhajon...
13e0fce1223c2ad7a126e1dc1453f45329807ac8
{ "head_commit": "386af409cec4ab742439789ac96ee0e88ed71094", "head_commit_message": "Merge pull request #2 from ksnzh/ksnzh-patch-1", "patch_to_review": "diff --git a/nerfstudio/engine/optimizers.py b/nerfstudio/engine/optimizers.py\nindex 3f01fb2e96..a408bcc3a0 100644\n--- a/nerfstudio/engine/optimizers.py\n+++ ...
[ { "diff_hunk": "@@ -127,7 +127,8 @@ def optimizer_scaler_step_all(self, grad_scaler: GradScaler) -> None:\n if max_norm is not None:\n grad_scaler.unscale_(optimizer)\n torch.nn.utils.clip_grad_norm_(self.parameters[param_group], max_norm)\n- grad_scaler.st...
13b55b18e7bf006610cc258d9792d9aa20b47211
diff --git a/nerfstudio/engine/optimizers.py b/nerfstudio/engine/optimizers.py index 3f01fb2e96..3ff693685d 100644 --- a/nerfstudio/engine/optimizers.py +++ b/nerfstudio/engine/optimizers.py @@ -127,7 +127,8 @@ def optimizer_scaler_step_all(self, grad_scaler: GradScaler) -> None: if max_norm is not None: ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17624@800d1ad
pandas-dev/pandas
Python
17,624
BUG: Fix groupby nunique with NaT
- [x] closes #17575 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-09-22T12:24:38Z
pd.groupby(pd.TimeGrouper()) mishandles null values in dates #### Code Sample, a copy-pastable example if possible #### The code is updated following some comments ```python import pandas as pd import random from random import randint random.seed(2) data= [['2010-01-06', randint(1,9)], ['2010-08-26', r...
@fujiaxiang : Thanks reporting this! Unfortunately, we can't replicate your code because `df_r` is not defined in your code. Could you please fix that? `# Your code here import pandas as pd import random data = [] for m in range(12 * 10000): M = m % 12 + 1 data += [['2017-' + str(M) + '-' + str(m % 28...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n#### The code is updated following some comments\r\n```python\r\nimport pandas as pd\r\nimport random\r\nfrom random import randint\r\n\r\nrandom.seed(2)\r\ndata= [['2010-01-06', randint(1,9)],\r\n ['2010-08-26', randint(1,9)],\r\n ...
8276a420a36c26eaab38856177023cb064963f19
{ "head_commit": "800d1ad38931dbaa4e1a87479f75a71555c0bc02", "head_commit_message": "TST: Add the nunique with NaT test", "patch_to_review": "diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py\nindex f14ed08a27fae..5b4456589c4ea 100644\n--- a/pandas/core/groupby.py\n+++ b/pandas/core/groupby.py\n@@ -317...
[ { "diff_hunk": "@@ -3688,6 +3688,18 @@ def test_nunique_with_timegrouper(self):\n )['data'].apply(pd.Series.nunique)\n tm.assert_series_equal(result, expected)\n \n+ def test_nunique_with_timegrouper_and_nat(self):\n+ test = pd.DataFrame({", "line": null, "original_line": 3692,...
29d4cf6874435cf9771633214e43188c10cf6552
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 1cd65bb530f73..e4a3bd796e3ba 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -543,6 +543,7 @@ Groupby/Resample/Rolling - Bug in ``Series.resample(...).apply()`` where an empty ``Series`` modified ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17517@f09c9d5
pandas-dev/pandas
Python
17,517
BUG: preserve name in set_categories (#17509)
- [x] closes #17509 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry
2017-09-13T19:12:53Z
Series losts its name after set_categories #### Code Works fine ``` python ( Series([1,2,3], name='A') .astype('category') .name ) ``` I get 'A' #### Code in trouble ``` python ( Series([1,2,3], name='A') .astype('category') .cat.set_categories([1,2,3]) .name ) ``` I get ...
@jreback : This seems to ring a bell for some reason. Maybe it was regarding `Series` in general? In any case, it seems reasonable that the name should be kept. Feel free to investigate and see where things can be changed to create the desired behavior. I wonder if https://github.com/pandas-dev/pandas/blob/f11bbf2...
[ { "body": "#### Code Works fine\r\n``` python\r\n(\r\n Series([1,2,3], name='A')\r\n .astype('category')\r\n .name\r\n)\r\n```\r\nI get 'A'\r\n\r\n#### Code in trouble\r\n``` python\r\n(\r\n Series([1,2,3], name='A')\r\n .astype('category')\r\n .cat.set_categories([1,2,3])\r\n .name\r\n)\r\...
328c7e179b72e257e27adf92a06718fd5a40473f
{ "head_commit": "f09c9d5dd54a1143b81d976bb34aaccaea420bbf", "head_commit_message": "Update test_categorical.py", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 52e056103cbdc..eacb51e793bec 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\n+++ b/doc/source/w...
[ { "diff_hunk": "@@ -57,6 +57,13 @@ def test_getitem_listlike(self):\n expected = c[np.array([100000]).astype(np.int64)].codes\n tm.assert_numpy_array_equal(result, expected)\n \n+ def test_getname_category(self):\n+ expected = 'A'\n+ s = pd.Series([1, 2, 3], name='A').astype('ca...
ce78e6c98b6f5dd18bfaaf111cbd921ebf37cfc3
diff --git a/doc/source/categorical.rst b/doc/source/categorical.rst index 8835c4a1533d0..65361886436d6 100644 --- a/doc/source/categorical.rst +++ b/doc/source/categorical.rst @@ -146,6 +146,8 @@ Using ``.describe()`` on categorical data will produce similar output to a `Seri df.describe() df["cat"].describe...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
nerfstudio-project__nerfstudio-1218@a8da72e
nerfstudio-project/nerfstudio
Python
1,218
Blender addon script and documentation
First version of blender addon python script located in scripts/blender and new documentation for the addon. The Blender addon is for importing or exporting a camera path for visual effects and compositing.
2023-01-10T04:16:31Z
Fbx Import for Camera Tracking **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** It would be great if you could make it possible to import fbx animations from blender for example to nerfstudio as camera path. Some other Nerf generating application is able...
This would be a nice feature to include. Do you know of other nerf libraries that have this support that we can reference? Hi,Yes there is one that allow that and you can export an animation From Blender as fbx and import directly to there. It is https://lumalabs.aiNot sure if this answers your question.BRMarkusAm 28.1...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nNo.\r\n\r\n**Describe the solution you'd like**\r\n\r\nIt would be great if you could make it possible to import fbx animations from blender for example to nerfstudio as camera path. Some other Nerf generating application is able t...
af41819611d8560930aff2daaef6484ee824e4af
{ "head_commit": "a8da72ee943e3fe0d2840d53c50ef03d4fb6cd16", "head_commit_message": "Merge branch 'main' into cyrus/blender_addon", "patch_to_review": "diff --git a/docs/index.md b/docs/index.md\nindex ae22709866..53d45784d3 100644\n--- a/docs/index.md\n+++ b/docs/index.md\n@@ -52,6 +52,7 @@ quickstart/custom_dat...
[ { "diff_hunk": "@@ -0,0 +1,404 @@\n+bl_info = {", "line": null, "original_line": 1, "original_start_line": null, "path": "scripts/blender/nerfstudio_addon_1_0.py", "start_line": null, "text": "@user1:\nCan you rename the file to `nerfstudio_blender.py`" }, { "diff_hunk": "@@ -0,0...
ea501d1e906127a6cda2f3c9a38e8a3b843fd89f
diff --git a/docs/index.md b/docs/index.md index ae22709866..53d45784d3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -52,6 +52,7 @@ quickstart/custom_dataset quickstart/viewer_quickstart quickstart/export_geometry quickstart/data_conventions +quickstart/blender_addon Contributing<reference/contributing> ``` ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-17310@2209eae
pandas-dev/pandas
Python
17,310
ENH: Better error message if usecols doesn't match columns
GH17301: Improving the error message given when usecols doesn't match with the columns provided. - [x] closes #17301 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry NOTE: Do I need to add a whatsnew entry for something so small? Happy t...
2017-08-22T16:03:14Z
Improve the error message when `usecols` cannot match all columns #### Code Sample ```python import pandas as pd # Where example.csv is: # column1,column2 # 1, 2 pd.read_csv('example.csv', usecols=['column1', 'column2', ' column3']) ``` #### Problem description The error when all of the columns provided ...
If there are no objections to this, I'm happy to pick this up and implement. Also happy to take on any suggestions from people on a different error message. @AaronCritchley : Go right ahead! I would also suggest, if possible, that you upgrade your `pandas` installation too. We're at `0.20.3` right now, though your...
[ { "body": "#### Code Sample\r\n\r\n```python\r\nimport pandas as pd\r\n# Where example.csv is:\r\n# column1,column2\r\n# 1, 2\r\n\r\npd.read_csv('example.csv', usecols=['column1', 'column2', ' column3'])\r\n```\r\n#### Problem description\r\n\r\nThe error when all of the columns provided in usecols are not foun...
d163de70c93547035579870e2ae9008cb3640b45
{ "head_commit": "2209eae98824a354ec81a900c278b05d120a685b", "head_commit_message": "Adding whatsnews entry, and test for multiple missing columns", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt\nindex 1a08a1353a605..64f2701896a94 100644\n--- a/doc/source/whats...
[ { "diff_hunk": "@@ -76,6 +76,7 @@ Other Enhancements\n - Improved wording of ``ValueError`` raised in :func:`to_datetime` when ``unit=`` is passed with a non-convertible value (:issue:`14350`)\n - :func:`Series.fillna` now accepts a Series or a dict as a ``value`` for a categorical dtype (:issue:`17033`)\n - :f...
5dfccdb6e617ec6596a1a9c34ff4e5d5b4e091cf
diff --git a/doc/source/whatsnew/v0.22.0.txt b/doc/source/whatsnew/v0.22.0.txt index 1a08a1353a605..1cad0e68d0f25 100644 --- a/doc/source/whatsnew/v0.22.0.txt +++ b/doc/source/whatsnew/v0.22.0.txt @@ -76,6 +76,7 @@ Other Enhancements - Improved wording of ``ValueError`` raised in :func:`to_datetime` when ``unit=`` is ...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17377@9d0031f
pandas-dev/pandas
Python
17,377
BUG: Return local Timestamp.weekday_name attribute (#17354)
- [x] closes #17354 - [x] tests added / passed - [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` - [x] whatsnew entry @jreback created a new method `_get_named_field` based on your [comment](https://github.com/pandas-dev/pandas/issues/17354#issuecomment-325319229) in the issue thread.
2017-08-30T06:28:00Z
BUG: Timestamp.weekday_name uses UTC instead of given timezone #### Code Sample, a copy-pastable example if possible ```python import pandas as pd # Create a Timestamp for 11pm Monday 28th ts = pd.Timestamp('2017-08-28 23:00:00') # Both weekday() and weekday_name indicate this is a Monday assert ts.weekday() ...
Oops. ¯ \ _ (ツ) _ / ¯ PR to patch this is welcome! this is correct for a DTI, but the impl for ``Timestamp`` is not converting to local timestamps (and ``Timestamp.weeday`` is in the super class. should be an easy fix. needs (see ``_get_field``). note that we should make a ``_get_named_field`` (similar to ``_get_fi...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nimport pandas as pd\r\n\r\n# Create a Timestamp for 11pm Monday 28th\r\nts = pd.Timestamp('2017-08-28 23:00:00')\r\n# Both weekday() and weekday_name indicate this is a Monday\r\nassert ts.weekday() == 0\r\nassert ts.weekday_na...
8351f86a0079b6b0cb95414807a2c2248530ef2c
{ "head_commit": "9d0031f1be1656e14bb14801fbfff3a47442143d", "head_commit_message": "Ctype array and leftover val", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 81e52266f972e..14e07978c7adc 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\n+++ b/doc/source...
[ { "diff_hunk": "@@ -1268,13 +1266,33 @@ cdef class _Timestamp(datetime):\n # same timezone if specified)\n return datetime.__sub__(self, other)\n \n- cpdef _get_field(self, field):\n+ cdef int64_t _maybe_convert_value_to_local(self):\n+ \"\"\"Convert UTC i8 value to local i8 value i...
ddaa4e39e530562a37b6ba80598c7d777000710e
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 81e52266f972e..14e07978c7adc 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -399,6 +399,7 @@ Conversion - Fixed the return type of ``IntervalIndex.is_non_overlapping_monotonic`` to be a Python ``...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
nerfstudio-project__nerfstudio-1936@f58e8d0
nerfstudio-project/nerfstudio
Python
1,936
Ability to use vanilla pytorch instead of tcnn for Nerfacto
- [x] `--pipeline.model.implementation tcnn` is default but `--pipeline.model.implementation torch` can be used for vanilla pytorch. This will only work for the Nerfacto method at the moment. - [x] Removed "nerfacto" from the blacklisted github actions tests. The vanilla pytorch implementation is maybe ~4x slower. ...
2023-05-16T22:56:01Z
Does anyone meet pretty low performance using TorchNerfactoField? **Describe the bug** I tried both TCNNNerfactoField and TorchNerfactoField on my captured set of images. TCNNNerfactoField does not have any issues, and perfect reconstruction, but TorchNerfactoField has very low evaluation performance (20psnr vs 40 psn...
[ { "body": "**Describe the bug**\r\nI tried both TCNNNerfactoField and TorchNerfactoField on my captured set of images. TCNNNerfactoField does not have any issues, and perfect reconstruction, but TorchNerfactoField has very low evaluation performance (20psnr vs 40 psnr of TCNNNerfactoField).\r\n\r\nIn addition, ...
400ab5a313c44f4f84b409431dfc26375cf866c6
{ "head_commit": "f58e8d081f61a396474afdf3fe7f1f2dd8119a1f", "head_commit_message": "removed/reverted files", "patch_to_review": "diff --git a/docs/quickstart/export_geometry.md b/docs/quickstart/export_geometry.md\nindex 2ffd51895f..490638422a 100644\n--- a/docs/quickstart/export_geometry.md\n+++ b/docs/quicksta...
[ { "diff_hunk": "@@ -71,6 +67,13 @@ gen = [\n \"transformers==4.24.0\",\n ]\n \n+# Geometry export related dependencies\n+export = [\n+ \"open3d>=0.16.0\",\n+ \"pymeshlab>=2022.2.post2\",\n+ \"trimesh>=3.20.2\"", "line": null, "original_line": 74, "original_start_line": null, "path":...
34280fa3aa8e77e933e237a52521a3bea68b7bde
diff --git a/nerfstudio/configs/base_config.py b/nerfstudio/configs/base_config.py index e167ce5679..4f1d822384 100644 --- a/nerfstudio/configs/base_config.py +++ b/nerfstudio/configs/base_config.py @@ -64,14 +64,16 @@ class MachineConfig(PrintableConfig): seed: int = 42 """random seed initialization""" - ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17023@cb2eb3e
pandas-dev/pandas
Python
17,023
Set pd.options.display.max_columns=0 by default
Update: Remove everything related to `max_rows` and only deal with `max_columns` in this PR. Changed `max_columns` to `0` (automatically adapt the number of displayed columns to the actual terminal width) when run in a terminal ~~and `max_rows` to `20` (because I'd like to see the "whole" data frame at a glance like...
2017-07-19T11:04:00Z
Can't pd.options.display.max_columns = 0 by default? `pd.options.display.max_columns` is 20 by default, but when running in a terminal this value could be auto-detected by setting it to 0. I know that this setting can be customized, but for the average user it would be much more convenient if there was no extra step in...
Say you auto-detect (via get_terminal_size) and its 80, then what, how many columns should it be? This is a pretty reasonable default. Maybe I wasn't clear. If the width gets autodetected, a much more reasonable choice for `max_columns` would be `0`. That way, the printed object would fit within the terminal width. ...
[ { "body": "`pd.options.display.max_columns` is 20 by default, but when running in a terminal this value could be auto-detected by setting it to 0. I know that this setting can be customized, but for the average user it would be much more convenient if there was no extra step involved. Is there a way to detect i...
cdfce2b0ad99f7faad57cc5247cf33aab5725bed
{ "head_commit": "cb2eb3e463c8d0f7f2088b4a67ff9a001b65361f", "head_commit_message": "Move images to _static", "patch_to_review": "diff --git a/doc/source/options.rst b/doc/source/options.rst\nindex a82be4d84bf3f..48247eb48baaf 100644\n--- a/doc/source/options.rst\n+++ b/doc/source/options.rst\n@@ -78,8 +78,8 @@ w...
[ { "diff_hunk": "@@ -658,6 +658,37 @@ Notice in the example above that the converted ``Categorical`` has retained ``or\n \n Note that the unintenional conversion of ``ordered`` discussed above did not arise in previous versions due to separate bugs that prevented ``astype`` from doing any type of category to cat...
f79591468c624344b9f56b77cad115ccc2407154
diff --git a/doc/source/_static/print_df_new.png b/doc/source/_static/print_df_new.png new file mode 100644 index 0000000000000..767d7d3f0ef06 Binary files /dev/null and b/doc/source/_static/print_df_new.png differ diff --git a/doc/source/_static/print_df_old.png b/doc/source/_static/print_df_old.png new file mode 1006...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-16996@b424439
pandas-dev/pandas
Python
16,996
BUG: np.inf now causes Index to upcast from int to float
- [x] closes #16957 - [x] tests added / passed - [x] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff`` - [x] whatsnew entry Previously the following code would cause an OverflowError ```python df = pd.DataFrame(columns=[0]) df.loc[0] = 0 df.loc[np.inf] = 1 ``` This patch catches the e...
2017-07-17T17:04:18Z
Creating a new row with np.inf as an index causes an OverflowError #### Code Sample, a copy-pastable example if possible ```python # make a dataframe with one column df = pd.DataFrame(columns=[0]) # pandas is greate because we cna use arbitrary objects to insert new # rows and columns dynamically. df.loc[11] =...
@Erotemic : Seems reasonable to me. If you think you can patch it as well, a PR is welcome!
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n# make a dataframe with one column\r\ndf = pd.DataFrame(columns=[0])\r\n# pandas is greate because we cna use arbitrary objects to insert new\r\n# rows and columns dynamically.\r\ndf.loc[11] = 'a'\r\ndf.loc['y', 0] = 'b'\r\ndf....
0bd871fb9634e8b73efcc1aeabb93961fbc43d53
{ "head_commit": "b424439e8b03f3ea4243ef4d849e5c5bace8888a", "head_commit_message": "FIX: np.inf now upcasts int Index to float", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 935e9d740b91c..4ff973046f932 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\n++...
[ { "diff_hunk": "@@ -542,6 +571,18 @@ def test_astype_assignment_with_dups(self):\n # result = df.get_dtype_counts().sort_index()\n # expected = Series({'float64': 2, 'object': 1}).sort_index()\n \n+ def test_coercion_with_contains(self):\n+ # Related to GH 16957\n+ # Checking if...
7310c36c382da4c9829e8f0af1226a431fefaa1e
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 935e9d740b91c..b8c4cf61edc5b 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -145,6 +145,7 @@ Bug Fixes ~~~~~~~~~ - Fixes regression in 0.20, :func:`Series.aggregate` and :func:`DataFrame.aggre...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-17156@679ad4e
pandas-dev/pandas
Python
17,156
BUG: Rolling apply on DataFrame with Datetime index returns NaN
- [x] #15305 - [x] changing the order of 'calling roll_sum' and 'get_window_indexer' in 'roll_generic' could fix #15305 The bug caused by the return values from get_window_indexer. It changes value of 'win', which is not supposed to be passed to roll_sum.
2017-08-02T20:29:11Z
Rolling apply on DataFrame with Datetime index returns NaN #### Code Sample, a copy-pastable example if possible ```python import pandas as pd df = pd.DataFrame({'A': [0, 1, 2, 3, 4]}, index=[pd.Timestamp('20130101 09:00:00'), pd.Timestamp('20130101 09:00:01'), ...
well ``.apply`` rolling on time-specified windows isn't tested very well :< The issue is that the counts computation is using the fixed interval one (see a few lines above). Instead it needs to bascially call ``counts = roll_count(...)`` more or les. see https://github.com/pandas-dev/pandas/blob/master/pandas/win...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nimport pandas as pd\r\n\r\ndf = pd.DataFrame({'A': [0, 1, 2, 3, 4]},\r\n index=[pd.Timestamp('20130101 09:00:00'),\r\n pd.Timestamp('20130101 09:00:01'),\r\n pd.T...
3e9e947b89d8edd7426bf8c748b1c6e3de5a7afb
{ "head_commit": "679ad4e62cc528e7a68c842949386b06a4eac82e", "head_commit_message": "fix issue #15305, update _libs\\window.pyx and tests\\test_window.py", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 1931ffff4b217..8fa4bcf28b04e 100644\n--- a/doc/sourc...
[ { "diff_hunk": "@@ -423,6 +423,27 @@ def test_constructor_with_timedelta_window(self):\n expected = df.rolling('3D').sum()\n tm.assert_frame_equal(result, expected)\n \n+ def test_constructor_with_timedelta_window_and_minperiods(self):\n+ # GH 15305\n+ n = 10\n+ d...
8f165d712c280c35055e3d2424244c26bb7741be
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index cc9ab81ce0955..6aee779151003 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -349,6 +349,8 @@ Groupby/Resample/Rolling - Bug in ``.rolling(...).quantile()`` which incorrectly used different defaul...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16965@42b8c8f
pandas-dev/pandas
Python
16,965
DOC: document convention argument for resample()
- [ ] closes #15432 - [ ] tests added / passed - [ ] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff`` - [ ] whatsnew entry
2017-07-15T21:51:46Z
Resample convention='start' not functioning properly #### Code Sample, a copy-pastable example if possible ```python import pandas as pd df = pd.DataFrame({'values': [2, 3]}, index='1986-01-31', '1986-2-28') df.resample('M', convention='s').sum() ``` #### Problem description The convention argument does ...
This biggest problem with the `convention` keyword is that is completely undocumented (also mentioned in https://github.com/pandas-dev/pandas/issues/5023 as the general issue about resample's docs). As a result, I am also not sure what the `convention` keyword should actually do, but I think it is meant for the case...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nimport pandas as pd\r\n\r\ndf = pd.DataFrame({'values': [2, 3]}, index='1986-01-31', '1986-2-28')\r\ndf.resample('M', convention='s').sum()\r\n\r\n```\r\n#### Problem description\r\n\r\nThe convention argument does not seem to ...
2cd85ca748f62d7430b30e2d9ddd036e972cc64e
{ "head_commit": "42b8c8f407d8477518e271efb1a201b39ab02dd1", "head_commit_message": "DOC: document convention argument for resample()", "patch_to_review": "diff --git a/pandas/core/generic.py b/pandas/core/generic.py\nindex a4bb746722c1e..5d76d625aec81 100644\n--- a/pandas/core/generic.py\n+++ b/pandas/core/gener...
[ { "diff_hunk": "@@ -4946,6 +4948,50 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,\n 2000-01-01 00:06:00 26\n Freq: 3T, dtype: int64\n \n+ For a Series with a PeriodIndex, the keyword ``convention`` can be\n+ used to control whether to use the start...
6653dbe2dbce08d50ef67b132b053389a3977707
diff --git a/pandas/core/generic.py b/pandas/core/generic.py index a4bb746722c1e..e4e2e0093b1a6 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4826,6 +4826,8 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None, label : {'right', 'left'} Which bin edge ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16907@e163de1
pandas-dev/pandas
Python
16,907
Fixes for #16896(TimedeltaIndex indexing regression for strings)
Fixed a regression for indexing with a string with a ``TimedeltaIndex`` (#16896) I am not a fan of the catch all except, but there is no guarantee in `_get_dtype_type`. As part of this PR, we can ensure that all type checks return True/False. `_get_dtype_type` should probably return a type or a TypeError... Nothing ...
2017-07-13T14:41:25Z
BUG: TimedeltaIndex indexing regression for strings in v0.20.3 With pandas 0.20.2: ``` In [1]: import pandas as pd In [3]: df = pd.DataFrame({'x': range(3)}, pd.to_timedelta(range(3), unit='days')) In [4]: df.loc['0 days'] Out[4]: x 0 Name: 0 days 00:00:00, dtype: int64 In [5]: df.index Out[5]: Timede...
#16638 seems most likely cc @jdeschenes, mind taking a look? After a bit of investigation: ```python import pandas as pd df = pd.DataFrame({'x': range(3)}, pd.to_timedelta(range(3), unit='days')) df.loc['0 days 00:00:00'] ``` This will work. The culprit is the `is_timedelta64_dtype` function which was ...
[ { "body": "With pandas 0.20.2:\r\n```\r\nIn [1]: import pandas as pd\r\n\r\nIn [3]: df = pd.DataFrame({'x': range(3)}, pd.to_timedelta(range(3), unit='days'))\r\n\r\nIn [4]: df.loc['0 days']\r\nOut[4]:\r\nx 0\r\nName: 0 days 00:00:00, dtype: int64\r\n\r\nIn [5]: df.index\r\nOut[5]: TimedeltaIndex(['0 days', ...
9d13227345882daaa90f03078c09a9b44a18ce72
{ "head_commit": "e163de1e0c0106f2f2d42d94c51d38d5d88be276", "head_commit_message": "Fixes for #16896\n\nFixed a regression for indexing with a string with a ``TimedeltaIndex``", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex a5ee0e0ce2653..7b40e7ae04f2d ...
[ { "diff_hunk": "@@ -155,7 +155,7 @@ Indexing\n \n - When called with a null slice (e.g. ``df.iloc[:]``), the ``.iloc`` and ``.loc`` indexers return a shallow copy of the original object. Previously they returned the original object. (:issue:`13873`).\n - When called on an unsorted ``MultiIndex``, the ``loc`` in...
3d366951ae620c741932f056a4689e61718133ad
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index a5ee0e0ce2653..0fbf865b24d50 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -155,7 +155,7 @@ Indexing - When called with a null slice (e.g. ``df.iloc[:]``), the ``.iloc`` and ``.loc`` indexers ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16960@19da337
pandas-dev/pandas
Python
16,960
Fixes SparseSeries initiated with dictionary raising AttributeError
- [x] closes #16905 - [x] tests added / passed - [x] whatsnew entry
2017-07-15T20:56:55Z
BUG: SparseSeries from dict inconsistency #### Code Sample, a copy-pastable example if possible Two (somewhat related) issues: ```python >>> pd.Series({1: 1}) 1 1 dtype: int64 >>> pd.SparseSeries({1: 1}) --------------------------------------------------------------------------- AttributeError: 'dict' obje...
yep looks like a bug I think I have a fix for this. I'm testing it now.
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\nTwo (somewhat related) issues:\r\n```python\r\n>>> pd.Series({1: 1})\r\n1 1\r\ndtype: int64\r\n\r\n>>> pd.SparseSeries({1: 1})\r\n---------------------------------------------------------------------------\r\nAttributeError: 'dict' object ha...
96168ef698ac8bbccba251258ee66958359b11bf
{ "head_commit": "19da33784c701b5533eb63fa16258362b44fae14", "head_commit_message": "Refactors test for SparseSeries construction", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 6ddf6029b99bb..e6a14d4bb1c85 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\n...
[ { "diff_hunk": "@@ -88,6 +88,18 @@ def setup_method(self, method):\n self.ziseries2 = SparseSeries(arr, index=index, kind='integer',\n fill_value=0)\n \n+ def test_constructor_data_input(self):\n+ # see gh-16905\n+ test_dict = {1: 1}\n+ test_...
54167627f7c7a283aadc424298f6a71ac900231a
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 6ddf6029b99bb..f8bd643f05ca0 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -180,7 +180,7 @@ Groupby/Resample/Rolling Sparse ^^^^^^ - +- Bug in ``SparseSeries`` raises ``AttributeError`` when ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16887@3b4ef99
pandas-dev/pandas
Python
16,887
Let _get_dtype accept Categoricals and CategoricalIndex
- [ x] closes #16817 - [x ] tests added / passed - [x ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.) - [ ] whatsnew entry Makes ``_get_dtype`` accept ``Categorical``s and ``Catego...
2017-07-11T22:00:47Z
BUG: _get_dtype accepts CategoricalDtype but throws TypeError with a Categorical #### Problem description I find it inconistent that ``_get_dtype`` accept a ``CategoricalDtype``, but will thow TypeError on ``Categorical``s. #### Code Sample, a copy-pastable example if possible ```python >>> cats = pd.Categor...
This is an internal method, do you actually need it for something? - We have *no* tests for these routines (either ``_get_dtype`` or ``_get_dtype_type``). rather we have bunches of integration tests via all of the ``is_*`` routines. Would be nice to nail down what this actually takes / returns. - We should actually ma...
[ { "body": "#### Problem description\r\n\r\nI find it inconistent that ``_get_dtype`` accept a ``CategoricalDtype``, but will thow TypeError on ``Categorical``s. \r\n\r\n#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n>>> cats = pd.Categorical([1,2,3])\r\n>>> pd.core.dtypes.common._get_...
a9421af1aac906cc38d025ed5db4a2b55cb8b9bc
{ "head_commit": "3b4ef99a92b82a9054146f6e858944d121110ab7", "head_commit_message": "Added a note for change in dtypes.common._get_dtype in whatsnew", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 015fdf1f45f47..4523569fb0f63 100644\n--- a/doc/source/wha...
[ { "diff_hunk": "@@ -147,7 +147,8 @@ Bug Fixes\n Conversion\n ^^^^^^^^^^\n \n-\n+- :func:`dtypes.common._get_dtype` now accepts ``Categorical``s and", "line": null, "original_line": 150, "original_start_line": null, "path": "doc/source/whatsnew/v0.21.0.txt", "start_line": null, "text": "@...
54da1458f45161f3c6215dbe4e53711bf73dca88
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 015fdf1f45f47..40df813cf4b3b 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -148,7 +148,6 @@ Conversion ^^^^^^^^^^ - Indexing ^^^^^^^^ diff --git a/pandas/core/dtypes/common.py b/pandas/c...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16801@36646d2
pandas-dev/pandas
Python
16,801
BUG: render dataframe as html do not produce duplicate element id's (#16780)
closes #16780 tests added / passed passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` whatsnew entry
2017-06-29T22:15:44Z
Pandas style render set_uuid sets Multiple ids #### Code Sample, a copy-pastable example if possible ```python df = pd.DataFrame({'a': [1, 3, 5, 6], 'b': [2, 4, 12, 21]}) df.style.render(uuid='test') ## or same with df.style.set_uuid('test').render() <style type="text/css" >\n</style> \n<table id="T_test" > ...
Thanks for the report. For reference the problem IDs are generated at - https://github.com/pandas-dev/pandas/blob/65a0e642e1270791e6586c967758b362b865b6a8/pandas/io/formats/templates/html.tpl#L28 - https://github.com/pandas-dev/pandas/blob/65a0e642e1270791e6586c967758b362b865b6a8/pandas/io/formats/templates/html.tp...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\ndf = pd.DataFrame({'a': [1, 3, 5, 6], 'b': [2, 4, 12, 21]})\r\ndf.style.render(uuid='test')\r\n## or same with df.style.set_uuid('test').render()\r\n\r\n<style type=\"text/css\" >\\n</style> \\n<table id=\"T_test\" > \\n<thea...
85740a5b6285e529931aab7a205468e57d023b7f
{ "head_commit": "36646d288a16131c928d19b94e09b822372bf0b2", "head_commit_message": "CLN: removing spaces in code causes pylint check to fail", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex de2516d75040b..86952375f6068 100644\n--- a/doc/source/whatsnew/v...
[ { "diff_hunk": "@@ -92,6 +92,8 @@ Performance Improvements\n Bug Fixes\n ~~~~~~~~~\n \n+- fix issue when rendering dataframe to html where element id's were not unique (:issue:`16780`)", "line": null, "original_line": 95, "original_start_line": null, "path": "doc/source/whatsnew/v0.21.0.txt", ...
289c9225f6c5b27a11c980fcd4c05f4c0cec4ce2
diff --git a/doc/source/whatsnew/v0.20.3.txt b/doc/source/whatsnew/v0.20.3.txt index 17195715d0f95..6b806fd411d03 100644 --- a/doc/source/whatsnew/v0.20.3.txt +++ b/doc/source/whatsnew/v0.20.3.txt @@ -37,6 +37,7 @@ Performance Improvements Bug Fixes ~~~~~~~~~ - Fixed issue with dataframe scatter plot for categorical...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16860@5751965
pandas-dev/pandas
Python
16,860
ENH - Modify Dataframe.select_dtypes to accept scalar values
This commit relates to GH16855. It allows the Dataframe.select_dtypes function to accept scalar values as well as list-like values. As such, it should maintain backwards compatibility. - [x ] closes #16855 - [x ] tests added / passed - [x ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --di...
2017-07-08T14:52:02Z
API: DataFrame.select_dtypes should accept scalar ``` In [164]: df = pd.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']}) In [165]: df.select_dtypes(include='object') --------------------------------------------------------------------------- TypeError Traceback (most recent call l...
+100 :) We should do the same for `exclude` I was looking at picking this up as one of my first contributions. A quick question for clarity though. `select_dtypes` allows strings (`'category'`, `'datetimetz'`, etc) but also allows `numpy.number`. For example: df.select_dtypes(include=['category', numpy.number...
[ { "body": "```\r\nIn [164]: df = pd.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})\r\n\r\nIn [165]: df.select_dtypes(include='object')\r\n---------------------------------------------------------------------------\r\nTypeError Traceback (most recent call last)\r\n<ipython-inpu...
18f929fa83d2d1f335f8ccf325c05a6ce314b94d
{ "head_commit": "575196557e46a21d28e3f8b63193fac2423cf981", "head_commit_message": "ENH - Modify Dataframe.select_dtypes to accept scalar values\n\nThis commit related to GH16855. It allows the Dataframe.select_dtypes\nfunction to accept scalar values as well as list-like values. As such,\nit should maintain backw...
[ { "diff_hunk": "@@ -2348,10 +2346,15 @@ def select_dtypes(self, include=None, exclude=None):\n 4 True\n 5 False\n \"\"\"\n- include, exclude = include or (), exclude or ()\n- if not (is_list_like(include) and is_list_like(exclude)):\n- raise TypeError('include...
2f9ae6e550d6461d89654180961d28d02fe5a7f5
diff --git a/doc/source/basics.rst b/doc/source/basics.rst index 134cc5106015b..d8b1602fb104d 100644 --- a/doc/source/basics.rst +++ b/doc/source/basics.rst @@ -2229,7 +2229,3 @@ All numpy dtypes are subclasses of ``numpy.generic``: Pandas also defines the types ``category``, and ``datetime64[ns, tz]``, which ar...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-16858@0c5cc74
pandas-dev/pandas
Python
16,858
BUG: Series.isin fails or categoricals
- closes #16639 - [1 ] tests added / passed - ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.) - [check ] whatsnew entry
2017-07-07T21:30:40Z
Series.isin fails (errors) for categoricals #### Code Sample, a copy-pastable example if possible ```python import pandas as pd import numpy as np #%% print(pd.__version__) vals = np.array([0, 1,2, 0]); cats = ['a', 'b', 'c']; DFtrades = pd.DataFrame({'id': pd.Series(pd.Categorical(1).from_codes(vals, cats...
I'm guessing the fix to this looks something like #16543 - did some refactoring the algorithms file and this is a case that probably got missed this fixes. Though I think we should add some asv's with categoricals to make sure they are hitting the right path ``` diff --git a/pandas/core/algorithms.py b/pandas/core/...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\n#%%\r\nprint(pd.__version__)\r\nvals = np.array([0, 1,2, 0]);\r\ncats = ['a', 'b', 'c'];\r\n\r\nDFtrades = pd.DataFrame({'id': pd.Series(pd.Categorical(1).from_codes(vals, cats))});\...
18f929fa83d2d1f335f8ccf325c05a6ce314b94d
{ "head_commit": "0c5cc74f64cede3ea6a643fdb516a070e78f75e7", "head_commit_message": "BUG: GH16639 fix Series.isin for Categoricals", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex d5cc3d6ddca8e..20daa19a7eded 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\...
[ { "diff_hunk": "@@ -188,7 +188,7 @@ Numeric\n \n Categorical\n ^^^^^^^^^^^\n-\n+- Bug in ``Series.isin()`` when called for categoricals (:issue`16639`)", "line": null, "original_line": 191, "original_start_line": null, "path": "doc/source/whatsnew/v0.21.0.txt", "start_line": null, "text"...
8e19c9830454a716128149f0edf854267380b23c
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index d5cc3d6ddca8e..c6046aac831b1 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -188,7 +188,7 @@ Numeric Categorical ^^^^^^^^^^^ - +- Bug in ``:func:Series.isin()`` when called with a categorical ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16744@b8a6007
pandas-dev/pandas
Python
16,744
Test for #16726. unittest that ensures datetime is understood
- [x] closes #16726 - [x] test added
2017-06-21T11:24:41Z
Different behaviour on two different environments. TypeError: data type "datetime" not understood #### I have an aggregation logic ```python In [19]: datewise_prices Out[19]: [{'arrivalDate': 1490227200000, 'maxPrice': 3300, 'minPrice': 3300, 'modalPrice': 3300}, {'arrivalDate': 1490400000000, 'max...
Can you make a copy-pastable example, as requested? ``` import pandas as pd datewise_prices = [ {'arrivalDate': 1490227200000, 'maxPrice': 3300, 'minPrice': 3300, 'modalPrice': 3300}, {'arrivalDate': 1490400000000, 'maxPrice': 3300, 'minPrice': 3300, 'modalPrice': 3300}, ...
[ { "body": "#### I have an aggregation logic\r\n\r\n```python\r\nIn [19]: datewise_prices\r\nOut[19]: \r\n[{'arrivalDate': 1490227200000,\r\n 'maxPrice': 3300,\r\n 'minPrice': 3300,\r\n 'modalPrice': 3300},\r\n {'arrivalDate': 1490400000000,\r\n 'maxPrice': 3300,\r\n 'minPrice': 3300,\r\n 'modalPrice': 330...
8a98f5ed541c87a9bf101c9331bd6cfa8f007cc9
{ "head_commit": "b8a6007e8b5f79249b63407b8a9e5f88422a6ce9", "head_commit_message": "Test for #16726. unittest that ensures datetime is understood", "patch_to_review": "diff --git a/pandas/tests/series/test_datetime_values.py b/pandas/tests/series/test_datetime_values.py\nindex e1fc9af0cca89..456d337ce2b1c 100644...
[ { "diff_hunk": "@@ -409,3 +409,11 @@ def test_date_tz(self):\n date(2015, 11, 22)])\n assert_series_equal(s.dt.date, expected)\n assert_series_equal(s.apply(lambda x: x.date()), expected)\n+\n+ def test_datetime_understood(self):\n+ # Ensures it doesn't throw...
36960cd3fef212a9d92e14a6031d70aa08b888a7
diff --git a/pandas/tests/series/test_datetime_values.py b/pandas/tests/series/test_datetime_values.py index e1fc9af0cca89..e810eadd2dee9 100644 --- a/pandas/tests/series/test_datetime_values.py +++ b/pandas/tests/series/test_datetime_values.py @@ -409,3 +409,13 @@ def test_date_tz(self): da...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Dependency Updates & Env Compatibility" }
pandas-dev__pandas-16701@9fa9971
pandas-dev/pandas
Python
16,701
BUG: Fix regression for RGB(A) color arguments
- [ ] closes #16695 - [x] test added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry Fixes a regression in the plot API in which RGB and RGBA tuples in the `color` kwarg caused an error when passed to matplotlib. The root cause of this error is th...
2017-06-15T06:33:34Z
DataFrame plot method no long takes RGB tuple as color arg #### Problem description The `plot` method on `DataFrame` objects takes a `color` argument that in versions prior to 0.20.2 took an RGB tuple as an accepted value. The 0.20.2 release throws an exception when specifying an RGB tuple for the `color` arg. #...
Follow up: Enclosing the tuple in a list works: ``` df.plot(x='b', y='a', color=[(1, 0, 0)]) ``` This looks related to #16233 which fixes #3486 but breaks what I perceive to be a fairly standard way of assigning line color (e.g. it is the first method listed for specifying color on https://matplotlib.org/users/col...
[ { "body": "#### Problem description\r\n\r\nThe `plot` method on `DataFrame` objects takes a `color` argument that in versions prior to 0.20.2 took an RGB tuple as an accepted value. The 0.20.2 release throws an exception when specifying an RGB tuple for the `color` arg.\r\n\r\n#### Code Sample\r\n\r\n```python...
b7e7fd3f17d4d2a2f87b9d169cf87143f04e5d33
{ "head_commit": "9fa99716f4ff55c7617ac05758df0135f61bd068", "head_commit_message": "Update what's new", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.3.txt b/doc/source/whatsnew/v0.20.3.txt\nindex 249e05623a27f..87ecedda8eec6 100644\n--- a/doc/source/whatsnew/v0.20.3.txt\n+++ b/doc/source/whatsnew/v...
[ { "diff_hunk": "@@ -59,7 +59,7 @@ I/O\n \n Plotting\n ^^^^^^^^\n-\n+- Allow series plots to accept RGB and RGBA tuples as color arguments (:issue:`16233`)", "line": null, "original_line": 62, "original_start_line": null, "path": "doc/source/whatsnew/v0.20.3.txt", "start_line": null, "tex...
d61d17aa269176bfd4fd0aa5892f74950070a43d
diff --git a/doc/source/whatsnew/v0.20.3.txt b/doc/source/whatsnew/v0.20.3.txt index 249e05623a27f..acd19a8b8da10 100644 --- a/doc/source/whatsnew/v0.20.3.txt +++ b/doc/source/whatsnew/v0.20.3.txt @@ -59,7 +59,7 @@ I/O Plotting ^^^^^^^^ - +- Fix regression in series plotting that prevented RGB and RGBA tuples from ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16557@a298430
pandas-dev/pandas
Python
16,557
BUG: conversion of Series to Categorical
Patch to bug fix #16524
2017-05-31T18:08:15Z
Converting Series to categorical When converting `Series` to `categorical` dtype, the following method ```python pd.Series(pd.Series(['a', 'b', 'c']), dtype='category') ``` fails with traceback ```pytb --------------------------------------------------------------------------- TypeError ...
yeah this should work. the ``riase_on_error`` arg should not be passed thru here (we changing this arg in the future anyhow) PR's are welcome.
[ { "body": "When converting `Series` to `categorical` dtype, the following method\r\n\r\n```python\r\n\r\npd.Series(pd.Series(['a', 'b', 'c']), dtype='category')\r\n\r\n```\r\n\r\nfails with traceback\r\n\r\n```pytb\r\n---------------------------------------------------------------------------\r\nTypeError ...
10c17d4896799cf1e8f313025d1071e5abbb65f9
{ "head_commit": "a298430f5877b0017ef78707f693955dbdfeaac6", "head_commit_message": "DOC: move release note", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.3.txt b/doc/source/whatsnew/v0.20.3.txt\nindex 2032209c4aa23..64dfe02673e77 100644\n--- a/doc/source/whatsnew/v0.20.3.txt\n+++ b/doc/source/whats...
[ { "diff_hunk": "@@ -44,6 +44,7 @@ Conversion\n ^^^^^^^^^^\n \n - Bug in pickle compat prior to the v0.20.x series, when ``UTC`` is a timezone in a Series/DataFrame/Index (:issue:`16608`)\n+- Bug in ``Series`` with ``dtype='category'`` (:issue:`16524`)", "line": null, "original_line": 47, "original_s...
795575a07e36cdfeae2d3c8b41cbcdce3506365c
diff --git a/doc/source/whatsnew/v0.20.3.txt b/doc/source/whatsnew/v0.20.3.txt index 2032209c4aa23..83cd5cc4b470c 100644 --- a/doc/source/whatsnew/v0.20.3.txt +++ b/doc/source/whatsnew/v0.20.3.txt @@ -44,6 +44,7 @@ Conversion ^^^^^^^^^^ - Bug in pickle compat prior to the v0.20.x series, when ``UTC`` is a timezone ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16487@ccbbad6
pandas-dev/pandas
Python
16,487
DOC: Update to docstring of DataFrame(dtype) (#14764)
- [ ] closes #14764 - [ ] tests added / passed - [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [ ] whatsnew entry
2017-05-24T21:21:15Z
DOC: pd.DataFrame(dtype) arg cannot be list, dict, Series. And None will infer wider type than necessary. #### Code Sample, a copy-pastable example if possible ```python # This is a DOCbug simply to document what pd.DataFrame(dtype) currently does. # It is non-obvious to new users, gives non-obvious error messag...
repro for the error case ```python df = pd.DataFrame(columns=['year', 'month'], dtype={'year': 'int32', 'month': 'int8'}, index=range(10), data=-1) ``` I could see an argument for supporting this, consistent with #13375 To be clear, I'm only asking for the documentation to r...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n\r\n# This is a DOCbug simply to document what pd.DataFrame(dtype) currently does.\r\n# It is non-obvious to new users, gives non-obvious error messages, and also behaves differently to read_csv(dtype)\r\n\r\n# a) Leaving dtype...
ef487d9e474e8052c0f7c6260de5802a950defad
{ "head_commit": "ccbbad683f113355f7a679b785403e737d9fd6e0", "head_commit_message": "Adding some more documentation on dataframe with regards to dtype", "patch_to_review": "diff --git a/pandas/core/frame.py b/pandas/core/frame.py\nindex 78a369761afc1..02404d7235031 100644\n--- a/pandas/core/frame.py\n+++ b/pandas...
[ { "diff_hunk": "@@ -241,17 +241,52 @@ class DataFrame(NDFrame):\n Column labels to use for resulting frame. Will default to\n np.arange(n) if no column labels are provided\n dtype : dtype, default None\n- Data type to force, otherwise infer\n+ Data type to force. Only a single ...
edc1c046c596d086c91cf7af2d62c2adc75e3258
diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 743d623ee5e44..907959c42323e 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -241,17 +241,47 @@ class DataFrame(NDFrame): Column labels to use for resulting frame. Will default to np.arange(n) if no column labels are provid...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
pandas-dev__pandas-16512@135f8d0
pandas-dev/pandas
Python
16,512
DOC: Update Sphinx Deprecated Directive
- [x] closes #16507 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry XR #6581 for version numbers. Hopefully whitespace is okay.
2017-05-26T07:07:31Z
DOC: Update docs to use sphinx deprecated directive As an example: ``` sheetname : string, int, mixed list of strings/ints, or None, default 0 .. deprecated:: 0.21.0 Use `sheet_name` instead ``` Some examples that need to be replaced (line numbers, and maybe filenames will change) ``` doc/sou...
[ { "body": "As an example:\r\n\r\n```\r\nsheetname : string, int, mixed list of strings/ints, or None, default 0\r\n .. deprecated:: 0.21.0\r\n Use `sheet_name` instead\r\n\r\n```\r\n\r\nSome examples that need to be replaced (line numbers, and maybe filenames will change)\r\n\r\n```\r\ndoc/source/io.rs...
1265c27f4bbd06e1bb75f846139a164bdadd5b31
{ "head_commit": "135f8d0939c94549c1db6bfd069e31ae14298115", "head_commit_message": "Removed references to future versions", "patch_to_review": "diff --git a/doc/source/io.rst b/doc/source/io.rst\nindex bca23dd18a0e3..52d57e1d1f49b 100644\n--- a/doc/source/io.rst\n+++ b/doc/source/io.rst\n@@ -137,8 +137,8 @@ usec...
[ { "diff_hunk": "@@ -1148,7 +1148,8 @@ cdef class _Timestamp(datetime):\n \n cpdef datetime to_datetime(_Timestamp self):\n \"\"\"\n- DEPRECATED: use :meth:`to_pydatetime` instead.\n+ .. deprecated:: 0.19.0\n+ Use :meth:`to_pydatetime` instead.", "line": null, "origina...
8f31b835b2756e043ca258ab3d4633cba3b95bfa
diff --git a/doc/source/io.rst b/doc/source/io.rst index e7c1cc13d103d..74a604339cddb 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -137,8 +137,10 @@ usecols : array-like or callable, default ``None`` Using this parameter results in much faster parsing time and lower memory usage. as_recarray : boolea...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Documentation Updates" }
pandas-dev__pandas-16455@44f4f00
pandas-dev/pandas
Python
16,455
Fix correct warning with c engine when skipping lines
Fixed bug where c engine would not print warnings for lines it skipped in case the skipped line had an inline comment. Also, its accounting of number of fields in such lines would be off by one. - [x] closes #16472 - [x] tests added - [x] tests passed - [x] passes ``git diff upstream/master --name-only --...
2017-05-23T14:40:51Z
Incorrect skipping of lines with inline comments and printing warnings #### Code Sample, a copy-pastable example if possible ```python # Your code here from io import StringIO import numpy as np import pandas as pd test_input = u"""\ 1 2 2 2 3 3 2 3 # 3 fields 4 2 3# 3 fields 5 2 # 2 fields 6 2# 2 field...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n# Your code here\r\nfrom io import StringIO\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\ntest_input = u\"\"\"\\\r\n1 2\r\n2 2 3\r\n3 2 3 # 3 fields\r\n4 2 3# 3 fields\r\n5 2 # 2 fields\r\n6 2# 2 fields\r\n7 # 1 field, Na...
6cbd5589fd005f987381bacbaa79e96950cd5dcb
{ "head_commit": "44f4f00ff5b81888c4fa2d7502c44b74dea55fc5", "head_commit_message": "Move test to CParserTests\n\nThe behavior is only applicable on the `c` engine.", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt\nindex 6d6a148ed025f..6149fb0c392c1 100644\n--- ...
[ { "diff_hunk": "@@ -53,6 +53,7 @@ Indexing\n I/O\n ^^^\n \n+- Bug in skipping error lines with inline comments in space delimited text files (:issue:`16472`)", "line": null, "original_line": 56, "original_start_line": null, "path": "doc/source/whatsnew/v0.20.2.txt", "start_line": null, "...
6fd269de25ab0ab18216a257a7c921ec8350622b
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index 6d6a148ed025f..6c9728191f5b6 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -53,6 +53,7 @@ Indexing I/O ^^^ +- Bug in pd.read_csv() when comment is passed in space deliminted text files (:issu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16444@90f63b0
pandas-dev/pandas
Python
16,444
BUG: Handle numpy strings in index names in HDF #13492
Work in progress! - [ ] closes #13492 - [ ] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-23T00:11:36Z
ERR: raise on invalid coulmns using a fixed HDFStore #### Code Sample ``` idx = pd.Index(pd.to_datetime([datetime.date(2000, 1, 1), datetime.date(2000, 1, 2)]), name='cols') idx1 = pd.Index(pd.to_datetime([datetime.date(2010, 1, 1), datetime.date(2010, 1, 2)]), name='rows') s = pd.DataFrame(np.arange(4).reshape(2,2), ...
not really sure what you are doing. pls show an exact reproduction. ``` In [7]: idx = pd.Index(pd.to_datetime([datetime.date(2000, 1, 1), datetime.date(2000, 1, 2)]), name='cols') In [8]: idx1 = pd.Index(pd.to_datetime([datetime.date(2010, 1, 1), datetime.date(2010, 1, 2)]), name='rows') In [9]: s = pd.DataFrame(np...
[ { "body": "#### Code Sample\n\n```\nidx = pd.Index(pd.to_datetime([datetime.date(2000, 1, 1), datetime.date(2000, 1, 2)]), name='cols')\nidx1 = pd.Index(pd.to_datetime([datetime.date(2010, 1, 1), datetime.date(2010, 1, 2)]), name='rows')\ns = pd.DataFrame(np.arange(4).reshape(2,2), columns=idx, index=idx1)\npri...
4ec98d8b10728af9695c7e35e04b7e3fd9c408d3
{ "head_commit": "90f63b08071a149d47c42c30401d831d1e5a1092", "head_commit_message": "BUG: Handle numpy strings in index names in HDF5 #13492", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt\nindex 379249b6e55d6..7bca4174da297 100644\n--- a/doc/source/whatsnew/v0...
[ { "diff_hunk": "@@ -2568,6 +2568,8 @@ def read_index_node(self, node, start=None, stop=None):\n \n if 'name' in node._v_attrs:\n name = node._v_attrs.name\n+ if isinstance(name, compat.string_types):", "line": null, "original_line": 2571, "original_start_line": null, ...
70a55ece6e20ee33d3f0a2666beabc58bbadd1c3
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index 379249b6e55d6..7bca4174da297 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -70,6 +70,7 @@ I/O - Bug that raised IndexError HTML-rendering an empty DataFrame (:issue:`15953`) - Bug in ``pd.read_...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16442@23a0cec
pandas-dev/pandas
Python
16,442
GH10559: Minor improvement: Change read_excel sheet name
modify io/excel.py and relevant docs (io.rst) to use sheet_name for read_excel but allow sheetname to still be used for backwards compatibility. add test_excel to verify that sheet_name and sheetname args produce the same result. - [X] closes #10559 - [X] tests added / passed - [X] passes ``git diff upstrea...
2017-05-22T23:49:13Z
Minor improvement: Change to_excel "sheet_name" to "sheetname" pd.read_excel() takes "sheetname" as an argument. pd.DataFrame.to_excel() takes "sheet_name" as an argument. For consistency, I think one ought to be changed to match the other. On my windows installation of pandas 0.16.2, I modified to_excel to take sheet...
Agree we should make them the same (at least make it available, maybe not necessary to actually deprecate the discouraged alias). I am only not fully sure if would go with `sheetname` instead of `sheet_name` (we are not always very consistent in the use of `_` to separate words in keywords, but I think the general pol...
[ { "body": "pd.read_excel() takes \"sheetname\" as an argument.\npd.DataFrame.to_excel() takes \"sheet_name\" as an argument.\n\nFor consistency, I think one ought to be changed to match the other.\nOn my windows installation of pandas 0.16.2, I modified to_excel to take sheetname rather than sheet_name. All I ...
49ec31bbaeca81a6f58fc1be26fe80f3ac188cdd
{ "head_commit": "23a0cecd906071c205f53bdc333939fd04e35c45", "head_commit_message": "GH10559: Minor improvement: Change to_excel sheet name\n\nmodify io/excel.py and relevant docs (io.rst) to use sheet_name for read_excel\nbut allow sheetname to still be used for backwards compatibility. add test_excel\nto verify ...
[ { "diff_hunk": "@@ -544,6 +544,18 @@ def test_date_conversion_overflow(self):\n result = self.get_exceldf('testdateoverflow')\n tm.assert_frame_equal(result, expected)\n \n+ # GH10559: Minor improvement: Change to_excel \"sheet_name\" to \"sheetname\"", "line": null, "original_line": ...
4c6da132e9f0a1c4c42a03aa12effa167aeab218
diff --git a/doc/source/io.rst b/doc/source/io.rst index 9692766505d7a..bca23dd18a0e3 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -2561,12 +2561,12 @@ Reading Excel Files ''''''''''''''''''' In the most basic use-case, ``read_excel`` takes a path to an Excel -file, and the ``sheetname`` indicating whi...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
pandas-dev__pandas-16435@bcd922c
pandas-dev/pandas
Python
16,435
Add README improvements.
- [Y] closes #16427 - [Y] whatsnew entry ** Included reference to contribute guide in READEME. ** In the "installation from source" section, refer to the actual section in the docs, instead of to the general website ** Update "Discussion and Development" section: remove reference to scipy mailing list, but add o...
2017-05-22T21:10:34Z
README improvements * README fixes ** Include reference to contribute guide in READEME. Some people have had a hard time finding their way from the repo to the contribution guide. ** In the "installation from source" section, refer to the actual section in the docs, instead of to the general website ** Update "Disc...
I'm fixing this now.
[ { "body": "* README fixes\r\n** Include reference to contribute guide in READEME. Some people have had a hard time finding their way from the repo to the contribution guide.\r\n** In the \"installation from source\" section, refer to the actual section in the docs, instead of to the general website\r\n** Updat...
49ec31bbaeca81a6f58fc1be26fe80f3ac188cdd
{ "head_commit": "bcd922cd5200b61e590277f62804ebf307cc51c3", "head_commit_message": "Add README improvements.", "patch_to_review": "diff --git a/README.md b/README.md\nindex e05f1405419fc..212a8a1422789 100644\n--- a/README.md\n+++ b/README.md\n@@ -204,7 +204,7 @@ python setup.py build --compiler=mingw32\n python...
[ { "diff_hunk": "@@ -225,4 +225,16 @@ Python projects, questions are welcome on the scipy-user mailing\n list. Specialized discussions or design issues should take place on", "line": null, "original_line": 225, "original_start_line": null, "path": "README.md", "start_line": null, "text": ...
29541b9a7d176d353eabcdc14828c4eac150edf4
diff --git a/README.md b/README.md index e05f1405419fc..01182d7b7b4b5 100644 --- a/README.md +++ b/README.md @@ -204,13 +204,13 @@ python setup.py build --compiler=mingw32 python setup.py install ``` -See http://pandas.pydata.org/ for more information. +See **[the docs](http://pandas.pydata.org/pandas-docs/stable/i...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
pandas-dev__pandas-16486@4903b20
pandas-dev/pandas
Python
16,486
return empty MultiIndex for symmetrical difference on equal MultiIndexes
- [X] closes #13490 - [X] tests added / passed - [X] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
2017-05-24T20:40:41Z
Symmetric difference on equal MultiIndexes raises TypeError Calling `symmetric_difference` on two equal multiindices results in a TypeError rather than an empty MultiIndex. This is surprising since calling `difference` on the same multiindices results in the expected empty MultiIndex. #### Code Sample, a copy-pastable ...
yeah I agree, on empties this should behave the same as `.difference` / `.union` cc @TomAugspurger Agreed.
[ { "body": "Calling `symmetric_difference` on two equal multiindices results in a TypeError rather than an empty MultiIndex. This is surprising since calling `difference` on the same multiindices results in the expected empty MultiIndex.\n#### Code Sample, a copy-pastable example if possible\n\n```\na = pandas.M...
92d07992e826808cd56f0bd8fec083b510ca402d
{ "head_commit": "4903b20bc385ac335a8da0fdfd33a5a79ed69c25", "head_commit_message": "return empty MultiIndex for symmetrical difference on equal MultiIndexes", "patch_to_review": "diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py\nindex 2af4f112ca941..c1b637e64b515 100644\n--- a/pandas/core/i...
[ { "diff_hunk": "@@ -2320,11 +2318,15 @@ def symmetric_difference(self, other, result_name=None):\n except TypeError:\n pass\n \n- attribs = self._get_attributes_dict()\n- attribs['name'] = result_name\n- if 'freq' in attribs:\n- attribs['freq'] = None\n- ...
6c67a4a9583e8951e15057d0a5a8f662f3974b8b
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index 90146aa176b31..692e0c02606ad 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -40,6 +40,7 @@ Bug Fixes - Silenced a warning on some Windows environments about "tput: terminal attributes: No such de...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16429@e465311
pandas-dev/pandas
Python
16,429
BUG: Interpolate limit=n GH16282
- [x] closes #16282 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-22T19:32:28Z
df.interpolate limit_direction= does not work without limit=x setting the interpolate limit_direction setting should work even without a limit=x setting. When interpolate is called without a limit=x setting, it always (apparently) uses the limit_direction setting default of 'forward' even when it is explicitly set t...
Thanks for the report, want to take a look at where it's going wrong? Maybe somewhere around https://github.com/pandas-dev/pandas/blob/9e57d915744623bef31170629bd1996eda3352cf/pandas/core/internals.py#L908 I've got a fix for this and the associated enhancement for limit_direction='inside' GH16284. The issue was insi...
[ { "body": "the interpolate limit_direction setting should work even without a limit=x setting.\r\n\r\nWhen interpolate is called without a limit=x setting, it always (apparently) uses the limit_direction setting default of 'forward' even when it is explicitly set to 'backward' or 'both'\r\n\r\nThe code below wi...
49ec31bbaeca81a6f58fc1be26fe80f3ac188cdd
{ "head_commit": "e465311ff5a8bc9a8d448803e4860d58a6bd8f3f", "head_commit_message": "Test: Added small test for code coverage", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 36dffc3d3378b..aeb6204fd2229 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\n+++ ...
[ { "diff_hunk": "@@ -106,6 +106,8 @@ Reshaping\n \n Numeric\n ^^^^^^^\n+- DataFrame.interpolate was not respecting limit_direction when using the default limit=None (unlimited). Specifically, it would always use limit_direction='forward' even when limit_direction was set otherwise. Now default limit=None will wo...
d3d9cb38f0d9297a568d33f5a2759eeb9bb06850
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index e0a8065d9a507..74a0212e9a4f7 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -77,7 +77,7 @@ Reshaping Numeric ^^^^^^^ - +- Bug in .interpolate(), where limit_direction was not respected when li...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16428@0bdc8ed
pandas-dev/pandas
Python
16,428
Error with .drop([]) on non-unique index
Wraps the labels array in `_ensure_object`. The labels array is being cast to a float by default, causing the error raised in #16398. - [X] closes #16398 - [X] tests added / passed - [X] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-22T19:10:05Z
Error with .drop([]) on non-unique index #### Code Sample, a copy-pastable example if possible ```python In [2]: pd.DataFrame([[1,2], [3,4], [5,6]], index=['a','a','b']).drop(['a']) Out[2]: 0 1 b 5 6 In [3]: pd.DataFrame([[1,2], [3,4], [5,6]], index=['a','a','b']).drop(['b']) Out[3]: 0 1 a 1 ...
Working on this as a part of the pycon sprint
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\nIn [2]: pd.DataFrame([[1,2], [3,4], [5,6]], index=['a','a','b']).drop(['a'])\r\nOut[2]: \r\n 0 1\r\nb 5 6\r\n\r\nIn [3]: pd.DataFrame([[1,2], [3,4], [5,6]], index=['a','a','b']).drop(['b'])\r\nOut[3]: \r\n 0 1\r\na 1 ...
49ec31bbaeca81a6f58fc1be26fe80f3ac188cdd
{ "head_commit": "0bdc8edd43becde84d667d3c939fbce4d68c9c23", "head_commit_message": "BUG: fix-drop-on-non-unique-index", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt\nindex e0857019d2fd4..21a4fedb89b39 100644\n--- a/doc/source/whatsnew/v0.20.2.txt\n+++ b/doc/s...
[ { "diff_hunk": "@@ -93,3 +93,5 @@ Categorical\n \n Other\n ^^^^^\n+\n+- Fix ``pd.drop([])`` for dataframes with non-unique indices (:issue:`16270`)", "line": null, "original_line": 97, "original_start_line": null, "path": "doc/source/whatsnew/v0.20.2.txt", "start_line": null, "text": "@u...
1973925f7689dfc5adb02acc6d17fd28fc3157d7
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index e0857019d2fd4..7231b497c4bd4 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -93,3 +93,5 @@ Categorical Other ^^^^^ + +- Bug in ``pd.drop([])`` for DataFrame with non-unique indices (:issue:`16...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-15515@5909635
pandas-dev/pandas
Python
15,515
TST: DataFrame.hist() does not get along with matplotlib.pyplot.tight_layout()
- [ ] closes #9351 - [ ] tests added / passed - [ ] passes ``git diff upstream/master | flake8 --diff`` - [ ] whatsnew entry
2017-02-27T00:30:03Z
DataFrame.hist() does not get along with matplotlib.pyplot.tight_layout() When `tight_layout()` is called after `DataFrame.hist()` it raises `AttributeError: 'NoneType' object has no attribute 'is_bbox` if any of subplots is empty (number of charts with histograms is smaller than number os subplots). I.e. the followin...
Ditto here, I can't seem to figure out what's going on. Would either of you want to dig into what's causing the problem? It seems that ``` python 129 tight_bbox_raw = union([ax.get_tightbbox(renderer) for ax in subplots]) ``` in `matplotlib.tight_layout.auto_adjust_subplotpars` returns None when it's ex...
[ { "body": "When `tight_layout()` is called after `DataFrame.hist()` it raises `AttributeError: 'NoneType' object has no attribute 'is_bbox` if any of subplots is empty (number of charts with histograms is smaller than number os subplots).\n\nI.e. the following code:\n\n```\npd.DataFrame({'a':np.random.randn(100...
b3ae4c7698de4623e1279d579b46192ef79250d1
{ "head_commit": "59096357bcf43cfd3243498a1ae5761585b3ce16", "head_commit_message": "Add unit test for #9351", "patch_to_review": "diff --git a/pandas/tests/plotting/test_hist_method.py b/pandas/tests/plotting/test_hist_method.py\nindex 4f64f66bd3c4d..54538ba358812 100644\n--- a/pandas/tests/plotting/test_hist_me...
[ { "diff_hunk": "@@ -238,6 +238,20 @@ def test_hist_layout(self):\n with tm.assertRaises(ValueError):\n df.hist(layout=(-1, -1))\n \n+ @slow\n+ def test_tight_layout(self):\n+ tm._skip_if_mpl_1()\n+\n+ df = DataFrame(randn(100, 2))\n+ df.plot.hist()\n+\n+ try...
809d8473677bce11dd780ecb332b130c3b523c9a
diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt index c94429b469641..f601e0558740f 100644 --- a/doc/source/whatsnew/v0.20.0.txt +++ b/doc/source/whatsnew/v0.20.0.txt @@ -626,7 +626,7 @@ Bug Fixes - +- Bug in ``DataFrame.hist`` where ``plt.tight_layout`` caused an ``AttributeError`` ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-14886@c717bfe
pandas-dev/pandas
Python
14,886
BUG: regression in DataFrame.combine_first with integer columns (GH14687)
closes #14687
2016-12-15T10:53:24Z
combine_first throws ValueError: Cannot convert NA to integer I do not understand why there is a need to convert NA to integer if the result does not have NAs. Perhaps the combine_first algo needs to do it under the hood? #### A small, complete example of the issue ```python from pandas import DataFrame DataF...
This seems to be a regression from 0.18, as this worked before: ``` In [1]: DataFrame({'a': [0, 1, 3, 5]}).combine_first(DataFrame({'a': [1, 4]})) Out[1]: a 0 0 1 1 2 3 3 5 In [2]: pd.__version__ Out[2]: u'0.18.1' ``` @Dmitrii-I Thanks for the report! Always welcome to look into what could have caused this c...
[ { "body": "I do not understand why there is a need to convert NA to integer if the result does not have NAs. Perhaps the combine_first algo needs to do it under the hood?\r\n\r\n\r\n#### A small, complete example of the issue\r\n\r\n```python\r\nfrom pandas import DataFrame\r\nDataFrame({'a': [0, 1, 3, 5]}).com...
5f889a2106f6584583458e01dbd0f3b9b696fab2
{ "head_commit": "c717bfe66caf4a0ccf858946da188dddbe009fe7", "head_commit_message": "BUG: regression in DataFrame.combine_first with integer columns (GH14687)", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.19.2.txt b/doc/source/whatsnew/v0.19.2.txt\nindex dabc6036fc9ba..291b0ffde145e 100644\n--- a/doc/...
[ { "diff_hunk": "@@ -3665,10 +3665,8 @@ def combine(self, other, func, fill_value=None, overwrite=True):\n otherSeries[other_mask] = fill_value\n \n # if we have different dtypes, possibily promote\n- if notnull(series).all():\n- new_dtype = this_dtype\n- ...
7f325cdef23a7c1ef06a5a6ef0f0f62fbf5b5273
diff --git a/doc/source/whatsnew/v0.19.2.txt b/doc/source/whatsnew/v0.19.2.txt index dabc6036fc9ba..291b0ffde145e 100644 --- a/doc/source/whatsnew/v0.19.2.txt +++ b/doc/source/whatsnew/v0.19.2.txt @@ -78,7 +78,7 @@ Bug Fixes - Bug in clipboard functions on linux with python2 with unicode and separators (:issue:`13747`...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-14780@0ab4876
pandas-dev/pandas
Python
14,780
ENH: Pandas Series provide to_excel method
- [x] closes #8825 - [x] tests added / passed - [ ] passes ``git diff upstream/master | flake8 --diff`` - [x] whatsnew entry
2016-12-01T07:51:08Z
Pandas Series should provide to_excel method Hello, Pandas Series provide `to_csv`method but they doesn't provide `to_excel` method. Adding `to_excel` will avoid user to convert a `pandas.core.series.Series` to a `pandas.core.frame.DataFrame` in order to output Excel file DataFrames provide ``` df.to_clipboard df....
ok, current work-around is: `s.to_frame().to_excel()` pulll-requests welcome
[ { "body": "Hello,\n\nPandas Series provide `to_csv`method but they doesn't provide `to_excel` method.\nAdding `to_excel` will avoid user to convert a `pandas.core.series.Series` to a `pandas.core.frame.DataFrame` in order to output Excel file\n\nDataFrames provide \n\n```\ndf.to_clipboard df.to_hdf df.t...
c0e13d1bccd4a783486eba8cc769db48a7875de8
{ "head_commit": "0ab4876374078d8eafecb622c24d9e7a4fbe639e", "head_commit_message": "ENH: Pandas Series provide to_excel method\nCloses #8825", "patch_to_review": "diff --git a/doc/source/api.rst b/doc/source/api.rst\nindex 638abd5421862..929664840f583 100644\n--- a/doc/source/api.rst\n+++ b/doc/source/api.rst\n@...
[ { "diff_hunk": "@@ -1016,6 +1016,64 @@ def __setstate__(self, state):\n # ----------------------------------------------------------------------\n # I/O Methods\n \n+ _shared_docs['to_excel'] = \"\"\"\n+ Write %(klass)s to a excel sheet\n+\n+ %(versionadded_to_excel)s\n+", "line": null, ...
605b9cebba9146f920d321f845d80f995845636e
diff --git a/doc/source/api.rst b/doc/source/api.rst index 638abd5421862..929664840f583 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -692,6 +692,7 @@ Serialization / IO / Conversion Series.to_pickle Series.to_csv Series.to_dict + Series.to_excel Series.to_frame Series.to_xarray ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-14545@9b76f7e
pandas-dev/pandas
Python
14,545
BUG/API: Index.append with mixed object/Categorical indices
Closes #14298, related to #13660 and #13767 This closes the `info()` issue with CategoricalIndex, but the underlying issue is actually related to Index.append, when appending mixed dtype index objects: ``` In [11]: pd.Index(['a']).append(pd.CategoricalIndex(['a', 'b'])) ... AttributeError: 'Index' object has ...
2016-10-31T15:43:07Z
.info() fails with CategoricalIndex in the columns Just in the columns, the index doesn't cause any issues. This came up as the output of `pd.get_dummies` can have a CategoricalIndex in the columns. #### A small, complete example of the issue ``` python In [31]: idx = pd.CategoricalIndex(['a', 'b']) In [32]: df = pd....
Similar example from #14450 ``` df = pd.DataFrame({"data": np.arange(0, 10, 0.1)}) v = pd.cut(df.data, [0, 1, 2, 5, 10], include_lowest=True).rename("cuts") df.join(pd.get_dummies(v)) ```
[ { "body": "Just in the columns, the index doesn't cause any issues. This came up as the output of `pd.get_dummies` can have a CategoricalIndex in the columns.\n#### A small, complete example of the issue\n\n``` python\nIn [31]: idx = pd.CategoricalIndex(['a', 'b'])\n\nIn [32]: df = pd.DataFrame(np.zeros((2, 2))...
093aa8231eae92ff6cf7ef9564d62289b458aaff
{ "head_commit": "9b76f7ed146831829dc3b54f3143c787c0a35b90", "head_commit_message": "BUG/API: Index.append with mixed object/Categorical indices", "patch_to_review": "diff --git a/pandas/indexes/base.py b/pandas/indexes/base.py\nindex 4d2dcd259e623..883076542cf88 100644\n--- a/pandas/indexes/base.py\n+++ b/pandas...
[ { "diff_hunk": "@@ -1464,13 +1464,13 @@ def append(self, other):\n names = set([obj.name for obj in to_concat])\n name = None if len(names) > 1 else self.name\n \n- typs = _concat.get_dtype_kinds(to_concat)\n-\n- if 'category' in typs:\n+ if self.is_categorical():\n ...
0d4749527959ec7bfce1a786b6a06a90d152414c
diff --git a/pandas/indexes/base.py b/pandas/indexes/base.py index 4d2dcd259e623..54eaf86315a88 100644 --- a/pandas/indexes/base.py +++ b/pandas/indexes/base.py @@ -1464,13 +1464,13 @@ def append(self, other): names = set([obj.name for obj in to_concat]) name = None if len(names) > 1 else self.name ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
nerfstudio-project__nerfstudio-212@bad18f3
nerfstudio-project/nerfstudio
Python
212
Viewer refactor with state sync
- [x] react code is written functionally w/o component classes - [x] store state in reactjs with [redux](https://redux.js.org/) - [x] add ESLint for static code analysis - [x] removed three.js from Python code and moved it to javascript - [x] `write`, `read`, and `delete` functions for keeping state synchronized -...
2022-07-27T05:27:02Z
Add all visualizer code to github actions (linting) Report when viewer isn't connected to server The server should send consistent pings to the client. When the sever gets disconnected, the viewer should transfer to a "disconnected" state. Remove threejs logic from server The threejs logic should exist exclusively i...
I'll add this.
[ { "body": "", "number": 180, "title": "Add all visualizer code to github actions (linting)" }, { "body": "The server should send consistent pings to the client. When the sever gets disconnected, the viewer should transfer to a \"disconnected\" state.", "number": 202, "title": "Report whe...
2c40c1b2bc525e4182882e3ca796b0d2b68ba216
{ "head_commit": "bad18f3285e72285897107015692be45129106ec", "head_commit_message": "remove package.json from root", "patch_to_review": "diff --git a/.github/workflows/viewer_client_app.yml b/.github/workflows/viewer_client_app.yml\nindex 49d096997d..10b8896763 100644\n--- a/.github/workflows/viewer_client_app.ym...
[ { "diff_hunk": "@@ -213,58 +211,36 @@ def handle_zmq(self, frames: List[bytes]):\n frames: the list containing command + object to be placed in tree\n \"\"\"\n cmd = frames[0].decode(\"utf-8\")\n- print(cmd)\n+ # print(cmd)", "line": null, "original_line": 214, ...
1378a276c481168142d66dd253eb2712e0745726
diff --git a/.github/workflows/viewer_client_app.yml b/.github/workflows/viewer_client_app.yml index 49d096997d..10b8896763 100644 --- a/.github/workflows/viewer_client_app.yml +++ b/.github/workflows/viewer_client_app.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@master - name: Install Node.js -...
{ "difficulty": "high", "estimated_review_effort": 5, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-16509@227d8c4
pandas-dev/pandas
Python
16,509
PERF: optimized median func when bottleneck not present
closes #16468 Uses np.nanmedian to compute median instead of internal algos.median when bottleneck is not present/turned off. Has order of magnitude performance benefits `df = pd.DataFrame(np.random.randn(10000, 2), columns=list('AB'))` Before ``` >>> pd.set_option('use_bottleneck', False) >>> %timeit df.m...
2017-05-25T22:10:38Z
PERF: .median(axis=1) perf issues ``` In [2]: df = pd.DataFrame(np.random.randn(10000, 2), columns=list('AB')) In [3]: result1 = df.median(1) In [4]: result2 = pd.Series(np.nanmedian(df.values, axis=1), index=df.index) In [5]: result1.equals(result2) Out[5]: True In [6]: %timeit result1 = df.median(1) 24...
I get similar results ``` >>> df = pd.DataFrame(np.random.randn(10000, 2), columns=list('AB')) >>> pd.set_option('use_bottleneck', False) >>> %timeit df.median(1) 327 ms ± 4.51 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) >>> %timeit pd.Series(np.nanmedian(df.values, axis=1), index=df.index) 1.8...
[ { "body": "```\r\nIn [2]: df = pd.DataFrame(np.random.randn(10000, 2), columns=list('AB'))\r\n\r\nIn [3]: result1 = df.median(1)\r\n\r\nIn [4]: result2 = pd.Series(np.nanmedian(df.values, axis=1), index=df.index)\r\n\r\nIn [5]: result1.equals(result2)\r\nOut[5]: True\r\n\r\nIn [6]: %timeit result1 = df.median(1...
6ba65ca8a69560d526762bdbded64b3139f66d7a
{ "head_commit": "227d8c42d5a26a69aa2dd5f1dc3880709c22bb6e", "head_commit_message": "pep8", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 4f55c6388c728..8aac5c410d7e7 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\n+++ b/doc/source/whatsnew/v0.21.0.txt\n@...
[ { "diff_hunk": "@@ -344,12 +344,22 @@ def nanmedian(values, axis=None, skipna=True):\n \n values, mask, dtype, dtype_max = _get_values(values, skipna)\n \n+ if not skipna:", "line": null, "original_line": 347, "original_start_line": null, "path": "pandas/core/nanops.py", "start_line":...
027a2b2fe053df0e8909f3ab35d63f9813fc761a
diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt index fe5342c520196..5fa0c1ff9253f 100644 --- a/doc/source/whatsnew/v0.23.0.txt +++ b/doc/source/whatsnew/v0.23.0.txt @@ -379,6 +379,8 @@ Performance Improvements - Improved performance of :func:`IntervalIndex.symmetric_difference()` (:issu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Performance Optimizations" }
pandas-dev__pandas-16247@fa4e036
pandas-dev/pandas
Python
16,247
BUG: rolling.quantile does not return an interpolated result
Now computing the quantile of a rolling window matches the default of the rolling method in Series, DataFrame and np.percentile. Fixes bugs #9413 and #16211 - [x] closes #9413 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-05T06:52:13Z
BUG: pandas rolling_quantile does not use interpolation i recently bumped an unexpected issue with pandas rolling funcs. rolling_quantile for example: ``` >> row = 10 >> col = 5 >> idx = pd.date_range(20100101,periods=row,freq='B') >> a = pd.DataFrame(np.random.rand(row*col).reshape((row,-1)),index=idx) >> a ...
It looks like the difference here is that `quantile` and `percentile` take the weighted average of the nearest points, whereas `rolling_quantile` simply uses one the nearest point (no averaging): ``` In [35]: a = pd.DataFrame(np.arange(row*col).reshape((row,-1))) In [36]: a Out[36]: 0 1 2 3 4 0 0 1 ...
[ { "body": "i recently bumped an unexpected issue with pandas rolling funcs. rolling_quantile for example:\n\n```\n>> row = 10\n>> col = 5\n>> idx = pd.date_range(20100101,periods=row,freq='B')\n>> a = pd.DataFrame(np.random.rand(row*col).reshape((row,-1)),index=idx)\n>> a\n 0 1 ...
e832ddfc8bb6362a465de18ccdd25a42585ba2bd
{ "head_commit": "fa4e036fc7bbb218dc9aab6186fb6217b9e62559", "head_commit_message": "Added benchmarks for rolling windows", "patch_to_review": "diff --git a/asv_bench/benchmarks/rolling.py b/asv_bench/benchmarks/rolling.py\nnew file mode 100644\nindex 0000000000000..9da9d0b855323\n--- /dev/null\n+++ b/asv_bench/b...
[ { "diff_hunk": "@@ -167,9 +167,11 @@ Plotting\n \n Groupby/Resample/Rolling\n ^^^^^^^^^^^^^^^^^^^^^^^^\n-- Bug in ``DataFrame.resample().size()`` where an empty ``DataFrame`` did not return a ``Series`` (:issue:`14962`)\n \n+- Bug in ``DataFrame.resample().size()`` where an empty ``DataFrame`` did not return a ...
4080942107c217aef2ad54defd09928f6469f7fc
diff --git a/asv_bench/benchmarks/rolling.py b/asv_bench/benchmarks/rolling.py new file mode 100644 index 0000000000000..9da9d0b855323 --- /dev/null +++ b/asv_bench/benchmarks/rolling.py @@ -0,0 +1,185 @@ +from .pandas_vb_common import * +import pandas as pd +import numpy as np + + +class DataframeRolling(object): + ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16141@a5c4e9e
pandas-dev/pandas
Python
16,141
ENH 14194: add style option for hiding index and columns
- [ x] closes #14194 - [ x] tests added / passed - [ x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-04-26T04:56:04Z
ENH: DataFrame.style option for hiding the index #### Code Sample, a copy-pastable example if possible ``` python df = pd.DataFrame(np.random.randn(10, 2)) df.style.set_include_index(False) # name TBD ``` #### Expected Output Same output, but without the index Would maybe want a way to hide the columns too. --- C...
[ { "body": "#### Code Sample, a copy-pastable example if possible\n\n``` python\ndf = pd.DataFrame(np.random.randn(10, 2))\ndf.style.set_include_index(False) # name TBD\n```\n#### Expected Output\n\nSame output, but without the index\n\nWould maybe want a way to hide the columns too.\n\n---\n\nCurrent workaroun...
9c799e2c4331e5e42cfda03323eef165feb5be1a
{ "head_commit": "a5c4e9e66897cefe67e2b1dd46171b116fc861ec", "head_commit_message": "fix merge", "patch_to_review": "diff --git a/doc/source/style.ipynb b/doc/source/style.ipynb\nindex a78595beabf1d..20f7c2a93b9e6 100644\n--- a/doc/source/style.ipynb\n+++ b/doc/source/style.ipynb\n@@ -674,13 +674,14 @@\n \"- ...
[ { "diff_hunk": "@@ -24,7 +24,8 @@ Other Enhancements\n \n - Better support for :func:`Dataframe.style.to_excel` output with the ``xlsxwriter`` engine. (:issue:`16149`)\n - :func:`pandas.tseries.frequencies.to_offset` now accepts leading '+' signs e.g. '+1h'. (:issue:`18171`)\n--\n+- :class:`pandas.io.formats.st...
cb779ec02f45634f73635b7f3f97b5cd7b4d6dfb
diff --git a/doc/source/style.ipynb b/doc/source/style.ipynb index a78595beabf1d..20f7c2a93b9e6 100644 --- a/doc/source/style.ipynb +++ b/doc/source/style.ipynb @@ -674,13 +674,14 @@ "- precision\n", "- captions\n", "- table-wide styles\n", + "- hiding the index or columns\n", "\n", "Each of...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-14378@47723c3
pandas-dev/pandas
Python
14,378
BUG: Convert float freqstrs to ints at finer resolution
- [x] closes #8419 - [x] tests added / passed - [x] passes `git diff upstream/master | flake8 --diff` - [x] whatsnew entry Passing `'0.5min'` as a frequency string should generate 30 second intervals, rather than five minute intervals. By recursively increasing resolution until one is found for which the frequency is...
2016-10-08T16:32:21Z
date_range treats '.5s' as '5s' I'm new to pandas, so maybe I'm missing something, but I'd expected freq='.5s' to give me 500ms intervals, not 5s intervals: > > > pd.date_range(0, periods=5, freq='.5s')[1] > > > Timestamp('1970-01-01 00:00:05', offset='5S') > > > pd.date_range(0, periods=5, freq='500ms')[1] > > > Time...
these don't take fractional units ATM (I don't think was ever implemented). I don't think very difficult to fix. welcome to have a pull-request. https://github.com/pydata/pandas/blob/master/pandas/tseries/frequencies.py#L97 I think this may have to do with the integer division when assigned values to a freq group. Fo...
[ { "body": "I'm new to pandas, so maybe I'm missing something, but I'd expected freq='.5s' to give me 500ms intervals, not 5s intervals:\n\n> > > pd.date_range(0, periods=5, freq='.5s')[1]\n> > > Timestamp('1970-01-01 00:00:05', offset='5S')\n> > > pd.date_range(0, periods=5, freq='500ms')[1]\n> > > Timestamp('1...
86233e15193c3bcd0f646915891ca6c7892335d9
{ "head_commit": "47723c3d24bbee3ee203341f338da4a05d70bfc2", "head_commit_message": "Convert float freqstrs to ints at finer resolution\n\nPassing `'0.5min'` as a frequency string should generate 30 second\nintervals, rather than five minute intervals. By recursively increasing\nresolution until one is found for wh...
[ { "diff_hunk": "@@ -38,32 +38,52 @@ class FreqGroup(object):\n FR_NS = 12000\n \n \n-US_RESO = 0\n-MS_RESO = 1\n-S_RESO = 2\n-T_RESO = 3\n-H_RESO = 4\n-D_RESO = 5\n+RESO_NS = 0\n+RESO_US = 1\n+RESO_MS = 2\n+RESO_SEC = 3\n+RESO_MIN = 4\n+RESO_HR = 5\n+RESO_DAY = 6\n \n \n class Resolution(object):\n \n #...
80b6d5adc38e1e4f708398b6e228e9ef73360e88
diff --git a/doc/source/whatsnew/v0.19.1.txt b/doc/source/whatsnew/v0.19.1.txt index db5bd22393e64..545b4380d9b75 100644 --- a/doc/source/whatsnew/v0.19.1.txt +++ b/doc/source/whatsnew/v0.19.1.txt @@ -58,4 +58,4 @@ Bug Fixes - Bug in ``df.groupby`` causing an ``AttributeError`` when grouping a single index frame by a ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16266@b7be15a
pandas-dev/pandas
Python
16,266
BUG: support for "level=" when reset_index() is called with a flat Index
- [x] closes #16263 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-06T10:03:58Z
DataFrame.reset_index deletes index, does not all for ints as level arg #### Code Sample, a copy-pastable example if possible ```python import pandas as pd import numpy as np pd.__version__ ``` u'0.20.1' ```python data = pd.DataFrame(np.random.randn(4,4), columns=['A', 'B', 'C', 'D']) data ``` <div> ...
This is related to passing the ``level=`` argument when there is a non-Multi``Index``. Before, the argument would be just discarded: ```python In [3]: pd.DataFrame(np.random.randn(4,4), columns=['A', 'B', 'C', 'D']).reset_index(level='not present') Out[3]: index A B C D 0 ...
[ { "body": "#### Code Sample, a copy-pastable example if possible\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\npd.__version__\r\n```\r\n u'0.20.1'\r\n\r\n```python\r\ndata = pd.DataFrame(np.random.randn(4,4), columns=['A', 'B', 'C', 'D']) \r\ndata\r\n```\r\n\r\n<div>\r\n<table border=\"1\" class...
ba60321d00d686a3137ffe26f919d64e84d43aa0
{ "head_commit": "b7be15a1e70f2ffe1e50e140d4ec61be4056fa09", "head_commit_message": "TST: test drop= and Series", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt\nindex 504f8004bc8a6..f14a08876b6e8 100644\n--- a/doc/source/whatsnew/v0.20.2.txt\n+++ b/doc/source/w...
[ { "diff_hunk": "@@ -141,6 +141,45 @@ def test_reset_index(self):\n tm.assert_index_equal(rs.index, Index(index.get_level_values(1)))\n assert isinstance(rs, Series)\n \n+ def test_reset_index_level(self):\n+ df = pd.DataFrame([[1, 2, 3], [4, 5, 6]],\n+ columns=...
c3014730212787377f8af0aa06ff2d3b1db526c4
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index 504f8004bc8a6..f14a08876b6e8 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -42,7 +42,7 @@ Conversion Indexing ^^^^^^^^ - +- Bug in ``DataFrame.reset_index(level=)`` with single level index (:...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16317@7c461b2
pandas-dev/pandas
Python
16,317
BUG: select_as_multiple doesn't respect start/stop kwargs GH16209
- [x] closes #16209 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-10T03:52:50Z
BUG: HDFStore.select_as_multiple doesn't respect start/stop kwargs ```python import pandas as pd df = pd.DataFrame({"foo": [1, 2], "bar": [1, 2]}) with pd.HDFStore("foo.h5", 'w') as store: store.append_to_multiple({'selector': ['foo'], 'data': None}, df, selector='selector') single_row = store.select...
yep, looks like https://github.com/pandas-dev/pandas/blob/master/pandas/io/pytables.py#L829 needs to pass ``start/stop`` as well. pull-requests welcome! Hmm, so I'm attempting to submit a PR. I've added a new test that mirrors the example from above, but when I insert start/stop into line 829, I get the following te...
[ { "body": "\r\n```python\r\nimport pandas as pd\r\n\r\ndf = pd.DataFrame({\"foo\": [1, 2], \"bar\": [1, 2]})\r\n\r\nwith pd.HDFStore(\"foo.h5\", 'w') as store:\r\n store.append_to_multiple({'selector': ['foo'], 'data': None}, df, selector='selector')\r\n single_row = store.select_as_multiple(['selector', ...
81aa70c2a598f9c12d8cb56a4d758b7f213770fe
{ "head_commit": "7c461b291c45cfa83502c11eb15b2d1c1ba47536", "head_commit_message": "BUG: select_as_multiple doesn't respect start/stop kwargs GH16209", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 36dffc3d3378b..bb9ad95856875 100644\n--- a/doc/source/w...
[ { "diff_hunk": "@@ -82,6 +82,7 @@ Indexing\n I/O\n ^^^\n \n+- Bug in ``HDFStore.select_as_multiple()`` where start/stop arguments were not respected (:issue:`16209`)", "line": null, "original_line": 85, "original_start_line": null, "path": "doc/source/whatsnew/v0.21.0.txt", "start_line": nul...
6d6764f247bf83de047dde96057f2627ea4f6868
diff --git a/doc/source/whatsnew/v0.20.2.txt b/doc/source/whatsnew/v0.20.2.txt index bca92137891a0..02f70d85ab278 100644 --- a/doc/source/whatsnew/v0.20.2.txt +++ b/doc/source/whatsnew/v0.20.2.txt @@ -51,6 +51,7 @@ I/O - Bug that would force importing of the clipboard routines unnecessarily, potentially causing an i...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
pandas-dev__pandas-16220@67c57e8
pandas-dev/pandas
Python
16,220
ENH: Provide dict object for to_dict() #16122
- [x] closes #16122 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry
2017-05-03T21:05:46Z
Feature Request: Provide dict object for pd.Series.to_dict() I frequently use the `.to_dict()` method and was wondering how difficult it would be to implement a `dict_obj` argument to specify what type of dictionary will be used. For example, if one was interested in preserving the order: ``` from collections imp...
The implementation of `to_dict` is just ```python def to_dict(self): """ Convert Series to {label -> value} dict Returns ------- value_dict : dict """ return dict(compat.iteritems(self)) ``` So, if you wanted to take an argument (`type`, `kind...
[ { "body": "I frequently use the `.to_dict()` method and was wondering how difficult it would be to implement a `dict_obj` argument to specify what type of dictionary will be used. For example, if one was interested in preserving the order: \r\n\r\n```\r\nfrom collections import OrderedDict\r\n\r\npd.Series(lis...
4bdbcb638340a0529c2ddc7d3a85d0209004763f
{ "head_commit": "67c57e82e017e089a11351807315c0270150652a", "head_commit_message": "ENH: Provide dict object for to_dict() #16122", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt\nindex 36dffc3d3378b..4beab02db26a8 100644\n--- a/doc/source/whatsnew/v0.21.0.txt\...
[ { "diff_hunk": "@@ -479,6 +481,45 @@ def _dict_compat(d):\n for key, value in iteritems(d))\n \n \n+def prep_maping_for_to_dict(into):\n+ \"\"\"\n+ Helper function to standardize the supplied mapping so it can\n+ be passed to the ``Series.to_dict()`` and ``DataFrame.to_dict()``\n+ \n...
8469977d6e582aeeeff5a523ade0e14fba937ecd
diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 3df0a21facb02..ce80a80e58cd7 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -26,6 +26,7 @@ New features Other Enhancements ^^^^^^^^^^^^^^^^^^ +- ``Series.to_dict()`` and ``DataFrame.to_dict()`...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-14737@8e4adbb
pandas-dev/pandas
Python
14,737
ENH: support cut/qcut for datetime/timedelta (GH14714)
- [x] closes #14714 - [x] tests added / passed - [x] passes ``git diff upstream/master | flake8 --diff`` - [x] whatsnew entry
2016-11-25T06:43:10Z
ENH: enable pd.cut to handle i8 convertibles so this should work for timedeltas AND datetimes. Should be straight forward. detect an i8 convertible. turn into i8. do the cut. turn back to the original dtype. ``` In [15]: s = Series(pd.to_timedelta(np.random.randint(0,100,size=10),unit='ms')).sort_values() In ...
@jreback in the above example should the return type of the final object be 'timedelta64'? (the datatype of the original input) yes (it should be original dtype) @jreback Does it currently return strings? I got the below output by printing typeof over the members of category object returned Categories (5, object): [(2...
[ { "body": "so this should work for timedeltas AND datetimes.\r\n\r\nShould be straight forward. detect an i8 convertible. turn into i8. do the cut. turn back to the original dtype.\r\n\r\n```\r\nIn [15]: s = Series(pd.to_timedelta(np.random.randint(0,100,size=10),unit='ms')).sort_values()\r\n\r\nIn [16]: s\r\nO...
725453deb2efae1b84d87131e785a42a22753659
{ "head_commit": "8e4adbb6cf1f87c95440c4eb89fc61262645ffe9", "head_commit_message": "removed trailing whitespace from test_tile file", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt\nindex 6fe0ad8092a03..5e94a95e38cbb 100644\n--- a/doc/source/whatsnew/v0.20.0.tx...
[ { "diff_hunk": "@@ -81,6 +82,11 @@ def cut(x, bins, right=True, labels=None, retbins=False, precision=3,\n array([1, 1, 1, 1, 1], dtype=int64)\n \"\"\"\n # NOTE: this binning code is changed a bit from histogram for var(x) == 0\n+ # for handling the cut for datetime and timedelta objects\n+ x_...
65eae672e7fe503a580a9c0900d96aeb893a50f3
diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt index 6fe0ad8092a03..5e94a95e38cbb 100644 --- a/doc/source/whatsnew/v0.20.0.txt +++ b/doc/source/whatsnew/v0.20.0.txt @@ -50,6 +50,7 @@ Other enhancements - ``pd.read_excel`` now preserves sheet order when using ``sheetname=None`` (:issue...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
pandas-dev__pandas-15873@e249722
pandas-dev/pandas
Python
15,873
VIS: Allow 'C0'-like plotting for plotting colors #15516
- [x] closes #15516 - [x] tests added / passed - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` - [x] whatsnew entry Defined special case for 'CN' cases where N is 0 to 9. There may be custom color cycles that can also be parsed as a single color so the ValueError message is le...
2017-04-03T09:02:06Z
VIS: plot method cannot handle new 'C0'-like colors (matplotlib 2.0) matplotlib 2.0 introduced a few 2-character color abbreviations: C0, C1, C2, ... to refer to the colors of the current color cycle (very handy! this way you can refer to a color of the color cycle without hardcoding it, and use it as a shortcut for ...
This one is pretty old, but I'd love to revive it. I'm not sure how tests will cover this change. Is it alright if I give it a try anyway? sure! try adding. test with the code as above (u will check this plot works)
[ { "body": "matplotlib 2.0 introduced a few 2-character color abbreviations: C0, C1, C2, ... to refer to the colors of the current color cycle \r\n(very handy! this way you can refer to a color of the color cycle without hardcoding it, and use it as a shortcut for `color='tab:blue'` if you want the new blue inst...
ba30e3a2e376035549b009079d44ba5ca7a4c48f
{ "head_commit": "e2497222ecf64e07f4bd7873a1b860021b0b605c", "head_commit_message": "Added case color='' and support for mpl < 2.0", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt\nindex fa24c973a7549..f390e7eeb98bc 100644\n--- a/doc/source/whatsnew/v0.20.0.txt\...
[ { "diff_hunk": "@@ -217,10 +217,18 @@ def _maybe_valid_colors(colors):\n # check whether each character can be convertable to colors\n maybe_color_cycle = _maybe_valid_colors(list(colors))\n if maybe_single_color and maybe_color_cycle and len(colors) > 1:\n- msg = (\"'{0}' can...
9d15e7d36c7db2ea554849f9617a5684b2ccc646
diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt index ad190671cbbdc..a872bcee3ed12 100644 --- a/doc/source/whatsnew/v0.20.0.txt +++ b/doc/source/whatsnew/v0.20.0.txt @@ -342,6 +342,7 @@ Other Enhancements - The ``skiprows`` argument in ``pd.read_csv()`` now accepts a callable function as...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
psf__black-4294@3991948
psf/black
Python
4,294
GitHub Action: Allow reading version from pyproject.toml
### Description This adds an `use_pyproject` input to the GitHub Action that – when set to `true` – will read the black version from pyproject.toml file. Either from the `project.dependencies` array or one of the arrays from the `project.optional-dependencies` table. Closes: #4285 ### Checklist - did you ... ...
2024-03-30T10:38:04Z
GitHub Action: Option to parse version from pyproject.toml **Is your feature request related to a problem? Please describe.** When using black's GitHub action "psf/black", you need to specify the black version to use manually as an option to the action, in addition to specifying it in pyproject.toml. This can easily...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nWhen using black's GitHub action \"psf/black\", you need to specify the black version to use manually as an option to the action, in addition to specifying it in pyproject.toml. This can easily lead to inconsistencies between t...
836acad86371578527408a4c8f968cde1302e130
{ "head_commit": "39919481f1bf57e001189eb8b855721946a2bacd", "head_commit_message": "[pre-commit.ci] auto fixes from pre-commit.com hooks\n\nfor more information, see https://pre-commit.ci", "patch_to_review": "diff --git a/action.yml b/action.yml\nindex 49cd6b06e4c..d49dc4ac3a0 100644\n--- a/action.yml\n+++ b/ac...
[ { "diff_hunk": "@@ -13,12 +15,101 @@\n JUPYTER = os.getenv(\"INPUT_JUPYTER\") == \"true\"\n BLACK_ARGS = os.getenv(\"INPUT_BLACK_ARGS\", default=\"\")\n VERSION = os.getenv(\"INPUT_VERSION\", default=\"\")\n+USE_PYPROJECT = os.getenv(\"INPUT_USE_PYPROJECT\") == \"true\"\n+\n+BLACK_VERSION_RE = re.compile(r\"^bl...
000727571974200825e9f963564c25ba238bc01f
diff --git a/CHANGES.md b/CHANGES.md index 014aec77392..73b9954830a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -48,6 +48,9 @@ <!-- For example, Docker, GitHub Actions, pre-commit, editors --> +- Add a new option `use_pyproject` to the GitHub Action `psf/black`. This will read the + Black version from `pyproject....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
public-apis__public-apis-1593@97cb773
public-apis/public-apis
Python
1,593
Add check for checking duplicated links in README file
Add extra check into validate_links.py file to check if there are some duplicated links in the README file I create an ignored list for some duplicated links which are not related to any API link. There is this link `https://github.com/davemachado/public-api` in the README listed twice. Should we ignore it too? C...
2021-03-20T09:42:37Z
Add extra validation to check if more than two links are the same There should be a check in the validation to check if more than two links are the same. If they exist in the README the "merge" button should be blocked to merge the PR.
[ { "body": "There should be a check in the validation to check if more than two links are the same. \r\nIf they exist in the README the \"merge\" button should be blocked to merge the PR.\r\n\r\n", "number": 1592, "title": "Add extra validation to check if more than two links are the same" } ]
2174b22c9b756bd8343c4424ff3ca4d6e47b31a0
{ "head_commit": "97cb773f4517dfa04fa3b49b373b39e9461388dd", "head_commit_message": "Add check for checking duplicated links in README file\n\nCloses #1592", "patch_to_review": "diff --git a/build/validate_links.py b/build/validate_links.py\nindex ab36b0c840..c4eafce954 100755\n--- a/build/validate_links.py\n+++ ...
[ { "diff_hunk": "@@ -16,6 +21,29 @@ def parse_links(filename):\n links = [raw_link[0] for raw_link in raw_links]\n return links\n \n+def dup_links(links):\n+ \"\"\"Check for duplicated links\"\"\"\n+ print(f'Checking for duplicated links...')\n+ hasError = False\n+ seen = {}\n+ dupes = []\...
ed25ea30ac9ada949d553326576cd2b4b6b2f751
diff --git a/build/validate_format.py b/build/validate_format.py index 22fca30a2d..545fea2c9a 100755 --- a/build/validate_format.py +++ b/build/validate_format.py @@ -20,7 +20,6 @@ errors = [] title_links = [] -previous_links = [] anchor_re = re.compile(anchor + '\s(.+)') section_title_re = re.compile('\*\s\[(.*)...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
psf__black-4024@07be862
psf/black
Python
4,024
Fix long case blocks not split into multiple lines
### Description Fixes #3850 . > This note has been edited for readability and ease of future reference. Previously Black doesn't recognize `case` block as one of the syntax blocks need to be wrapped with invisible parentheses, and hence will also not be splitting the `case` blocks into multiple lines even when...
2023-11-04T23:32:38Z
Line too long: Many cases in case block **Describe the bug** Match patterns with lots of `|`-delimited alternatives are not split into multiple lines. **To Reproduce** ```python % cat longmatch.py match x: case "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "a...
While I was trying to fix this issue, I noticed that the rules for `case` is a bit different than the others: the [trailing comma rules ](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#trailing-commas) will not be activated on `case` E.g. Black will currently leave this piece of code ...
[ { "body": "**Describe the bug**\r\n\r\nMatch patterns with lots of `|`-delimited alternatives are not split into multiple lines.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\n% cat longmatch.py \r\nmatch x:\r\n case \"abcd\" | \"abcd\" | \"abcd\" | \"abcd\" | \"abcd\" | \"abcd\" | \"abcd\" | \"abcd\" | \"abcd\...
ecbd9e8cf71f13068c7e6803a534e00363114c91
{ "head_commit": "07be862e12f6fe736ad09b74945d05141998bdcf", "head_commit_message": "Add changes.md", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 5ce37943693..739550cd453 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -12,6 +12,8 @@\n - Fix crash when whitespace followed a backslash before new...
[ { "diff_hunk": "@@ -12,6 +12,8 @@\n - Fix crash when whitespace followed a backslash before newline in a docstring (#4008)\n \n - Fix crash on formatting code like `await (a ** b)` (#3994)\n+- Fix a bug that long `case` blocks will not be split into multiple lines, also enabled", "line": null, "original...
da296f35e7731fadc3e03d8f439015a96adf25b9
diff --git a/CHANGES.md b/CHANGES.md index b1fe25ef625..a847d737518 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,8 @@ indented less (#3964) - Multiline list and dict unpacking as the sole argument to a function is now also indented less (#3992) +- Fix a bug where long `case` blocks were not split into m...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
psf__black-4155@5346f29
psf/black
Python
4,155
fix: Don't allow unparenthesizing walruses
<!-- Hello! Thanks for submitting a PR. To help make things go a bit more smoothly we would appreciate that you go through this template. --> ### Description Resolves #3758. ### Checklist - did you ... <!-- If any of the following items aren't relevant for your contribution please still tick them so we kn...
2024-01-17T00:47:09Z
cannot parse assignment expression in preview style since 23.1 Hello, I seem to have found a bug in black's preview style regarding assignment expressions, that has been present since version 23.1.0. **Describe the bug** When using an assignment expression in my code example, black with preview=true complains ...
Thanks for reporting! I'm guessing we incorrectly remove the parentheses here. Should be an easy fix. Bisects to 658c8d8d96047c5ba77be4aecc2545a22d5e35b9 (#3440), cc @yilei
[ { "body": "Hello,\r\n\r\nI seem to have found a bug in black's preview style regarding assignment expressions, that has been present since version 23.1.0.\r\n\r\n**Describe the bug**\r\n\r\nWhen using an assignment expression in my code example, black with preview=true complains it cannot parse the line. Black ...
b7c3a9fedd4cfcc6a6a88aacc7b0f599b63d4716
{ "head_commit": "5346f2953a1b4287cb107a2dd1b41733366c46b2", "head_commit_message": "format\n\nSigned-off-by: RedGuy12 <paul@reid-family.org>", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 8fb8677dd77..2bd58ed49ff 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -22,6 +22,7 @@\n - Address a missi...
[ { "diff_hunk": "@@ -1545,6 +1555,10 @@ def maybe_make_parens_invisible_in_atom(\n and max_delimiter_priority_in_atom(node) >= COMMA_PRIORITY\n )\n or is_tuple_containing_walrus(node)\n+ or (\n+ Preview.wrap_long_dict_values_in_parens in mode", "line": null, ...
f3bb84770d1a193f78aab657232bd5e6e75f3bd1
diff --git a/CHANGES.md b/CHANGES.md index 8fb8677dd77..2bd58ed49ff 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ - Address a missing case in the change to allow empty lines at the beginning of all blocks, except immediately before a docstring (#4130) - For stubs, fix logic to enforce empty line after...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
psf__black-4270@cf5a091
psf/black
Python
4,270
Fix AST safety check false negative
Fixes #4268 Previously we would allow whitespace changes in all strings, now only in docstrings.
2024-03-09T15:14:59Z
AST safety check fails to catch incorrect f-string change **Describe the style change** I wonder if f-strings should be formatted at all. **Examples in the current _Black_ style** ```python print(f"{"|".join(['a','b','c'])}") ``` **Desired style** ```python print(f"{"|".join(['a','b','c'])}") ``` ...
Confirmed this bug: ``` % python3.12 -m black -c '''print(f"{"|".join(['a','b','c'])}")''' print(f"{" | ".join([a,b,c])}") ``` This is related to our lack of nested f-string support (#3746). I suppose our parser misparses this as two strings with an `|` operator in between, then we reformat it to add spaces ar...
[ { "body": "**Describe the style change**\r\n\r\nI wonder if f-strings should be formatted at all.\r\n\r\n**Examples in the current _Black_ style**\r\n\r\n```python\r\nprint(f\"{\"|\".join(['a','b','c'])}\")\r\n```\r\n\r\n**Desired style**\r\n\r\n```python\r\nprint(f\"{\"|\".join(['a','b','c'])}\")\r\n```\r\n\r\...
f03ee113c9f3dfeb477f2d4247bfb7de2e5f465c
{ "head_commit": "cf5a091fbe962c804c3451d0eeabed39c09acb16", "head_commit_message": "reverse", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex e28730a3b5f..1d20a4c9210 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -11,6 +11,10 @@\n <!-- Changes that affect Black's stable style -->\n \n - Don't mo...
[ { "diff_hunk": "@@ -215,6 +238,9 @@ def stringify_ast(node: ast.AST, depth: int = 0) -> Iterator[str]:\n normalized = value.rstrip()\n else:\n normalized = value\n- yield f\"{' ' * (depth + 2)}{normalized!r}, # {value.__class__.__name__}\"\n+ y...
2a6507797132d0bfa16de632fc0048f281a41dc8
diff --git a/CHANGES.md b/CHANGES.md index e28730a3b5f..1d20a4c9210 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ <!-- Changes that affect Black's stable style --> - Don't move comments along with delimiters, which could cause crashes (#4248) +- Strengthen AST safety check to catch more unsafe changes...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Style, Linting, Formatting Fixes" }
pandas-dev__pandas-14531@f6f87b6
pandas-dev/pandas
Python
14,531
ENH: merge_asof() has left_index/right_index and left_by/right_by (#14253)
- [x] closes #14253 - [x] tests added / passed - [x] passes `git diff upstream/master | flake8 --diff` - [x] whatsnew entry
2016-10-28T17:43:02Z
Add left_by/right_by and left_index/right_index to merge_asof() The current `merge_asof()` has only one parameter for `by`, assuming that both DataFrames have the same column name. It does have `left_on` and `right_on`, so perhaps something similar for `by` would be helpful. Also, there is no `left_index` or `right_in...
@chrisaycock can you show an example where they are meaningful? I did have them initially, but I couldn't come up with a good use case. In that the merge-asof is quite restricted in what you are doing with it and the API area pretty much covers it. The example I'm working through now is that my left table is indexed ...
[ { "body": "The current `merge_asof()` has only one parameter for `by`, assuming that both DataFrames have the same column name. It does have `left_on` and `right_on`, so perhaps something similar for `by` would be helpful.\n\nAlso, there is no `left_index` or `right_index` parameter in `merge_asof()`. Adding th...
3552dc0c4533a5eafafe859f5afd29a7ce063e03
{ "head_commit": "f6f87b65f8b1dc80defa88aa6f02e3b71b6c32bb", "head_commit_message": "ENH: merge_asof() has left_index/right_index and left_by/right_by (#14253)", "patch_to_review": "diff --git a/doc/source/whatsnew/v0.19.1.txt b/doc/source/whatsnew/v0.19.1.txt\nindex 3edb8c1fa9071..c968ed56c585f 100644\n--- a/doc...
[ { "diff_hunk": "@@ -731,21 +754,35 @@ def _get_merge_keys(self):\n right_keys.append(rk)\n join_names.append(None) # what to do?\n else:\n- right_keys.append(right[rk]._values)\n- join_names.append...
acad843dcdf717eea2418a22390d36f84398f3a7
diff --git a/doc/source/whatsnew/v0.19.1.txt b/doc/source/whatsnew/v0.19.1.txt index db5bd22393e64..545b4380d9b75 100644 --- a/doc/source/whatsnew/v0.19.1.txt +++ b/doc/source/whatsnew/v0.19.1.txt @@ -58,4 +58,4 @@ Bug Fixes - Bug in ``df.groupby`` causing an ``AttributeError`` when grouping a single index frame by a ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
psf__black-3368@45c1bf0
psf/black
Python
3,368
Prefer splitting right hand side of assignment statements.
<!-- Hello! Thanks for submitting a PR. To help make things go a bit more smoothly we would appreciate that you go through this template. --> ### Description When an assignment statement's left hand side fits on a single line, prefer splitting the right hand side's outer optional parens. Fixes #1498. ...
2022-10-31T22:42:21Z
Prefer expanding RHS of item assignment over LHS Hi guys, first of all thanks for this amazing tool! Glad to see it taking the Python world by storm. This is a fairly minor style change request. The formatting I take issue with occurs during item assignment. When the assignment exceeds the line length and the RHS...
FYI-- I'm working on a PR to make this change. https://github.com/psf/black/issues/445#issuecomment-1287537807 mentions the same issue where the LHS is a tuple.
[ { "body": "Hi guys, first of all thanks for this amazing tool! Glad to see it taking the Python world by storm.\r\n\r\nThis is a fairly minor style change request.\r\n\r\nThe formatting I take issue with occurs during item assignment. When the assignment exceeds the line length and the RHS has no \"required\" p...
a2821815af5f5a706c673279d6405e286d6e95b8
{ "head_commit": "45c1bf0d2eb24de3fe08ee7b127a317db1839507", "head_commit_message": "Merge branch 'main' into tuple", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 1a7c320baf8..9868349c9a8 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -70,6 +70,8 @@\n present) or as a single newline character...
[ { "diff_hunk": "@@ -631,6 +644,22 @@ def right_hand_split(\n \n Note: running this function modifies `bracket_depth` on the leaves of `line`.\n \"\"\"\n+ rhs_result = _first_right_hand_split(line, omit=omit)\n+ yield from _maybe_split_omitting_optional_parens(\n+ rhs_result, line, line_leng...
bcc807595b8a29bd7a4eeb565433200e0647377c
diff --git a/CHANGES.md b/CHANGES.md index 1a7c320baf8..9868349c9a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -70,6 +70,8 @@ present) or as a single newline character (if a newline is present) (#3348) - Implicitly concatenated strings used as function args are now wrapped inside parentheses (#3307) +- For assi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-3594@6964056
psf/black
Python
3,594
Support files with type comment syntax errors
### Description Resolves #3593 ### Checklist - did you ... - [x] Add an entry in `CHANGES.md` if necessary? - [x] Add / update tests if necessary? - [x] Add new / update outdated documentation?
2023-03-04T06:56:50Z
Let black run on files even if `ast.parse` with `type_comments=True` fails **Is your feature request related to a problem? Please describe.** Right now, if a file parsing because of invalid type comments (even if the code runs just fine), black won't format the file. For example: ```python import typing de...
If the change is approved, I can work on the PR as well. Makes sense to me. We should try `ast.parse(type_comments=False)` only as a fallback, so performance won't be impacted for the case where `type_comments=True` parses correctly.
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nRight now, if a file parsing because of invalid type comments (even if the code runs just fine), black won't format the file.\r\n\r\nFor example:\r\n\r\n```python\r\nimport typing\r\n\r\ndef foo(\r\n # type: typing.List\r\n ...
6ffc5f7b01eab341f1b2cd373b6faed0072a2351
{ "head_commit": "69640562aa398f528856ce91889330a10dfa83bf", "head_commit_message": "Fix typed_ast usage in <=3.7", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex a8b556cb7e8..bdc1459d6e2 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -29,6 +29,8 @@\n \n <!-- Changes to the parser or to version a...
[ { "diff_hunk": "@@ -175,11 +180,17 @@ def parse_ast(src: str) -> Union[ast.AST, ast3.AST]:\n first_error = \"\"\n for version in sorted(versions, reverse=True):\n try:\n- return parse_single_version(src, version)\n+ return parse_single_version(src, version, type_comments=Tr...
c11c3ebd6781a417bd557aa82a5eec3c2ae1c9c0
diff --git a/CHANGES.md b/CHANGES.md index 2fa0cb41b38..6aa9e2207b9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -31,6 +31,8 @@ <!-- Changes to the parser or to version autodetection --> +- Added support for formatting files with invalid type comments (#3594) + ### Performance <!-- Changes that improve Black's ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
psf__black-3209@f2d349f
psf/black
Python
3,209
Strip trailing commas in subscripts with -C
Fixes #2296, #3204
2022-08-05T04:14:09Z
black doesn't remove ugly trailing commas in subscripts **Describe the bug** We recently added `--skip-magic-trailing-comma` to black. When running with this option, we'd like it to always remove ugly unnecessary trailing commas that plagued some earlier versions of black, but it doesn't do this in the case of subsc...
[ { "body": "**Describe the bug**\r\n\r\nWe recently added `--skip-magic-trailing-comma` to black. When running with this option, we'd like it to always remove ugly unnecessary trailing commas that plagued some earlier versions of black, but it doesn't do this in the case of subscripts.\r\n\r\n**To Reproduce**\r\...
507234c47d39f5b1d8289cdd49994e03dd97bcb4
{ "head_commit": "f2d349fae5ddab0553611e380b127240aa8eb394", "head_commit_message": "srsly okay okay okay okay", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 5b29f20bfff..5e4286cf65e 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -24,6 +24,8 @@\n this is invalid. This was a bug introduced in ...
[ { "diff_hunk": "@@ -301,8 +303,22 @@ def has_magic_trailing_comma(\n \n if not ensure_removable:\n return True\n+\n comma = self.leaves[-1]\n- return bool(comma.parent and comma.parent.type == syms.listmaker)\n+ if comma.parent is None:\n+ ...
4cab5c77cbfa03ce32b7e666e7561f12785c0834
diff --git a/CHANGES.md b/CHANGES.md index 5b29f20bfff..5e4286cf65e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,8 @@ this is invalid. This was a bug introduced in version 22.6.0. (#3166) - `--skip-string-normalization` / `-S` now prevents docstring prefixes from being normalized as expected (#3168) +- ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
psf__black-3035@549a094
psf/black
Python
3,035
Remove newline after code block open
### Description Fixes #902 Newlines are great. They help us organize our code and leave room for the coders and reviewers to breath. However, too many newlines can make simple code gigantic and massive. This is unnecessary in a lot of cases. I want to argue that having a newline right after `def` is redundant...
2022-04-25T09:17:58Z
Black should enforce zero empty leading lines in function body Operating system: playground Python version: playground *Black* version: master Consider following code snippet: ```python class X: def f(self, x): return x**2 ``` When class definition is formatted,...
I would assume this should also apply to classes, and I'd go as far as to say that all blocks should have their leading vertical whitespace removed, for example: ```python if a: b ``` But they could surely be taken care of in separate issues. More like a mental note for now. That sounds right I can't thi...
[ { "body": "Operating system: playground\r\nPython version: playground\r\n*Black* version: master\r\n\r\nConsider following code snippet:\r\n```python\r\nclass X:\r\n \r\n \r\n def f(self, x):\r\n \r\n \r\n return x**2\r\n```\r\n\r\nWhen class definition is formatted, empty lines be...
fdb01f8622de9394fe9d8ee149985d365ca1419f
{ "head_commit": "549a094f6f02776b28b362bc87540e5ea41f5a0d", "head_commit_message": "Added more tests", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 566077b1dbc..19b4eef9a8c 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -12,6 +12,7 @@\n \n - Fix unstable formatting involving `# fmt: skip` comm...
[ { "diff_hunk": "@@ -12,6 +12,7 @@\n \n - Fix unstable formatting involving `# fmt: skip` comments without internal spaces\n (#2970)\n+- trailing newlines are removed right after `def` statement (#3035)", "line": null, "original_line": 15, "original_start_line": null, "path": "CHANGES.md", ...
ee5888ba9f971039ebad003a678dfb58c9f47e7d
diff --git a/AUTHORS.md b/AUTHORS.md index 8aa6263313e..faa2b05840f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -148,6 +148,7 @@ Multiple contributions by: - [Rishikesh Jha](mailto:rishijha424@gmail.com) - [Rupert Bedford](mailto:rupert@rupertb.com) - Russell Davis +- [Sagi Shadur](mailto:saroad2@gmail.com) - [Rémi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-2942@a6b21b9
psf/black
Python
2,942
Avoid magic-trailing-comma in single-element subscripts
### Description Closes #2918. Ignores magic-trailing-comma for single-element subscripts. ### Checklist - did you ... <!-- If any of the following items aren't relevant for your contribution please still tick them so we know you've gone through the checklist. All user-facing changes should get an ...
2022-03-18T17:10:00Z
Avoid magic-trailing-comma newline in `tuple[int,]`, like tuple literal `(1,)` Black exempts single-element tuple literals from the usual handling of magic trailing commas: `(1,)` will *not* have a newline added (as would happen for lists, sets, etc.). I'd like to be able to write type annotations for a tuple-of-o...
That's a good idea! I like it because it makes for an unambiguous way to write a single-element tuple type; whenever I see `tuple[int]` I feel like the author may well have meant `tuple[int, ...]`.
[ { "body": "Black exempts single-element tuple literals from the usual handling of magic trailing commas: `(1,)` will *not* have a newline added (as would happen for lists, sets, etc.). \r\n\r\nI'd like to be able to write type annotations for a tuple-of-one-element in the same way, so that I can write either `...
5379d4f3f460ec9b7063dd1cc10f437b0edf9ae3
{ "head_commit": "a6b21b95eeb792f929c3bb63aca4bc5ebb9bc68f", "head_commit_message": "Update CHANGES.md", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex bb3ccb9ed9f..7da42223e7d 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -14,6 +14,8 @@\n \n <!-- Changes that affect Black's preview style -->\n ...
[ { "diff_hunk": "@@ -268,6 +273,20 @@ def has_magic_trailing_comma(\n return True\n \n if closing.type == token.RSQB:\n+ if (\n+ Preview.one_tuple_type in self.mode\n+ and is_within_annotation(closing)\n+ and closing.opening_bracket\n+ ...
b3afa72eb26d2f06912b2058d06ba9d8adcbb971
diff --git a/CHANGES.md b/CHANGES.md index d0faf7cecb9..d753a24ff77 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ <!-- Changes that affect Black's preview style --> - Code cell separators `#%%` are now standardised to `# %%` (#2919) +- Avoid magic-trailing-comma in single-element subscripts (#2942) ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-2991@9a2de75
psf/black
Python
2,991
Remove redundant parentheses around awaited coroutines/tasks
### Description Closes #275. Remove redundant parentheses around awaited coroutines/tasks. This is a tricky one as `await` is technically an expression and therefore in certain situations requires brackets for operator precedence. However, the vast majority of `await` usage is just `await some_coroutine(...)` and ...
2022-04-04T13:21:40Z
Should `await` automatically manage parentheses like `return`? On a first glance, it would be better. On another though, `await` is an expression which can potentially complicate formattings that are now rather simple. Alternatively, `await` should be ignored by an existing bracket pair for purposes of splitting on ...
Concrete example: ``` % black -c 'return (a)' return a % black -c 'await (a)' await (a) ```
[ { "body": "On a first glance, it would be better. On another though, `await` is an expression which can potentially complicate formattings that are now rather simple.\r\n\r\nAlternatively, `await` should be ignored by an existing bracket pair for purposes of splitting on delimiters, enabling for example fluent ...
98fcccee55acba04afdd933676f56927cfe9bbe4
{ "head_commit": "9a2de75c974c1a24aefc3c7d0b66e9a110d5a6a5", "head_commit_message": "await brackets", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 30c00566b3c..449c9fb6d85 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -14,6 +14,7 @@\n \n <!-- Changes that affect Black's preview style -->\n \n+...
[ { "diff_hunk": "@@ -14,6 +14,7 @@\n \n <!-- Changes that affect Black's preview style -->\n \n+- Parentheses around awaited coroutines/tasks are now managed (#2991)", "line": null, "original_line": 17, "original_start_line": null, "path": "CHANGES.md", "start_line": null, "text": "@user1...
ee470d6f54c4a83afaaf5b4f50abff4800a81974
diff --git a/CHANGES.md b/CHANGES.md index c631aec7a3b..e168e24d76e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ <!-- Changes that affect Black's preview style --> +- Remove redundant parentheses around awaited objects (#2991) - Parentheses around return annotations are now managed (#2990) - Remove...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-2939@d4fb955
psf/black
Python
2,939
Remove unnecessary parentheses from `except` clauses
<!-- Hello! Thanks for submitting a PR. To help make things go a bit more smoothly we would appreciate that you go through this template. --> ### Description Closes #2937. As described in the issue we want to remove redundant parentheses from `except` clauses. ### Checklist - did you ... - [X] Add a C...
2022-03-18T14:42:45Z
Remove redundant brackets from `except` clause **Is your feature request related to a problem? Please describe.** The except clause can accept a parenthesised tuple of exceptions. However, in the case of only a single exception the brackets should be removed. Black currently leaves both of these examples unchange...
Agree, this goes with a lot of other cases where we should remove redundant parens. Not sure about the tuple case; that would also change the AST.
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nThe except clause can accept a parenthesised tuple of exceptions. However, in the case of only a single exception the brackets should be removed.\r\n\r\nBlack currently leaves both of these examples unchanged:\r\n```\r\na = 1\r...
14d84ba2e96c5ca1351b8fe4d0d415cc148f4117
{ "head_commit": "d4fb95587f80a55a58c859720558bb4fbe08f446", "head_commit_message": "Remove unnecessary parentheses from Except clauses", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex bb3ccb9ed9f..f7fdd1db3d4 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -14,6 +14,8 @@\n \n <!-- Changes that af...
[ { "diff_hunk": "@@ -127,6 +127,7 @@ class Preview(Enum):\n \"\"\"Individual preview style features.\"\"\"\n \n string_processing = auto()\n+ remove_except_parens = auto()", "line": null, "original_line": 130, "original_start_line": null, "path": "src/black/mode.py", "start_line": ...
4da6d575ac5e0a6b8fc26a434cbb6f2de4630389
diff --git a/CHANGES.md b/CHANGES.md index b2325b648f9..d34bd4ead58 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ <!-- Changes that affect Black's preview style --> - Code cell separators `#%%` are now standardised to `# %%` (#2919) +- Remove unnecessary parentheses from `except` statements (#2939) - ...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-2919@22a0d08
psf/black
Python
2,919
dont skip formatting #%%
<!-- Hello! Thanks for submitting a PR. To help make things go a bit more smoothly we would appreciate that you go through this template. --> ### Description <!-- Good things to put here include: reasoning for the change (please link any relevant issues!), any noteworthy (or hacky) choices to be aware...
2022-03-14T09:54:05Z
black didn't format the cell note **Describe the style change** <!-- A clear and concise description of how the style can be improved. --> **Examples in the current _Black_ style** <!-- Think of some short code snippets that show how the current _Black_ style is not great: --> ```python #%% this is a cel...
Looks like this is intentional from https://github.com/psf/black/commit/c6c8ef76a4d991cd8a7a3b00a816b6db72ecdf04 , as `#%%` has a special meaning in the Spyder IDE I use vscode to write my code, and in vscode, the default note of cell is "# %%", rather than "#%%". And in spyder, "# %%" also can be distinguished as the ...
[ { "body": "**Describe the style change**\r\n\r\n<!-- A clear and concise description of how the style can be\r\nimproved. -->\r\n\r\n**Examples in the current _Black_ style**\r\n\r\n<!-- Think of some short code snippets that show\r\nhow the current _Black_ style is not great: -->\r\n\r\n```python\r\n#%% this i...
71e71e5f52e5f6bdeae63cc8c11b1bee44d11c30
{ "head_commit": "22a0d086ef28f6336c97df16738e5950b8a12426", "head_commit_message": "use self.mode.preview", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex edca0dcdad4..dad60053a88 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -14,6 +14,8 @@\n \n <!-- Changes that affect Black's preview style --...
[ { "diff_hunk": "@@ -0,0 +1,101 @@\n+# The percent-percent comments are Spyder IDE cells.\n+# Both `#%%`` and `# %%` are accepted, so `black` standardises\n+# to the latter.\n+\n+#%%\n+def func():\n+ x = \"\"\"\n+ a really long string\n+ \"\"\"\n+ lcomp3 = [", "line": null, "original_line": 1...
e8ee4d5ef8811bafe4caaee37c3d1efb4bf4cf32
diff --git a/CHANGES.md b/CHANGES.md index edca0dcdad4..dad60053a88 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,8 @@ <!-- Changes that affect Black's preview style --> +- Code cell separators `#%%` are now standardised to `# %%` (#2919) + ### _Blackd_ <!-- Changes to blackd --> diff --git a/src/black...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-2725@a963292
psf/black
Python
2,725
CI: add diff-shades integration
### Description After a few months worth of work, [diff-shades](https://github.com/ichard26/diff-shades) and the psf/black integration is now ready to be reviewed! If you've living under a rock then just take [one look at this comment on the mypy repository](https://github.com/python/mypy/pull/11717#issuecomment-992...
2021-12-23T21:51:42Z
Add a GitHub Action that runs `gallery` against a list of notable projects We should be running `gallery` against a list of notable projects in a GitHub Action on any commit and any pull request. ### A commit to master It should run `black` twice: using the *latest released version* and *the current master*; and di...
So I've started on this - I've wrote a tool `black-primer` that will run whatever black is in PATH in parallel at a level the runner can configure. This will enable us to run with Current Master then compare with stable / latest release on CI by uninstalling the editable / TOT version and `pip install black` ... ...
[ { "body": "We should be running `gallery` against a list of notable projects in a GitHub Action on any commit and any pull request.\r\n\r\n### A commit to master\r\nIt should run `black` twice: using the *latest released version* and *the current master*; and diff the codebases. This will allow us to identify w...
f0a99f640279adade284eba592630c67ad374574
{ "head_commit": "a963292a1c14c964f101776fe16df9046fc1feaa", "head_commit_message": "Add even more docs and minor cleanup", "patch_to_review": "diff --git a/.github/workflows/diff_shades.yml b/.github/workflows/diff_shades.yml\nnew file mode 100644\nindex 00000000000..b6a9b3355fb\n--- /dev/null\n+++ b/.github/wor...
[ { "diff_hunk": "@@ -40,3 +40,56 @@ If you're running locally yourself to test black on lots of code try:\n ```{program-output} black-primer --help\n \n ```\n+\n+## diff-shades\n+\n+diff-shades is a tool similar to black-primer, it also runs _Black_ across a list of Git\n+cloneable OSS projects recording the res...
aab8f28826aa8fee3900c342bf5cd893bad842bb
diff --git a/.github/workflows/diff_shades.yml b/.github/workflows/diff_shades.yml new file mode 100644 index 00000000000..b6a9b3355fb --- /dev/null +++ b/.github/workflows/diff_shades.yml @@ -0,0 +1,134 @@ +name: diff-shades + +on: + push: + branches: [main] + paths-ignore: ["docs/**", "tests/**", "*.md"] + + ...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Test Suite / CI Enhancements" }