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
xorbitsai__inference-1168@f3ada96
xorbitsai/inference
Python
1,168
FEAT: OAuth system supports api-key
The built-in permission system now supports API key authentication. Fixes #918
2024-03-21T02:28:24Z
Any further plan to add access key for rest API call As mentioned in title . Model services are exposed by http reuqest for many cases, seems there is no palce in system to add authentication in http request (like the bare token in openai ), or it's already in the system? Any related infomation/documentation is...
We have implemented [OAuth2 system](https://inference.readthedocs.io/en/latest/user_guide/auth_system.html) in #793 , access key will be supported in the next two to three versions. > We have implemented [OAuth2 system](https://inference.readthedocs.io/en/latest/user_guide/auth_system.html) in #793 , access key will be...
[ { "body": "As mentioned in title .\r\n\r\nModel services are exposed by http reuqest for many cases, seems there is no palce in system to add authentication in http request (like the bare token in openai ), or it's already in the system?\r\n\r\nAny related infomation/documentation is welcomed !!!", "numbe...
31032869b5e1f9a0915723d9e689a3a55eb9c9d0
{ "head_commit": "f3ada96298b9d5f98f25547857e3b35452b5480a", "head_commit_message": "bug fix", "patch_to_review": "diff --git a/doc/source/development/contributing_environment.rst b/doc/source/development/contributing_environment.rst\nindex 80aa266dfb..25ee11cc71 100644\n--- a/doc/source/development/contributing_...
[ { "diff_hunk": "@@ -67,22 +88,33 @@ def __call__(\n headers={\"WWW-Authenticate\": authenticate_value},\n )\n \n+ through_api_key = False\n+\n try:\n assert self._config is not None\n- payload = jwt.decode(\n- token,\n- self...
5acf72f6438e18f3c739e436b8456b94eff3ea79
diff --git a/doc/source/development/contributing_environment.rst b/doc/source/development/contributing_environment.rst index 80aa266dfb..25ee11cc71 100644 --- a/doc/source/development/contributing_environment.rst +++ b/doc/source/development/contributing_environment.rst @@ -8,7 +8,7 @@ Creating a development environmen...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
xorbitsai__inference-2079@5ae18b2
xorbitsai/inference
Python
2,079
Feat: Support internvl2 and internvl stream
2024-08-13T09:57:28Z
intervl2不支持流式请求 ### System Info / 系統信息 cuda 11.8 python3.9 xinference 0.14.0 ### Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece? - [X] docker / docker - [ ] pip install / 通过 pip install 安装 - [ ] installation from source / 从源码安装 ### Version info / 版本信息 0.14.0 ### The command used to start Xinferenc...
另,internvl2 的 usage 返回 tokens 都是 -1,希望能正确返回。 This issue is stale because it has been open for 7 days with no activity.
[ { "body": "### System Info / 系統信息\n\ncuda 11.8\r\npython3.9 \r\nxinference 0.14.0\n\n### Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?\n\n- [X] docker / docker\n- [ ] pip install / 通过 pip install 安装\n- [ ] installation from source / 从源码安装\n\n### Version info / 版本信息\n\n0.14.0\n\n### The command us...
f5229a2354cd1592abdd8f3c757fc02be90a744c
{ "head_commit": "5ae18b28764237b353f12520b18eff114c26d36f", "head_commit_message": "fix bug", "patch_to_review": "diff --git a/xinference/model/llm/__init__.py b/xinference/model/llm/__init__.py\nindex 749596fdbe..93342e86b5 100644\n--- a/xinference/model/llm/__init__.py\n+++ b/xinference/model/llm/__init__.py\n...
[ { "diff_hunk": "@@ -28,6 +29,8 @@\n Union,\n )\n \n+from transformers import AutoTokenizer", "line": null, "original_line": 32, "original_start_line": null, "path": "xinference/model/llm/vllm/core.py", "start_line": null, "text": "@user1:\n`transformers` is an optional dependency, so...
e1afe8f15c1d0e974077fcafca1d2eab1a66f24f
diff --git a/xinference/model/llm/__init__.py b/xinference/model/llm/__init__.py index 7b41e0b776..6d06b0ecaa 100644 --- a/xinference/model/llm/__init__.py +++ b/xinference/model/llm/__init__.py @@ -127,7 +127,7 @@ def _install(): from .transformers.minicpmv26 import MiniCPMV26Model from .transformers.qwen_vl...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
sympy__sympy-27708@5224812
sympy/sympy
Python
27,708
Fix ask(Q.finite(x**-1), Q.real(x)) to handle potential division by zero
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2025-03-06T21:49:55Z
ask(Q.finite(x**-1), Q.real(x)) incorrectly returns True, ignoring potential division by zero **Description:** There is an issue with the handling of assumptions for the expression x**-1 when x is real and could potentially be zero. The current implementation doesn't account for the possibility of x being zero, which ...
[ { "body": "**Description:**\n\nThere is an issue with the handling of assumptions for the expression x**-1 when x is real and could potentially be zero. The current implementation doesn't account for the possibility of x being zero, which leads to an incorrect result.\n\n**Current behavior:**\n\n```\nfrom sympy...
715492717df410968e83efdd35a9ed135f2ec2de
{ "head_commit": "5224812d50ae2f7c32dabfdaba9ff971bc085ed4", "head_commit_message": "Added tests", "patch_to_review": "diff --git a/sympy/assumptions/handlers/calculus.py b/sympy/assumptions/handlers/calculus.py\nindex bb4f387eb582..43b0a62bf341 100644\n--- a/sympy/assumptions/handlers/calculus.py\n+++ b/sympy/as...
[ { "diff_hunk": "@@ -195,6 +195,8 @@ def _(expr, assumptions):\n if base_bounded is False and ask(Q.extended_nonzero(expr.exp), assumptions):\n return False\n if base_bounded and exp_bounded:\n+ if ask(Q.zero(expr.base),assumptions) is not False and ask(Q.negative(expr.exp),assumptions) is...
45c9656c09d62a53d5b69c844c6aecc873e72489
diff --git a/sympy/assumptions/handlers/calculus.py b/sympy/assumptions/handlers/calculus.py index bb4f387eb582..e2b9c43ccea2 100644 --- a/sympy/assumptions/handlers/calculus.py +++ b/sympy/assumptions/handlers/calculus.py @@ -195,6 +195,12 @@ def _(expr, assumptions): if base_bounded is False and ask(Q.extended_n...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-27666@a49f2ba
sympy/sympy
Python
27,666
Fix: Improve Q.infinite(Expr) handling for symbolic conditions and complex infinity
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2025-02-26T23:34:57Z
ask(Q.infinite(I*oo)) gives None The `Q.infinite` predicate returns `None` for expressions like `1 + I * oo`, which involve complex numbers where the imaginary part is infinite. This behavior is unexpected because the magnitude of the complex number should be considered infinite due to the presence of `I * oo`. **...
The Q.infinite predicate in SymPy is designed to identify expressions that are explicitly infinite, such as oo, -oo, or zoo (complex infinity). In your example, 1 + I * oo, the expression combines a finite real part (1) with an infinite imaginary part (I * oo). SymPy does not automatically interpret this combination as...
[ { "body": "The `Q.infinite` predicate returns `None` for expressions like `1 + I * oo`, \nwhich involve complex numbers where the imaginary part is infinite. \n\nThis behavior is unexpected because the magnitude of the complex number should be \nconsidered infinite due to the presence of `I * oo`.\n\n**Expected...
ee3c38aea07e53d42808dd89f1bf6fe5823ec6b8
{ "head_commit": "a49f2baa63d3f59cfd4b0928a4c06554a22dae62", "head_commit_message": "Removed whitespace", "patch_to_review": "diff --git a/sympy/assumptions/handlers/calculus.py b/sympy/assumptions/handlers/calculus.py\nindex 263bed6da00c..aac68c7d875d 100644\n--- a/sympy/assumptions/handlers/calculus.py\n+++ b/s...
[ { "diff_hunk": "@@ -232,6 +232,15 @@ def _(expr, assumptions):\n return True\n \n \n+@InfinitePredicate.register(Expr)\n+def _(expr, assumptions):\n+ if assumptions is True:\n+ result = ask(~Q.finite(expr))\n+ else:\n+ result = ask(~Q.finite(expr),assumptions)\n+ return result", "...
a021d8d9a0da6582a518c1bb9bcad79057c6b36f
diff --git a/sympy/assumptions/handlers/calculus.py b/sympy/assumptions/handlers/calculus.py index 263bed6da00c..c685b16cfe35 100644 --- a/sympy/assumptions/handlers/calculus.py +++ b/sympy/assumptions/handlers/calculus.py @@ -4,7 +4,7 @@ """ from sympy.assumptions import Q, ask -from sympy.core import Add, Mul, Po...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xorbitsai__inference-793@17cc512
xorbitsai/inference
Python
793
FEAT: Simple OAuth2 system
Fixes #698 <img width="1849" alt="image" src="https://github.com/xorbitsai/inference/assets/109656400/69156198-e6d0-4094-8c1a-3b9251d4175c"> <img width="1288" alt="image" src="https://github.com/xorbitsai/inference/assets/109656400/663fd072-fb37-46a4-9131-deb0009d7603"> # Detail 1. add `--auth-config` opti...
2023-12-20T10:42:14Z
Provide some authentication mechanism for UI and API ### Is your feature request related to a problem? Please describe Currently anyone with the xinference URL can make requests and add/remove models. I need a little more control. It does not have to be necessarily very sophisticated initially, some sort of shared sec...
Yes, it's in our roadmap, and we plan to implement it within next two to three releases. Suggestions are welcome. I'll provide some suggestions but first I want to repeat that I could use a very simple mechanism initially like I described above. But if we are talking more full fledged mechanism then here are some th...
[ { "body": "### Is your feature request related to a problem? Please describe\r\nCurrently anyone with the xinference URL can make requests and add/remove models. I need a little more control. It does not have to be necessarily very sophisticated initially, some sort of shared secret would do, although if you gu...
ab575c413b0a28c338b9ca1d9cccb51276ceed9d
{ "head_commit": "17cc512ad1e7df492c2c4611b8256d9fcae6ea3e", "head_commit_message": "Add chinese doc for Oauth2", "patch_to_review": "diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml\nindex b5f969f797..70fa563fed 100644\n--- a/.github/workflows/python.yaml\n+++ b/.github/workflows/python...
[ { "diff_hunk": "@@ -0,0 +1,225 @@\n+# SOME DESCRIPTIVE TITLE.\n+# Copyright (C) 2023, Xorbits Inc.\n+# This file is distributed under the same license as the Xinference package.\n+# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.\n+#\n+#, fuzzy\n+msgid \"\"\n+msgstr \"\"\n+\"Project-Id-Version: Xinference \\n\"\n+\"Report-...
18d7007f3dcbdd8c370ef51806d31eaf0916ac62
diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b5f969f797..70fa563fed 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -128,6 +128,8 @@ jobs: ${{ env.SELF_HOST_PYTHON }} -m pip install -U modelscope ${{ env.SELF_HOST_PYTHON }} ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Security Patches / Vulnerability Fixes" }
sympy__sympy-27577@857ca2b
sympy/sympy
Python
27,577
polys: Add PuiseuxRing and remove the ring cache
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2025-02-09T15:12:47Z
memory leak, not a cache issue Hello I have the following code that uses the latest sympy (1.11.1) tested with python 3.8.10 on Windows 10 and with python 3.11.1 on macOS 13.1, the memory is constantly growing. Any ideas why? ``` from sympy import Point, Ray, Circle while True: circle = Circle(Point(0.0, 0...
I can reproduce this but no idea why it happens. Clearing the cache doesn't help. Calling `gc.collect` doesn't help. With this diff the memory usage stays constant: ```diff diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py index 0c1c5d0..35d92af 100644 --- a/sympy/geometry/ellipse.py +++ b/sympy/g...
[ { "body": "Hello\r\n\r\nI have the following code that uses the latest sympy (1.11.1) tested with python 3.8.10 on Windows 10 and with python 3.11.1 on macOS 13.1, the memory is constantly growing. Any ideas why?\r\n\r\n```\r\nfrom sympy import Point, Ray, Circle\r\nwhile True:\r\n circle = Circle(Point(0.0,...
b5646b90853edbacd6406447efd4a5c302bde16a
{ "head_commit": "857ca2ba78d0023e39868c4cba0d675544183beb", "head_commit_message": "fix(integrals): Fix PRDE inexact division\n\nIn the risch integrator Poly.quo_ground was used when the ground domain\nwas a ring leading to an invalid PolyElement with negative exponent.\nThis commit converts the ground domain to a...
[ { "diff_hunk": "@@ -0,0 +1,795 @@\n+\"\"\"\n+Puiseux rings. These are used by the ring_series module to represented\n+truncated Puiseux series. Elements of a Puiseux ring are like polynomials\n+except that the exponents can be negative or rational rather than just\n+non-negative integers.\n+\"\"\"\n+\n+# Previo...
6cfcf8e0f8e17ca2d3b1b48b0466def48a714d35
diff --git a/doc/src/modules/polys/ringseries.rst b/doc/src/modules/polys/ringseries.rst index 43d5a9e6ce7e..0a57ede91961 100644 --- a/doc/src/modules/polys/ringseries.rst +++ b/doc/src/modules/polys/ringseries.rst @@ -35,47 +35,22 @@ Taylor series, we extend it to allow Laurent and even Puiseux series (with fractiona...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-27524@67e24d4
sympy/sympy
Python
27,524
Fix: Return None in finite predicate Mul expression when a finite argument’s nonzero status is indeterminate
## Fixes #27447 #### Brief description of what is fixed or changed Previously, in a Mul expression, if any argument was unbounded (infinite), the result would immediately be False, ignoring cases where a finite argument could be zero. However, if the finite argument is zero, the correct result should be None (undef...
2025-01-29T11:50:46Z
ask(Q.finite(f * i)) wrongly returns False (for finite f and infinite i) ```python >>>f = Symbol('f', finite=True) >>>i = Symbol('i', infinite=True) >>>ask(Q.finite(f * i)) False ``` ~~An infinite number times zero is zero as far as I'm aware. So since zero is a finite number, this behavior is incorrect.~~ An infinite...
> An infinite number times zero is zero as far as I'm aware. I would say that it is undefined. A useful thing to check is how sympy itself evaluates these things. The assumption system should be consistent with the evaluation rules. In this case: ``` In [1]: 0*oo Out[1]: nan ``` Should this be considered a bug then? S...
[ { "body": "```python\n>>>f = Symbol('f', finite=True)\n>>>i = Symbol('i', infinite=True)\n>>>ask(Q.finite(f * i))\nFalse\n```\n\n~~An infinite number times zero is zero as far as I'm aware. So since zero is a finite number, this behavior is incorrect.~~\nAn infinite number times zero is undefined, so the above ...
f07466ae38d6f7985c4e9eec2c7dfff43fec3cf7
{ "head_commit": "67e24d47fea04eca26846713d1019b0d8fdbb118", "head_commit_message": "remove failing test from test-issue-27447. Make the separate xfail function for failing test issue 27662", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 46892edcb46f..614f0d5712e2 100644\n--- a/.mailmap\n+++ b/.mail...
[ { "diff_hunk": "@@ -151,10 +151,14 @@ def _(expr, assumptions):\n * /s = not signed\n \"\"\"\n result = True\n+ possible_zero = False\n for arg in expr.args:\n _bounded = ask(Q.finite(arg), assumptions)\n if _bounded:\n- continue\n+ if ask(Q.zero(arg)...
278c80d818e45816400c384d9e7f35c79045f1f4
diff --git a/.mailmap b/.mailmap index 46892edcb46f..614f0d5712e2 100644 --- a/.mailmap +++ b/.mailmap @@ -771,6 +771,7 @@ Jason Ross <jasonross1024@gmail.com> Jason Siefken <siefkenj@gmail.com> Jason Tokayer <jason.tokayer@gmail.com> Jason Tokayer <jason.tokayer@gmail.com> <jason.tokayer@capitalone.com> +Jatin Bhar...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xorbitsai__inference-616@333bd7e
xorbitsai/inference
Python
616
ENH: cache status
Resolves #592 Introduce `cache_status` into the output of `list_model_registrations`. For LLMs, `cache_status` will be incorporated into each model's specification. For PyTorch models, this will be a boolean value. For GGML models, it will manifest as a list of booleans to reflect the status across various quant...
2023-11-06T09:59:12Z
ENH: let users know if the model is cached or not ### Is your feature request related to a problem? Please describe The describe model API should indicate to the caller whether the model has been cached. Additionally, updates are required for the web UI: - A "cached" tag should be added to the model card if the mo...
[ { "body": "### Is your feature request related to a problem? Please describe\r\nThe describe model API should indicate to the caller whether the model has been cached.\r\n\r\nAdditionally, updates are required for the web UI:\r\n- A \"cached\" tag should be added to the model card if the model has been cached.\...
e8e189568397b6c76f9942e25c5fb6d74258102e
{ "head_commit": "333bd7ec43ada87405fa499cd8428e3d281cdc1a", "head_commit_message": "UT", "patch_to_review": "diff --git a/xinference/api/restful_api.py b/xinference/api/restful_api.py\nindex 9075d48479..930b1b37ee 100644\n--- a/xinference/api/restful_api.py\n+++ b/xinference/api/restful_api.py\n@@ -23,7 +23,16 @...
[ { "diff_hunk": "@@ -102,46 +106,91 @@ def get_status(self) -> Dict:\n \"workers\": self._worker_status,\n }\n \n+ @staticmethod\n+ def _to_llm_reg(llm_family: \"LLMFamilyV1\", is_builtin: bool) -> Dict[str, Any]:", "line": null, "original_line": 110, "original_start_line": ...
c5462cc8fb92d6175ef6ddb970e5836b9de7da86
diff --git a/xinference/api/restful_api.py b/xinference/api/restful_api.py index 9075d48479..930b1b37ee 100644 --- a/xinference/api/restful_api.py +++ b/xinference/api/restful_api.py @@ -23,7 +23,16 @@ import gradio as gr import xoscar as xo -from fastapi import APIRouter, FastAPI, File, Form, HTTPException, Reques...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
xorbitsai__inference-613@dbb4899
xorbitsai/inference
Python
613
FEAT: support chatglm3 with ggml format
Resolve #609 Resolve #608
2023-11-06T07:16:05Z
BUG: Downloading model led to worker timeout ### Describe the bug Worker lost after downloading the model. ``` 2023-11-06 12:00:52,145 - modelscope - INFO - Use user-specified model revision: v1.0.0 Downloading: 100%|███████████████████████████████████████████████████████████████████| 3.27G/3.27G [06:02<00:00, 9.68...
[ { "body": "### Describe the bug\r\nWorker lost after downloading the model.\r\n```\r\n2023-11-06 12:00:52,145 - modelscope - INFO - Use user-specified model revision: v1.0.0\r\nDownloading: 100%|███████████████████████████████████████████████████████████████████| 3.27G/3.27G [06:02<00:00, 9.68MB/s]\r\n2023-11-0...
4903bae2f4fd60a93af5d79801766d65ee741511
{ "head_commit": "dbb48997e3d0a481fe13800b84a9b0395c11b95e", "head_commit_message": "chatglm3 ggml", "patch_to_review": "diff --git a/xinference/core/chat_interface.py b/xinference/core/chat_interface.py\nindex 86f4f081bc..aa5b284a72 100644\n--- a/xinference/core/chat_interface.py\n+++ b/xinference/core/chat_inte...
[ { "diff_hunk": "@@ -494,6 +494,15 @@\n ],\n \"model_description\": \"ChatGLM3 is the third generation of ChatGLM, still open-source and trained on Chinese and English data.\",\n \"model_specs\": [\n+ {\n+ \"model_format\": \"ggmlv3\",\n+ \"model_size_in_billions\": 6,\n+ \"...
f6acabc185b20a6690fcd0d3ff42ea6ae44e7056
diff --git a/xinference/core/chat_interface.py b/xinference/core/chat_interface.py index 86f4f081bc..aa5b284a72 100644 --- a/xinference/core/chat_interface.py +++ b/xinference/core/chat_interface.py @@ -21,6 +21,7 @@ from gradio.layouts import Accordion, Column, Row from ..client.restful.restful_client import ( + ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-27510@5ae991f
sympy/sympy
Python
27,510
Improve Custom Function Precedence Printing
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2025-01-25T09:17:03Z
Printing multiplication by negative number with custom (infix) function not correctly parenthesized. I am trying to define a custom function with lower precedence than multiplication. However, whenever there is a negative number involved, the parentheses are not there anymore. ----- **Custom function:** ```pytho...
Maybe a call to `printer.parenthesize(arg, level)` is missing, but I can't quite get it to work. Ok, so I debugged this to: ```pycon >>> precedence(Mul(Integer(-1), Integer(2), F(Symbol('a'), Symbol('b')))) 40 >>> precedence(Mul(Integer(2), F(Symbol('a'), Symbol('b')))) 50 ``` so if you set your precedence lower...
[ { "body": "I am trying to define a custom function with lower precedence than multiplication. However, whenever there is a negative number involved, the parentheses are not there anymore.\r\n\r\n-----\r\n\r\n**Custom function:**\r\n```python\r\nclass F(sympy.Function):\r\n precedence = 45\r\n\r\n def _sym...
f07466ae38d6f7985c4e9eec2c7dfff43fec3cf7
{ "head_commit": "5ae991f362a2033f00b216a870d9a49d18cb848d", "head_commit_message": "Merge branch 'sympy:master' into preced", "patch_to_review": "diff --git a/sympy/printing/precedence.py b/sympy/printing/precedence.py\nindex 563a04b3494a..6c45215ae72b 100644\n--- a/sympy/printing/precedence.py\n+++ b/sympy/prin...
[ { "diff_hunk": "@@ -87,3 +88,45 @@ def test_And_Or():\n assert precedence(x & y) == PRECEDENCE[\"And\"]\n assert precedence(x | y) == PRECEDENCE[\"Or\"]\n assert precedence(~y) == PRECEDENCE[\"Not\"]\n+\n+\n+def test_custom_function_precedence_comparison():\n+ \"\"\"\n+ Test cases for custom f...
9bf37c0982cf49826e39c17388a85ea6de0b4a02
diff --git a/sympy/printing/precedence.py b/sympy/printing/precedence.py index 563a04b3494a..d22d5746aeee 100644 --- a/sympy/printing/precedence.py +++ b/sympy/printing/precedence.py @@ -59,6 +59,11 @@ def precedence_Mul(item): + from sympy.core.function import Function + if any(hasattr(arg, 'precedence') an...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-27503@71b92cf
sympy/sympy
Python
27,503
Fix issues in polynomial multiplication with RR domain
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> This PR tackles numerical instability over the RR field when multiplying polynomials when coefficients differ by several orders of magnitude in magnitude. #### References to other Issues or ...
2025-01-22T19:46:39Z
Incorrect result when doing multiplication of polynomials in SymPy ``` import sympy x = sympy.symbols('x') e = sympy.poly(18786186952704.0*x**391 + 607420044804096.0*x**390 + 1.00192653483704e+16*x**389 + 1.12340813861618e+17*x**388 + 9.62398129745822e+17*x**387 + 6.71245471589807e+18*x**386 + 3.96638528291356e+19*x**...
I'm not sure what is happening here: ```python In [30]: e.LC() Out[30]: 18786186952704.0 In [31]: (e*x).LC() Out[31]: -1.02749361615667e+15 ``` I think it goes wrong in here: https://github.com/sympy/sympy/blob/97e74c1a97d0cf08ef63be24921f5c9e620d3e68/sympy/polys/densearith.py#L773-L789 This is a major bug to do wit...
[ { "body": "```\nimport sympy\n\nx = sympy.symbols('x')\ne = sympy.poly(18786186952704.0*x**391 + 607420044804096.0*x**390 + 1.00192653483704e+16*x**389 + 1.12340813861618e+17*x**388 + 9.62398129745822e+17*x**387 + 6.71245471589807e+18*x**386 + 3.96638528291356e+19*x**385 + 2.04022369386301e+20*x**384 + 9.316450...
fa7ee53392af364a53f062784cf79d0ecad70e86
{ "head_commit": "71b92cfd4b3d88d12f73b0e24ff6983387058c33", "head_commit_message": "added test cases", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex a14247066bf6..55ff28f9f63d 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1173,6 +1173,7 @@ Pranjal Tale <pranjaltale16@gmail.com>\n Prashant Tyagi <pras...
[ { "diff_hunk": "@@ -995,3 +995,37 @@ def test_dmp_expand():\n assert dmp_expand(([[1], [2], [3]], [[1], [2]], [[7], [5], [4], [3]]), 1, ZZ) == \\\n dmp_mul([[1], [2], [3]], dmp_mul([[1], [2]], [[7], [5], [\n 4], [3]], 1, ZZ), 1, ZZ)\n+\n+def test_dup_mul_poly():\n+ x = Symbol('x')...
7cab03dd7e25daf7e2440caa98ee6944ad77dd78
diff --git a/sympy/polys/densearith.py b/sympy/polys/densearith.py index 30bf9553b05e..1088691ca3fb 100644 --- a/sympy/polys/densearith.py +++ b/sympy/polys/densearith.py @@ -757,7 +757,7 @@ def dup_mul(f, g, K): n = max(df, dg) + 1 - if n < 100: + if n < 100 or not K.is_Exact: h = [] ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
xorbitsai__inference-524@f4b46cc
xorbitsai/inference
Python
524
BUG: Fix stream not compatible with openai
OpenAI stream response always split by line and each line is a valid json with `data:` prefix. Fixes: https://github.com/xorbitsai/inference/issues/523
2023-10-10T10:54:30Z
BUG: Stream response does not compatible with openai ### Describe the bug A clear and concise description of what the bug is. ```python openai.error.APIError: HTTP code 200 from API ({"id": "chatcmpl-346fc892-932c-464a-8051-9df38827d566", "model": "my_code_llama", "created": 1696932753, "object": "chat.completion....
[ { "body": "### Describe the bug\r\nA clear and concise description of what the bug is.\r\n\r\n```python\r\nopenai.error.APIError: HTTP code 200 from API ({\"id\": \"chatcmpl-346fc892-932c-464a-8051-9df38827d566\", \"model\": \"my_code_llama\", \"created\": 1696932753, \"object\": \"chat.completion.chunk\", \"ch...
f22977bcb4f0f7c2367f73d18d198c708aeced53
{ "head_commit": "f4b46cc653f3ca87ea44fa495775bf3b82e15bfa", "head_commit_message": "Refine ut", "patch_to_review": "diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml\nindex a5bd69ec4d..25bb360901 100644\n--- a/.github/workflows/python.yaml\n+++ b/.github/workflows/python.yaml\n@@ -97,6 +...
[ { "diff_hunk": "@@ -97,6 +97,7 @@ jobs:\n pip install s3fs\n pip install modelscope\n pip install -e \".[dev]\"\n+ pip install openai", "line": null, "original_line": 100, "original_start_line": null, "path": ".github/workflows/python.yaml", "start_line...
86a49a978b41b82c106aab8030f11844cc2de588
diff --git a/setup.cfg b/setup.cfg index 179c099761..62ad84c0eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -62,6 +62,7 @@ dev = jieba>=0.42.0 flake8>=3.8.0 black + openai all = ctransformers llama-cpp-python>=0.2.0 diff --git a/xinference/client/common.py b/xinference/client/common.py index ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-27407@873bdd5
sympy/sympy
Python
27,407
Migrate sympy.physics.quantum to use Kinds and _constructor_postprocessor_mapping
The goal of this effort is to remove the special methods like `__mul__`, `__rmul__`, and `__pow__` from the quantum classes. Instead, we are moving to using the new `Kind` and `_constructor_postprocessor_mapping` logic. Before review/merge: - [x] Implement kinds for bras, kets and operators. - [x] Replace custom...
2024-12-27T01:23:15Z
Multiplying kets should produce a tensor product ## Input code ```python srepr(qapply(Ket('a') * Ket('b'))) ``` ## Expected output ```python TensorProduct(Ket(Symbol('a')), Ket(Symbol('b'))) ``` ## Actual output ```python Mul(Ket(Symbol('a')), Ket(Symbol('b'))) ``` ## Rationale Qapply converts _bra_ × _ket...
This is a good call out. I agree that `ket*ket` and `bra*bra` should return tensor products. The code to convert products of bras and kets to inner and outer products is here: https://github.com/sympy/sympy/blob/master/sympy/physics/quantum/state.py#L226 https://github.com/sympy/sympy/blob/master/sympy/physics/quantu...
[ { "body": "## Input code\r\n```python\r\nsrepr(qapply(Ket('a') * Ket('b')))\r\n```\r\n## Expected output\r\n```python\r\nTensorProduct(Ket(Symbol('a')), Ket(Symbol('b')))\r\n```\r\n## Actual output\r\n```python\r\nMul(Ket(Symbol('a')), Ket(Symbol('b')))\r\n```\r\n## Rationale\r\nQapply converts _bra_ × _ket_ to...
b7e7de3b02c8d1edf683e12c61a69f57eebd4ce9
{ "head_commit": "873bdd59cec00d1e25b665400fd49301c94f605b", "head_commit_message": "quantum: Add docstrings and inline comments to PR\n\nIn this commit I have added docstrings and inline comments for (hopefully) everything that needs it.", "patch_to_review": "diff --git a/doc/src/explanation/active-deprecations....
[ { "diff_hunk": "@@ -68,18 +80,22 @@ def qapply(e, **options):\n |k><b|\n >>> qapply(A * b.dual / (b * b.dual))\n |k>\n- >>> qapply(k.dual * A / (k.dual * k), dagger=True)\n- <b|\n >>> qapply(k.dual * A / (k.dual * k))\n- <k|*|k><b|/<k|k>\n+ <b|\n \...
c11078925db5e76886cfbf78a948e44152eb9724
diff --git a/doc/src/explanation/active-deprecations.md b/doc/src/explanation/active-deprecations.md index d8b1c469fbdf..22fb46480686 100644 --- a/doc/src/explanation/active-deprecations.md +++ b/doc/src/explanation/active-deprecations.md @@ -76,10 +76,28 @@ SymPy deprecation warnings. ## Version 1.14 +(deprecated...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
xorbitsai__inference-449@e4dbd11
xorbitsai/inference
Python
449
ENH: Safe iterate stream of ggml model
- [x] Use FastAPI stream. - [x] Fix parallel ggml stream undefined behaviour. Fix: https://github.com/xorbitsai/inference/issues/448
2023-09-14T06:59:40Z
BUG: Incorrect traceback if raises an exception when stream iteration ### Describe the bug A clear and concise description of what the bug is. ### To Reproduce To help us to reproduce this bug, please provide information below: ```python xinference/tests/test_client.py:188 (test_RESTful_client) self = <urlli...
[ { "body": "### Describe the bug\r\nA clear and concise description of what the bug is.\r\n\r\n### To Reproduce\r\nTo help us to reproduce this bug, please provide information below:\r\n\r\n```python\r\nxinference/tests/test_client.py:188 (test_RESTful_client)\r\nself = <urllib3.response.HTTPResponse object at 0...
b3dcd1577e3986e264a4f985cbcd6140f67f4041
{ "head_commit": "e4dbd1137fd5c1f643b8a6170ba7f869c7804c37", "head_commit_message": "Avoid parallel stream iteration on ggml model", "patch_to_review": "diff --git a/setup.cfg b/setup.cfg\nindex 7b92e1f6dd..2acfd1a976 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -34,7 +34,6 @@ install_requires =\n pydantic<2\...
[ { "diff_hunk": "@@ -517,32 +513,16 @@ async def create_completion(self, request: Request, body: CreateCompletionReques\n raise HTTPException(status_code=500, detail=str(e))\n \n if body.stream:\n- # create a pair of memory object streams\n- send_chan, recv_chan = anyio....
38f7ffeca1242f9fe6cac197567c7f2e538e4d9e
diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index e10ce59281..f645fb323a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -104,5 +104,8 @@ jobs: run: | pytest --timeout=1500 \ -W ignore::PendingDeprecationWarning \ - ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-27269@0105c46
sympy/sympy
Python
27,269
Added Lambdify with latex symbols test in test_codeprinter.py
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-11-17T23:33:38Z
Lambdify with latex symbols I have a complicated expression that needs to be evaluated. If the evaluation fails with numpy, than it switches to sympy. My symbols contains latex syntax. This is the simplest reproducible example I could come up with: ```python from sympy import * import inspect x1, x2 = symbols(...
This should probably be fixed in the SymPy-printer (and all printers...) similar to https://github.com/sympy/sympy/pull/20806 Probably the best place is to change here: https://github.com/sympy/sympy/blob/68c37df362e8585d72fc7ef490013bb8eff16e3e/sympy/printing/codeprinter.py#L397-L408 In that way, all code printers...
[ { "body": "I have a complicated expression that needs to be evaluated. If the evaluation fails with numpy, than it switches to sympy. My symbols contains latex syntax.\r\n\r\nThis is the simplest reproducible example I could come up with:\r\n\r\n```python\r\nfrom sympy import *\r\nimport inspect\r\nx1, x2 = sym...
d3bded9d53d554bab23689b45b77871555d2f2fc
{ "head_commit": "0105c46db79135bf786c8b74f3a61ec683f016d2", "head_commit_message": "Added test for _print_Symbol in test_codeprinter.py", "patch_to_review": "diff --git a/sympy/printing/codeprinter.py b/sympy/printing/codeprinter.py\nindex 765f7f01f4c7..15a054609274 100644\n--- a/sympy/printing/codeprinter.py\n+...
[ { "diff_hunk": "@@ -428,7 +427,8 @@ def _print_Symbol(self, expr):\n raise ValueError(msg.format(name))\n return name + self._settings['reserved_word_suffix']\n else:\n- return name\n+ # Remove curly braces from subscripted variables. x_{1} -> x_1\n+ ...
c37138c0c340a2bd445092425582777312559bfd
diff --git a/sympy/printing/codeprinter.py b/sympy/printing/codeprinter.py index 765f7f01f4c7..4a654580b8a3 100644 --- a/sympy/printing/codeprinter.py +++ b/sympy/printing/codeprinter.py @@ -418,7 +418,6 @@ def _print_Variable(self, expr): return self._print(expr.symbol) def _print_Symbol(self, expr): -...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-27352@b3187d6
sympy/sympy
Python
27,352
Add QR Decomposition Method for DomainMatrix and DDM
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-12-08T15:36:38Z
GramSchmidt is really, really slow I tried applying Gram-Schmidt to construct an orthonormal basis of the following four vectors: $$ \begin{bmatrix} -1 + \frac{\sqrt{2}}{2} \\\\ \frac{1}{2} + \frac{\sqrt{2}}{2} \\\\ - \frac{\sqrt{2}}{2} - \frac{1}{2} \\\\ 0 \end{bmatrix}, \begin{bmatrix} -1 - \frac{\sqrt{2}}{2} \...
It looks like this suffers expression blowup in the QR code. I guess the QR decomposition should be implemented for DomainMatrix. This is the matrix code for QR adapted to DomainMatrix: ```python from sympy import Matrix from sympy.polys.matrices import DomainMatrix from sympy.polys.matrices.ddm import DDM, DMDomainErr...
[ { "body": "I tried applying Gram-Schmidt to construct an orthonormal basis of the following four vectors:\n\n$$\n\\begin{bmatrix} -1 + \\frac{\\sqrt{2}}{2} \\\\\\\\ \\frac{1}{2} + \\frac{\\sqrt{2}}{2} \\\\\\\\ - \\frac{\\sqrt{2}}{2} - \\frac{1}{2} \\\\\\\\ 0 \\end{bmatrix},\n\\begin{bmatrix} -1 - \\frac{\\...
e53690af7e57eeef7e8c6dea1521a4dc0024cf95
{ "head_commit": "b3187d679de12daa6b2224b521af4a58bc09f02c", "head_commit_message": "Added qr to SDM & DFM", "patch_to_review": "diff --git a/sympy/polys/matrices/_dfm.py b/sympy/polys/matrices/_dfm.py\nindex c2f6f16922e0..6a915f4fc61e 100644\n--- a/sympy/polys/matrices/_dfm.py\n+++ b/sympy/polys/matrices/_dfm.py...
[ { "diff_hunk": "@@ -3256,6 +3256,23 @@ def lu(self):\n L, U, swaps = self.rep.lu()\n return self.from_rep(L), self.from_rep(U), swaps\n \n+ def qr(self):\n+ \"\"\"\n+ QR decomposition for DomainMatrix.\n+\n+ Returns:\n+ - Q: Orthogonal DomainMatrix.\n+ ...
f838189e7b9ec735e12498ea23aef51cfc33b361
diff --git a/sympy/polys/matrices/_dfm.py b/sympy/polys/matrices/_dfm.py index c2f6f16922e0..6a915f4fc61e 100644 --- a/sympy/polys/matrices/_dfm.py +++ b/sympy/polys/matrices/_dfm.py @@ -694,6 +694,11 @@ def lu(self): L, U, swaps = self.to_ddm().lu() return L.to_dfm(), U.to_dfm(), swaps + def qr(...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Performance Optimizations" }
xorbitsai__inference-289@25d3dd4
xorbitsai/inference
Python
289
FEAT: Support Ctransformers
Resolves #220
2023-08-03T06:38:28Z
FEAT: support starcoder ENH: incorporate ctransformer ### Is your feature request related to a problem? Please describe We need a backend to support StarCoder, MPT, and falcon in GGML. ### Describe the solution you'd like A clear and concise description of what you want to happen. ### Describe alternatives yo...
[ { "body": "", "number": 184, "title": "FEAT: support starcoder" }, { "body": "### Is your feature request related to a problem? Please describe\r\nWe need a backend to support StarCoder, MPT, and falcon in GGML.\r\n\r\n### Describe the solution you'd like\r\nA clear and concise description of wh...
22146b0ab9a78e0452cfa1b7126e77ed3ef16dcb
{ "head_commit": "25d3dd454257aeb2c4520eb831f72cad47008d27", "head_commit_message": "add GPU check to make sure only supported model can initialize Cuda.", "patch_to_review": "diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml\nindex 810939afbd..28741ea347 100644\n--- a/.github/workflows/p...
[ { "diff_hunk": "@@ -0,0 +1,277 @@\n+# Copyright 2022-2023 XProbe Inc.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENSE-2.0...
bfecc8a24670a57ff67bc160a80dc380cdd52f85
diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 810939afbd..28741ea347 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -92,6 +92,7 @@ jobs: pip install sentencepiece pip install transformers_stream_generator pip install ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
xorbitsai__inference-285@69c91fa
xorbitsai/inference
Python
285
ENH: Support Enviroment Variable
ATT This implementation is capable to: If the user didn't type in the -e or --endpoint when required: The program will search if user have exported an endpoint into OS environ. If so, the endpoint variable in the program will automatically be set to that endpoint in OS. If not, we will give it the defa...
2023-08-02T03:40:35Z
ENH: client supports env variable XINFERENCE_ENDPOINT ### Is your feature request related to a problem? Please describe It could be troublesome when starting xinference with a custom port. You have to specify the endpoint every time when you use xinference CLI. ### Describe the solution you'd like I hope we can op...
[ { "body": "### Is your feature request related to a problem? Please describe\r\nIt could be troublesome when starting xinference with a custom port. You have to specify the endpoint every time when you use xinference CLI.\r\n\r\n### Describe the solution you'd like\r\nI hope we can optimize user experience by u...
0a6e90c96e745d83688355202a700878771b74b7
{ "head_commit": "69c91fa7b824daa044dbd93a09cee23187d73cdd", "head_commit_message": "ADD the Enviroment Variable Enhancement", "patch_to_review": "diff --git a/xinference/constants.py b/xinference/constants.py\nindex 18c606a831..070d6c7510 100644\n--- a/xinference/constants.py\n+++ b/xinference/constants.py\n@@ -...
[ { "diff_hunk": "@@ -22,3 +22,4 @@\n XINFERENCE_DEFAULT_LOCAL_HOST = \"127.0.0.1\"\n XINFERENCE_DEFAULT_DISTRIBUTED_HOST = \"0.0.0.0\"\n XINFERENCE_DEFAULT_ENDPOINT_PORT = 9997\n+XINFERENCE_ENV_ENDPOINT_VARIABLE = \"XINFERENCE_ENDPOINT\"", "line": null, "original_line": 25, "original_start_line": nul...
a489f3eb559a5a8e9a8a36e8ff3512b6b2cefeeb
diff --git a/xinference/constants.py b/xinference/constants.py index 18c606a831..34a684c5e7 100644 --- a/xinference/constants.py +++ b/xinference/constants.py @@ -22,3 +22,4 @@ XINFERENCE_DEFAULT_LOCAL_HOST = "127.0.0.1" XINFERENCE_DEFAULT_DISTRIBUTED_HOST = "0.0.0.0" XINFERENCE_DEFAULT_ENDPOINT_PORT = 9997 +XINFERE...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sympy__sympy-27102@4a3836b
sympy/sympy
Python
27,102
Handle multiple equations and inequalities for `parse_expr`
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-09-22T05:37:46Z
[Potential Bug] parse_expr fails to parse complete expression Hi, I am new to sympy, and trying to use sympy for programatic algebraic simplification. I find that it is very useful, and works in most cases, however I found the following case where it deviates from my expected behaviour: ```python3 from sympy import...
The parser can be made more strict with the fix ```diff diff --git a/sympy/parsing/sympy_parser.py b/sympy/parsing/sympy_parser.py index 17919fe01a..3779107edf 100644 --- a/sympy/parsing/sympy_parser.py +++ b/sympy/parsing/sympy_parser.py @@ -1128,7 +1128,7 @@ class EvaluateFalseTransformer(ast.NodeTransformer): ...
[ { "body": "Hi, I am new to sympy, and trying to use sympy for programatic algebraic simplification. I find that it is very useful, and works in most cases, however I found the following case where it deviates from my expected behaviour:\r\n\r\n```python3\r\nfrom sympy import parse_expr\r\nparse_expr(\"0 <= x <=...
1e56b3fb44e5398a3ef8a3cdd25dd7a7b87cd762
{ "head_commit": "4a3836b87f6c70c8663645d3304e620c15fb3c95", "head_commit_message": "Implement fallback behavior", "patch_to_review": "diff --git a/sympy/parsing/sympy_parser.py b/sympy/parsing/sympy_parser.py\nindex 17919fe01ae6..6f4747b2571a 100644\n--- a/sympy/parsing/sympy_parser.py\n+++ b/sympy/parsing/sympy...
[ { "diff_hunk": "@@ -280,16 +280,21 @@ def test_parse_function_issue_3539():\n assert parse_expr('f(x)') == f(x)\n \n def test_issue_24288():\n- inputs = {\n- \"1 < 2\": Lt(1, 2, evaluate=False),\n- \"1 <= 2\": Le(1, 2, evaluate=False),\n- \"1 > 2\": Gt(1, 2, evaluate=False),\n- ...
f9e063b0e39fcc5df727163162216a2be0fa73c9
diff --git a/sympy/parsing/sympy_parser.py b/sympy/parsing/sympy_parser.py index 17919fe01ae6..be613dee4d03 100644 --- a/sympy/parsing/sympy_parser.py +++ b/sympy/parsing/sympy_parser.py @@ -12,7 +12,7 @@ import types from typing import Tuple as tTuple, Dict as tDict, Any, Callable, \ List, Optional, Union as tU...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-27100@b974add
sympy/sympy
Python
27,100
give SparseMatrix own reshape routine
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-09-20T13:47:41Z
SparseMatrix should have its own reshape routine The following should be about a million times faster with a dedicated reshape routine that just moves around existing elements and does nothing with 0s: ``` >>> s = SparseMatrix.zeros(1000, 1000) >>> s[0] = 1 >>> s.reshape(1, 10**6) ```
@smichr I want to work on this issue. I need some help that routine should create another zero matrix and substitute non zero element or it should modify existing one? The same thing happens with this `>>> s = eye(10**5)` `Traceback (most recent call last):` ` File "<string>", line 1, in <module>` ` File "/base/d...
[ { "body": "The following should be about a million times faster with a dedicated reshape routine that just moves around existing elements and does nothing with 0s:\r\n\r\n```\r\n>>> s = SparseMatrix.zeros(1000, 1000)\r\n>>> s[0] = 1\r\n>>> s.reshape(1, 10**6)\r\n```", "number": 13828, "title": "SparseMa...
a8b17a9a9262890601c06fdc2c264189b5b07e7c
{ "head_commit": "b974addf04db066905ed5a6218c408882f172f1f", "head_commit_message": "give SparseMatrix own reshape routine", "patch_to_review": "diff --git a/sympy/matrices/matrixbase.py b/sympy/matrices/matrixbase.py\nindex 7080b19e8a03..3ac1c8c87697 100644\n--- a/sympy/matrices/matrixbase.py\n+++ b/sympy/matric...
[ { "diff_hunk": "@@ -316,6 +316,7 @@ def sparse_zeros(n):\n SparseMatrix([(0, 1, 2), (3, 1, 2), (3, 4, 2), (3, 4, 5)])\n assert m1.reshape(2, 6) == \\\n SparseMatrix([(0, 1, 2, 3, 1, 2), (3, 4, 2, 3, 4, 5)])\n+ assert sparse_eye(10**3).reshape(1, 10**6).shape == (1, 10**6) # is not slow",...
e851df9af6fcbccf926b66446137029f5ff20f13
diff --git a/sympy/matrices/matrixbase.py b/sympy/matrices/matrixbase.py index 7080b19e8a03..3ac1c8c87697 100644 --- a/sympy/matrices/matrixbase.py +++ b/sympy/matrices/matrixbase.py @@ -505,7 +505,9 @@ def reshape(self, rows, cols): """ if self.rows * self.cols != rows * cols: raise Valu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sympy__sympy-27085@c408d1f
sympy/sympy
Python
27,085
DM uses copy
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-09-18T22:44:46Z
DomainMatrix will modify lists used for its construction -- intended? I am not sure that the mutation of the instantiating lists for a DomainMatrix is intended: ```python >>> l = [1,2] >>> DomainMatrix([l],(1,2),ZZ) DomainMatrix([[1, 2]], (1, 2), ZZ) >>> _[0,0]=42 >>> l [42, 2] compare to Matrix >>> l = [1...
That could be changed in the constructor. I think at the time that I made it I was very concerned about the performance impact of things like copying a list. Some time later and after lots of performance measurements I don't think it would have any significant impact. The `DomainMatrix` constructor is not really used i...
[ { "body": "I am not sure that the mutation of the instantiating lists for a DomainMatrix is intended:\r\n```python\r\n>>> l = [1,2]\r\n>>> DomainMatrix([l],(1,2),ZZ)\r\nDomainMatrix([[1, 2]], (1, 2), ZZ)\r\n>>> _[0,0]=42\r\n>>> l\r\n[42, 2]\r\n\r\ncompare to Matrix\r\n\r\n>>> l = [1,2]\r\n>>> Matrix([l])\r\nMat...
c870d17c2638f5061800e344b72ff80086a0b41d
{ "head_commit": "c408d1f3da8300eb2bd60a0381ea00c3f37fb03f", "head_commit_message": "DM uses copy", "patch_to_review": "diff --git a/sympy/polys/matrices/ddm.py b/sympy/polys/matrices/ddm.py\nindex 2425aaffba64..8f90a3305367 100644\n--- a/sympy/polys/matrices/ddm.py\n+++ b/sympy/polys/matrices/ddm.py\n@@ -117,7 +...
[ { "diff_hunk": "@@ -60,6 +60,11 @@ def test_DomainMatrix_init():\n \n raises(DMBadInputError, lambda: DomainMatrix([[ZZ(1), ZZ(2)]], (2, 2), ZZ))\n \n+ # uses copy\n+ was = [i.copy() for i in lol]\n+ A[0,0] = 42", "line": null, "original_line": 65, "original_start_line": null, "path...
b39fa6fffeef5a1c71c546817bffac4dcebb06ea
diff --git a/sympy/polys/matrices/ddm.py b/sympy/polys/matrices/ddm.py index 2425aaffba64..8f90a3305367 100644 --- a/sympy/polys/matrices/ddm.py +++ b/sympy/polys/matrices/ddm.py @@ -117,7 +117,7 @@ def __init__(self, rowslist, shape, domain): if len(rowslist) != m or any(len(row) != n for row in rowslist): ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-27090@24365bc
sympy/sympy
Python
27,090
_unevaluated_Mul watches for nc args
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-09-19T13:11:14Z
_unevaluated_Mul re-orders non-commutative factors ```python from sympy import S from sympy.core.mul import _unevaluated_Mul as f from sympy.abc import x A, B = symbols("A B", commutative=False) >>> f(x, A, B, S(2), A).args (2, x, A, A, B) # should be (2, x, A, B, A) ```
[ { "body": "```python\r\nfrom sympy import S\r\nfrom sympy.core.mul import _unevaluated_Mul as f\r\nfrom sympy.abc import x\r\nA, B = symbols(\"A B\", commutative=False)\r\n>>> f(x, A, B, S(2), A).args\r\n(2, x, A, A, B) # should be (2, x, A, B, A)\r\n```", "number": 27091, "title": "_unevaluated_Mul re...
eeb8b8b063c52c4cc58ccf6585cb2b6631b2b2ae
{ "head_commit": "24365bca644ee533e9de85bfc650f32ac0231bcc", "head_commit_message": "use _unevaluated_Mul with as_independent", "patch_to_review": "diff --git a/sympy/core/expr.py b/sympy/core/expr.py\nindex 7c4015e0f0e5..97112c6390eb 100644\n--- a/sympy/core/expr.py\n+++ b/sympy/core/expr.py\n@@ -1889,9 +1889,7 ...
[ { "diff_hunk": "@@ -1889,9 +1889,7 @@ def has(e):\n depend.extend(nc[i:])\n break\n indep.append(n)\n- return Mul(*indep), (\n- Mul(*depend, evaluate=False) if nc else\n- _unevaluated_Mul(*depend))\n+ ret...
3060a841bd281ca13275dda7714d1f0393ebf3df
diff --git a/sympy/core/expr.py b/sympy/core/expr.py index 7c4015e0f0e5..c90a05b94eea 100644 --- a/sympy/core/expr.py +++ b/sympy/core/expr.py @@ -1889,9 +1889,7 @@ def has(e): depend.extend(nc[i:]) break indep.append(n) - return Mul(*indep), ( - ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xorbitsai__inference-171@72966ac
xorbitsai/inference
Python
171
ENH: Implement RESTful API stream generate
Resolves #166.
2023-07-13T10:18:15Z
ENH: RESTful API stream generate ### Is your feature request related to a problem? Please describe Provide stream generateion in RESTful API. ### Describe the solution you'd like A clear and concise description of what you want to happen. ### Describe alternatives you've considered A clear and concise descript...
[ { "body": "### Is your feature request related to a problem? Please describe\r\nProvide stream generateion in RESTful API.\r\n\r\n### Describe the solution you'd like\r\nA clear and concise description of what you want to happen.\r\n\r\n### Describe alternatives you've considered\r\nA clear and concise descript...
63e4133dac14e581201987f6166e8ea6691e83cb
{ "head_commit": "72966ace5748d461ff8e3cc31e0e7889f24f2ddc", "head_commit_message": "exception handling", "patch_to_review": "diff --git a/setup.cfg b/setup.cfg\nindex 8c1a49e68d..627bbb8d12 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -34,6 +34,7 @@ install_requires =\n pydantic\n fastapi\n uvicorn\n...
[ { "diff_hunk": "@@ -80,6 +81,34 @@ def chat(\n return self._isolation.call(coro)\n \n \n+def streaming_response_iterator(response_lines):\n+ for line in response_lines:\n+ line = line.strip()\n+ if line:\n+ if line == b\"data: [DONE]\":", "line": null, "original_line"...
3689d14a05ff62974ad0c1f940c0d906739130e5
diff --git a/setup.cfg b/setup.cfg index 082ee4bded..1b9fef7e22 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,7 @@ install_requires = pydantic fastapi uvicorn + sse_starlette [options.packages.find] exclude = diff --git a/xinference/client.py b/xinference/client.py index 60b751d994..b7d9c7cd...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
sympy__sympy-27020@42493e3
sympy/sympy
Python
27,020
fail when no subset solves poly system; better removal of redundant solutions
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> Until the Groebner approach is used to solve systems of polynomials, it might be advantageous to try solve the equations with the traditional methods (instead of a system-of-equations approach)...
2024-08-30T03:15:15Z
Possible bug with sympy.solve For some systems of equations, sympy.solve can succeed when solving with respect to a subset of variables but raises an error when asked to solve with respect to a large set containing that variable set (containing that subset). This seems like a bug, as it should at least be able to find ...
This comes from SO: https://stackoverflow.com/questions/78913691/why-might-sympy-solve-succeed-with-respect-to-fewer-variables-but-fail-w-r-t-mo This is the error: ```python In [2]: solve([x, x**2], [x, y, z]) --------------------------------------------------------------------------- NotImplementedError ...
[ { "body": "For some systems of equations, sympy.solve can succeed when solving with respect to a subset of variables but raises an error when asked to solve with respect to a large set containing that variable set (containing that subset). This seems like a bug, as it should at least be able to find the same so...
95a8175eb35ca7c8d84afadafb8df4bfb93fd1d2
{ "head_commit": "42493e3fa9eec2ed12a797e74ce7a8f091c75532", "head_commit_message": "update existing soln\n\nWhen testing to see if a solution is a superset of another, update the other with the values of the solution being tested, first.", "patch_to_review": "diff --git a/sympy/solvers/solvers.py b/sympy/solvers...
[ { "diff_hunk": "@@ -2571,6 +2571,14 @@ def test_issue_20747():\n \n def test_issue_27001():\n assert solve((x, x**2), (x, y, z), dict=True) == [{x: 0}]\n+ s = a1, a2, a3, a4, a5 = symbols('a1:6')\n+ eqs = [8*a1**4*a2 + 4*a1**2*a2**3 - 8*a1**2*a2*a4 + a2**5/2 - 2*a2**3*a4 +\n+ 8*a2*a3**2 + 2*a2*...
c3c1ace3db4cf0400a58dc797c274bb4542b9715
diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py index 869c8aa7fdc0..b1210a2baaf6 100644 --- a/sympy/solvers/solvers.py +++ b/sympy/solvers/solvers.py @@ -1893,7 +1893,7 @@ def _solve_system(exprs, symbols, **flags): if got_s: solved_syms = list(got_s) ...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-27013@9a3a4c4
sympy/sympy
Python
27,013
Fixed bug related to limits of abs
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-08-28T17:33:25Z
Wrong limit result for Abs((-n/(n+1))**n) ```python import sympy from sympy import S, Symbol, limit, oo print('sympy version:', sympy.__version__) n = Symbol('n', real=True) expr = (n/(n+1))**n print(limit(expr, n, oo)) # Success expr = (-n/(n+1))**n print(limit(expr, n, oo)) # Wrong expr = Abs((...
Thanks for raising this. We do perform poorly when it comes to limits (bi-directional, or at infinities too ... you can easily find similar errors for `-oo` too ) involving the abs function. It seems that the result for the third limit (the one with abs) is being returned correctly by gruntz but not for the second one...
[ { "body": "```python\r\nimport sympy\r\n\r\nfrom sympy import S, Symbol, limit, oo\r\n\r\nprint('sympy version:', sympy.__version__)\r\n\r\nn = Symbol('n', real=True)\r\n\r\nexpr = (n/(n+1))**n\r\nprint(limit(expr, n, oo)) # Success\r\n\r\nexpr = (-n/(n+1))**n\r\nprint(limit(expr, n, oo)) # Wrong\r\n\r\nexpr ...
01a25577c8acda8f50a7d35eb0971fc0a1e17344
{ "head_commit": "9a3a4c4cef825970af045829e2791bb09d705eec", "head_commit_message": "added and modified tests\n\nSigned-off-by: arnabnandikgp <arnabnandi2002@gmail.com>", "patch_to_review": "diff --git a/sympy/series/gruntz.py b/sympy/series/gruntz.py\nindex 0bf3bf3e50b1..cad37a988757 100644\n--- a/sympy/series/g...
[ { "diff_hunk": "@@ -273,16 +273,20 @@ def set_signs(expr):\n arg_flag = isinstance(expr, arg)\n sign_flag = isinstance(expr, sign)\n if abs_flag or sign_flag or arg_flag:\n- sig = limit(expr.args[0], z, z0, dir)\n- if sig.is_zero:\n- ...
3ef9001c15fbb2b61a24f8bbc3915b136f33962c
diff --git a/sympy/series/gruntz.py b/sympy/series/gruntz.py index 0bf3bf3e50b1..cad37a988757 100644 --- a/sympy/series/gruntz.py +++ b/sympy/series/gruntz.py @@ -411,7 +411,7 @@ def sign(e, x): return 1 if e.exp.is_Integer: return s**e.exp - elif isinstance(e, log): + elif isin...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26954@3dca453
sympy/sympy
Python
26,954
Support Ei(z) expansion at -oo
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-08-13T05:31:50Z
Ei(-x) * exp(x) (exponential integral) limit to infinity error out The following limit computes fine: ``` (Ei(x) * exp(-x)).limit(x, oo) # Result: 0 ``` But the following doesn't: ``` (Ei(-x) * exp(x)).limit(x, oo) # Or equivalent: (Ei(x) * exp(-x)).limit(x, -oo) # Expected: 0 ``` Instead, sympy will...
The immediate error message results from a bug that is easily fixed: ```diff diff --git a/sympy/functions/special/error_functions.py b/sympy/functions/special/error_functions.py index 09279588b6..ba29c4d7d4 100644 --- a/sympy/functions/special/error_functions.py +++ b/sympy/functions/special/error_functions.py @@...
[ { "body": "The following limit computes fine:\r\n\r\n```\r\n(Ei(x) * exp(-x)).limit(x, oo)\r\n# Result: 0\r\n```\r\n\r\nBut the following doesn't:\r\n\r\n```\r\n(Ei(-x) * exp(x)).limit(x, oo)\r\n# Or equivalent: (Ei(x) * exp(-x)).limit(x, -oo)\r\n# Expected: 0\r\n```\r\n\r\nInstead, sympy will error out with\r\...
823065c6d82ef2ceb9c0c78ef19ae94685dbdfef
{ "head_commit": "3dca4530178450dd519daf9b57f5f08eb673f084", "head_commit_message": "Support Ei(z) expansion at -oo", "patch_to_review": "diff --git a/sympy/functions/special/error_functions.py b/sympy/functions/special/error_functions.py\nindex fd616c49af6f..945bad4c4384 100644\n--- a/sympy/functions/special/err...
[ { "diff_hunk": "@@ -437,6 +437,11 @@ def test_ei():\n assert Ei(x).series(x, 1, 3) == Ei(1) + E*(x - 1) + O((x - 1)**3, (x, 1))\n assert Ei(x).series(x, oo) == \\\n (120/x**5 + 24/x**4 + 6/x**3 + 2/x**2 + 1/x + 1 + O(x**(-6), (x, oo)))*exp(x)/x\n+ assert Ei(x).series(x, -oo) == \\\n+ (...
b973d2f3ab285e7525f9932f430645a67717455a
diff --git a/sympy/functions/special/error_functions.py b/sympy/functions/special/error_functions.py index fd616c49af6f..945bad4c4384 100644 --- a/sympy/functions/special/error_functions.py +++ b/sympy/functions/special/error_functions.py @@ -1263,7 +1263,7 @@ def _eval_aseries(self, n, args0, x, logx): from s...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26843@df899c7
sympy/sympy
Python
26,843
fix(polys): fix DMP.cancel for GF(p) with Flint
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-07-21T12:03:04Z
Poly.cancel fails over GF with ground types flint This is after gh-25940 ```python In [1]: Poly(x, modulus=11).cancel(Poly(x, modulus=11)) --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) Cell In[1], line 1 ----...
[ { "body": "This is after gh-25940\r\n```python\r\nIn [1]: Poly(x, modulus=11).cancel(Poly(x, modulus=11))\r\n---------------------------------------------------------------------------\r\nAssertionError Traceback (most recent call last)\r\nCell In[1], line 1\r\n----> 1 Poly(x, modulus...
958cc95aebc35ced70d870586e68d0468684c1a0
{ "head_commit": "df899c7be13e3b9767736462092ddea8cf2416c8", "head_commit_message": "fix(polys): fix DMP.cancel for GF(p) with Flint", "patch_to_review": "diff --git a/sympy/polys/polyclasses.py b/sympy/polys/polyclasses.py\nindex 55780f086709..eab3b39034a7 100644\n--- a/sympy/polys/polyclasses.py\n+++ b/sympy/po...
[ { "diff_hunk": "@@ -2138,19 +2138,28 @@ def _lcm(f, g):\n \n def _cancel(f, g):\n \"\"\"Cancel common factors in a rational function ``f/g``. \"\"\"\n+ assert f.dom == g.dom\n+ R = f.dom\n+\n # Think carefully about how to handle denominators and coefficient\n # canonic...
71ce1acad71decbda804ed6c121da9dec20ab87a
diff --git a/sympy/polys/domains/finitefield.py b/sympy/polys/domains/finitefield.py index 92ecbaeb52dd..d21e0035a35b 100644 --- a/sympy/polys/domains/finitefield.py +++ b/sympy/polys/domains/finitefield.py @@ -31,51 +31,78 @@ flint = None -def _modular_int_factory(mod, dom, symmetric, self): +def _modular_int...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26796@ac5a022
sympy/sympy
Python
26,796
diophantine: make trivial solution satisfy assumptions
Currently, trivial solutions will always be returned regardless of the assumptions of positiveness. An additional check is now added after a trivial solution is appended. <!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to ...
2024-07-11T15:50:59Z
diophantine and diop_solve ignore assumptions Using `solvers.diophantine` `diophantine` and `diop_solve` functions with integer and positive assumed symbols, also `{(0, 0)}` and negative solutions are returned. For example: ```python from sympy import Symbol from sympy.solvers.diophantine import diophantine, diop_s...
It seems currently `diop_quadratic()` will always return a trivial solution if applied when no other solutions are found. https://github.com/sympy/sympy/blob/3a812204052176854bdfc1ea9d12097c3f9307ca/sympy/solvers/diophantine/diophantine.py#L1479-L1485 Maybe we should rearrange the logic? By the way, you should use `d...
[ { "body": "Using `solvers.diophantine` `diophantine` and `diop_solve` functions with integer and positive assumed symbols, also `{(0, 0)}` and negative solutions are returned.\r\nFor example:\r\n```python\r\nfrom sympy import Symbol\r\nfrom sympy.solvers.diophantine import diophantine, diop_solve\r\n\r\nx = Sym...
e2145b58f528b495d08e0670ad5c2a19c1d1bbe1
{ "head_commit": "ac5a02295beeaccbe3e8d3813ef38b55d910f775", "head_commit_message": "diophantine: trivial solution under assumptions\n\nCurrently trivial solution will always be returned regardless of\nthe assumptions of positiveness. An additional check is now added\nafter a trivial solution is appended.", "patc...
[ { "diff_hunk": "@@ -1482,7 +1482,14 @@ def diophantine(eq, param=symbols(\"t\", integer=True), syms=None,\n null = tuple([0]*len(var))\n # if there is no solution, return trivial solution\n if not sols and eq.subs(zip(var, null)).is_zero:\n- sols.add(null)\n+ null_feasible = True\n+ ...
f316763465893a8cce7d2e65a36f24173b7faf4b
diff --git a/sympy/solvers/diophantine/diophantine.py b/sympy/solvers/diophantine/diophantine.py index d02d0689d814..8200ef6da21e 100644 --- a/sympy/solvers/diophantine/diophantine.py +++ b/sympy/solvers/diophantine/diophantine.py @@ -1482,7 +1482,9 @@ def diophantine(eq, param=symbols("t", integer=True), syms=None, ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26883@ceb6266
sympy/sympy
Python
26,883
[PDF] Fix "Missing character" issues when building PDF
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs Fix #26877 <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-...
2024-07-30T17:52:19Z
[PDF] Missing characters are reported during PDF via LaTeX build Page numbers from log maybe off because I had a problem with the Chromium svg to pdf conversion so perhaps this induces some shift not sure. Besides only some pages numbers are shown because by luck the warning was the first one on current page, so `[NNN...
The `^^C` ones come from `\mathbf{\Lambda_c}` mark-up in `src/explanation/modules/physics/mechanics/lagrange.rst`. Edit: *this next sentence is **wrong** on two counts. Loading `unicode-math` does not solve this issue. At least with the current version one should use `\symbf` here not `\mathbf`. And actually ...
[ { "body": "Page numbers from log maybe off because I had a problem with the Chromium svg to pdf conversion so perhaps this induces some shift not sure. Besides only some pages numbers are shown because by luck the warning was the first one on current page, so `[NNNN]` indicates the page *before*.\r\n\r\nI hope...
9f339a2056ade589f925b84da7160c0b73fecd2f
{ "head_commit": "ceb62663d844b91d2d5622bccd74cba949a8ad65", "head_commit_message": "[PDF] Fix \"Missing character\" issues when building PDF\n\nFix #26877", "patch_to_review": "diff --git a/doc/src/conf.py b/doc/src/conf.py\nindex cb2a5409fb1f..517557f02e5c 100644\n--- a/doc/src/conf.py\n+++ b/doc/src/conf.py\n@...
[ { "diff_hunk": "@@ -372,7 +372,7 @@\n \n \\usepackage{bm}", "line": null, "original_line": 373, "original_start_line": null, "path": "doc/src/conf.py", "start_line": null, "text": "@author:\nThis serves nothing because there is not a single usage of `\\bm` in math mark-up in sources. Bu...
c17c93ee37b2c7e64d8fc85ae82542d1cd4b59e4
diff --git a/doc/src/conf.py b/doc/src/conf.py index aac398d9cec8..c553d6c70afe 100644 --- a/doc/src/conf.py +++ b/doc/src/conf.py @@ -364,12 +364,50 @@ latex_engine = 'xelatex' latex_use_xindy = False latex_elements = { + 'passoptionstopackages': r'\PassOptionsToPackage{no-math}{fontspec}', 'fontpkg': r''' ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26729@dead56e
sympy/sympy
Python
26,729
use only relative error in control_plots test
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> fixes #26728 #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-clos...
2024-06-22T00:55:37Z
Control test fails with numpy 2.0 CC @akshanshbhatt @faze-geek This is the second time I have asked to fix these tests (gh-23128). This test fails with numpy 2.0: ```console $ pytest sympy/physics/control/tests/test_control_plots.py::test_pole_zero =============================================================...
I'm not able to reproduce this locally. Tests seem to pass with `numpy==2.0.0`. ``` $ python -c "import numpy; print(numpy.version.version)" 2.0.0 $ pytest sympy/physics/control/tests/test_control_plots.py::test_pole_zero ======================== test session starts ======================== platform darwin --...
[ { "body": "CC @akshanshbhatt @faze-geek \r\n\r\nThis is the second time I have asked to fix these tests (gh-23128).\r\n\r\nThis test fails with numpy 2.0:\r\n```console\r\n$ pytest sympy/physics/control/tests/test_control_plots.py::test_pole_zero\r\n==============================================================...
6d6e89caad6da38313a9174fc186b67904872a47
{ "head_commit": "dead56ec78be8c9957dbbed0c6526a421716d20e", "head_commit_message": "Update test_control_plots.py", "patch_to_review": "diff --git a/sympy/physics/control/control_plots.py b/sympy/physics/control/control_plots.py\nindex 3742de329e61..7f1fc5179ee6 100644\n--- a/sympy/physics/control/control_plots.p...
[ { "diff_hunk": "@@ -88,8 +90,8 @@ def pole_zero_numerical_data(system):\n >>> from sympy.physics.control.lti import TransferFunction\n >>> from sympy.physics.control.control_plots import pole_zero_numerical_data\n >>> tf1 = TransferFunction(s**2 + 1, s**4 + 4*s**3 + 6*s**2 + 5*s + 2, s)\n- >>> po...
a3a545f1f3c0a507ae5e6925304e6ddca85796a1
diff --git a/sympy/physics/control/control_plots.py b/sympy/physics/control/control_plots.py index 3742de329e61..e233d5d0a4e2 100644 --- a/sympy/physics/control/control_plots.py +++ b/sympy/physics/control/control_plots.py @@ -2,12 +2,14 @@ from sympy.functions.elementary.exponential import (exp, log) from sympy.poly...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Dependency Updates & Env Compatibility" }
sympy__sympy-26780@7de5d9d
sympy/sympy
Python
26,780
Fix a bug with diophantine() when cornacchia() is not called properly
Occasionally diophantine() and diop_quadratic() result in a DN form $X^2 - DY^2 = N$ which cannot be handled by the current cornacchia() properly. For example, previously the diophantine solver will miss some solutions: ``` >>> eq1 = x**2 - 15*x + y**2 - 8*y # also mentioned in #18628 >>> diophantine(eq1) {(0, 0), ...
2024-07-08T03:07:31Z
diophantine(), diop_quadratic() missing solutions With sympy version 1.5.1: ``` from sympy import * from sympy.solvers.diophantine import diop_quadratic a, b, x, y = symbols('a b x y', integer=True, positive=True) f = -a*x + x**2 - b*y + y**2 g = f.subs([(a, 15), (b, 8)]) print('diophantine (', g, ') solut...
`diophantine` is doing additional filtering on the results to match the assumptions on `x` and `y` as positive integers. `diop_quadratic` has no such checks. The boundary between public and private methods in the diophantine solver is extremely ill-defined. I agree that there are solutions missing from your examp...
[ { "body": "With sympy version 1.5.1:\r\n\r\n```\r\nfrom sympy import *\r\nfrom sympy.solvers.diophantine import diop_quadratic\r\n\r\na, b, x, y = symbols('a b x y', integer=True, positive=True)\r\nf = -a*x + x**2 - b*y + y**2\r\ng = f.subs([(a, 15), (b, 8)])\r\nprint('diophantine (', g, ') solutions:', dioph...
16362cc09da946b518f549f249e81672a221030d
{ "head_commit": "7de5d9d6be7fcb4383c8fc5bcd13197da5ed8745", "head_commit_message": "fix typos in the comments of cornacchia()", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 55b874e6f897..d67a21ac36df 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1550,6 +1550,7 @@ Zeel Shah <kshah215@gmail.com>\n Zhe...
[ { "diff_hunk": "@@ -2174,6 +2174,25 @@ def cornacchia(a:int, b:int, m:int) -> set[tuple[int, int]]:\n \"\"\"\n # Assume gcd(a, b) = gcd(a, m) = 1 and a, b > 0 but no error checking\n sols = set()\n+\n+ if a + b > m:\n+ # xy = 0 must hold if there exists a solution\n+ if m % a == 0:\...
875e72dbfef4fd279230baf86c29452057506f63
diff --git a/.mailmap b/.mailmap index 55b874e6f897..86b8e0da17b8 100644 --- a/.mailmap +++ b/.mailmap @@ -1550,6 +1550,8 @@ Zeel Shah <kshah215@gmail.com> Zhenxu Zhu <xzdlj@outlook.com> xzdlj <xzdlj@outlook.com> Zhi-Qiang Zhou <zzq_890709@hotmail.com> zhouzq-thu <zzq_890709@hotmail.com> Zhongshi <zj495@nyu.edu> +Zh...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26623@a5db5b8
sympy/sympy
Python
26,623
vector: created VectorKind and Add with vectors now calls VectorAdd
#### References to other Issues or PRs Fixes #26121 #### Brief description of what is fixed or changed Created a VectorKind class, which is the kind for all vector objects in Sympy. The result of operations between vectors, such as Cross, also has VectorKind. Added a postprocessor for Add with respect to Vect...
2024-05-26T21:35:44Z
matrix of vectors destroys vector type from sympy.matrices import Matrix from sympy.vector import CoordSys3D, Vector Sys = CoordSys3D('Sys') O = Sys.origin # The row matrix of unit vectors E = Matrix([Sys.i, Sys.j, Sys.k]).T # A Column matrix of coordinates a = Matrix([1, 2,...
It is because: ```python In [61]: type(Add(Sys.i, Sys.j)) Out[61]: sympy.core.add.Add In [62]: type(Sys.i + Sys.j) Out[62]: sympy.vector.vector.VectorAdd ``` The Matrix code assumes that it can add things with `Add` but there is no mechanism that makes this work with vectors. Ideally the `.kind` would be us...
[ { "body": " from sympy.matrices import Matrix\r\n from sympy.vector import CoordSys3D, Vector\r\n\r\n Sys = CoordSys3D('Sys')\r\n O = Sys.origin\r\n\r\n # The row matrix of unit vectors\r\n E = Matrix([Sys.i, Sys.j, Sys.k]).T\r\n\r\n # A Column matrix of coordinates\r\n a = Matrix([1, 2,...
ae3027b4ca682023dee36e7e8883311c62cc08e3
{ "head_commit": "a5db5b850cdeca1d9c06b001977c8aef13f0a110", "head_commit_message": "vector: updated VectorKind docstring\n\nAfter making VectorKind a parametrised kind, we forgot\nto update the docstring. It is updated now.", "patch_to_review": "diff --git a/sympy/vector/__init__.py b/sympy/vector/__init__.py\ni...
[ { "diff_hunk": "@@ -344,6 +347,24 @@ def _div_helper(one, other):\n else:\n raise TypeError(\"Invalid division involving a vector\")\n \n+# The following is adapted from the matrices.expressions.matexpr file\n+\n+def get_postprocessor(cls):\n+ def _postprocessor(expr):\n+ vec_class...
c4a8977c6a705fc6cfb366b704d3b659c3975631
diff --git a/sympy/vector/__init__.py b/sympy/vector/__init__.py index 9228befbdb4b..f6757bbeb350 100644 --- a/sympy/vector/__init__.py +++ b/sympy/vector/__init__.py @@ -17,11 +17,14 @@ from sympy.vector.implicitregion import ImplicitRegion from sympy.vector.parametricregion import (ParametricRegion, parametric_regi...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-26557@07f5e42
sympy/sympy
Python
26,557
Prevent RecursionError in nc_simplify for floating point coefficients
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-04-30T13:44:06Z
RecursionError in simplify of non-commutative expressions with non-integer coefficient Simplifying expressions with non-commutative symbols and floating point coeefficients generates a recursion error. ```python from sympy import Symbol, cos, pi X = Symbol('X', commutative = False) try: display( (2 * cos(p...
The check here fails if `com_coeff = 1.0`: https://github.com/sympy/sympy/blob/7c4f580838612edea6dcd6ae7d5b8a75af2d8f10/sympy/simplify/simplify.py#L1761-L1762
[ { "body": "Simplifying expressions with non-commutative symbols and floating point coeefficients generates a recursion error.\r\n\r\n```python\r\nfrom sympy import Symbol, cos, pi\r\nX = Symbol('X', commutative = False)\r\n\r\ntry:\r\n display( (2 * cos(pi/3) * X).simplify() )\r\nexcept RecursionError as e:\...
7c4f580838612edea6dcd6ae7d5b8a75af2d8f10
{ "head_commit": "07f5e42677c5b753f2d61e9fc4cfe2464e9e0b75", "head_commit_message": "Add name to mailmap file", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 4c0988c98177..0303e3b9fb17 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1616,6 +1616,7 @@ richierichrawr <richierichrawr@users.noreply.github.c...
[ { "diff_hunk": "@@ -1616,6 +1616,7 @@ richierichrawr <richierichrawr@users.noreply.github.com>\n rimibis <33387803+rimibis@users.noreply.github.com>\n risubaba <risubhjain1010@gmail.com>\n ritikBhandari <ritikbhandari68@gmail.com>\n+rrodenbusch <rrodenbusch@gmail.com>", "line": null, "original_line": 16...
e3c8666ce5748cb284e84b418087e59d21de6675
diff --git a/.mailmap b/.mailmap index 4c0988c98177..aac350bcc3c5 100644 --- a/.mailmap +++ b/.mailmap @@ -1188,6 +1188,7 @@ Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Rich LaSota <rjlasota@gmail.com> Richard Otis <richard.otis@outlook.com> <ovolve@users.noreply.github.com> Richard Otis <richard.otis@...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26546@b4f4d39
sympy/sympy
Python
26,546
improve assumptions of roots of non-real expression
#### References to other Issues or PRs Fixes #26545 #### Brief description of what is fixed or changed Add a simple check in `_eval_is_extended_real` of the `Pow` class, to return `False`, when the n-th root of a non-real expression is taken, i.e. when the base is not real and the exponent is a rational number ...
2024-04-26T11:56:11Z
Roots of non-real elements should be non-real themselves, but their domain is unknown ### Description This is not a bug, rather an idea for an improvement At the moment, taking the squareroot of a non-real expression (`is_extended_real==False`) does result in the value of `is_extended_real` being `None`. ```{pyt...
> The function `_eval_is_extended_real` of the `Pow` class could be amplified, to return False, when the base is not real and the exponent is a rational with a nominator of 1. Sounds reasonable.
[ { "body": "### Description\r\nThis is not a bug, rather an idea for an improvement\r\n\r\nAt the moment, taking the squareroot of a non-real expression (`is_extended_real==False`) does result in the value of `is_extended_real` being `None`.\r\n\r\n```{python}\r\n>>> x = Symbol('x', real=True)\r\n>>> print((I+x)...
68b548d79d43004a1c68990fedd9933384256d20
{ "head_commit": "b4f4d39e5f07b6ac4b0e6e9439552b0e5dea86de", "head_commit_message": "fix use wrong property", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 2b868286fc0f..4c0988c98177 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -881,6 +881,7 @@ Liwei Cai <cai.lw123@gmail.com>\n Ljubiša Moćić <3rdslash...
[ { "diff_hunk": "@@ -513,6 +513,11 @@ def _eval_is_extended_real(self):\n return self.exp.is_imaginary\n return\n real_e = self.exp.is_extended_real\n+ if real_b == False and real_e:\n+ if self.exp == S.Half:\n+ return False\n+ if ty...
e676709a3f5805acd6b7a9bf19c71c4497a46c3f
diff --git a/.mailmap b/.mailmap index 2b868286fc0f..4c0988c98177 100644 --- a/.mailmap +++ b/.mailmap @@ -881,6 +881,7 @@ Liwei Cai <cai.lw123@gmail.com> Ljubiša Moćić <3rdslasher@gmail.com> Lokesh Sharma <lokeshhsharma@gmail.com> <your_email@youremail.com> Longqi Wang <iqgnol@gmail.com> +Lorenz Winkler <lorenz.win...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sympy__sympy-26484@cf57b4f
sympy/sympy
Python
26,484
Text backend plotting
Fixes #26481. For some reason, the bounds of the backend renderer became complex at some point. I just check if they are complex and then convert them to real if the complex part is equal to 0. This solution is kinda a hack and it might be good to investigate why the endpoints are becoming complex at some point, b...
2024-04-09T22:10:30Z
Plotting with Sympy's inbuilt TextBackend doesn't seem to be working ```from sympy import symbols from sympy.plotting import plot x = symbols('x') plot(x, (x, 0, 5)) Traceback (most recent call last): File "c:\Users\sammy\gsoc\sympy\test.py", line 4, in <module> plot(x, (x, 0, 5)) File "c:\Users\sammy\...
You can force the backend to be text with `plot(..., backend='text')`. @SamLubelsky did you come across this as a result of running the tests/doctests in some way? I recently came across this as well with `pytest --doctest-only sympy/plotting` when matplotlib was not installed. I have fixed that in https://github.co...
[ { "body": "```from sympy import symbols\r\nfrom sympy.plotting import plot\r\nx = symbols('x')\r\nplot(x, (x, 0, 5))\r\n\r\nTraceback (most recent call last):\r\n File \"c:\\Users\\sammy\\gsoc\\sympy\\test.py\", line 4, in <module>\r\n plot(x, (x, 0, 5))\r\n File \"c:\\Users\\sammy\\gsoc\\sympy\\sympy\\plo...
e89ee9373fbbb90e92e18e6181606254653bbc34
{ "head_commit": "cf57b4f3631eba99cc379a458076fa0e992dcc61", "head_commit_message": "added regression tests", "patch_to_review": "diff --git a/sympy/plotting/tests/test_plot.py b/sympy/plotting/tests/test_plot.py\nindex dc6950de2224..b62ec113bfeb 100644\n--- a/sympy/plotting/tests/test_plot.py\n+++ b/sympy/plotti...
[ { "diff_hunk": "@@ -60,6 +60,13 @@ def save(self):\n def close(self):\n pass\n \n+def test_basic_plotting_backend():\n+ x = Symbol('x')\n+ try:\n+ plot(x, (x, 0, 3), backend='text')\n+ plot(x**2 + 1, (x, 0, 3), backend='text')\n+ except TypeError as exc:\n+ assert False...
8757b8879934776241fe84138b38c1ad19b577b0
diff --git a/sympy/plotting/tests/test_plot.py b/sympy/plotting/tests/test_plot.py index dc6950de2224..bf09e825e744 100644 --- a/sympy/plotting/tests/test_plot.py +++ b/sympy/plotting/tests/test_plot.py @@ -60,6 +60,10 @@ def save(self): def close(self): pass +def test_basic_plotting_backend(): + x =...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26515@2c01ca9
sympy/sympy
Python
26,515
fix(polys): fix multi factorisation over QQ<a>
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-04-17T22:48:43Z
factor produces wrong output `sympy.factor(expr)` produces the wrong output if an underscore is used in the name of one of the symbols in `expr`. EDIT: The issue is more general. The correctness of the factorization output depends on the names of the variables. Using symbol names with more than one character also chan...
The bug seems to be related to factoring of multivariate expressions including `sympy.I`. A shorter reproduction example is ```py import sympy a, b = sympy.symbols("a b") ((b - sympy.I)**2 * (b + sympy.I) * (a + 1)).expand().factor() ``` which produces an incorrect expression $(a+1)(b^2 + 1)$. The originally ...
[ { "body": "`sympy.factor(expr)` produces the wrong output if an underscore is used in the name of one of the symbols in `expr`.\r\nEDIT: The issue is more general. The correctness of the factorization output depends on the names of the variables. Using symbol names with more than one character also changes the ...
af0c8559a845df49a6d0f8855659cebd0ddc9bc8
{ "head_commit": "2c01ca924ef4ff8aed4f4d0f5b3a222f44ac299a", "head_commit_message": "polys: rename PolyElement.norm_algebraic -> norm", "patch_to_review": "diff --git a/doc/src/modules/polys/internals.rst b/doc/src/modules/polys/internals.rst\nindex 31c8659be326..25d24f6ac28c 100644\n--- a/doc/src/modules/polys/i...
[ { "diff_hunk": "@@ -118,59 +184,203 @@ def dup_sqf_norm(f, K):\n return s, f, r\n \n \n+def _dmp_sqf_norm_shifts(f, u, K):\n+ \"\"\"Generate a sequence of candidate shifts for dmp_sqf_norm.\"\"\"\n+ #\n+ # We want to find a minimal shift if possible because shifting high degree\n+ # variables ca...
82c1557b6a7ea386e0182020b6930e4bfeb64763
diff --git a/doc/src/modules/polys/internals.rst b/doc/src/modules/polys/internals.rst index 31c8659be326..25d24f6ac28c 100644 --- a/doc/src/modules/polys/internals.rst +++ b/doc/src/modules/polys/internals.rst @@ -545,7 +545,9 @@ Polynomial factorization in characteristic zero: .. currentmodule:: sympy.polys.factor...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-26346@3a74b4f
sympy/sympy
Python
26,346
Fixed Maximum bending moment bug in physics beam
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-03-10T21:52:17Z
max bending moment bug ```python from sympy.physics.continuum_mechanics.beam import Beam from sympy import symbols L1 = 6.2 L2 = 1.3 E, I = symbols('E, I') R1, R2 = symbols('R1, R2') trave = Beam(L1+L2, E, I) trave.apply_load(R1, 0, -1) trave.apply_load(R2, L1, -1) trave.apply_load(10,0,0) trave.bc_d...
[ { "body": "```python\r\nfrom sympy.physics.continuum_mechanics.beam import Beam\r\nfrom sympy import symbols\r\n\r\nL1 = 6.2\r\nL2 = 1.3\r\n\r\nE, I = symbols('E, I')\r\nR1, R2 = symbols('R1, R2')\r\ntrave = Beam(L1+L2, E, I)\r\ntrave.apply_load(R1, 0, -1)\r\ntrave.apply_load(R2, L1, -1)\r\n\r\ntrave.apply_load...
07da3cec213b829d1edef980bd44b3547ffb0f8c
{ "head_commit": "3a74b4fcf087b6cad20c9bd54f491b5f3c2d3f98", "head_commit_message": "Apply suggestions from code review", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 20b4d5efc52e..f64d79255ec8 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1119,6 +1119,7 @@ Prateek Papriwal <papriwalprateek@gmail.com...
[ { "diff_hunk": "@@ -1417,8 +1417,15 @@ def _solve(f, *symbols, **flags):\n result = set()\n if any(e.is_zero for e, c in f.args):\n f = f.simplify() # failure imminent w/o help\n- for i, (expr, cond) in enumerate(f.args):\n- if expr.is_zero:\n+\n+ cond = neg...
2a6c98fca9229cc31d87a4f0af362ed1e08579a1
diff --git a/.mailmap b/.mailmap index 20b4d5efc52e..f64d79255ec8 100644 --- a/.mailmap +++ b/.mailmap @@ -1119,6 +1119,7 @@ Prateek Papriwal <papriwalprateek@gmail.com> Praveen Sahu <povinsahu@gmail.com> povinsahu1909 <povinsahu@gmail.com> Prayush Dawda <35144226+iamprayush@users.noreply.github.com> Prempal Singh <...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26232@f71a407
sympy/sympy
Python
26,232
Patched Wigner3j not working with float that were half integers
This pull request addresses an issue where the Wigner3j function would raise a ValueError when encountering half-integer inputs recognized as floats. The problem stemmed from incomplete validation checks, which failed to properly handle such inputs. #### References to other Issues or PRs Fixed #26219 #### Brie...
2024-02-15T16:26:41Z
Wigner3j has problems with Half Integers I was trying to find the result of this operation and am getting this error for half integers ``` >>> w3j = Wigner3j(0,0,1/2,1/2,1/2,-1/2) >>> w3j.doit() Traceback (most recent call last): File "<console>", line 1, in <module> File "D:\Orgs\sympy\sympy\physics\qua...
What happens if rational numbers are used instead of floats? ``` import sympy from sympy import Rational import sympy.physics.wigner as w a = Rational(1,2) b=w.Wigner3j(a,a,a,a,a,a) b.doit() 0 ``` I think Rationals are working fine in my case , although I dont think there should be any difference in handling sympy ra...
[ { "body": "I was trying to find the result of this operation and am getting this error for half integers\r\n```\r\n>>> w3j = Wigner3j(0,0,1/2,1/2,1/2,-1/2) \r\n>>> w3j.doit()\r\nTraceback (most recent call last):\r\n File \"<console>\", line 1, in <module>\r\n File \"D:\\Orgs\\sympy\\sympy\\physics\\quantu...
101e6d0215b5ada022577f1b77e512e54f24b59e
{ "head_commit": "f71a407033a38de213510c3f4a3a51c085690ae2", "head_commit_message": " Wigner3j : Fix inner function and add test case\n\nThis commit addresses an issue with the inner function in the\nwigner_3j calculation method in the sympy.physics.wigner m...
[ { "diff_hunk": "@@ -107,7 +107,7 @@ def _calc_factlist(nn):\n _Factlist.append(_Factlist[ii - 1] * ii)\n return _Factlist[:int(nn) + 1]\n \n-\n+from fractions import Fraction", "line": null, "original_line": 110, "original_start_line": null, "path": "sympy/physics/wigner.py", ...
c24377369348c8070167785e1ba5ac303eeae6d8
diff --git a/.mailmap b/.mailmap index 20b4d5efc52e..327176212189 100644 --- a/.mailmap +++ b/.mailmap @@ -1378,6 +1378,7 @@ Sushant Hiray <hiraysushant@gmail.com> Susumu Ishizuka <susumu.ishizuka@kii.com> Swapnil Agarwal <swapnilag29@gmail.com> Szymon Mieszczak <szymon.mieszczak@gmail.com> +T-vaccari <05-gesto-foll...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26180@03df4d9
sympy/sympy
Python
26,180
Polys: Refine dup_clear_denoms function and update tests
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-02-05T14:02:18Z
CoercionFailed when integrating exponential functions. But only for some values - why? I am using sympy to solve and evaluate integrals. For some values, I get the error about coercion failed: _raise CoercionFailed("Cannot convert %s of type %s from %s to %s" % (element, type(element), base, self)) sympy.polys.poly...
The problem is: ```python In [11]: integrate(2.999*exp(-x)/(2.83*x + 1), (x, 0, 1)) --------------------------------------------------------------------------- CoercionFailed ``` More directly the problem is: ```python In [18]: Poly([F(8.48717/(8.0089*x + 2.83)), F(0.0)], y, domain=F).clear_denoms() Out[18]: (...
[ { "body": "I am using sympy to solve and evaluate integrals. For some values, I get the error about coercion failed:\r\n\r\n_raise CoercionFailed(\"Cannot convert %s of type %s from %s to %s\" % (element, type(element), base, self))\r\nsympy.polys.polyerrors.CoercionFailed: Cannot convert (8.48717*_Dummy_6413 +...
a2122a82cd64d5b4cbd93ed4bba0641f6afb4770
{ "head_commit": "03df4d9ec94b384e9c79871fcf650bde211ddea9", "head_commit_message": "This commit refines the `dup_clear_denoms` function within the polys module, focusing on enhancing its efficiency and reliability when dealing with exact domains. The adjustments ensure that the function more accurately clears deno...
[ { "diff_hunk": "@@ -613,6 +612,9 @@ def test_dup_sign_variations():\n \n \n def test_dup_clear_denoms():\n+\n+ x = symbols('x')\n+", "line": null, "original_line": 617, "original_start_line": 615, "path": "sympy/polys/tests/test_densetools.py", "start_line": null, "text": "@user1:\n``...
56018d272ea7076fa8e29968d5019be518667fa4
diff --git a/sympy/polys/densetools.py b/sympy/polys/densetools.py index b56a4a773b6b..ecd1c98c3be3 100644 --- a/sympy/polys/densetools.py +++ b/sympy/polys/densetools.py @@ -1199,13 +1199,20 @@ def dup_clear_denoms(f, K0, K1=None, convert=False): for c in f: common = K1.lcm(common, K0.denom(c)) - if...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26173@edc3e5b
sympy/sympy
Python
26,173
[integrals] fix substitution formula in meijerint
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-02-04T06:31:35Z
Wrong result for a simple integral `sympy.integrate` returns a wrong result for a simple integral of a Gaussian function. The following code ```python import sympy as sp x = sp.Symbol('x') f = sp.exp(-0.8*x**2) sp.integrate(f, (x, -3, -0.2)) ``` returns $−0.447288590994492\sqrt{\pi}$, which has the correct magni...
In fact if we calculate the indefinite integral first and then substitute limits, sympy gives a correct result : ``` indefinite_integral = sp.integrate(f, x) result = indefinite_integral.subs(x, -0.2) - indefinite_integral.subs(x, -3) ``` One of the reason for this disparity I believe is because sympy evaluat...
[ { "body": "`sympy.integrate` returns a wrong result for a simple integral of a Gaussian function. The following code\r\n```python\r\nimport sympy as sp\r\nx = sp.Symbol('x')\r\nf = sp.exp(-0.8*x**2)\r\nsp.integrate(f, (x, -3, -0.2))\r\n```\r\nreturns $−0.447288590994492\\sqrt{\\pi}$, which has the correct magni...
d447356bacf8c6d0db1c4f118c7c1188c4ef33a5
{ "head_commit": "edc3e5bef72ec8afa801a1f4e89f01f4ab1cdf93", "head_commit_message": "25786 fix test", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 0a73b94bf2b5..7ceb7715d2e9 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -945,6 +945,7 @@ Matthew Wardrop <matthew.wardrop@airbnb.com>\n Matthias Bussonnie...
[ { "diff_hunk": "@@ -755,10 +755,15 @@ def test_issue_6462():\n \n def test_indefinite_1_bug():\n assert integrate((b + t)**(-a), t, meijerg=True\n- ) == -b**(1 - a)*(1 + t/b)**(1 - a)/(a - 1)\n+ ).equals(-b**(1 - a)*(1 + t/b)**(1 - a)/(a - 1))", "line": null, "original_line": 758, ...
7f246d740ad6d780f03fca4b415ddcb632c0133b
diff --git a/.mailmap b/.mailmap index 0a73b94bf2b5..7ceb7715d2e9 100644 --- a/.mailmap +++ b/.mailmap @@ -945,6 +945,7 @@ Matthew Wardrop <matthew.wardrop@airbnb.com> Matthias Bussonnier <bussonniermatthias@gmail.com> Matthias Geier <Matthias.Geier@gmail.com> Matthias Köppe <mkoeppe@math.ucdavis.edu> Matthias Koepp...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-26052@fb4f780
sympy/sympy
Python
26,052
Add test case for bad subset evaluation
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs Fixes https://github.com/sympy/sympy/issues/9855 #### Brief description of what is fixed or changed Add test case for issue https://github.com/symp...
2024-01-08T16:51:51Z
bad subset evaluation > > > x, y, z = symbols('x, y, z', real=True) > > > s1 = Interval(1,x) & Interval(y,2) > > > s2 = Interval(1,2) > > > s1.is_subset(s2) > > > False > > > simplify(s1.contains(z) >> s2.contains(z)) > > > True
Looks like this might be fixed: ```python >>> s1.is_subset(s2) is None True ``` The `is_subset` result was changed from False to None in 31c2dfa2ed466bbd644ade6ad14bbfb7ecbb33a0 from #17526. On the other hand the correct answer is True so None is suboptimal here. I'm not sure if there is a simple way to improve ...
[ { "body": "> > > x, y, z = symbols('x, y, z', real=True)\n> > > s1 = Interval(1,x) & Interval(y,2)\n> > > s2 = Interval(1,2)\n> > > s1.is_subset(s2)\n> > > False\n> > > simplify(s1.contains(z) >> s2.contains(z))\n> > > True\n", "number": 9855, "title": "bad subset evaluation" } ]
02eeb233a4078fb5f97a76bafbb36433691b372b
{ "head_commit": "fb4f7800194be27e633ad6c21b775c0833eeaf1d", "head_commit_message": "Add test case for isssue 9855", "patch_to_review": "diff --git a/sympy/sets/tests/test_sets.py b/sympy/sets/tests/test_sets.py\nindex 47426479e98f..4bceadbf6f01 100644\n--- a/sympy/sets/tests/test_sets.py\n+++ b/sympy/sets/tests/...
[ { "diff_hunk": "@@ -1744,3 +1744,10 @@ def test_issue_14336():\n x = Symbol(\"x\")\n U -= U.intersect(Ne(x, 1).as_set())\n U -= U.intersect(S.true.as_set())\n+\n+def test_issue_9855():\n+ #https://github.com/sympy/sympy/issues/9855\n+ x, y, z = symbols('x, y, z', real=True)\n+ s1 = Interval...
0079834e1d5e9db7bbecd7f55436983e36d87bb6
diff --git a/sympy/sets/tests/test_sets.py b/sympy/sets/tests/test_sets.py index 47426479e98f..657ab19a90eb 100644 --- a/sympy/sets/tests/test_sets.py +++ b/sympy/sets/tests/test_sets.py @@ -1744,3 +1744,10 @@ def test_issue_14336(): x = Symbol("x") U -= U.intersect(Ne(x, 1).as_set()) U -= U.intersect(S....
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-26073@0f19a73
sympy/sympy
Python
26,073
Updated Symbol Docstring
#### References to other Issues or PRs Fixes #22981 #### Brief description of what is fixed or changed Added Explanation, assumptions, Examples, Parameters to the documentation. Added examples about creating symbols by passing Greek symbols and rules for adding subscripts. #### Other comments I am new t...
2024-01-14T00:51:19Z
Docstring for Symbol is very thin I linked to the docstring of `Symbol`, which is one of the most widely used objects in SymPy and was surprised at how little information was present in the docstring. This is all it is: ``` class Symbol(AtomicExpr, Boolean): """ Assumptions: commutative = True ...
@moorepants I want to work on this issue. @moorepants I think even the examples used here should not really be used here instead in the documentation we do have symbols and therefore it should be used there. As a beginner I don't know for sure and it was not mentioned in the documentation but I just think, `sympy.Sy...
[ { "body": "I linked to the docstring of `Symbol`, which is one of the most widely used objects in SymPy and was surprised at how little information was present in the docstring. This is all it is:\r\n\r\n```\r\nclass Symbol(AtomicExpr, Boolean):\r\n \"\"\"\r\n Assumptions:\r\n commutative = True\r\n...
3f7066f0d4f7efde2126715c9f5e1768be832371
{ "head_commit": "0f19a730afeef9710ec970f144dd146ffa50c9a0", "head_commit_message": "Update sympy/core/symbol.py\n\nCo-authored-by: S.Y. Lee <sylee957@gmail.com>", "patch_to_review": "diff --git a/sympy/core/symbol.py b/sympy/core/symbol.py\nindex 68c89874c97f..4e5c754fff32 100644\n--- a/sympy/core/symbol.py\n++...
[ { "diff_hunk": "@@ -205,21 +205,56 @@ def numbered_string_incr(s, start=0):\n \n class Symbol(AtomicExpr, Boolean):\n \"\"\"\n+ Symbol class is used to create symbolic variables.\n+\n+ Explanation\n+ ===========\n+\n+ Symbolic variables are placeholders for mathematical symbols that can represen...
0962d0549d53bbf0a33de597533e0b47e91328c1
diff --git a/.mailmap b/.mailmap index 9260c4d775dd..54a946dd2571 100644 --- a/.mailmap +++ b/.mailmap @@ -1488,6 +1488,7 @@ Yeshwanth N <yeshsurya@gmail.com> <yeshwanth.nagaraj@aptean.com> YiDing Jiang <yidinggjiangg@gmail.com> Yicong Guo <guoyicong100@gmail.com> Yogesh Mishra <ymishra013@gmail.com> yogesh1997 <ymi...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
sympy__sympy-26051@12f4278
sympy/sympy
Python
26,051
removing is_commutative
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-01-07T20:21:45Z
IndexedBase non-commutivity fails Hi there, I believe I've found a bug relating to the IndexedBase class, where it doesn't seem to respect non-commutivity of objects. If I have two non-commuting IndexedBase objects `t` and `u`, I would expect that `t[0]*u[0]+u[0]*t[0]!=2*t[0]*u[0]`. The below code highlights the ...
Problem is already here: ```python >>> print(u[0]*t[0]) t[0]*u[0] ``` Seems to be an assumptions problem: ```python In [4]: u[0]._assumptions['commutative'] Out[4]: False In [5]: u[0].is_commutative Out[5]: True ``` Looks like the fix is ```diff diff --git a/sympy/tensor/indexed.py b/sympy/tensor/indexed...
[ { "body": "Hi there, \r\n\r\nI believe I've found a bug relating to the IndexedBase class, where it doesn't seem to respect non-commutivity of objects. If I have two non-commuting IndexedBase objects `t` and `u`, I would expect that `t[0]*u[0]+u[0]*t[0]!=2*t[0]*u[0]`. The below code highlights the issue, show...
02eeb233a4078fb5f97a76bafbb36433691b372b
{ "head_commit": "12f427839f71789241df5a2ad80678727783a2fc", "head_commit_message": "removing is_commutative", "patch_to_review": "diff --git a/sympy/tensor/indexed.py b/sympy/tensor/indexed.py\nindex ff372ac655d9..8be0bd902b1c 100644\n--- a/sympy/tensor/indexed.py\n+++ b/sympy/tensor/indexed.py\n@@ -139,7 +139,6...
[ { "diff_hunk": "@@ -501,3 +501,10 @@ def test_complicated_derivative_with_Indexed():\n ((x[i] - y[i])**2/sigma,)\n )/sigma**2\n )\n+\n+\n+def test_IndexedBase_commutative():\n+ t = IndexedBase('t' ,commutative=False)\n+ u = IndexedBase('u' ,commutative=False)", "line": null, ...
27b9ccee4a4f49a1e25cb433fc03b0454e4142a9
diff --git a/.mailmap b/.mailmap index baec495a41c1..e87829efc992 100644 --- a/.mailmap +++ b/.mailmap @@ -1501,6 +1501,7 @@ Zach Raines <raineszm@gmail.com> Zachariah Etienne <zachetie@gmail.com> Zamrath Nizam <zamiguy_ni@yahoo.com> <zamiguy.ni@gmail.com> Zaz Brown <zazbrown@zazbrown.com> +Zedmat <104870914+harshka...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-26031@e3f932b
sympy/sympy
Python
26,031
minor changes in mod(a, b)
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-01-01T17:14:01Z
i think mod(a,b) are considering only integers solutions Hello guys, i have a simplification of my code which is: ``` import sympy as sp import itertools Zp = range(3) Zq = range(3) sextetos = itertools.product(Zp, Zp, Zp, Zq, Zq, Zq) x, y, z, w = sp.symbols('x y z w', real=True) system = [] #it will ...
You haven't defined what p and q are. oops, sorry, it was an input, and Zp, Zq was two ranges based on p and q. I decided to send with p and q = 3 to make it more specific, but i forgot to switch all the p and q with the number 3. Sorry. @joaorrmattos I think the following code is a simplified version which removes ...
[ { "body": "Hello guys, i have a simplification of my code which is:\r\n\r\n```\r\nimport sympy as sp\r\nimport itertools\r\n\r\nZp = range(3)\r\nZq = range(3) \r\nsextetos = itertools.product(Zp, Zp, Zp, Zq, Zq, Zq)\r\n\r\n\r\nx, y, z, w = sp.symbols('x y z w', real=True)\r\nsystem = []\r\n#it will test the gen...
c81c8169142f14a1b427664e073cde196f111d53
{ "head_commit": "e3f932bd290c7dc7959de4438b9848e9954a6f62", "head_commit_message": "Adding test cases", "patch_to_review": "diff --git a/sympy/core/mod.py b/sympy/core/mod.py\nindex 873e815cb227..3f0e07a5612c 100644\n--- a/sympy/core/mod.py\n+++ b/sympy/core/mod.py\n@@ -164,8 +164,10 @@ def number_eval(p, q):\n ...
[ { "diff_hunk": "@@ -682,6 +682,7 @@ def test_sympy__core__function__WildFunction():\n def test_sympy__core__mod__Mod():\n from sympy.core.mod import Mod\n assert _test_args(Mod(x, 2))\n+ assert _test_args(Mod(3*x, 2))", "line": null, "original_line": 685, "original_start_line": null, ...
d276455c8a70f84f5e7398fe17677272c0162d0d
diff --git a/sympy/core/mod.py b/sympy/core/mod.py index 873e815cb227..3f0e07a5612c 100644 --- a/sympy/core/mod.py +++ b/sympy/core/mod.py @@ -164,8 +164,10 @@ def number_eval(p, q): return prod_non_mod*cls(net, q) if q.is_Integer and q is not S.One: - non_mod_l = [i % q i...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25982@bfd5e77
sympy/sympy
Python
25,982
polys: add RR[x].is_Exact == False
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-12-13T11:18:43Z
Question about sympy.solve / sympy.nonlinsolve I am trying to solve the nonlinear system of equations below. (These are the three 'law of cosine' equations, I found them in the internet.) ``` a1, b1, c1, ca, cb, cg = sm.symbols('a1, b1, c1, ca, cb, cg') eq1 = a1*a1 + b1*b1 - 2.*a1*b1*cg - c1*c1 eq2 = a1*a1 + c1*c1 ...
If you change the floats to integers then it solves very quickly: ```python In [7]: a1, b1, c1, ca, cb, cg = sm.symbols('a1, b1, c1, ca, cb, cg') ...: eq1 = a1*a1 + b1*b1 - 2*a1*b1*cg - c1*c1 ...: eq2 = a1*a1 + c1*c1 - 2*a1*c1*cb - b1*b1 ...: eq3 = b1*b1 + c1*c1 - 2*b1*c1*ca - a1*a1 ...: ...: %ti...
[ { "body": "I am trying to solve the nonlinear system of equations below. (These are the three 'law of cosine' equations, I found them in the internet.)\r\n```\r\na1, b1, c1, ca, cb, cg = sm.symbols('a1, b1, c1, ca, cb, cg')\r\neq1 = a1*a1 + b1*b1 - 2.*a1*b1*cg - c1*c1\r\neq2 = a1*a1 + c1*c1 - 2.*a1*c1*cb - b1*b...
ffd3f417742ecb9ee0cc0820677980ce78d8ea7d
{ "head_commit": "bfd5e774dacebb257b15dcacdd3310108c9126df", "head_commit_message": "polys: don't convert to exact domain for RR[z] gcd", "patch_to_review": "diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py\nindex f3839e22d1cd..aa3411864e10 100644\n--- a/sympy/core/numbers.py\n+++ b/sympy/core/numbers.p...
[ { "diff_hunk": "@@ -1489,7 +1489,19 @@ def dup_inner_gcd(f, g, K):\n (x - 1, x + 1, x - 2)\n \n \"\"\"\n- if not K.is_Exact:\n+ # XXX: This used to check for K.is_Exact but leads to awkward results when\n+ # the domain is something like RR[z] e.g.:\n+ #\n+ # >>> g, p, q = Poly(1, x).cance...
5b64014b3b50e1fdc5e95d857940a4136792c652
diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py index f3839e22d1cd..aa3411864e10 100644 --- a/sympy/core/numbers.py +++ b/sympy/core/numbers.py @@ -4248,6 +4248,53 @@ def equal_valued(x, y): return (1 << neg_exp) == q +def all_close(expr1, expr2, rtol=1e-5, atol=1e-8): + """Return True if exp...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-26036@e8ed910
sympy/sympy
Python
26,036
Fix for bug in pow class
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2024-01-02T15:18:50Z
Series expansion not working Hello, In our project we use very large functions and a lot of series expansions throw a "not implemented error". I managed to extract a relatively simple case: `(1/sqrt(( - y + 1)**2 + (y - 0.23)**4)).series(y,x0=0,n=5)` When using `apart()` the series expansion works: `apart(...
Hey @RagonEbker thanks for reporting this issue. We actually have the necessary tools to address the above case. The problem lies here https://github.com/sympy/sympy/blob/aa6db7c688855c181e020929dd34b9639dec64ad/sympy/core/power.py#L1581-L1586 Let's say we want to calculate the series for `(1/sqrt(( - y + 1)**2 ...
[ { "body": "Hello,\r\n\r\nIn our project we use very large functions and a lot of series expansions throw a \"not implemented error\". I managed to extract a relatively simple case:\r\n\r\n`(1/sqrt(( - y + 1)**2 + (y - 0.23)**4)).series(y,x0=0,n=5)`\r\n\r\nWhen using `apart()` the series expansion works: \r\n\r\...
b354658bfd7b863ee59897321d9645efbb9d1f57
{ "head_commit": "e8ed910523b3cb18581470335c74b0e2be6c53b4", "head_commit_message": "changes added\n\nSigned-off-by: arnabnandikgp <arnabnandi2002@gmail.com>", "patch_to_review": "diff --git a/sympy/core/power.py b/sympy/core/power.py\nindex a8dc47bdfe67..d695e7d08320 100644\n--- a/sympy/core/power.py\n+++ b/symp...
[ { "diff_hunk": "@@ -1533,7 +1533,8 @@ def _eval_nseries(self, x, n, logx, cdir=0):\n return res\n \n f = b.as_leading_term(x, logx=logx)\n- g = (b/f - S.One).cancel(expand=False)\n+ g = (b.expand() - f).cancel()", "line": null, "original_line": 1536, "original_s...
cabd6483017136e2b1909e3a75d00df62043aa6e
diff --git a/sympy/core/power.py b/sympy/core/power.py index a8dc47bdfe67..e6e9e310db47 100644 --- a/sympy/core/power.py +++ b/sympy/core/power.py @@ -1533,7 +1533,8 @@ def _eval_nseries(self, x, n, logx, cdir=0): return res f = b.as_leading_term(x, logx=logx) - g = (b/f - S.One).canc...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25875@4f91444
sympy/sympy
Python
25,875
Float(0).is_integer is True, Float(1.1).is_integer is False, Float(1) is None
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-11-05T03:44:33Z
`is_zero` broken for integer/float comparison Not sure if this is a recent regression, but comparing an integer-assumption symbol to a Float (or a non-integer to an `Integer`) returns the wrong value: ```python >>> i = Symbol('x', integer=True) >>> Eq(i, 1.0) False >>> Eq(i, 1) Eq(x, 1) >>> ni = Symbol('x', ...
It's been this way all the way back to SymPy 1.2 and is because of this: ```python In [1]: Float(1) Out[1]: 1.00000000000000 In [2]: Float(1).is_integer Out[2]: False ``` That in turn is because of this: https://github.com/sympy/sympy/blob/997749da1838628eaeb077c7ab32da6666912e13/sympy/core/numbers.py#L1239-L...
[ { "body": "Not sure if this is a recent regression, but comparing an integer-assumption symbol to a Float (or a non-integer to an `Integer`) returns the wrong value:\r\n\r\n```python\r\n>>> i = Symbol('x', integer=True)\r\n>>> Eq(i, 1.0)\r\nFalse\r\n>>> Eq(i, 1)\r\nEq(x, 1)\r\n\r\n>>> ni = Symbol('x', integer=F...
1770afaff55220b9f893fedb5b889f698826bf58
{ "head_commit": "4f914443104958edf49e9014c922e2d0c2adabd2", "head_commit_message": "Update sympy/assumptions/handlers/ntheory.py", "patch_to_review": "diff --git a/sympy/assumptions/handlers/ntheory.py b/sympy/assumptions/handlers/ntheory.py\nindex 4f1397b283ee..ccb91f726e2e 100644\n--- a/sympy/assumptions/handl...
[ { "diff_hunk": "@@ -98,10 +98,10 @@ def test_float_1():\n assert ask(Q.positive(z)) is True\n assert ask(Q.negative(z)) is False\n assert ask(Q.even(z)) is False", "line": null, "original_line": 100, "original_start_line": null, "path": "sympy/assumptions/tests/test_query.py", "s...
b8d349dd8e1639a88442f8ba88cc82a6c1cb8611
diff --git a/sympy/assumptions/handlers/ntheory.py b/sympy/assumptions/handlers/ntheory.py index 4f1397b283ee..ccb91f726e2e 100644 --- a/sympy/assumptions/handlers/ntheory.py +++ b/sympy/assumptions/handlers/ntheory.py @@ -5,7 +5,7 @@ from sympy.assumptions import Q, ask from sympy.core import Add, Basic, Expr, Float...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-25916@6aeff4f
sympy/sympy
Python
25,916
changing orient_explicit method to orient_dcm method, also adding new method orient_explicit
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-11-21T18:16:13Z
Add new method that is more intuitive than orient_explicit() The mechanics method `orient_explicit()` takes a direction cosine matrix that is the inverse of what a `ReferenceFrame.dcm()` outputs and it is confusing. We have to make clear warnings about this everywhere. It was a mistake that we designed it this way (or ...
So far as I see, we just need to handle the transposing inside the `orient_from_dcm()`, right? I can work on this. @moorepants could you confirm my approach to this? If we keep orient_explicit, then you can just have the new method call orient_explicit. I think that having two methods, which do the same but use the tra...
[ { "body": "The mechanics method `orient_explicit()` takes a direction cosine matrix that is the inverse of what a `ReferenceFrame.dcm()` outputs and it is confusing. We have to make clear warnings about this everywhere. It was a mistake that we designed it this way (or rather didn't design it).\r\n\r\nThis show...
69d3af720c7449a9dcddf17b7e2a4e8724caf15a
{ "head_commit": "6aeff4f2a0a1f43ef8671899eeba6f87ef1a5688", "head_commit_message": "Adding .mailmap", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 34ec49129623..95b414ba51c1 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -654,6 +654,7 @@ Harold Erbin <harold.erbin@gmail.com>\n Harrison Oates <48871176...
[ { "diff_hunk": "@@ -720,57 +720,38 @@ def orient_explicit(self, parent, dcm):\n dcm : Matrix, shape(3, 3)\n Direction cosine matrix that specifies the relative rotation\n between the two reference frames.\n-\n+ rotation matrix : Matrix Rotation Direction\n+ The ...
f2da0e41c4d42ca7171f334c15efb1de00bf562b
diff --git a/.mailmap b/.mailmap index 34ec49129623..5e153ae5e20b 100644 --- a/.mailmap +++ b/.mailmap @@ -657,6 +657,7 @@ Harry Zheng <harry@harryzheng.com> Harsh Agarwal <hagarwal9200@gmail.com> Harsh Gupta <mail@hargup.in> <gupta.harsh96@gmail.com> Harsh Jain <harshjniitr@gmail.com> +Harsh Kasat <hkasat@waymore.i...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sympy__sympy-25822@838de45
sympy/sympy
Python
25,822
watch for iterable sols
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-10-23T13:57:23Z
AttributeError: when solve differential equation: `y(x).diff(x).diff(x)*y(x)**3+49` ```python from sympy import Derivative, Function, Symbol, dsolve x = Symbol('x') y = Function('y') dsolve(y(x).diff(x).diff(x)*y(x)**3+49, y(x)) ``` the error: ```python Traceback (most recent call last): File "sympy/solver...
Some how the solutions are being returned from somewhere as a list of lists of solutions rather than a list of solutions. ```diff diff --git a/sympy/solvers/ode/ode.py b/sympy/solvers/ode/ode.py index 75bccdf8d5..4fc6d75d01 100644 --- a/sympy/solvers/ode/ode.py +++ b/sympy/solvers/ode/ode.py @@ -639,6 +639,7 @@ de...
[ { "body": "```python\r\nfrom sympy import Derivative, Function, Symbol, dsolve\r\nx = Symbol('x')\r\ny = Function('y')\r\ndsolve(y(x).diff(x).diff(x)*y(x)**3+49, y(x))\r\n```\r\n\r\nthe error:\r\n```python\r\nTraceback (most recent call last):\r\n File \"sympy/solvers/ode/ode.py\", line 640, in dsolve\r\n r...
4cc0be9f5533ea5ffb9c50c5ccb96af810d70417
{ "head_commit": "838de45b18f7a4be7e0b85ed4da3ddc053fbbc6c", "head_commit_message": "watch for iterable sols", "patch_to_review": "diff --git a/sympy/solvers/ode/ode.py b/sympy/solvers/ode/ode.py\nindex 75bccdf8d56b..d9d40e37f4fe 100644\n--- a/sympy/solvers/ode/ode.py\n+++ b/sympy/solvers/ode/ode.py\n@@ -639,6 +6...
[ { "diff_hunk": "@@ -1094,3 +1094,12 @@ def test_issue_23425():\n assert classify_ode(eq) == \\\n ('Liouville', 'nth_order_reducible', \\\n '2nd_power_series_ordinary', 'Liouville_Integral')\n+\n+\n+def test_issue_25820():\n+ x = Symbol('x')\n+ y = Function('y')\n+ eq = y(x)**3*Deriv...
0e79b9b492a0e1db0e98e17cec77124c407cb214
diff --git a/sympy/solvers/ode/ode.py b/sympy/solvers/ode/ode.py index 75bccdf8d56b..d9d40e37f4fe 100644 --- a/sympy/solvers/ode/ode.py +++ b/sympy/solvers/ode/ode.py @@ -639,6 +639,7 @@ def recur_len(l): hint = hints['hint'] return _helper_simplify(eq, hint, hints, simplify, ics=ics) + def...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25814@0f39e0d
sympy/sympy
Python
25,814
Reject unordered sets in linear_eq_to_matrix
#### References to other Issues or PRs Fixes https://github.com/sympy/sympy/pull/25812 This PR contains the squashed commit version of the previously closed #25812 . This new PR do not have commits which will unintentionally affect a large number of lines in the blame. Fixes https://github.com/sympy/sympy/issues...
2023-10-21T04:34:08Z
`linear_eq_to_matrix` should reject unordered symbols Although dictionaries are ordered in newer Python versions, sets are unordered and should be rejected as input to `linear_eq_to_matrix` which returns the linear coefficients for one or more expressions *in the order that symbols are given*. Although the routine whic...
Can I work on this?
[ { "body": "Although dictionaries are ordered in newer Python versions, sets are unordered and should be rejected as input to `linear_eq_to_matrix` which returns the linear coefficients for one or more expressions *in the order that symbols are given*. Although the routine which this function uses will order the...
c226febc80e48826d4314f63a391b31c4d20cfeb
{ "head_commit": "0f39e0dfb4462698318d3b855c70c4d509854f19", "head_commit_message": "Reject unordered sets in linear_eq_to_matrix\n\nPrevious implementations allowed unordered sets as inputs for\nlinear_eq_to_matrix, leading to unpredictable outputs. This change\nintroduces input validation to ensure that the symbo...
[ { "diff_hunk": "@@ -3271,3 +3271,13 @@ def test_issue_22628():\n \n def test_issue_25781():\n assert solve(sqrt(x/2) - x) == [0, S.Half]\n+\n+\n+def test_issue_25423():\n+ x, y = symbols('x y')\n+ equations1 = []\n+ equations2 = [2 * x + 3 * y - 1]\n+ nonlinear_equations = [x ** 2 + y ** 2 - 1, ...
aa3db964d220c750d0a00aef264506bb0c94f3dd
diff --git a/.mailmap b/.mailmap index 80e50bcc92c1..512b3fd19773 100644 --- a/.mailmap +++ b/.mailmap @@ -466,6 +466,7 @@ Colin B. Macdonald <cbm@m.fsf.org> <macdonald@maths.ox.ac.uk> Colin Marquardt <github@marquardt-home.de> Colleen Lee <colleenclee@gmail.com> <clee@coursera.org> Comer Duncan <comer.duncan@gmail....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25717@6b7112f
sympy/sympy
Python
25,717
Fix Rational parsing in Mathematica parser
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs Fixes #25716 #### Brief description of what is fixed or changed The Mathematica parser at present creates an `AppliedUndef` function with the same na...
2023-09-22T14:42:48Z
'Rational[m,n]' conversion from Mathematica fails to create a Rational Minimal working example: ``` > from sympy.parsing.mathematica import parse_mathematica > parse_mathematica("Rational[1,2]") Rational(1, 2) > parse_mathematica("Rational[1,2]") + 2 AttributeError: 'Rational' object has no attribute 'p' ``` ...
[ { "body": "Minimal working example:\r\n\r\n```\r\n> from sympy.parsing.mathematica import parse_mathematica\r\n> parse_mathematica(\"Rational[1,2]\")\r\nRational(1, 2)\r\n> parse_mathematica(\"Rational[1,2]\") + 2\r\nAttributeError: 'Rational' object has no attribute 'p'\r\n```\r\n\r\nI have investigated this a...
c0c175e3ab05b40edc44b445a55c076820a8f2e2
{ "head_commit": "6b7112f1f19f0c3466d5ad430980b553f66950a6", "head_commit_message": "Added test for Rational conversion in Mathematica parser", "patch_to_review": "diff --git a/sympy/parsing/mathematica.py b/sympy/parsing/mathematica.py\nindex d0cbe7f7b13f..09414d11628e 100644\n--- a/sympy/parsing/mathematica.py\...
[ { "diff_hunk": "@@ -975,6 +976,7 @@ def converter(expr):\n \"Times\": Mul,\n \"Plus\": Add,\n \"Power\": Pow,\n+ \"Rational\": lambda *a: Rational(*a),", "line": null, "original_line": 979, "original_start_line": null, "path": "sympy/parsing/mathematica.py", "s...
fcf8232737a2b4f9f0c64218f40d9b75be806497
diff --git a/.mailmap b/.mailmap index 99e41da3b539..fa4f81a43713 100644 --- a/.mailmap +++ b/.mailmap @@ -706,6 +706,7 @@ James Goppert <james.goppert@gmail.com> James Harrop <ebc121@gmail.com> James Pearson <xiong.chiamiov@gmail.com> James Taylor <user234683@tutanota.com> +James Whitehead <whiteheadj@gmail.com> jc...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-25706@970e61a
sympy/sympy
Python
25,706
remove `Eq.rewrite(Add)`
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-09-20T03:02:33Z
TypeError on Eq(2*sign(x + 3)/(5*Abs(x + 3)**(3/5)), 0) ```python from sympy import Symbol, Eq, sign, Abs, Rational x = Symbol('x', real=True) eq = Eq(2*sign(x + 3)/(5*Abs(x + 3)**Rational(3, 5)), 0) eq.simplify() ``` Result: ``` Traceback (most recent call last): File "/home/satels/workenv/krcore/...
This is because an `Eq` is rewritten as an `Add`: ```python In [4]: Eq(x, 2).rewrite(Add) Out[4]: x - 2 ``` I have said before that this rewrite rule is a mistake: rewrite is not expected to turn one kind of expression into a different kind and in this case a Boolean should not be rewritten to an Expr. This is ...
[ { "body": "```python\r\nfrom sympy import Symbol, Eq, sign, Abs, Rational\r\n\r\nx = Symbol('x', real=True)\r\n\r\neq = Eq(2*sign(x + 3)/(5*Abs(x + 3)**Rational(3, 5)), 0)\r\n\r\neq.simplify()\r\n\r\n```\r\n\r\nResult:\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/satels/workenv/krcore/lib/pyth...
67c72efedfbddc20589f463fe1a8c813640b6349
{ "head_commit": "970e61a553f4df14964dfb5544b6225be2ab7601", "head_commit_message": "e.rewrite(Add) -> e.lhs_rhs()", "patch_to_review": "diff --git a/sympy/calculus/util.py b/sympy/calculus/util.py\nindex e140396d8cd7..2e9bfab05108 100644\n--- a/sympy/calculus/util.py\n+++ b/sympy/calculus/util.py\n@@ -422,7 +422...
[ { "diff_hunk": "@@ -422,7 +422,7 @@ def _check(orig_f, period):\n period = None\n \n if isinstance(f, Relational):\n- f = f.lhs - f.rhs\n+ f = f.lhs_rhs()", "line": null, "original_line": 425, "original_start_line": null, "path": "sympy/calculus/util.py", "start_line": ...
30af3bc3e5394ce4efcd25c65bd7879307ef1eba
diff --git a/doc/src/explanation/active-deprecations.md b/doc/src/explanation/active-deprecations.md index 8cb667933931..a4752713f2f8 100644 --- a/doc/src/explanation/active-deprecations.md +++ b/doc/src/explanation/active-deprecations.md @@ -76,6 +76,16 @@ SymPy deprecation warnings. ## Version 1.13 +(eq-rewrite-...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25528@7586c52
sympy/sympy
Python
25,528
Improve Logical Simplification Handling in sympy.logic.boolalg
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs Fixes #25451 <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-clo...
2023-08-16T09:54:16Z
Incorrect simplification when mixing basic logical operators and equality Have I misunderstood something about how sympy is supposed to work? This basic simplification of a small logical expression is incorrect. ```python from sympy import * a,b,c = symbols("a b c") expr = Or(And(a,c), Eq(a,b)) # incorrect...
You are right that this simplification is incorrect: ```python In [18]: c1 = And(a, c) In [19]: c2 = Eq(a, b) In [20]: c1 Out[20]: a ∧ c In [21]: c2 Out[21]: a = b In [22]: c1 | c2 Out[22]: a ∧ c ``` Probably somewhere this comes from mixing up the idea of Symbol as being both `Expr` and `Boolean` (t...
[ { "body": "Have I misunderstood something about how sympy is supposed to work? This basic simplification of a small logical expression is incorrect.\r\n\r\n```python\r\nfrom sympy import *\r\n\r\na,b,c = symbols(\"a b c\")\r\n\r\nexpr = Or(And(a,c), Eq(a,b))\r\n\r\n# incorrectly simplifies to a & c\r\nprint(exp...
3236f7439c989486b83226a4ae8e342575a6ec9f
{ "head_commit": "7586c5240d2a2ca9beef6ac8ed8cf6ad79f4d256", "head_commit_message": "Update .mailmap", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 34c061d0b266..20c42ee993f7 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1352,6 +1352,7 @@ Tanu Hari Dixit <tokencolour@gmail.com>\n Tarang Patel <tarang...
[ { "diff_hunk": "@@ -1345,3 +1341,8 @@ def test_relational_threeterm_simplification_patterns_numerically():\n assert originalvalue == simplifiedvalue, \"Original: {}\\nand\"\\\n \" simplified: {}\\ndo not evaluate to the same value for\"\\\n \"{}\".format(p...
5075448785ff9dde2fd05566c358b04329a91bc2
diff --git a/.mailmap b/.mailmap index 34c061d0b266..20c42ee993f7 100644 --- a/.mailmap +++ b/.mailmap @@ -1352,6 +1352,7 @@ Tanu Hari Dixit <tokencolour@gmail.com> Tarang Patel <tarangrockr@gmail.com> <tarang@ubuntu.ubuntu-domain> Tarun Gaba <tarun.gaba7@gmail.com> Tasha Kim <jae_young_kim@brown.edu> +Taylan Sahin ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25556@2d9a292
sympy/sympy
Python
25,556
Added tests to prevent oo and wrong coefficient of Min in piecewise integration for cases with both float and int
#### References to other Issues or PRs Fixes #20781 #### Brief description of what is fixed or changed Test prevents the additional +oo and adds the correct (=2) coefficient in the Min function that calculates piecewise integration with two variables. the problem occurs when both variables showing range of val...
2023-08-20T21:46:16Z
Sympy.integrate wrongfully returns oo when applied on Piecewise with both floats and integers of same value # introduction When integrating the sum of the shown two piecewise functions, it wrongfully returns oo. This happens when floats and integers at functionally the same value appear. IPython console for SymPy ...
Hey @oscarbenjamin @asmeurer the problem is caused by these lines: https://github.com/sympy/sympy/blob/14db44e03a8622da5cfe11f61ff43131ffd1fade/sympy/functions/elementary/piecewise.py#L262-L272 It took a lot of debugging. The problem is that the `current_cond` stores the conditions it had already got for example if ...
[ { "body": "# introduction\r\nWhen integrating the sum of the shown two piecewise functions, it wrongfully returns oo.\r\nThis happens when floats and integers at functionally the same value appear.\r\n\r\nIPython console for SymPy 1.7.1 (Python 3.8.5-64-bit)\r\n\r\n# example\r\n````\r\nimport sympy as sp\r\nx_d...
067e0eaf90158c6b0ef6be14c32d9d9ccd97985b
{ "head_commit": "2d9a2923c06bd9a6d1952cbf8fcd4c52390778c5", "head_commit_message": "added tests for #20781", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex ed9268cc06c1..dd2a1322503d 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -612,6 +612,8 @@ Gaurav Jain <gjain369@gmail.com> Gaurav Jain <72644006+gj...
[ { "diff_hunk": "@@ -2098,6 +2098,16 @@ def test_issue_20782():\n assert integrate(f, (x, -oo, 1)) == 1\n assert integrate(-f, (x, -oo, 1)) == -1\n \n+def test_issue_20781():\n+ x_d = Symbol('x_d')\n+ fun_sum = lambda x, a1, a2: Piecewise((0, x<a1),(1, x>=a1)) + Piecewise((0, x<a2),(1, x>=a2))\n+\n...
0453f2ab1ac770ae07faae8c243c8723305a4e41
diff --git a/.mailmap b/.mailmap index ed9268cc06c1..dd2a1322503d 100644 --- a/.mailmap +++ b/.mailmap @@ -612,6 +612,8 @@ Gaurav Jain <gjain369@gmail.com> Gaurav Jain <72644006+gjain-7@users.noreply.git Gautam Menghani <gum3ng@protonmail.com> gautammenghani <gautammenghani14@gmail.com> Gautam Menghani <gum3ng@proton...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-25283@9e6500a
sympy/sympy
Python
25,283
Add CRootsOf incrementally for eigenvalues
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-06-23T03:45:17Z
incorrect multiplicities from `eigenvals` To reproduce: ``` import numpy as np import sympy as sp print(sp.__version__) dd = sd = [0] * 11 + [1] ds = [2,0,1,0,0,0,1,0,1,0,1,0] ss = ds.copy() ss[8] = 2 def rotate(x, i): return x[i:] + x[:i] mat = [] for i in range(12): mat.append(rotate(ss,i...
I think that some roots are ignored from `roots`. I'm trying to investigate whether the matrix code is responsible for something but `sum(roots(mat.charpoly()).values())` already behaves suspicious. With `multiple=True`, the result seems correct Eigenvects are computable but quite slow though.
[ { "body": "To reproduce:\r\n```\r\nimport numpy as np\r\nimport sympy as sp\r\n\r\nprint(sp.__version__)\r\n\r\ndd = sd = [0] * 11 + [1]\r\nds = [2,0,1,0,0,0,1,0,1,0,1,0]\r\nss = ds.copy()\r\nss[8] = 2\r\n\r\ndef rotate(x, i):\r\n return x[i:] + x[:i]\r\n\r\nmat = []\r\nfor i in range(12):\r\n mat.append(...
9d4517c6b1840aa2c2dfd1617aea32ccedc7041d
{ "head_commit": "9e6500a3348eeb18072fb775681b8050c00c6026", "head_commit_message": "Use counter", "patch_to_review": "diff --git a/sympy/matrices/eigen.py b/sympy/matrices/eigen.py\nindex ea39e83a940c..cc421077a3e8 100644\n--- a/sympy/matrices/eigen.py\n+++ b/sympy/matrices/eigen.py\n@@ -258,7 +258,7 @@ def _eig...
[ { "diff_hunk": "@@ -258,7 +258,7 @@ def _eigenvals_dict(\n f = charpoly.as_expr()\n x = charpoly.gen\n try:\n- eigs = {CRootOf(f, x, idx): 1 for idx in range(degree)}\n+ eigs = Counter(CRootOf(f, x, idx) for idx in range(degree))", "line": nu...
545f9e4c502ec939fe3aaa6e4632600ddcb3c0cc
diff --git a/sympy/matrices/eigen.py b/sympy/matrices/eigen.py index ea39e83a940c..cec37c9e61b0 100644 --- a/sympy/matrices/eigen.py +++ b/sympy/matrices/eigen.py @@ -210,11 +210,8 @@ def _eigenvals_list( eigs = roots(charpoly, multiple=True, **flags) if len(eigs) != block.rows: - degree ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25295@ef8b664
sympy/sympy
Python
25,295
Added the logo to the docs
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-06-27T14:12:05Z
Add logo guide to the docs We should have a page in the docs that just has our logo that people can copy, and a guide on how to use it. Right now the logo is available if you build it in the source, but it's not easily accessible from a Google search.
Hi @asmeurer when you said, 'a guide on how to use it'. Do you mean like a rst file for how to generate the logo?
[ { "body": "We should have a page in the docs that just has our logo that people can copy, and a guide on how to use it. Right now the logo is available if you build it in the source, but it's not easily accessible from a Google search. ", "number": 25275, "title": "Add logo guide to the docs" } ]
ad95bcc5282aecf3085675b2a2658419836c8a91
{ "head_commit": "ef8b6640f75fc2adfe654c2018f026729e8746a7", "head_commit_message": "Moved the SymPy Logo page to the How-To Guides section and added the logo image inline.", "patch_to_review": "diff --git a/doc/src/contributing/documentation-style-guide.rst b/doc/src/contributing/documentation-style-guide.rst\ni...
[ { "diff_hunk": "@@ -0,0 +1,32 @@\n+===========\n+SymPy Logo\n+===========\n+\n+We would like to make it easy for you to include the SymPy project identity in\n+your next academic paper, course materials, or presentation.\n+\n+.. image:: ../logo/sympy.svg\n+ :width: 600\n+ :align: center\n+ :alt: SymPy Logo\...
cbe12dd9a1c496b2477c08aa414d96c8b79aa21a
diff --git a/doc/src/contributing/documentation-style-guide.rst b/doc/src/contributing/documentation-style-guide.rst index 230a5df08420..60f06fea06d0 100644 --- a/doc/src/contributing/documentation-style-guide.rst +++ b/doc/src/contributing/documentation-style-guide.rst @@ -177,7 +177,7 @@ Narrative documentation can b...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
sympy__sympy-25256@40ea678
sympy/sympy
Python
25,256
Removed lazy calculation and storage of norm
#### References to other Issues or PRs Fixes #25254 #### Release Notes <!-- BEGIN RELEASE NOTES --> NO ENTRY <!-- END RELEASE NOTES -->
2023-06-19T08:38:10Z
Quaternions in version 12 Dear friends, I have detected a problem when multiplying Quaternions using the * to do the product between two. It also fails when using q.mul(p). In my case, one of the quaternions was obtained by the "from Axis angle". This code gives me problems: `p= Quaternion(1,0,1,0); q = Quaterni...
CC @evbernardes ```python In [3]: p= Quaternion(1,0,1,0); q = Quaternion.from_axis_angle((1,1,1), 3*np.pi/4); qi =q.inverse() In [4]: q*p --------------------------------------------------------------------------- ValueError: Incompatible value for norm. ``` Hello @singladur. I think the bug itself comes fro...
[ { "body": "Dear friends,\r\nI have detected a problem when multiplying Quaternions using the * to do the product between two. It also fails when using q.mul(p). In my case, one of the quaternions was obtained by the \"from Axis angle\". This code gives me problems:\r\n\r\n`p= Quaternion(1,0,1,0);\r\nq = Quate...
a0673de13b81e06b0fcdba9ea938cbbd098f9ea7
{ "head_commit": "40ea678b641201ed091142267f69479932b1bdd8", "head_commit_message": "fixed test", "patch_to_review": "diff --git a/sympy/algebras/quaternion.py b/sympy/algebras/quaternion.py\nindex d0a8915ee9c0..42dd989ec648 100644\n--- a/sympy/algebras/quaternion.py\n+++ b/sympy/algebras/quaternion.py\n@@ -884,7...
[ { "diff_hunk": "@@ -46,6 +47,18 @@ def test_quaternion_construction_norm():\n assert (q1 * q3).norm() == q1.norm()\n \n \n+def test_issue_25254():\n+ # calculating the inverse cached the norm which caused problems\n+ # when multiplying\n+ p = Quaternion(1, 0, 1, 0)\n+ q = Quaternion.from_axis_an...
5cf7d0e73681c83fb8282f720765108aab011d26
diff --git a/sympy/algebras/quaternion.py b/sympy/algebras/quaternion.py index d0a8915ee9c0..42dd989ec648 100644 --- a/sympy/algebras/quaternion.py +++ b/sympy/algebras/quaternion.py @@ -884,7 +884,7 @@ def norm(self): q = self # trigsimp is used to simplify sin(x)^2 + cos(x)^2 (these terms ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-25056@2e34024
sympy/sympy
Python
25,056
Fix substituting TensExpr in Mul
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-04-15T05:23:48Z
Substituting Tensor into Mul returns Mul rather than TensMul When I substitute a tensor into a Mul (using `subs` or `replace`), I would expect the output to be a `TensMul`, but it remains a `Mul`. (in isympy prompt) ``` In [1]: from sympy import symbols In [2]: from sympy.tensor.tensor import TensorIndexType, ten...
This should be handled with postprocessors, similar to https://github.com/sympy/sympy/blob/master/sympy/matrices/expressions/matexpr.py#L518. More generally, it might be a good idea to make tensor expressions and matrix expressions share some code, but that could be a lot of work. I've made a PR: https://github.com...
[ { "body": "When I substitute a tensor into a Mul (using `subs` or `replace`), I would expect the output to be a `TensMul`, but it remains a `Mul`.\r\n\r\n(in isympy prompt)\r\n```\r\nIn [1]: from sympy import symbols\r\nIn [2]: from sympy.tensor.tensor import TensorIndexType, tensor_indices, TensorHead\r\nIn [3...
bce780e23c0408e76c83d1c2866b469baa1e1e66
{ "head_commit": "2e340240950626c3f652386c98d2370cbf3916f7", "head_commit_message": "tensor: get_postprocessor: remove unnecessary use of list in any()\n\nflake8 does not like it.", "patch_to_review": "diff --git a/sympy/tensor/tensor.py b/sympy/tensor/tensor.py\nindex 3d0c5da67b89..07280946d1fb 100644\n--- a/sym...
[ { "diff_hunk": "@@ -4861,3 +4861,23 @@ def _expand(expr, **kwargs):\n return expr._expand(**kwargs)\n else:\n return expr.expand(**kwargs)\n+\n+\n+def get_postprocessor(cls):\n+ def _postprocessor(expr):\n+ tens_class = {Mul: TensMul, Add: TensAdd}[cls]\n+ if any(isinstance(...
e9e59ff5f8ae169b9f115ab04fd19d48f70b26c5
diff --git a/sympy/tensor/tensor.py b/sympy/tensor/tensor.py index 3d0c5da67b89..9601ae75d8fb 100644 --- a/sympy/tensor/tensor.py +++ b/sympy/tensor/tensor.py @@ -4861,3 +4861,18 @@ def _expand(expr, **kwargs): return expr._expand(**kwargs) else: return expr.expand(**kwargs) + + +def get_postproc...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-24974@8b1e363
sympy/sympy
Python
24,974
physics: Unit dyads access from ReferenceFrames
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-03-25T08:50:06Z
ReferenceFrame should have attributes to access unit dyads and its unit dyadic ReferenceFrame has `.x,.y,.z` to access the unit vectors. It would be nice if you could access unit dyads also with `.xx,.xy,.xz,...`. Then you can construct dyadics without having to do `outer(N.x, N.x)`. This is a simple fix and addition. ...
We could add an attribute for the unit dyadic. Maybe `N.dyadic` or `N.unit`. Not sure what the best name would be. Hello, I am willing to work on this. I wanted to ask if the intended behavior should be something like: ``` python >>> N = ReferenceFrame('N') >>> N.xx (N.x|N.x) >>> N.yz (N.y|N.z) ``` I have some ...
[ { "body": "ReferenceFrame has `.x,.y,.z` to access the unit vectors. It would be nice if you could access unit dyads also with `.xx,.xy,.xz,...`. Then you can construct dyadics without having to do `outer(N.x, N.x)`. This is a simple fix and addition. It would need to be documented and shown in some examples.",...
403b9b0dd24f9bd64e5b599c2ad1e87dad06da44
{ "head_commit": "8b1e36354c4ace4b01d12cb58fde49279e5460d8", "head_commit_message": "Fixed unit dyad example documentation mistake", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex b3945e4c9ad8..856c6064202e 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -802,6 +802,7 @@ Kiyohito Yamazaki <kyamaz@openql.o...
[ { "diff_hunk": "@@ -145,6 +145,30 @@ def __init__(self, name, indices=None, latexs=None, variables=None):\n >>> type(A) == type(D)\n True\n \n+ Unit dyads for the ReferenceFrame can be accessed through the attributes ``xx``, ``xy``, etc. For example:\n+\n+ >>> from sympy.physics.ve...
70d761f30c2173867786e1e0941b26b8f46b6bca
diff --git a/.mailmap b/.mailmap index b3945e4c9ad8..856c6064202e 100644 --- a/.mailmap +++ b/.mailmap @@ -802,6 +802,7 @@ Kiyohito Yamazaki <kyamaz@openql.org> Klaus Rettinghaus <klaus.rettinghaus@enote.com> Konrad Meyer <konrad.meyer@gmail.com> Konstantin Togoi <konstantin.togoi@gmail.com> <togoi.konstantin@outloo...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sympy__sympy-24909@db16c7a
sympy/sympy
Python
24,909
Fix bug when multiplying Prefix and Quantity.
#### References to other Issues or PRs Fixes #24832 #### Brief description of what is fixed or changed Previously, when multiplying a prefix and a quantity, the code would return 1 if the product of their scale factors was equal to 1. This resulted in incorrect output in some cases, such as when multiplying "mill...
2023-03-13T14:24:25Z
Bug with milli prefix What happened: ``` In [1]: from sympy.physics.units import milli, W In [2]: milli*W == 1 Out[2]: True In [3]: W*milli Out[3]: watt*Prefix(milli, m, -3, 10) ``` What I expected to happen: milli*W should evaluate to milli watts / mW `milli*W` or more generally `milli` times some unit eval...
I get a 1 for all of the following (and some are redundant like "V" and "volt"): ```python W, joule, ohm, newton, volt, V, v, volts, henrys, pa, kilogram, ohms, kilograms, Pa, weber, tesla, Wb, H, wb, newtons, kilometers, webers, pascals, kilometer, watt, T, km, kg, joules, pascal, watts, J, henry, kilo, teslas ``` ...
[ { "body": "What happened:\r\n```\r\nIn [1]: from sympy.physics.units import milli, W\r\nIn [2]: milli*W == 1\r\nOut[2]: True\r\nIn [3]: W*milli\r\nOut[3]: watt*Prefix(milli, m, -3, 10)\r\n```\r\nWhat I expected to happen: milli*W should evaluate to milli watts / mW\r\n\r\n`milli*W` or more generally `milli` tim...
d3b4158dea271485e3daa11bf82e69b8dab348ce
{ "head_commit": "db16c7a9a6b7e198a2e0a272a2d0f06294d5f132", "head_commit_message": "fix code quality of the previous commit", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 7f81e5547e2b..05415c6a450c 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -821,6 +821,7 @@ Langston Barrett <langston.barrett@gmail...
[ { "diff_hunk": "@@ -17,15 +17,16 @@ def test_prefix_operations():\n \n dodeca = Prefix('dodeca', 'dd', 1, base=12)\n \n- assert m * k == 1\n+ assert m * k == S.One", "line": null, "original_line": 20, "original_start_line": null, "path": "sympy/physics/units/tests/test_prefixes.py", ...
a0b5e4fa25ee318973e2d983fa9096f998bc042f
diff --git a/.mailmap b/.mailmap index 7f81e5547e2b..05415c6a450c 100644 --- a/.mailmap +++ b/.mailmap @@ -821,6 +821,7 @@ Langston Barrett <langston.barrett@gmail.com> Lars Buitinck <larsmans@gmail.com> Laura Domine <temigo@gmx.com> Lauren Glattly <laurenglattly@gmail.com> +Le Cong Minh Hieu <hieu.lecongminh@gmail....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-24867@2e4cd91
sympy/sympy
Python
24,867
Fixes diff and Derivative different results in matix expressions
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-03-06T19:53:26Z
diff and Derivative return different results Here's a short code snippet to create this different results: ``` import sympy as sp A=sp.MatrixSymbol('A', 3, 4) B=sp.MatrixSymbol('B', 4, 3) J=A*B Jinv=sp.Matrix(J).adjugate()#/sp.Matrix(J).det() alpha=sp.symbols('alpha') u=sp.MatrixSymbol('u', 3, 4) x=sp.symb...
This is the output: ```python In [3]: Jk[0, 0] Out[3]: (x⋅u + A)[1, 0]⋅(x⋅u + A)[2, 1]⋅B₀₁⋅B₁₂ - (x⋅u + A)[1, 0]⋅(x⋅u + A)[2, 1]⋅B₀₂⋅B₁₁ + (x⋅u + A)[1, 0] ⋅(x⋅u + A)[2, 2]⋅B₀₁⋅B₂₂ - (x⋅u + A)[1, 0]⋅(x⋅u + A)[2, 2]⋅B₀₂⋅B₂₁ + (x⋅u + A)[1, 0]⋅(x⋅u + A)[2, 3 ]⋅B₀₁⋅B₃₂ - (x⋅u + A)[1, 0]⋅(x⋅u + A)[2, 3]⋅B₀₂⋅B₃₁ - (x⋅u...
[ { "body": "Here's a short code snippet to create this different results:\r\n\r\n```\r\nimport sympy as sp\r\nA=sp.MatrixSymbol('A', 3, 4)\r\nB=sp.MatrixSymbol('B', 4, 3)\r\nJ=A*B\r\nJinv=sp.Matrix(J).adjugate()#/sp.Matrix(J).det()\r\n\r\nalpha=sp.symbols('alpha')\r\nu=sp.MatrixSymbol('u', 3, 4)\r\nx=sp.symbols(...
05516b96c3957e0f9424148cb3b5460f2262656a
{ "head_commit": "2e4cd9199f25a901382b2fc9fcf926111cf78fe3", "head_commit_message": "added simple tests", "patch_to_review": "diff --git a/sympy/matrices/expressions/matexpr.py b/sympy/matrices/expressions/matexpr.py\nindex a433c8bbb49d..75ee6177c0f6 100644\n--- a/sympy/matrices/expressions/matexpr.py\n+++ b/symp...
[ { "diff_hunk": "@@ -404,6 +404,18 @@ def test_issue_21195():\n assert A.diff(x) == B\n \n \n+def test_issue_24859():\n+ A = MatrixSymbol('A', 2, 3)\n+ B = MatrixSymbol('B', 3, 2)\n+ J = A*B\n+ Jinv = Matrix(J).adjugate()\n+ u = MatrixSymbol('u', 2, 3)\n+ Jk = Jinv.subs(A, A + x*u)\n+\n+ ...
0fd5f03d09d8be1728da7c3c815cdd39350a07e1
diff --git a/sympy/matrices/expressions/matexpr.py b/sympy/matrices/expressions/matexpr.py index a433c8bbb49d..75ee6177c0f6 100644 --- a/sympy/matrices/expressions/matexpr.py +++ b/sympy/matrices/expressions/matexpr.py @@ -633,10 +633,7 @@ def indices(self): def _eval_derivative(self, v): if not isinsta...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-24747@f6a3e20
sympy/sympy
Python
24,747
Fix erroring test in `sympy/printing/tests/test_aesaracode.py`
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-02-20T12:48:12Z
`optional-dependencies` jobs in CI failing due to test error in `sympy/printing/tests/test_aesaracode.py` Full traceback is: ``` ____________ sympy/printing/tests/test_aesaracode.py:test_Rationals ____________ Traceback (most recent call last): File "/home/runner/work/sympy/sympy/sympy/testing/runtests.py", line ...
This is currently causing multiple job failures in all CI. Opened PR #24747 to fix. Issue seems to stem from the use of `aesara.tensor.true_div` in the Aesara printer` as well as in the test, because this has been deprecated. Interestingly, it doesn't seem to be erroring with pytest. > Interestingly, it doesn't seem to...
[ { "body": "Full traceback is:\r\n```\r\n____________ sympy/printing/tests/test_aesaracode.py:test_Rationals ____________\r\nTraceback (most recent call last):\r\n File \"/home/runner/work/sympy/sympy/sympy/testing/runtests.py\", line 1337, in _timeout\r\n function()\r\n File \"/home/runner/work/sympy/sympy...
c6cb7c5602fa48034ab1bd43c2347a7e8488f12e
{ "head_commit": "f6a3e207d1b16c3e34abb0914b81f7c7559f1d91", "head_commit_message": "Fix typo in module name", "patch_to_review": "diff --git a/sympy/printing/aesaracode.py b/sympy/printing/aesaracode.py\nindex 1806a0721328..5f6fc2e56a19 100644\n--- a/sympy/printing/aesaracode.py\n+++ b/sympy/printing/aesaracode....
[ { "diff_hunk": "@@ -69,6 +76,8 @@\n sympy.Transpose: DimShuffle((False, False), [1, 0]),\n }\n \n+ aesara_version = tuple(getattr(aesara, '__version__').split('.'))", "line": null, "original_line": 79, "original_start_line": null, "path": "sympy/printing/aesaracode.py", "s...
72b658b0f8f70c78ba3d645a2dacfe3bbcbc6f90
diff --git a/sympy/printing/aesaracode.py b/sympy/printing/aesaracode.py index 1806a0721328..87117e06fadb 100644 --- a/sympy/printing/aesaracode.py +++ b/sympy/printing/aesaracode.py @@ -17,6 +17,13 @@ from aesara.tensor.elemwise import Elemwise from aesara.tensor.elemwise import DimShuffle + # `true_div...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-24750@516a019
sympy/sympy
Python
24,750
Test case added for numerical evaluation in test_simplify
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-02-20T20:29:22Z
problems with numerical evaluation I working with a simple statistical mechanics example, using the Stirling approximation of the factorial in combinatorial functions: ``` from __future__ import division from sympy.abc import * from sympy import * from sympy.physics.units import avogadro_number as N # Stirling's app...
Nothing stands out to me as being wrong: ``` >>> z.subs(n,2).n(4).simplify() 0.5*k*log(k) - 0.5*k*log(k + 1) - 0.5*log(k + 1) + 1.266 >>> z.simplify().subs(n,2).n(4) 0.5*k*log(k) - 0.5*k*log(k + 1) - 0.5*log(k + 1) + 1.266 >>> z.simplify().n(4, subs={n:2}) 0.5*k*log(k) - 0.5*k*log(k + 1) + 0.5*log(n) - 0.5*log(k + 1) ...
[ { "body": "I working with a simple statistical mechanics example,\nusing the Stirling approximation of the factorial in combinatorial functions:\n\n```\nfrom __future__ import division\nfrom sympy.abc import *\nfrom sympy import *\nfrom sympy.physics.units import avogadro_number as N\n\n\n# Stirling's approxima...
7459acbf979ad88cedb781de016d19722bc7a959
{ "head_commit": "516a019633a622330ef4067b516dd2a3d1f2643c", "head_commit_message": "fixed formatting", "patch_to_review": "diff --git a/sympy/simplify/tests/test_simplify.py b/sympy/simplify/tests/test_simplify.py\nindex 4ed4fc47f6f2..4cf06956408d 100644\n--- a/sympy/simplify/tests/test_simplify.py\n+++ b/sympy/...
[ { "diff_hunk": "@@ -1036,6 +1036,22 @@ def test_issue_23543():\n x, y, z = symbols(\"x y z\", commutative=False)\n assert (x*(y + z/2)).simplify() == x*(2*y + z)/2\n \n+def test_issue_11004():\n+ def f(n):\n+ return sqrt(2*pi*n) * (n/E)**n\n+\n+ def m(n, k):\n+ return f(n) / (f(n/k)...
fac1a5ce5d3801d67ad97d12a4b5998df5d992bd
diff --git a/sympy/simplify/tests/test_simplify.py b/sympy/simplify/tests/test_simplify.py index 4ed4fc47f6f2..a26e8e33a2eb 100644 --- a/sympy/simplify/tests/test_simplify.py +++ b/sympy/simplify/tests/test_simplify.py @@ -1037,6 +1037,30 @@ def test_issue_23543(): assert (x*(y + z/2)).simplify() == x*(2*y + z)/2 ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-24666@7d194c7
sympy/sympy
Python
24,666
Added test for simplified Piecewise is missing conditions
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-02-06T08:51:03Z
simplified Piecewise is missing conditions I have been trying to write a model for the size of symbolic powers. I define the Piecewise expression as follows for power `b**e` with the expressions of the Piecewise giving a value that is representative of the region in which the size of the power is found (e.g. 1/2 if ...
It looks like it is the Mod that is causing the trouble: ```python >>> p ((e >= 1) & (b < -1) & Eq(Mod(e, 2), 1)) | ((e <= -1) & (b > -1) & (b < 0) & Eq(Mod(e, 2), 1)) >>> p.simplify() (b < -1) & Eq(Mod(e, 2), 1) >>> p.subs(Eq(Mod(e, 2), 1),True) ((e >= 1) & (b < -1)) | ((e <= -1) & (b > -1) & (b < 0)) >>> _.si...
[ { "body": "I have been trying to write a model for the size of symbolic powers.\r\nI define the Piecewise expression as follows for power `b**e` with\r\nthe expressions of the Piecewise giving a value that is representative\r\nof the region in which the size of the power is found (e.g. 1/2 if the\r\nvalue of th...
9a1de69bf68064a304cc2c0e7e5328647be5ebd0
{ "head_commit": "7d194c72f787c902ace7139a50313bcb0026390e", "head_commit_message": "empty commit", "patch_to_review": "diff --git a/sympy/functions/elementary/tests/test_piecewise.py b/sympy/functions/elementary/tests/test_piecewise.py\nindex 958c671c470f..74618bfa59a9 100644\n--- a/sympy/functions/elementary/te...
[ { "diff_hunk": "@@ -1339,6 +1340,31 @@ def test_issue_14787():\n f = Piecewise((x, x < 1), ((S(58) / 7), True))\n assert str(f.evalf()) == \"Piecewise((x, x < 1), (8.28571428571429, True))\"\n \n+def test_issue_21481():\n+ b, e = symbols('b e')\n+ A = Piecewise((1, Eq(b, 1) | Eq(e, 0) | (Eq(b, -1)...
a0871f8e479463db063790562dbfd0468e2ac626
diff --git a/sympy/functions/elementary/tests/test_piecewise.py b/sympy/functions/elementary/tests/test_piecewise.py index 958c671c470f..2d4de12b284e 100644 --- a/sympy/functions/elementary/tests/test_piecewise.py +++ b/sympy/functions/elementary/tests/test_piecewise.py @@ -5,6 +5,7 @@ from sympy.core.expr import unch...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-24586@49edcdc
sympy/sympy
Python
24,586
define dummies once for geometry module
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-01-25T04:48:31Z
memory leak, not a cache issue Hello I have the following code that uses the latest sympy (1.11.1) tested with python 3.8.10 on Windows 10 and with python 3.11.1 on macOS 13.1, the memory is constantly growing. Any ideas why? ``` from sympy import Point, Ray, Circle while True: circle = Circle(Point(0.0, 0...
I can reproduce this but no idea why it happens. Clearing the cache doesn't help. Calling `gc.collect` doesn't help. With this diff the memory usage stays constant: ```diff diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py index 0c1c5d0..35d92af 100644 --- a/sympy/geometry/ellipse.py +++ b/sympy/g...
[ { "body": "Hello\r\n\r\nI have the following code that uses the latest sympy (1.11.1) tested with python 3.8.10 on Windows 10 and with python 3.11.1 on macOS 13.1, the memory is constantly growing. Any ideas why?\r\n\r\n```\r\nfrom sympy import Point, Ray, Circle\r\nwhile True:\r\n circle = Circle(Point(0.0,...
fcf3dd948f2db2599a4a2cba8773c3e1f44f12ef
{ "head_commit": "49edcdc06bfa7b2e4e864e07a96dfcc19e1eee81", "head_commit_message": "define dummies once for module", "patch_to_review": "diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py\nindex 0c1c5d06c4cb..bc38a5427e2f 100644\n--- a/sympy/geometry/ellipse.py\n+++ b/sympy/geometry/ellipse.py\n@...
[ { "diff_hunk": "@@ -34,6 +34,8 @@\n \n import random\n \n+x = Dummy('x', real=True)\n+y = Dummy('y', real=True)", "line": null, "original_line": 38, "original_start_line": 37, "path": "sympy/geometry/ellipse.py", "start_line": null, "text": "@user1:\nWould it be better to use more anonym...
e35b5cfdf3c828265454a8cd9d33466f15ea2601
diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py index 0c1c5d06c4cb..96dc2dc1171c 100644 --- a/sympy/geometry/ellipse.py +++ b/sympy/geometry/ellipse.py @@ -34,6 +34,8 @@ import random +x, y = [Dummy('ellipse_dummy', real=True) for i in range(2)] + class Ellipse(GeometrySet): """An ellipt...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-24714@0b18e2b
sympy/sympy
Python
24,714
Added test for sring extension=True error
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-02-13T18:36:14Z
sring extension=True error: nan is not in any domain Somehow a nan is generated in the intermediate calculations I guess (same for sfield): ```julia In [1]: items = [S(3)/16 + sqrt(3*sqrt(3) + 10)/8, S(1)/8 + 3*sqrt(3)/16, S(1)/8 + 3*sqrt(3)/16, -S(3)/16 + sqrt(3*sqrt(3) + 10)/8] In [2]:...
This seems to be working now. Looks like it was fixed in 97129c5f70b32ca39875caccf3d5bb574c497546 from https://github.com/sympy/sympy/pull/20274 @oscarbenjamin seems it working fine on the master, should it require a test to close? ``` python >>> items = [S(3)/16 + sqrt(3*sqrt(3) + 10)/8, S(1)/8 + 3*sqrt(3)/16, S(1...
[ { "body": "Somehow a nan is generated in the intermediate calculations I guess (same for sfield):\r\n```julia\r\nIn [1]: items = [S(3)/16 + sqrt(3*sqrt(3) + 10)/8, S(1)/8 + 3*sqrt(3)/16, S(1)/8 + 3*sqrt(3)/16, -S(3)/16 + sqrt(3*sqrt(3) + 10)/8] \r\n\r\nIn [2]: items ...
8cc0567ed69bff99f7a12a17846f3809f4151af1
{ "head_commit": "0b18e2be56d9fc7e8f03fa3a6332c955f9cad1e9", "head_commit_message": "Added test for sring extension=True error", "patch_to_review": "diff --git a/sympy/polys/tests/test_rings.py b/sympy/polys/tests/test_rings.py\nindex 35d2b3617230..4bd47b0cd00f 100644\n--- a/sympy/polys/tests/test_rings.py\n+++ b...
[ { "diff_hunk": "@@ -1455,6 +1457,16 @@ def test_PolyElement_sqf_list():\n assert f.sqf_part() == p\n assert f.sqf_list() == (1, [(g, 1), (h, 2)])\n \n+def test_issue_18894():\n+ items = [S(3)/16 + sqrt(3*sqrt(3) + 10)/8, S(1)/8 + 3*sqrt(3)/16, S(1)/8 + 3*sqrt(3)/16, -S(3)/16 + sqrt(3*sqrt(3) + 10)/8]...
cc3726119320c73d0f964bc07c7fe68116cf9449
diff --git a/sympy/polys/tests/test_rings.py b/sympy/polys/tests/test_rings.py index 35d2b3617230..a753bdd809c9 100644 --- a/sympy/polys/tests/test_rings.py +++ b/sympy/polys/tests/test_rings.py @@ -12,7 +12,7 @@ from sympy.testing.pytest import raises from sympy.core import Symbol, symbols - +from sympy.core.singl...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-24463@2c5ce40
sympy/sympy
Python
24,463
Adding electron_rest_mass unit in physics.units
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-01-02T20:16:57Z
Missing electron rest mass unit in physics.units The electron rest mass (symbol: me) is the mass of a stationary electron, also known as the invariant mass of the electron. It is one of the fundamental constants of physics. It has a value of about 9.109×10−31 kilograms It is not in `physics.units` should we add it.
[ { "body": "The electron rest mass (symbol: me) is the mass of a stationary electron, also known as the invariant mass of the electron. It is one of the fundamental constants of physics. It has a value of about 9.109×10−31 kilograms\r\nIt is not in `physics.units` should we add it.", "number": 24462, "ti...
40b1af74c7f6826b9ba702c359cb538621e9207c
{ "head_commit": "2c5ce400f731c53cc2cac0ccc7929ff285b2aabf", "head_commit_message": "Adding electron_rest_mass unit", "patch_to_review": "diff --git a/sympy/physics/units/__init__.py b/sympy/physics/units/__init__.py\nindex 18fee8c60119..361dbfdbcb01 100644\n--- a/sympy/physics/units/__init__.py\n+++ b/sympy/phys...
[ { "diff_hunk": "@@ -304,11 +307,11 @@ def test_find_unit():\n 'deciliter', 'centiliter', 'deciliters', 'milliliter',\n 'centiliters', 'milliliters', 'planck_volume']\n assert find_unit('voltage') == ['V', 'v', 'volt', 'volts', 'planck_voltage']\n- assert find_unit(grams) == ['g', 't', 'Da...
148cb89a741149484f03a4c3ee4ba3141a03c5f3
diff --git a/sympy/physics/units/__init__.py b/sympy/physics/units/__init__.py index 18fee8c60119..361dbfdbcb01 100644 --- a/sympy/physics/units/__init__.py +++ b/sympy/physics/units/__init__.py @@ -164,6 +164,7 @@ josephson_constant, von_klitzing_constant, Da, dalton, amu, amus, atomic_mass_unit, atomic...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
sympy__sympy-24370@a33f382
sympy/sympy
Python
24,370
Fix Floor division with sympy.Integer
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> Fixes #24369 #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closi...
2022-12-11T14:10:23Z
Floor division with sympy.Integer gives: Argument of Integer should be of numeric type, got floor(1024/s0) ``` import sympy s0 = sympy.Symbol('s0') sympy.Integer(1024)//s0 ``` gives ``` Traceback (most recent call last): File "/Users/ezyang/Dev/sympy/sympy/core/numbers.py", line 2098, in __new__ iv...
The fix seems to be ```diff diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py index 3b1aec2..52f7ea4 100644 --- a/sympy/core/numbers.py +++ b/sympy/core/numbers.py @@ -2423,7 +2423,7 @@ def __floordiv__(self, other): return NotImplemented if isinstance(other, Integer): ...
[ { "body": "```\r\nimport sympy\r\n\r\ns0 = sympy.Symbol('s0')\r\nsympy.Integer(1024)//s0\r\n```\r\n\r\ngives\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/ezyang/Dev/sympy/sympy/core/numbers.py\", line 2098, in __new__\r\n ival = int(i)\r\n File \"/Users/ezyang/Dev/sympy/sympy/core/exp...
36a36f87dd3ac94593d8de186efd3532c77f5191
{ "head_commit": "a33f3824ad5a7461d885d82d2641fbd00d7e70e4", "head_commit_message": "fix #24369", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 12ebd404ed2c..e577eb5c6bf4 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -209,6 +209,7 @@ Abhinav Anand <abhinav.anand2807@gmail.com>\n Abhinav Chanda <abhinav...
[ { "diff_hunk": "@@ -121,13 +122,15 @@ def test_mod():\n \n \n def test_divmod():\n+ s0 = Symbol(\"s0\")\n assert divmod(S(12), S(8)) == Tuple(1, 4)\n assert divmod(-S(12), S(8)) == Tuple(-2, 4)\n assert divmod(S.Zero, S.One) == Tuple(0, 0)\n raises(ZeroDivisionError, lambda: divmod(S.Zero, S....
94ffb875960b82c5c86b45e462cab3c65ebcf151
diff --git a/.mailmap b/.mailmap index 12ebd404ed2c..e577eb5c6bf4 100644 --- a/.mailmap +++ b/.mailmap @@ -209,6 +209,7 @@ Abhinav Anand <abhinav.anand2807@gmail.com> Abhinav Chanda <abhinavchanda01@gmail.com> Abhishek <uchiha@pop-os.localdomain> Abhishek Garg <abhishekgarg119@gmail.com> +Abhishek Patidar <1e9abhi1e...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-24325@eb006f8
sympy/sympy
Python
24,325
Numerical error on conversion of coulomb to statcoulomb
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs fixes #24319 ,#24381 ,#24281 <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyu...
2022-11-29T10:29:14Z
Numerical error on conversion of coulomb to statcoulomb ```python In[2]: from sympy.physics.units import convert_to In[3]: from sympy.physics.units.systems.cgs import cgs_gauss In[4]: from sympy.physics.units.definitions.unit_definitions import statcoulomb, coulomb, second, gram, centimeter, erg In[5]: convert_to(...
Can I open the PR for that ?
[ { "body": "```python\r\nIn[2]: from sympy.physics.units import convert_to\r\nIn[3]: from sympy.physics.units.systems.cgs import cgs_gauss\r\nIn[4]: from sympy.physics.units.definitions.unit_definitions import statcoulomb, coulomb, second, gram, centimeter, erg\r\nIn[5]: convert_to(coulomb, statcoulomb, unit_sys...
cdef6fcbfc12008d0de65ecd8ed21d1912e77e5d
{ "head_commit": "eb006f839d32c13735b34d998669461ecca61da6", "head_commit_message": "add tests", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex be8e110a76d1..cd54bf00ef48 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -209,6 +209,7 @@ Abhinav Anand <abhinav.anand2807@gmail.com>\n Abhinav Chanda <abhinavc...
[ { "diff_hunk": "@@ -26,18 +25,47 @@ def test_conversion_to_from_si():\n assert convert_to(joule, erg, SI) == 10**7*erg\n assert convert_to(joule, erg, cgs_gauss) == 10**7*erg\n \n+\n assert convert_to(dyne, newton, SI) == newton/10**5\n assert convert_to(dyne, newton, cgs_gauss) == newton/10**5\...
5e676000de96867c81abf4aecb62ac8e8dcf654a
diff --git a/.mailmap b/.mailmap index be8e110a76d1..cd54bf00ef48 100644 --- a/.mailmap +++ b/.mailmap @@ -209,6 +209,7 @@ Abhinav Anand <abhinav.anand2807@gmail.com> Abhinav Chanda <abhinavchanda01@gmail.com> Abhishek <uchiha@pop-os.localdomain> Abhishek Garg <abhishekgarg119@gmail.com> +Abhishek Patidar <1e9abhi1e...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-24296@af44337
sympy/sympy
Python
24,296
Small errors in _laplace_rule_exp and _laplace_rule_trig corrected
#### References to other Issues or PRs Fixes #24294 #### Brief description of what is fixed or changed The functions _laplace_rule_exp and _laplace_rule_trig did not return the constant factors of their expressions. #### Other comments #### Release Notes <!-- BEGIN RELEASE NOTES --> * integrals ...
2022-11-22T07:01:30Z
laplace_transform drops coefficient when Heaviside used when using Heaviside with another function, I notice that adding a scalar coefficient (e.g., `2`) gets ignored in the output. I would expect `L(2 * sin(t) * u(t))` to be `2/(s**2 + 1)`, but `laplace_transform` outputs `1/(s**2 + 1)` (see **Out[5]** below). Note...
CC @hanspi42 This seems to fix it but the code around seems a bit fishy so maybe more is needed: ```python diff --git a/sympy/integrals/transforms.py b/sympy/integrals/transforms.py index 071a6f1..4160acd 100644 --- a/sympy/integrals/transforms.py +++ b/sympy/integrals/transforms.py @@ -1694,6 +1694,7 @@ def ...
[ { "body": "when using Heaviside with another function, I notice that adding a scalar coefficient (e.g., `2`) gets ignored in the output. I would expect `L(2 * sin(t) * u(t))` to be `2/(s**2 + 1)`, but `laplace_transform` outputs `1/(s**2 + 1)` (see **Out[5]** below).\r\n\r\nNote that when I explicitly state `t ...
69c654b27d939718cd060172ad0fba95ada5a699
{ "head_commit": "af443377dd48c2caf440d2b6dd76830dbe84712f", "head_commit_message": "Moved all constant-factor calculations to `_laplace_apply_rules`", "patch_to_review": "diff --git a/sympy/integrals/tests/test_transforms.py b/sympy/integrals/tests/test_transforms.py\nindex fa0a69085bef..884ad0a6d5b6 100644\n---...
[ { "diff_hunk": "@@ -1777,8 +1773,13 @@ def _laplace_apply_rules(f, t, s, doit=True, **hints):\n prog_rules = [_laplace_rule_timescale, _laplace_rule_heaviside,\n _laplace_rule_exp, _laplace_rule_trig, _laplace_rule_diff]\n for p_rule in prog_rules:\n- LT = p_rule(f, t, s, doit=d...
f8f54d96266618749131a69c528a6db2a5b28d27
diff --git a/sympy/integrals/tests/test_transforms.py b/sympy/integrals/tests/test_transforms.py index fa0a69085bef..884ad0a6d5b6 100644 --- a/sympy/integrals/tests/test_transforms.py +++ b/sympy/integrals/tests/test_transforms.py @@ -707,6 +707,10 @@ def test_laplace_transform(): assert inverse_laplace_transform(...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-24152@c8ffc40
sympy/sympy
Python
24,152
Fixes incomplete TensorProduct expand if scalar factors present in summands
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-10-21T13:47:03Z
Bug in expand of TensorProduct + Workaround + Fix ### Error description The expansion of a TensorProduct object stops incomplete if summands in the tensor product factors have (scalar) factors, e.g. ``` from sympy import * from sympy.physics.quantum import * U = Operator('U') V = Operator('V') P = TensorProduct(...
Can you make a pull request with this fix? Will do. I haven't worked with git before, so bear with me. But as I'm currently digging into some of the quantum package and have more and larger patches in the pipeline, it seems worth the effort to get git set up on my side. So watch out :-)
[ { "body": "### Error description\r\nThe expansion of a TensorProduct object stops incomplete if summands in the tensor product factors have (scalar) factors, e.g.\r\n```\r\nfrom sympy import *\r\nfrom sympy.physics.quantum import *\r\nU = Operator('U')\r\nV = Operator('V')\r\nP = TensorProduct(2*U - V, U + V)\r...
b9af885473ad7e34b5b0826cb424dd26d8934670
{ "head_commit": "c8ffc408bfe642d1ae0efc3471384c94226f5ff8", "head_commit_message": "Added to .mailmap", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 3e85675b0853..025916850778 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -449,6 +449,7 @@ Colin Marquardt <github@marquardt-home.de>\n Colleen Lee <coll...
[ { "diff_hunk": "@@ -246,9 +246,12 @@ def _eval_expand_tensorproduct(self, **hints):\n if isinstance(args[i], Add):\n for aa in args[i].args:\n tp = TensorProduct(*args[:i] + (aa,) + args[i + 1:])\n- if isinstance(tp, TensorProduct):\n- ...
ecc2cc9114fb688d912e76871c39d7d5be394e34
diff --git a/.mailmap b/.mailmap index 3e85675b0853..025916850778 100644 --- a/.mailmap +++ b/.mailmap @@ -449,6 +449,7 @@ Colin Marquardt <github@marquardt-home.de> Colleen Lee <colleenclee@gmail.com> <clee@coursera.org> Comer Duncan <comer.duncan@gmail.com> Constantin Mateescu <costica1234@me.com> +Costor <pcs2009...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-23932@376abd4
sympy/sympy
Python
23,932
SciPyPrinter: polygamma (fix gh-23924)
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs ~~Fixes #23924~~ #### Brief description of what is fixed or changed ~~Attempt to fix CI failure.~~ Add polygamma to explicit list of functions tha...
2022-08-15T07:45:13Z
CI failure: lambdify: NameError: name 'polygamma' is not defined This failure is seen in CI for the 3.11 optional dependency tests: ``` ____________ sympy/utilities/tests/test_lambdify.py:test_scipy_fns _____________ Traceback (most recent call last): File "/home/runner/work/sympy/sympy/sympy/utilities/tests/test...
This job is not "required" so a PR can still be merged if it fails. Resolving the cause of this though is a release blocker for 1.11. If the next SciPy release is going to break `lambdify` then we might need a fix for that in SymPy 1.11. I don't know `lambdify` very well though so I would appreciate it if someone wh...
[ { "body": "This failure is seen in CI for the 3.11 optional dependency tests:\r\n```\r\n____________ sympy/utilities/tests/test_lambdify.py:test_scipy_fns _____________\r\nTraceback (most recent call last):\r\n File \"/home/runner/work/sympy/sympy/sympy/utilities/tests/test_lambdify.py\", line 1103, in test_sc...
f0154339c0b4d2602f0f4a6db4488d572b40e16f
{ "head_commit": "376abd48e8f6595f52ee0af1aaba920cbd5ad5b8", "head_commit_message": "SciPyPrinter: polygamma (fix gh-23924)", "patch_to_review": "diff --git a/sympy/printing/numpy.py b/sympy/printing/numpy.py\nindex 5ab29585a17a..a42d1df5d26d 100644\n--- a/sympy/printing/numpy.py\n+++ b/sympy/printing/numpy.py\n@...
[ { "diff_hunk": "@@ -1077,7 +1077,7 @@ def test_scipy_fns():\n if not scipy:\n skip(\"scipy not installed\")\n \n- single_arg_sympy_fns = [Ei, erf, erfc, factorial, gamma, loggamma, digamma]\n+ single_arg_sympy_fns = [Ei, erf, erfc, factorial, gamma, loggamma, digamma, polygamma]", "line": ...
9c7ca29c35fbda36d84157767748842334bf384d
diff --git a/sympy/printing/numpy.py b/sympy/printing/numpy.py index 5ab29585a17a..a42d1df5d26d 100644 --- a/sympy/printing/numpy.py +++ b/sympy/printing/numpy.py @@ -290,6 +290,7 @@ def _print_NDimArray(self, expr): 'gamma': 'gamma', 'loggamma': 'gammaln', 'digamma': 'psi', + 'polygamma': 'polygamma'...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-23786@4b95864
sympy/sympy
Python
23,786
hep: Fixes bug in gamma_trace of sum of products containing GammaMatrix mixed with other symbols
#### References to other Issues or PRs Fixes #13636 #### Brief description of what is fixed or changed <!-- BEGIN RELEASE NOTES --> * physics.hep * Fixed a bug in finding traces of sums of products of GammaMatrix mixed with other factors. (#13636) <!-- END RELEASE NOTES -->
2022-07-16T17:48:29Z
Strangely behaved gamma_trace (gamma matrix trace) I am trying to use the high energy physics module of SymPy to compute traces of gamma matrices using the dedicated function `sympy.physics.hep.gamma_matrices.gamma_trace`. I have come accross the following strange behaviour: in some cases, the trace of a sum is not co...
`gamma_trace(B)` differs from that part of `gamma_trace(A + B)` which comes from `B` because it is processed by `_simplify_single_line`. It calls `extract_type_tens` in order to collect all gamma matrices, but only the explicit gamma matrix factors are found, not those embedded in `pis, kis, pfs`. Hence it seems that t...
[ { "body": "I am trying to use the high energy physics module of SymPy to compute traces of gamma matrices using the dedicated function `sympy.physics.hep.gamma_matrices.gamma_trace`. I have come accross the following strange behaviour: in some cases, the trace of a sum is not computed to be the sum of the trac...
54885cf23d6206a5a6cf4f71761cb07fbf2c6708
{ "head_commit": "4b958642e6e3a126a06abf039512c4b5a3f109a5", "head_commit_message": "Add myself to .mailmap", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex e832c7be1ef2..03eca177f6ff 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -588,6 +588,8 @@ Gilbert Gede <gilbertgede@gmail.com> <ggede@ucdavis.edu>\...
[ { "diff_hunk": "@@ -399,3 +400,25 @@ def test_gamma_matrix_trace():\n t = ps*ps*ps*ps*ps*ps*ps*ps\n r = gamma_trace(t)\n assert r.equals(4*p2*p2*p2*p2)\n+\n+def test_bug_13636():\n+ \"\"\"Test issue 13636 regarding handling traces of sums of products\n+ of GammaMatrix mixed with other factors....
f1d368f0d030b6ed1f40a93f8cb7d948fa7a4d42
diff --git a/.mailmap b/.mailmap index e832c7be1ef2..03eca177f6ff 100644 --- a/.mailmap +++ b/.mailmap @@ -588,6 +588,8 @@ Gilbert Gede <gilbertgede@gmail.com> <ggede@ucdavis.edu> Gilles Schintgen <gschintgen@hambier.lu> Gina <Dr-G@users.noreply.github.com> Gleb Siroki <g.shiroki@gmail.com> +Glenn Horton-Smith <glen...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-23493@2d971fb
sympy/sympy
Python
23,493
calculus : Fixes is_increasing() cases which undergo infinite recursive loop through periodicity()
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-05-13T10:11:35Z
is_increasing() function can lead to periodicity() infinite recursive loop **Environment:** Windows 10 Python 3.9 Sympy 1.10.1 Running in VsCode Jupyter Notebook **Explanation:** Some expressions can cause the is_increasing() function to lead to an infinite recursive loop via the periodicity() function. Below ...
This seems to be the fix: ```diff diff --git a/sympy/calculus/util.py b/sympy/calculus/util.py index 4f6ada07f1..ed8c4e2fbd 100644 --- a/sympy/calculus/util.py +++ b/sympy/calculus/util.py @@ -480,9 +480,8 @@ def _check(orig_f, period): elif f.is_Mul: coeff, g = f.as_independent(symbol, as_Add=...
[ { "body": "**Environment:**\r\nWindows 10\r\nPython 3.9\r\nSympy 1.10.1\r\nRunning in VsCode Jupyter Notebook\r\n\r\n**Explanation:**\r\nSome expressions can cause the is_increasing() function to lead to an infinite recursive loop via the periodicity() function. Below is the simplest code and expression I coul...
918eb81f4bb3ae062cef98a9dcb9ecda058e33d5
{ "head_commit": "2d971fbfa3296279d7181e4150498d9bdc011395", "head_commit_message": "Fix_23401", "patch_to_review": "diff --git a/sympy/calculus/tests/test_singularities.py b/sympy/calculus/tests/test_singularities.py\nindex 08036b5a1184..4d34e4a7c597 100644\n--- a/sympy/calculus/tests/test_singularities.py\n+++ ...
[ { "diff_hunk": "@@ -480,7 +480,7 @@ def _check(orig_f, period):\n \n elif f.is_Mul:\n coeff, g = f.as_independent(symbol, as_Add=False)\n- if isinstance(g, TrigonometricFunction) or coeff is not S.One:\n+ if isinstance(g, TrigonometricFunction) or coeff is not S.One and not (coeff.is_F...
836af81302765dbefb39fbe6ab469201a378a3fc
diff --git a/sympy/calculus/tests/test_singularities.py b/sympy/calculus/tests/test_singularities.py index 08036b5a1184..2a86be98bbb6 100644 --- a/sympy/calculus/tests/test_singularities.py +++ b/sympy/calculus/tests/test_singularities.py @@ -93,3 +93,9 @@ def test_is_monotonic(): assert not is_monotonic(-x**2, S....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-23821@779eba5
sympy/sympy
Python
23,821
add and use `has_xfree`
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs fixes https://github.com/sympy/sympy/issues/23775 by removing auto-expansion by linsolve (while still handling Eq) alternative to #23748 #### Brief d...
2022-07-23T15:08:51Z
linsolve can return NaN The routine to identify coefficients of a linear system is fast and can quickly distinguish linear from non-linear system, but the obtained coefficients are not expanded and should probably be so before using them to compute a solution for the system: the coefficient of `x` in the following is 0...
The coefficient should be expanded automatically when constructing the domain. It fails because the wrong domain is used because of a bug in `construct_domain`: ```python In [13]: construct_domain([-y**2 + (y-1)*(y+1) + y]) Out[13]: (ZZ[y], [y - 1]) In [14]: construct_domain([-y**2 + (y-1)*(y+1) + 1]) Out[14]: (...
[ { "body": "The routine to identify coefficients of a linear system is fast and can quickly distinguish linear from non-linear system, but the obtained coefficients are not expanded and should probably be so before using them to compute a solution for the system: the coefficient of `x` in the following is 0\r\n`...
64e187e9521cf63653a831c5c3edc956715207ce
{ "head_commit": "779eba5c83b878de53304429aaa8b6149480973d", "head_commit_message": "don't integrate 0 wrt t\n\nIt doesn't hurt, but it changes the form of the solution when a Sparse or Dense matrix is used because the Sparse automatically doesn't provide zeros (so they aren't integrated) while Dense does.", "pat...
[ { "diff_hunk": "@@ -2594,14 +2600,19 @@ def linear_eq_to_matrix(equations, *symbols):\n Eq or Matrix.\n '''))\n \n- A, b = [], []\n- for i, f in enumerate(equations):\n- if isinstance(f, Equality):\n- f = f.rewrite(Add, evaluate=False)\n- coeff_list = linea...
526e42880b9948217ecd478767c83b2af95a62b7
diff --git a/sympy/core/basic.py b/sympy/core/basic.py index 14640c32d9d3..28ccb1040fa8 100644 --- a/sympy/core/basic.py +++ b/sympy/core/basic.py @@ -1258,6 +1258,33 @@ def has(self, *patterns): """ return self._has(iterargs, *patterns) + def has_xfree(self, s: set[Basic]): + """return Tr...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-24488@3d0b53d
sympy/sympy
Python
24,488
Improves the docstring of rigid body
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2023-01-10T10:07:24Z
sympy.physics.mechanics // RigidBody I looked at the 'explanations' of RigidBody, using _help(me.RigidBody)._ For the kinetic energy I saw this: _'T = 1/2 (I omega^2 + m v^2)'_ Should it not be: T = 1/2 ( **(** I omega **)**^2 + m v^2 ) A **very minor** point, but since I saw it, I wanted to point it out.
`T = rotational_KE + translational_KE` where `rotational_KE = 1/2(I ω^2)` and `translational_KE = 1/2(m v^2)` Hence , `T = 1/2(I ω^2 + m v^2 )` So , It was mentioned [right](https://github.com/sympy/sympy/blob/master/sympy/physics/mechanics/rigidbody.py#L235). Are you sure? I is a 3 x 3 matrix omega is a vector,...
[ { "body": "I looked at the 'explanations' of RigidBody, using _help(me.RigidBody)._\n\nFor the kinetic energy I saw this:\n\n_'T = 1/2 (I omega^2 + m v^2)'_\n\nShould it not be:\n\nT = 1/2 ( **(** I omega **)**^2 + m v^2 )\n\nA **very minor** point, but since I saw it, I wanted to point it out.", "number": ...
f47b9f2c39d39a06a993e364edfbf3836bb6140d
{ "head_commit": "3d0b53d5d23e6091ea4ddff7af9defd66ad98a92", "head_commit_message": "fixes # 24451", "patch_to_review": "diff --git a/sympy/physics/mechanics/particle.py b/sympy/physics/mechanics/particle.py\nindex d8db1942c40b..6474ac7aad32 100644\n--- a/sympy/physics/mechanics/particle.py\n+++ b/sympy/physics/m...
[ { "diff_hunk": "@@ -182,7 +182,7 @@ def angular_momentum(self, point, frame):\n The angular momentum H of a rigid body B about some point O in a frame\n N is given by:\n \n- H = I . w + r x Mv\n+ `H = dot(I, w) + cross(r, M) * v`", "line": null, "original_line": 185...
2408e0b5a1f767abefaf136385b5d244bff1fea2
diff --git a/.mailmap b/.mailmap index 4b106d6f6eb4..0aa5ef9e9165 100644 --- a/.mailmap +++ b/.mailmap @@ -209,6 +209,7 @@ Abhinav Anand <abhinav.anand2807@gmail.com> Abhinav Chanda <abhinavchanda01@gmail.com> Abhishek <uchiha@pop-os.localdomain> Abhishek Garg <abhishekgarg119@gmail.com> +Abhishek Patidar <1e9abhi1e...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
sympy__sympy-23404@d37a3c0
sympy/sympy
Python
23,404
Improve printing for `PrimeIdeal`
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-04-21T00:02:16Z
polys/numberfields: `PrimeIdeal` printing methods need work. Two methods in the `PrimeIdeal` class, `pretty()` (for printing) and `reduce_poly()`, involve generating polynomial expressions. Ideally, the generator symbol in these expressions should be able to be automatically the same as the `alias` symbol for the gener...
So, in #22977 these two methods were made private, so that they could still be changed after v1.10. Here are some thoughts on improving them for v1.11: ## `PrimeIdeal.pretty` First, this is misnamed, because it's not "pretty printing" in the sense of 2D displays. It's really just a `repr`-type string. Apart f...
[ { "body": "Two methods in the `PrimeIdeal` class, `pretty()` (for printing) and `reduce_poly()`, involve generating polynomial expressions. Ideally, the generator symbol in these expressions should be able to be automatically the same as the `alias` symbol for the generator of the surrounding `AlgebraicField`.\...
29f265496ed010b427b95435d18b942ed2c5cb0a
{ "head_commit": "d37a3c05b98c8144d401fa264af687a525b5e39c", "head_commit_message": "Improve printing for `PrimeIdeal`\n\n* Support latex printing\n* Rename `_pretty()` --> `repr()` since this is not 2D printing.\n* Provide a `__str__()` method, which prints less info than the `__repr__()` method.", "patch_to_rev...
[ { "diff_hunk": "@@ -678,15 +702,30 @@ def __init__(self, T):\n Parameters\n ==========\n \n- T : :py:class:`~.Poly`\n- The monic, irreducible, univariate polynomial over :ref:`ZZ`, a\n- root of which is the generator of the power basis.\n+ T : :py:class:`~.Pol...
a8ce918e6d0aee616abae750c631b1bb8a2fa0cd
diff --git a/sympy/polys/domains/algebraicfield.py b/sympy/polys/domains/algebraicfield.py index 830d820ba24e..241ce819a2a8 100644 --- a/sympy/polys/domains/algebraicfield.py +++ b/sympy/polys/domains/algebraicfield.py @@ -213,8 +213,7 @@ class AlgebraicField(Field, CharacteristicZero, SimpleDomain): >>> K QQ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
sympy__sympy-23241@d566b5c
sympy/sympy
Python
23,241
Series/Limits: Fixed leading term method inconsistency for expressions involving variables in powers
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-03-15T07:04:32Z
Sympy giving the wrong solution Hello, While doing an example with ``` f(x) =( 2^(1/x) -2^(-1/x))/( 2^(1/x) +2^(-1/x)) ``` Where you want to see the left end-behavior and the right end-behavior for f(1/x). Now left end-behavior is -1 and right end-behavior is 1 but according to SymPy its results is equal to 1...
This looks like a regression, it was working correctly in e.g. 1.7.1 ``` I can confirm this is an error >>> f = (2**x - 2**(-x))/(2**x + 2**(-x)) >>> >>> limit(f, x, -oo) 1 # expected -1 ``` Bisected to bf1eb95c20d7b74e5bd30bfe03b17745f09faf23 from #21589. CC @0sidharth @jksuom It seems that `Pow._eval_as...
[ { "body": "Hello, \r\n\r\nWhile doing an example with \r\n```\r\nf(x) =( 2^(1/x) -2^(-1/x))/( 2^(1/x) +2^(-1/x))\r\n```\r\nWhere you want to see the left end-behavior and the right end-behavior for f(1/x). Now left end-behavior is -1 and right end-behavior is 1 but according to SymPy its results is equal to 1. ...
ebda8eb85f7c07c7c01d6bf7678aca03243a2ef3
{ "head_commit": "d566b5c03fca3cdf38308516e30dc6979d04f33a", "head_commit_message": "Added a case in leading term method of exponential.py", "patch_to_review": "diff --git a/sympy/core/power.py b/sympy/core/power.py\nindex c85a1fcee2c1..8be33df01ad4 100644\n--- a/sympy/core/power.py\n+++ b/sympy/core/power.py\n@@...
[ { "diff_hunk": "@@ -541,6 +541,8 @@ def _eval_as_leading_term(self, x, logx=None, cdir=0):\n # Check out function: test_issue_18473() in test_exponential.py and\n # test_limits.py for more information.\n return exp(arg0)\n+ if isinstance(arg.as_numer_denom()[0], log):"...
7e161a6d3bc6186f1acdb17ca7e844adfb316472
diff --git a/sympy/core/power.py b/sympy/core/power.py index c85a1fcee2c1..8be33df01ad4 100644 --- a/sympy/core/power.py +++ b/sympy/core/power.py @@ -1793,11 +1793,7 @@ def _eval_as_leading_term(self, x, logx=None, cdir=0): raise PoleError("Cannot expand %s around 0" % (self)) elif e.has(x): ...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-23218@74e3612
sympy/sympy
Python
23,218
feat(physics): `quantity_simplify` can now optionally simplify units across dimensions
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-03-08T16:59:56Z
Can't get joule/m^3 to simplify into pascal Sample: ```python from sympy.physics.units import * print(joule/meter**3) print(simplify(joule/meter**3)) ``` I expected one of these to give me pascal as the unit, but instead I get `joule/meter**3` in both cases. If I try `(joule/meter**3).convert_to(pascal)` inste...
I'd like to work on this issue. @dyc3 I looked over this and tested some parts of it, from what I understood, is that quantity_simplify() only works when the parameters are of the same unit, in the code, there is an example: >>> quantity_simplify(kilo*foot*inch) 250*foot**2/3 This works because foot and inch...
[ { "body": "Sample:\r\n```python\r\nfrom sympy.physics.units import *\r\nprint(joule/meter**3)\r\nprint(simplify(joule/meter**3))\r\n```\r\nI expected one of these to give me pascal as the unit, but instead I get `joule/meter**3` in both cases.\r\n\r\nIf I try `(joule/meter**3).convert_to(pascal)` instead, I get...
fdc707f73a65a429935c01532cd3970d3355eab6
{ "head_commit": "74e3612c823c3017ae855d67994b55504367687c", "head_commit_message": "refactor(physics.units): hard code preferred units map into each unit system\n\nI also took the liberty of renaming some imports to be more explicit and clear.", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 18f2083...
[ { "diff_hunk": "@@ -26,7 +28,7 @@ class UnitSystem(_QuantityMapper):\n \n _unit_systems = {} # type: tDict[str, UnitSystem]\n \n- def __init__(self, base_units, units=(), name=\"\", descr=\"\", dimension_system=None):\n+ def __init__(self, base_units, units=(), name=\"\", descr=\"\", dimension_system...
d4899d4d352df65c6d689f4c3f85567a02a46262
diff --git a/.mailmap b/.mailmap index 18f20831db4a..ee94aa49dc36 100644 --- a/.mailmap +++ b/.mailmap @@ -271,6 +271,7 @@ Calvin Jay Ross <calvinjayross@gmail.com> Cameron King <v-caking@microsoft.com> Carl Sandrock <carl.sandrock@up.ac.za> Carlos Cordoba <ccordoba12@gmail.com> +Carson McManus <carson.mcmanus1@gmai...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-23991@3d268de
sympy/sympy
Python
23,991
[GSoC] physics/continuum_mechanics: Added the `draw` method for the Truss Class
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-08-30T09:42:34Z
Truss - create and expose an attribute to get the length of the members The `Truss` class can be used as a starting point to compute node deflections thanks to the principle of virtual works or energy methods. However, these computations require the knowledge of the member lengths. The class already computes them inter...
[ { "body": "The `Truss` class can be used as a starting point to compute node deflections thanks to the principle of virtual works or energy methods. However, these computations require the knowledge of the member lengths. The class already computes them internally. It would be nice to be able to access them via...
821bf9133c61f208bbd8ae1237acba40d83b3401
{ "head_commit": "3d268de526226c7a6899923038f0aacec624074d", "head_commit_message": "draw method added in Truss", "patch_to_review": "diff --git a/sympy/physics/continuum_mechanics/truss.py b/sympy/physics/continuum_mechanics/truss.py\nindex 5c2d0d0517aa..ccddee798669 100644\n--- a/sympy/physics/continuum_mechani...
[ { "diff_hunk": "@@ -733,3 +737,226 @@ def solve(self):\n self._internal_forces[member] = forces_matrix[i]\n i += 1\n return\n+\n+ @doctest_depends_on(modules=('numpy',))\n+ def draw(self):\n+ \"\"\"\n+ Returns a plot object of the Truss with all its nodes, mem...
7272a5f04bd903ac067e85ddcc76db887717374a
diff --git a/sympy/physics/continuum_mechanics/truss.py b/sympy/physics/continuum_mechanics/truss.py index 8384a673f03b..a255123c3b27 100644 --- a/sympy/physics/continuum_mechanics/truss.py +++ b/sympy/physics/continuum_mechanics/truss.py @@ -3,17 +3,24 @@ to 2D Trusses. """ -from cmath import inf + +from cmath imp...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
sympy__sympy-23096@15cdffd
sympy/sympy
Python
23,096
Changed the name of the node visiting function from `visit_Num` to `visit_Constant`.
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-02-18T07:43:42Z
ast_parser: PendingDeprecationWarning: visit_Num is deprecated; add visit_Constant `sympy.parsing.ast_parser` triggers `PendingDeprecationWarning` in Python ≥ 3.8: ```console $ python3 -Wd Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more info...
This should be easy for someone to fix. I think we still support 3.7 so it will need to have a branch. I don't think there will be a problem, as the `Constant` Node type was [added in 3.6](https://greentreesnakes.readthedocs.io/en/latest/nodes.html#Constant), with plans to deprecate `Num` in 3.8.
[ { "body": "`sympy.parsing.ast_parser` triggers `PendingDeprecationWarning` in Python ≥ 3.8:\n```console\n$ python3 -Wd\nPython 3.8.10 (default, Nov 26 2021, 20:14:08) \n[GCC 9.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> from sympy.parsing.ast_parser import ...
3821fd7254db887c1e57c91a356d5563a764a1df
{ "head_commit": "15cdffd2497cd269c806b87e52ee7ed5640d9a08", "head_commit_message": "Reordered the `.mailmap` file.", "patch_to_review": "diff --git a/.mailmap b/.mailmap\nindex 24c64a770b39..a70905f4dcfa 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1141,6 +1141,7 @@ Tim Swast <tswast@gmail.com>\n Timothy Cyrus <t...
[ { "diff_hunk": "@@ -4,7 +4,7 @@ those who explicitly didn't want to be mentioned. People with a * next\n to their names are not found in the metadata of the git history. This\n file is generated automatically by running `./bin/authors_update.py`.\n \n-There are a total of 1127 authors.\n+There are a total of 11...
37f97867733b859c2e75b79a7390dcd70e1bef35
diff --git a/.mailmap b/.mailmap index 24c64a770b39..a70905f4dcfa 100644 --- a/.mailmap +++ b/.mailmap @@ -1141,6 +1141,7 @@ Tim Swast <tswast@gmail.com> Timothy Cyrus <tcyrus@users.noreply.github.com> Timothy Reluga <treluga@math.psu.edu> <tcr-public2@psu.edu> Timothy Reluga <treluga@math.psu.edu> me <none@none> +T...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
sympy__sympy-22973@201445d
sympy/sympy
Python
22,973
Add convenience methods for constructing `AlgebraicField`
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-01-31T18:48:02Z
polys/numberfields: Convenience constructors for `AlgebraicField` I'd like to propose a pair of new constructor methods, to support a couple of common use cases. ## Use Case 1 * You want a number field `Q(a)`, * AND you have the minimal polynomial `f(x)` for `a`, * AND you don't care _which_ root of `f` `a` i...
How would `to_sympy` or `from_sympy` work if we don't know which root is the generator? We still do. These methods choose the root for you. I think this seems reasonable.
[ { "body": "I'd like to propose a pair of new constructor methods, to support a couple of common use cases.\r\n\r\n\r\n## Use Case 1\r\n\r\n* You want a number field `Q(a)`,\r\n* AND you have the minimal polynomial `f(x)` for `a`,\r\n* AND you don't care _which_ root of `f` `a` is. (E.g. it's a Galois field, so ...
c1bfbd69158c4a97ce605a14ee5a00287469e01a
{ "head_commit": "201445d88cf835807c4f37d529548e6f01e27eb3", "head_commit_message": "Simplify some tests.\n\nThese are unit and doctests where we construct an `AlgebraicField`.\nWe now make simpler constructions, using the new convenience constructor methods.", "patch_to_review": "diff --git a/sympy/polys/domains...
[ { "diff_hunk": "@@ -891,6 +892,90 @@ def algebraic_field(self, *extension):\n r\"\"\"Returns an algebraic field, i.e. `K(\\alpha, \\ldots)`. \"\"\"\n raise DomainError(\"Cannot create algebraic field over %s\" % self)\n \n+ def alg_field_from_poly(self, poly, alias=None, root_index=-1):\n+ ...
c55d6f6740aaa7ace48d35be6e3b8970595e2260
diff --git a/sympy/polys/domains/domain.py b/sympy/polys/domains/domain.py index 6228affacbfa..b5185b288d69 100644 --- a/sympy/polys/domains/domain.py +++ b/sympy/polys/domains/domain.py @@ -3,6 +3,7 @@ from typing import Any, Optional, Type +from sympy.core.numbers import AlgebraicNumber from sympy.core import B...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sympy__sympy-22969@db9a049
sympy/sympy
Python
22,969
physics : Added refractive index in Gaussian Beam Parameters and refactored code
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-01-31T05:35:02Z
Gaussian Optics / Refractive index not considered Dear sympy maintainers, please correct me, if I am wrong, but I fear that the beam waist in class sympy.physics.optics.gaussopt.BeamParameter is not correctly computed. From the source: def w_0(self): """ The beam waist (minimal radius)...
I don't know the physics so well but you are of course welcome to correct it. Many contributors can help with the sympy aspects but I'm not sure how many would know the physics for this case. Here the formula implemented is incorrect .This will fix itself once the correct formula is used .The relation between Rayleigh ...
[ { "body": "Dear sympy maintainers,\r\n\r\nplease correct me, if I am wrong, but I fear that the beam waist in \r\n\r\nclass sympy.physics.optics.gaussopt.BeamParameter\r\n\r\nis not correctly computed.\r\n\r\nFrom the source:\r\n\r\ndef w_0(self):\r\n \"\"\"\r\n The beam waist (minimal radius).\r\...
d7bddf4f882fe5887638cf3336e7b2f4e989020b
{ "head_commit": "db9a0496afe31ce1f5946fd3283498c9e470b5fc", "head_commit_message": "Positional_Arguments_Fixed", "patch_to_review": "diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py\nindex e027d9ad0f46..c74e4620ec8f 100644\n--- a/sympy/core/tests/test_args.py\n+++ b/sympy/core/tests/tes...
[ { "diff_hunk": "@@ -582,9 +588,10 @@ def radius(self):\n return self.z*(1 + (self.z_r/self.z)**2)\n \n @property\n- def w(self):\n+ def w_z(self):", "line": null, "original_line": 591, "original_start_line": null, "path": "sympy/physics/optics/gaussopt.py", "start_line": nu...
6b59870830f9fdcf01d3b73f41d4225f56910002
diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py index e027d9ad0f46..c74e4620ec8f 100644 --- a/sympy/core/tests/test_args.py +++ b/sympy/core/tests/test_args.py @@ -4912,7 +4912,7 @@ def test_sympy__physics__optics__waves__TWave(): def test_sympy__physics__optics__gaussopt__BeamParameter():...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xonsh__xonsh-5838@13f05f5
xonsh/xonsh
Python
5,838
feat: #5745 - send Ctrl+C event on Windows instead of forceful terminate
<!--- Thanks for opening a PR on xonsh! Please do this: 1. Include a news file with your PR (https://xon.sh/devguide.html#changelog). 2. Add the documentation for your feature into `/docs`. 3. Add the example of usage or before-after behavior. 4. Mention the issue that this PR is addressing e.g. `#1234`. ...
2025-05-04T00:08:53Z
Pressing Ctrl-C in Windows cancels a subprocess ## Current Behavior <!--- For general xonsh issues, please try to replicate the failure using `xonsh --no-rc --no-env`. Short, reproducible code snippets are highly appreciated. You can use `$XONSH_SHOW_TRACEBACK=1`, `$XONSH_TRACE_SUBPROC=2`, or `$XONSH_DEBUG=1` to c...
I couldn't reproduce this, unfortunately. I ssh'd into a couple of different Ubuntu servers. Ran top, or `man grep`. Ctrl+C cancelled top and man. ``` xonfig +-----------------------------+---------------------+ | xonsh | 0.19.0 | | Git SHA | c059ac23 ...
[ { "body": "## Current Behavior\r\n<!---\r\nFor general xonsh issues, please try to replicate the failure using `xonsh --no-rc --no-env`.\r\nShort, reproducible code snippets are highly appreciated.\r\nYou can use `$XONSH_SHOW_TRACEBACK=1`, `$XONSH_TRACE_SUBPROC=2`, or `$XONSH_DEBUG=1`\r\nto collect more informa...
5ecdcae86d8d430f125b61a387cf6bb4ab877940
{ "head_commit": "13f05f5aa80aa0dbb6c8cdf6177d05430907555c", "head_commit_message": "#5745 - send Ctrl+C event on Windows instead of forceful terminate", "patch_to_review": "diff --git a/xonsh/procs/jobs.py b/xonsh/procs/jobs.py\nindex 0c41a33fac..3befb9a894 100644\n--- a/xonsh/procs/jobs.py\n+++ b/xonsh/procs/jo...
[ { "diff_hunk": "@@ -239,10 +242,7 @@ def wait_for_active_job(last_task=None, backgrounded=False, return_error=False):\n except subprocess.TimeoutExpired:\n pass\n except KeyboardInterrupt:\n- try:\n- _kill(active_task)\n- e...
cbcdcd2f4cb4c06c9a244e23212e0e69fb099bbe
diff --git a/xonsh/procs/jobs.py b/xonsh/procs/jobs.py index 0c41a33fac..8a16e36a99 100644 --- a/xonsh/procs/jobs.py +++ b/xonsh/procs/jobs.py @@ -234,15 +234,8 @@ def wait_for_active_job(last_task=None, backgrounded=False, return_error=False): proc = active_task["obj"] _continue(active_task) ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xonsh__xonsh-5744@d70ddfc
xonsh/xonsh
Python
5,744
try just using CaseSenssitiveDict from requests to see if it works
closes #5627 replaces #5633 option 1: just import `CaseInsensitiveDict` from `requests.strucures` pros: - not much typing cons: - replaces one dependency with another - requests is not typed natively so either has to be excluded from mypy, or also import `types-requests` as an additional dependency O...
2024-12-07T04:01:11Z
problems importing case_insensitive_dict ## Current Behavior <!--- The Regolith package imports Xonsh in its __init__ and when I rebuilt my env I go an import error: --> Traceback (if applicable): <details> ```xsh Traceback (most recent call last): File "C:\Users\simon\miniconda3\envs\r312\Scripts\regol...
sorry, some stuff got cut off there in my back and forth. I recently created a new conda env and got xonsh 0.18.2 py312h2e8e312_0 and got this error. There was no such error in my previous env (which was also python 3.12 but built some time before) Hey! I'm not the Windows user but I see there is `case_insensitive_...
[ { "body": "## Current Behavior\r\n<!---\r\nThe Regolith package imports Xonsh in its __init__ and when I rebuilt my env I go an import error:\r\n-->\r\n\r\nTraceback (if applicable):\r\n\r\n<details>\r\n\r\n```xsh\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\simon\\miniconda3\\envs\\r312\\Script...
0791372f30ac89bbf5cb2078e47f842598d5206d
{ "head_commit": "d70ddfc8b4ed0cc96cf3d388321b32e25c2cc689", "head_commit_message": "news", "patch_to_review": "diff --git a/news/remove-caseinsdict.rst b/news/remove-caseinsdict.rst\nnew file mode 100644\nindex 0000000000..8d1df06b0a\n--- /dev/null\n+++ b/news/remove-caseinsdict.rst\n@@ -0,0 +1,23 @@\n+**Added:*...
[ { "diff_hunk": "@@ -15,9 +15,7 @@ authors = [{ name = \"Anthony Scopatz\" }, { email = \"scopatz@gmail.com\" }]\n maintainers = [{ name = \"Xonsh Community\" }, { email = \"xonsh@gil.forsyth.dev\" }]\n license = { text = \"BSD 2-Clause License\" }\n requires-python = \">=3.9\"\n-dependencies = [\n- \"case-in...
77355e5923b24b45986943c4be53d5f67a158bbc
diff --git a/news/remove-caseinsdict.rst b/news/remove-caseinsdict.rst new file mode 100644 index 0000000000..196e04f0fd --- /dev/null +++ b/news/remove-caseinsdict.rst @@ -0,0 +1,24 @@ +**Added:** + +* <news item> + +**Changed:** + +* replaced `case_insensitive_dictionary` dependency with local + `CaseInsensitiveDict...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Dependency Updates & Env Compatibility" }
xonsh__xonsh-5491@0390a62
xonsh/xonsh
Python
5,491
Do not load `~/.xonshrc` in not interactive mode
### Motivation In #5099 was introduced the logic where all RC files are loaded in interactive and non-interactive modes. This logic is not working good for home based `~/.xonshrc` file. First of all `~/.xonshrc` is the buffer of settings focused on interactive mode. Most tools with integration with xonsh (e.g. `c...
2024-06-11T16:31:01Z
Unintended loading `xonshrc` file in script mode My xonshrc is pretty silent and I suddenly noticed that xonshrc is loaded in script mode: ```xsh cd /tmp echo 'echo RC' >> ~/.xonshrc echo '#!/usr/bin/env xonsh' > myscript chmod +x myscript ./myscript # RC xonsh myscript.xsh # RC ``` When I run any xo...
I think this is the result of #5099 (@cosineFish @bestlem). @gforsyth I think we need to fix/revert this in 0.17.0 because: * All xonsh scripts are affected. * If you have many libs in xonshrc and want to run xonsh script in env you will face with unintended errors about missing libs. It's bad experience. The u...
[ { "body": "My xonshrc is pretty silent and I suddenly noticed that xonshrc is loaded in script mode:\r\n\r\n```xsh\r\ncd /tmp\r\necho 'echo RC' >> ~/.xonshrc\r\necho '#!/usr/bin/env xonsh' > myscript\r\nchmod +x myscript\r\n\r\n./myscript\r\n# RC\r\n\r\nxonsh myscript.xsh\r\n# RC\r\n```\r\n\r\nWhen I run any xo...
0d28a6731b1ea830bf5be355b43fe96318fd7020
{ "head_commit": "0390a62b62be60b36cc985f22d7d3b720b7661d1", "head_commit_message": "docs", "patch_to_review": "diff --git a/docs/xonshrc.rst b/docs/xonshrc.rst\nindex 0dda09bf6a..ae5cc25485 100644\n--- a/docs/xonshrc.rst\n+++ b/docs/xonshrc.rst\n@@ -2,26 +2,30 @@ Run Control File\n =========================\n Xo...
[ { "diff_hunk": "@@ -308,6 +308,16 @@ def _get_rc_files(shell_kwargs: dict, args, env):\n # otherwise, get the RC files from XONSHRC, and RC dirs from XONSHRC_DIR\n rc = env.get(\"XONSHRC\")\n rcd = env.get(\"XONSHRC_DIR\")\n+\n+ if not env.get(\"XONSH_INTERACTIVE\", False):\n+ \"\"\"\n+ ...
20081b5a5179afa82b587e0bd3795b72caa2a2a5
diff --git a/docs/xonshrc.rst b/docs/xonshrc.rst index 0dda09bf6a..e53231393e 100644 --- a/docs/xonshrc.rst +++ b/docs/xonshrc.rst @@ -2,26 +2,30 @@ Run Control File ========================= Xonsh allows you to customize your shell behavior with run control files, called "xonshrc" files. These files are written eit...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xonsh__xonsh-5473@bc8da38
xonsh/xonsh
Python
5,473
Alias that returns modified command
### Motivation After deep dive into [How make sudo expand aliases?](https://github.com/xonsh/xonsh/issues/2618) I understood that we want to modify command before execution but we can't achieve this because all we can is to use callable alias to wrap the command into it. But: * Callable alias is a complex "process ...
2024-06-01T20:20:36Z
Question: how make sudo expand aliases? What is the official way to make sudo expand aliases, like `alias sudo='sudo '` on bash? This is what I tried: ```xsh $ACTUAL_SUDO = $(which sudo) def sudo_expanding_aliases(args): $ACTUAL_SUDO @(aliases.eval_alias(args)) aliases['sudo'] = sudo_expanding_aliases del ...
[ { "body": "What is the official way to make sudo expand aliases, like `alias sudo='sudo '` on bash?\r\n\r\nThis is what I tried:\r\n```xsh\r\n$ACTUAL_SUDO = $(which sudo)\r\ndef sudo_expanding_aliases(args):\r\n $ACTUAL_SUDO @(aliases.eval_alias(args))\r\naliases['sudo'] = sudo_expanding_aliases\r\ndel sudo_...
645c335fc6cf3088feb6e657b298d01929e23e55
{ "head_commit": "bc8da384998acf4a236baa4c8063df5d7e807c05", "head_commit_message": "Merge branch 'main' into command_alias", "patch_to_review": "diff --git a/docs/tutorial.rst b/docs/tutorial.rst\nindex 30cf8a1eaa..67b7ff92b5 100644\n--- a/docs/tutorial.rst\n+++ b/docs/tutorial.rst\n@@ -1275,7 +1275,7 @@ functio...
[ { "diff_hunk": "@@ -59,8 +61,9 @@ def EXEC_ALIAS_RE():\n class FuncAlias:\n \"\"\"Provides a callable alias for xonsh commands.\"\"\"\n \n- attributes_show = [\"__xonsh_threadable__\", \"__xonsh_capturable__\"]\n+ attributes_show = [\"__xonsh_threadable__\", \"__xonsh_capturable__\", \"return_command\...
9a5ecab454c0fb01a6d3d47fadb7a7eb9ae5d8bc
diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 30cf8a1eaa..0a39737e93 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -1275,7 +1275,7 @@ functions. If you don't know what these do, you probably don't need them. Aliases -============================== +======= Another important xonsh built-in i...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-22840@2446f4c
sympy/sympy
Python
22,840
Peabody/cse matrixsymbol
Treat matrix symbols and subelements as atomic instead of redefining them as individual variables. fixes #11991 by reviving PR #13185 Thanks @peabody124 for original fix, hopefully with release notes we can merge this @czgdp1807 (couldn't push directly to that PR since I'm not a maintainer) <!-- BEGIN R...
2022-01-11T17:34:54Z
cse() has strange behaviour for MatrixSymbol indexing Example: ```python import sympy as sp from pprint import pprint def sub_in_matrixsymbols(exp, matrices): for matrix in matrices: for i in range(matrix.shape[0]): for j in range(matrix.shape[1]): name = "%s_%d_%d" ...
Can you create a very simple example using MatrixSymbol and the expected output that you'd like to see? I think one would expect the output to be similar to the following (except for the expression returned by CSE being a matrix where the individual elements are terms as defined by matrix multiplication, that is, uncha...
[ { "body": "Example: \r\n```python\r\nimport sympy as sp\r\nfrom pprint import pprint\r\n\r\n\r\ndef sub_in_matrixsymbols(exp, matrices):\r\n for matrix in matrices:\r\n for i in range(matrix.shape[0]):\r\n for j in range(matrix.shape[1]):\r\n name = \"%s_%d_%d\" % (matrix.nam...
d822fcba181155b85ff2b29fe525adbafb22b448
{ "head_commit": "2446f4c1208b0bd8539b156ac00b3489d1c65807", "head_commit_message": "Update sympy/simplify/cse_main.py", "patch_to_review": "diff --git a/sympy/simplify/cse_main.py b/sympy/simplify/cse_main.py\nindex d649dd02a952..aa3199f5c005 100644\n--- a/sympy/simplify/cse_main.py\n+++ b/sympy/simplify/cse_mai...
[ { "diff_hunk": "@@ -586,7 +587,10 @@ def _find_repeated(expr):\n if isinstance(expr, RootOf):\n return\n \n- if isinstance(expr, Basic) and (expr.is_Atom or expr.is_Order):\n+ if isinstance(expr, Basic) and (\n+ expr.is_Atom or\n+ expr.is_Order or\...
86d13ad378a99a134b271a5b1793a55cb1af478a
diff --git a/sympy/simplify/cse_main.py b/sympy/simplify/cse_main.py index d649dd02a952..88e3f9335e8b 100644 --- a/sympy/simplify/cse_main.py +++ b/sympy/simplify/cse_main.py @@ -567,6 +567,7 @@ def tree_cse(exprs, symbols, opt_subs=None, order='canonical', ignore=()): Substitutions containing any Symbol from ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-22841@000db05
sympy/sympy
Python
22,841
watch for Add->Mul in as_numer_denom
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2022-01-11T18:48:08Z
Solve simplest algebraic equations with dummy parameter Very strange behaviour of `solve` command in SymPy, when I try to solve quadratic equation with parameter `a` (which is dummy here, because solution doesn't depends on it): ``` from sympy import * x, a = symbols("x a") eq = Eq(0, (4 - 4*x + x**2)/(4*a**2)) pr...
Simpler example: ``` from sympy import * x, a = symbols("x a") eq = Eq(0, x / (2 * a)) print(solve(eq, x)) print(solve(simplify(eq), x)) ``` Output: ``` [(a - 1)/a] [0] ``` But if we swap sides of the equation `eq = Eq(x / (2 * a), 0)`, then `solve` solves it correctly! Not sure what happens, but if you d...
[ { "body": "Very strange behaviour of `solve` command in SymPy, when I try to solve quadratic equation with parameter `a` (which is dummy here, because solution doesn't depends on it):\r\n```\r\nfrom sympy import *\r\nx, a = symbols(\"x a\")\r\neq = Eq(0, (4 - 4*x + x**2)/(4*a**2))\r\nprint(solve(eq, x))\r\nprin...
d822fcba181155b85ff2b29fe525adbafb22b448
{ "head_commit": "000db05c9a056619a610fd5ef9522e4855a7963c", "head_commit_message": "do not return 0 arg in Eq.rewrite(Add)", "patch_to_review": "diff --git a/sympy/core/add.py b/sympy/core/add.py\nindex 890d31369227..88dfbbc0c298 100644\n--- a/sympy/core/add.py\n+++ b/sympy/core/add.py\n@@ -613,6 +613,8 @@ def a...
[ { "diff_hunk": "@@ -613,6 +613,8 @@ def as_numer_denom(self):\n \"\"\"\n # clear rational denominator\n content, expr = self.primitive()\n+ if not isinstance(expr, self.func):", "line": null, "original_line": 616, "original_start_line": null, "path": "sympy/core/ad...
ef53083bd7afacc175d130cf2eb746aa5d53d172
diff --git a/sympy/core/add.py b/sympy/core/add.py index 890d31369227..41b5728fb8f7 100644 --- a/sympy/core/add.py +++ b/sympy/core/add.py @@ -613,6 +613,8 @@ def as_numer_denom(self): """ # clear rational denominator content, expr = self.primitive() + if not isinstance(expr, Add): + ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-22707@32e56ff
sympy/sympy
Python
22,707
quality: fix type hints and remove type: ignore
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2021-12-18T22:45:17Z
mypy code quality test failing The code quality test seems to be currently failing for all pull requests. This does not seem to have anything to do with the pull requests themselves. In particular, the `mypy` run is failing with the following message: ``` sympy/tensor/array/expressions/conv_array_to_matrix.py:288: er...
Yes ,I had reported this issue on the SymPy Gitter chat channel yesterday and asked for a potential fix .Thanks for opening this as an issue ! This diff makes mypy happy about the errors in `conv_array_to_matrix.py`: ```diff diff --git a/sympy/tensor/array/expressions/conv_array_to_matrix.py b/sympy/tensor/array/expr...
[ { "body": "The code quality test seems to be currently failing for all pull requests. This does not seem to have anything to do with the pull requests themselves. In particular, the `mypy` run is failing with the following message:\r\n```\r\nsympy/tensor/array/expressions/conv_array_to_matrix.py:288: error: No ...
d2197554a47702d04f863e368bcac6175d72dfb5
{ "head_commit": "32e56ff22068ff4ddb19ddb96691f13e6129d937", "head_commit_message": "quality: remove most type: ignore from sets", "patch_to_review": "diff --git a/sympy/assumptions/handlers/calculus.py b/sympy/assumptions/handlers/calculus.py\nindex ec2d9dcfd0c7..263bed6da00c 100644\n--- a/sympy/assumptions/hand...
[ { "diff_hunk": "@@ -1571,7 +1571,7 @@ def __init__(self, base_array: typing.Union[ArrayContraction, ArrayDiagonal, Arr\n args_with_ind[arg_pos].indices[rel_pos] = i\n self.args_with_ind: List[_ArgE] = args_with_ind\n self.number_of_contraction_indices: int = len(contraction_indic...
601588cf14e4c41f8f81b3e91a3be2ebae1f4cd7
diff --git a/sympy/assumptions/handlers/calculus.py b/sympy/assumptions/handlers/calculus.py index ec2d9dcfd0c7..263bed6da00c 100644 --- a/sympy/assumptions/handlers/calculus.py +++ b/sympy/assumptions/handlers/calculus.py @@ -18,7 +18,7 @@ # FinitePredicate -@FinitePredicate.register(Symbol) # type: ignore +@Fini...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
xonsh__xonsh-5349@0e6731e
xonsh/xonsh
Python
5,349
EnvPath methods (append, remove, add, insert) prepare the path
Closes #2468 Before: ```xsh $PATH.append(p"~/node_modules/.bin") $PATH.remove(p"~/node_modules/.bin") # ValueError $PATH.append("~/node_modules/.bin") $PATH.remove(p"~/node_modules/.bin") # ValueError $PATH.append($HOME+"/node_modules/.bin") $PATH.remove(p"~/node_modules/.bin") # ValueError $PATH.pr...
2024-04-20T19:29:48Z
Can't remove Path objects from $PATH If you add a `Path` object to `$PATH`, it is coerced to a string. However, the same coercion doesn't happen with `.remove()` For example, this fails: ``` 🐚 $PATH.append(p"~/node_modules/.bin") 🐚 $PATH.remove(p"~/node_modules/.bin") ValueError ``` (The work-around is t...
If anybody wants to add the path temporarily there is `swap`: ```python print($PATH) with ${...}.swap(PATH=$PATH+[p"~/node_modules/.bin"]): print($PATH) print($PATH) # ['/bin', '/usr/games', '/usr/local/games', '/snap/bin'] # ['/bin', '/usr/games', '/usr/local/games', '/snap/bin', PosixPath('/home/user/n...
[ { "body": "If you add a `Path` object to `$PATH`, it is coerced to a string. However, the same coercion doesn't happen with `.remove()`\r\n\r\nFor example, this fails:\r\n\r\n```\r\n🐚 $PATH.append(p\"~/node_modules/.bin\")\r\n🐚 $PATH.remove(p\"~/node_modules/.bin\")\r\nValueError\r\n```\r\n\r\n(The work-aroun...
e30dd960e2ec91b2df71ec95417a8b97645fb898
{ "head_commit": "0e6731e94ce0ba06ad00d927baf7fa5e053a9a71", "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/news/path_imp.rst b/news/path_imp.rst\nnew file mode 100644\nindex 0000000000..6abbb59149\...
[ { "diff_hunk": "@@ -228,8 +228,28 @@ def __len__(self):\n def __delitem__(self, key):\n self._l.__delitem__(key)\n \n+ @staticmethod\n+ def _prepare_path(p):\n+ return str(expand_path(p))\n+\n+ @staticmethod\n+ def _check_path(p):\n+ if not pathlib.Path(p).exists():\n+ ...
791fa0c2ae5917700f978ab687c51c9bc3eb5e6e
diff --git a/news/path_imp.rst b/news/path_imp.rst new file mode 100644 index 0000000000..20704b3278 --- /dev/null +++ b/news/path_imp.rst @@ -0,0 +1,23 @@ +**Added:** + +* Added PATH.prepend(path) to add path to the beginning. + +**Changed:** + +* EnvPath methods (append, remove, add, insert) prepare the path before a...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sympy__sympy-22696@4bab3f6
sympy/sympy
Python
22,696
physics/optics: Updated Medium to inherit from Basic
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2021-12-17T10:12:50Z
`Medium` not hashable This shows up as an issue in the LaTeX-printing, but is probably an issue elsewhere as well. ``` from sympy.physics.optics import Medium Medium('m') ``` gives ``` Traceback (most recent call last): File "C:\Users\Oscar\miniconda3\lib\site-packages\IPython\core\formatters.py", line 34...
It also needs a proper `srepr` method as any additional arguments are not returned. ``` In [10]: srepr(Medium('m', 3)) Out[10]: "Medium('m')" ``` The problem is a badly written `__new__` method: https://github.com/sympy/sympy/blob/81cd2630631e315586f796646a7f9268e71bf484/sympy/physics/optics/medium.py#L71-L89 ...
[ { "body": "This shows up as an issue in the LaTeX-printing, but is probably an issue elsewhere as well.\r\n\r\n```\r\nfrom sympy.physics.optics import Medium\r\nMedium('m')\r\n```\r\ngives\r\n```\r\nTraceback (most recent call last):\r\n\r\n File \"C:\\Users\\Oscar\\miniconda3\\lib\\site-packages\\IPython\\cor...
88ed7abb488da615b007dd2ed5404312caef473c
{ "head_commit": "4bab3f6f5b30ea9bd211fa7e45f7a900e43ea88f", "head_commit_message": "removed check for empty name", "patch_to_review": "diff --git a/sympy/physics/optics/medium.py b/sympy/physics/optics/medium.py\nindex e47179c22bb0..204161864203 100644\n--- a/sympy/physics/optics/medium.py\n+++ b/sympy/physics/o...
[ { "diff_hunk": "@@ -69,23 +70,32 @@ class Medium(Symbol):\n \"\"\"\n \n def __new__(cls, name, permittivity=None, permeability=None, n=None):\n- obj = super().__new__(cls, name)\n- obj._permittivity = sympify(permittivity)\n- obj._permeability = sympify(permeability)\n- obj._...
ecd1631ec57386beb08df701e63c1886e5c85837
diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py index e027d9ad0f46..19f43a01bcfb 100644 --- a/sympy/core/tests/test_args.py +++ b/sympy/core/tests/test_args.py @@ -4920,6 +4920,16 @@ def test_sympy__physics__optics__medium__Medium(): assert _test_args(Medium('m')) +def test_sympy__ph...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
xonsh__xonsh-4969@d5ccd11
xonsh/xonsh
Python
4,969
fix: web config tool including \r in prompt
<!--- Thanks for opening a PR on xonsh! Please include a news entry with your PR to help keep our changelog up to date! There are instructions available here: https://xon.sh/devguide.html#changelog --> <!--- If there is specific issue / feature request that this PR is addressing, please link to the corresponding ...
2022-10-18T00:13:42Z
Web config tool includes \r in prompt When using the web config (xonfig web), newlines are interpreted as "\r\n". On macOS (and Linux, I assume) this adds a "^M" to the prompt, before the newline. ## xonfig ``` +------------------+--------------------------------+ | xonsh | 0.13.3 ...
i'm happy to try working on this, could someone assign me the issue? All yours, @peipacut -- we historically haven't relied on issue assignment, you should feel free to pick up any open issues and just ping in the issue that you're going to work on them to avoid duplicate effort.
[ { "body": "When using the web config (xonfig web), newlines are interpreted as \"\\r\\n\". On macOS (and Linux, I assume) this adds a \"^M\" to the prompt, before the newline. \r\n## xonfig\r\n```\r\n+------------------+--------------------------------+\r\n| xonsh | 0.13.3 |\r...
ed11f319fad27dd452808e1b88e1f1776f8d8772
{ "head_commit": "d5ccd117e710f8f3b086be5d23f7628702ec835a", "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/xonsh/webconfig/file_writes.py b/xonsh/webconfig/file_writes.py\nindex 1e4b4aec21..4388b43...
[ { "diff_hunk": "@@ -239,10 +240,13 @@ def get(self):\n \n def post(self, data: \"cgi.FieldStorage\"):\n if data:\n- prompt = data.getvalue(self.var_name)\n+ prompt = data.getvalue(self.var_name).replace(\"\\r\", \"\")\n self.env[self.var_name] = prompt\n ...
2ad920c2f9c243e8be42534d0a81ba2ebfb7a2f2
diff --git a/xonsh/webconfig/file_writes.py b/xonsh/webconfig/file_writes.py index 1e4b4aec21..4388b4371d 100644 --- a/xonsh/webconfig/file_writes.py +++ b/xonsh/webconfig/file_writes.py @@ -1,5 +1,6 @@ """functions to update rc files""" import os +import re import typing as tp RENDERERS: tp.List[tp.Callable] = [...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
xonsh__xonsh-5340@468ba13
xonsh/xonsh
Python
5,340
Fix jobs.py: list index out of range
Fixes https://github.com/xonsh/xonsh/issues/2544#issuecomment-2059957967 Closes #2544 ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment**
2024-04-17T09:14:59Z
"command&" misparsed `true&` is misparsed. It should execute `true` in the background, but instead treats the whole thing as the command name. `true &` works fine. ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment**
Thanks for reporting! I don't think that this is easily fixable, since one of the ways that the parser works is that it says whitespace counts in subprocess mode. Addressing this would special case backgrounding to have whitespace not matter for the last token. That said, we probably would still want this.... This also...
[ { "body": "`true&` is misparsed. It should execute `true` in the background, but instead treats the whole thing as the command name.\r\n\r\n`true &` works fine.\r\n\r\n## For community\r\n⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment**\r\n", "number": 2544, "title": "\"comm...
6c94d4ad6c844d50d2a39319dba4aee35295f2f1
{ "head_commit": "468ba134594db90c39fdc968750e67612f5b0d7b", "head_commit_message": "test: update venv activator test", "patch_to_review": "diff --git a/news/fix-jobs-index.rst b/news/fix-jobs-index.rst\nnew file mode 100644\nindex 0000000000..9f735037bc\n--- /dev/null\n+++ b/news/fix-jobs-index.rst\n@@ -0,0 +1,2...
[ { "diff_hunk": "@@ -8,9 +8,7 @@\n def test_xonsh_activator(tmp_path):\n # Create virtualenv\n venv_dir = tmp_path / \"venv\"\n- assert b\"XonshActivator\" in check_output(\n- [sys.executable, \"-m\", \"virtualenv\", str(venv_dir)]\n- )\n+ check_output([sys.executable, \"-m\", \"venv\", s...
7ac0af6adbaa6d25c9ef2b41b91e9aa9b516f751
diff --git a/news/fix-jobs-index.rst b/news/fix-jobs-index.rst new file mode 100644 index 0000000000..9f735037bc --- /dev/null +++ b/news/fix-jobs-index.rst @@ -0,0 +1,23 @@ +**Added:** + +* <news item> + +**Changed:** + +* <news item> + +**Deprecated:** + +* <news item> + +**Removed:** + +* <news item> + +**Fixed:** +...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sympy__sympy-22677@cc0c63a
sympy/sympy
Python
22,677
MatrixElement symbol property added; validate shape compatible with indices
#### Brief description of what is fixed or changed fixes #22676 ##### symbol attribute has been added MatrixElement behaves more like Indexed in terms of argument access: ```python >>> IndexedBase('x')[0].base x >>> MatrixSymbol('x',2,2)[0,0].symbol x ``` ##### invalid substitutions no longer succeed ...
2021-12-15T18:43:24Z
MatrixElement allows bad subs ```python >>> m22 = MatrixSymbol("A",2,2) >>> m11 = MatrixSymbol("B",1,1) >>> m22.subs(m22,m11) == m11 # this is ok, just changing a symbol without context True >>> m22[1,1].subs(m22, m11) # this is not ok -- it indicates a non-existent element in B B[1, 1] ``` If you enter the e...
[ { "body": "```python\r\n>>> m22 = MatrixSymbol(\"A\",2,2)\r\n>>> m11 = MatrixSymbol(\"B\",1,1)\r\n>>> m22.subs(m22,m11) == m11 # this is ok, just changing a symbol without context\r\nTrue\r\n>>> m22[1,1].subs(m22, m11) # this is not ok -- it indicates a non-existent element in B\r\nB[1, 1]\r\n```\r\nIf you en...
44588dbb8c7ab833a8acb0cad94e395db82685e5
{ "head_commit": "cc0c63ab621e52f1e4ec2a27981e44208437b910", "head_commit_message": "watch for illegals at both limits", "patch_to_review": "diff --git a/sympy/concrete/summations.py b/sympy/concrete/summations.py\nindex 799667109e3c..f2c74da5eaaf 100644\n--- a/sympy/concrete/summations.py\n+++ b/sympy/concrete/s...
[ { "diff_hunk": "@@ -589,10 +589,14 @@ class MatrixElement(Expr):\n def __new__(cls, name, n, m):\n n, m = map(_sympify, (n, m))\n from sympy.matrices.matrices import MatrixBase\n- if isinstance(name, (MatrixBase,)):\n+ if isinstance(name, MatrixBase):\n if n.is_Inte...
bb8ce3b796e5f00a56e3222abff5652c7e5b7dcb
diff --git a/sympy/concrete/summations.py b/sympy/concrete/summations.py index 799667109e3c..f2c74da5eaaf 100644 --- a/sympy/concrete/summations.py +++ b/sympy/concrete/summations.py @@ -28,6 +28,7 @@ from sympy.polys.partfrac import apart from sympy.polys.polyerrors import PolynomialError, PolificationFailed from s...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sympy__sympy-22562@3ad091a
sympy/sympy
Python
22,562
Bugfix in `minimal_polynomial()` and `field_isomorphism()`.
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2021-11-29T19:50:35Z
Some functions misinterpret `AlgebraicNumber`s. In certain cases, the functions `minimal_polynomial()` and `field_isomorphism()` fail to operate on the numbers that are actually represented by instances of `AlgebraicNumber`. ## Explanation An `AlgebraicNumber` instance represents an element `alpha` of a numbe...
[ { "body": "In certain cases, the functions `minimal_polynomial()` and `field_isomorphism()`\r\nfail to operate on the numbers that are actually represented by instances of\r\n`AlgebraicNumber`.\r\n\r\n\r\n## Explanation\r\n\r\nAn `AlgebraicNumber` instance represents an element `alpha` of a number field `Q(thet...
b7f44335287bb9c410a8d35a24267519b3914516
{ "head_commit": "3ad091a534209bdc6a2a021e1f195e847b7ba847", "head_commit_message": "Bugfix in `minimal_polynomial()` and `field_isomorphism()`.\n\nThe `minimal_polynomial()` and `field_isomorphism()` functions were not always doing what they advertised to do.\nThis was due to a misapprehension of what an instance ...
[ { "diff_hunk": "@@ -2641,6 +2748,119 @@ def _eval_simplify(self, **kwargs):\n return AlgebraicNumber(r)\n return self\n \n+ @property\n+ def is_primitive_elt(self):\n+ r\"\"\"\n+ Say whether this algebraic number $\\alpha \\in \\mathbb{Q}(\\theta)$ is\n+ eq...
9d31b472894771e8e4d66000ede02625a0d47e5d
diff --git a/doc/src/modules/core.rst b/doc/src/modules/core.rst index c6fbe3ec8f59..0ade07ed6df3 100644 --- a/doc/src/modules/core.rst +++ b/doc/src/modules/core.rst @@ -129,6 +129,8 @@ AlgebraicNumber .. autoclass:: AlgebraicNumber :members: + .. automethod:: AlgebraicNumber.__new__ + NumberSymbol ^^^^^^^^...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
xonsh__xonsh-4817@8658381
xonsh/xonsh
Python
4,817
xontrib load/unload
<!--- Thanks for opening a PR on xonsh! Please include a news entry with your PR to help keep our changelog up to date! There are instructions available here: https://xon.sh/devguide.html#changelog --> <!--- If there is specific issue / feature request that this PR is addressing, please link to the corresponding ...
2022-05-23T17:09:36Z
[RFC] Feat: Improve xontrib lifecycle Xontribs do not, as of writing, provide a mechanism for unloading. IPython has the `_unload_ipython_extension` function that is called by IPython when a user unloads an extension. It would be nice to offer the same feature here. I propose that we follow a similar design, and add...
[ { "body": "Xontribs do not, as of writing, provide a mechanism for unloading. IPython has the `_unload_ipython_extension` function that is called by IPython when a user unloads an extension. It would be nice to offer the same feature here.\r\n\r\nI propose that we follow a similar design, and add two methods:\r...
e7ab9a4eb82c25f9ef329784dbf194c8b23065d4
{ "head_commit": "8658381c56846d3f1edc7621a484352a37190e5e", "head_commit_message": "chore: give explicit name", "patch_to_review": "diff --git a/docs/tutorial_xontrib.rst b/docs/tutorial_xontrib.rst\nindex 88956e8e02..a51b8de06d 100644\n--- a/docs/tutorial_xontrib.rst\n+++ b/docs/tutorial_xontrib.rst\n@@ -24,15 ...
[ { "diff_hunk": "@@ -24,15 +24,50 @@ took inspiration from for xonsh:\n * `Sphinx <http://sphinx-doc.org/>`_: Extensions are just Python modules,\n bundles some extensions with the main package, interface is a list of\n string names.\n+* `IPython <https://ipython.readthedocs.io/en/stable/config/extensions/in...
6ddb1a85ecc9148a6b416b5da355300ca2a09ce1
diff --git a/docs/tutorial_xontrib.rst b/docs/tutorial_xontrib.rst index 88956e8e02..468e00326d 100644 --- a/docs/tutorial_xontrib.rst +++ b/docs/tutorial_xontrib.rst @@ -24,15 +24,48 @@ took inspiration from for xonsh: * `Sphinx <http://sphinx-doc.org/>`_: Extensions are just Python modules, bundles some extension...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
sympy__sympy-22551@626064e
sympy/sympy
Python
22,551
core/containers: no longer create Tuple's with lists as arguments.
<!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes #1234" (see https://tinyurl.com/auto-closing for more i...
2021-11-26T01:10:18Z
Tuple using sympify instead of _sympify incorrectly supports lists Currently, `Tuple` supports the keyword `sympify` (`True` by default). However, this uses `sympify` rather than `_sympify`. As a result, `lists` appear to be supported as arguments to `Tuple` but this may result in unexpected behaviour since the resulti...
Alternatively, since this is used very often, perhaps it is better to define a `TestBasic` class for the tests, which takes care of this in the class constructor It is generally preferred to use `_sympify` rather than `sympify` but changing that everywhere would not be fully compatible. Is there a particular problem wi...
[ { "body": "Currently, `Tuple` supports the keyword `sympify` (`True` by default). However, this uses `sympify` rather than `_sympify`. As a result, `lists` appear to be supported as arguments to `Tuple` but this may result in unexpected behaviour since the resulting `Tuple` is now in principle mutable. Instead,...
11eb28349d8a97e1088e9daa1ad12b9046005185
{ "head_commit": "626064e1a582d6dc37fc3bcf54e3508d38fe6877", "head_commit_message": "removed misuses of sympify that would create Tuples with non-Basic argument", "patch_to_review": "diff --git a/sympy/core/containers.py b/sympy/core/containers.py\nindex 2c6a7721b09c..f3f8a89662ca 100644\n--- a/sympy/core/contain...
[ { "diff_hunk": "@@ -1270,19 +1270,20 @@ def __new__(cls, expr, *variables, **kwargs):\n must be supplied to differentiate %s''' % expr))\n \n # Standardize the variables by sympifying them:\n- variables = list(sympify(variables))\n+ #variables = sympify(list(variabl...
41ba53c4197cc7b5ffec89bf0161555f00b103b4
diff --git a/sympy/codegen/abstract_nodes.py b/sympy/codegen/abstract_nodes.py new file mode 100644 index 000000000000..eb5da05fc0fe --- /dev/null +++ b/sympy/codegen/abstract_nodes.py @@ -0,0 +1,15 @@ +"""This module provides containers for python objects that are valid +printing targets but are not a subclass of SymP...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
sympy__sympy-22483@42077c2
sympy/sympy
Python
22,483
recursive canonical
This is for Eq and Ne which can have relational args. <!-- Your title above should be a short description of what was changed. Do not include the issue number in the title. --> #### References to other Issues or PRs <!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact format, e.g. "Fixes...
2021-11-13T03:02:27Z
relationals created with symbols can be made canonical ``` python >>> a=1<x >>> b=S(1)<x >>> c=x>S(1) >>> a==b False >>> b==c False ``` The `a==b` failure is expected since Python flips the args around. But it and the `b==c` case could all be the same if Relationals created from symbols (<, >, etc...) would sort args ...
Actually, there is the gts and lts (in addition to the lhs and rhs attributes): ``` python >>> a = S(1) >>> b = a<x >>> c=x>a >>> b.lts == c.lts True >>> b.gts == c.gts True ``` Some work toward this end is in #8423 I don't think that auto-canonicalization is favored. It is possible to simplify this expression: ```...
[ { "body": "``` python\n>>> a=1<x\n>>> b=S(1)<x\n>>> c=x>S(1)\n>>> a==b\nFalse\n>>> b==c\nFalse\n```\n\nThe `a==b` failure is expected since Python flips the args around. But it and the `b==c` case could all be the same if Relationals created from symbols (<, >, etc...) would sort args canonically. This, like so...
76d72acaeeab0082fc43eee42ddc8688acd3e306
{ "head_commit": "42077c2a7e16e947aeffab4d1ccb42d5cb2ff0c4", "head_commit_message": "Update test_relational.py", "patch_to_review": "diff --git a/sympy/core/relational.py b/sympy/core/relational.py\nindex 3d95a9102bad..2b30b5d0d9a4 100644\n--- a/sympy/core/relational.py\n+++ b/sympy/core/relational.py\n@@ -111,7 ...
[ { "diff_hunk": "@@ -111,7 +111,8 @@ def __new__(cls, lhs, rhs, rop=None, **assumptions):\n # other than Eq/Ne;\n # Note: Symbol is a subclass of Boolean but is considered\n # acceptable here.\n- if any(map(_nontrivBool, (lhs, rhs))):\n+ if any(map(_nontr...
64a74e6c9c577a882aa958f717f6b64f4e6a3a24
diff --git a/sympy/core/relational.py b/sympy/core/relational.py index 3d95a9102bad..7a4be766fdb1 100644 --- a/sympy/core/relational.py +++ b/sympy/core/relational.py @@ -265,9 +265,20 @@ def canonical(self): x < -y >>> (-y < -x).canonical x < y + + The canonicalization is recursively ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
xonsh__xonsh-4461@3b2e507
xonsh/xonsh
Python
4,461
Fix: EnvPath.add() not maintain uniqueness with Path objects on replace
<!--- Thanks for opening a PR on xonsh! Please include a news entry with your PR to help keep our changelog up to date! There are instructions available here: https://xon.sh/devguide.html#changelog --> <!--- If there is specific issue / feature request that this PR is addressing, please link to the corresponding ...
2021-09-07T01:05:21Z
EnvPath.add() doesn't maintain uniqueness with Path objects ## xonfig <details> ``` +------------------+----------------------+ | xonsh | 0.9.27 | | Git SHA | 71fe9014 | | Commit Date | Jan 29 08:58:58 2021 | | Python | 3.9.5 | | PL...
Hi! > EnvPath.add(thing) (e.g. $PATH.add(thing)) should not allow multiple copies of thing to enter the list, compared as strings. Why? AFAIK the OS doesn't mind and other shells allow this as well. The `.add` method is specifically documented not to add duplicates (with flags controlling precise de-duping semantic...
[ { "body": "## xonfig\r\n\r\n<details>\r\n\r\n```\r\n+------------------+----------------------+\r\n| xonsh | 0.9.27 |\r\n| Git SHA | 71fe9014 |\r\n| Commit Date | Jan 29 08:58:58 2021 |\r\n| Python | 3.9.5 |\r\n| PLY | 3.11...
6df8a24fc92ce6af8adbd471f276171c96966b6d
{ "head_commit": "3b2e507fedc11ca113a046dbeb7f8b64ec2ade24", "head_commit_message": "Add tests for EnvPath.add() function", "patch_to_review": "diff --git a/news/fixduplicatepaths.rst b/news/fixduplicatepaths.rst\nnew file mode 100644\nindex 0000000000..8beed2482a\n--- /dev/null\n+++ b/news/fixduplicatepaths.rst\...
[ { "diff_hunk": "@@ -942,6 +942,30 @@ def test_env_path_add(left, right, exp):\n assert exp == obs\n \n \n+def test_env_path_add_replace_no_dupes_front_replace_existing():\n+ # Test replaces without dupes when added to front when adding existing entry\n+ path = EnvPath([\"/home/wakka\", \"/home/wakka/b...
e15ea850ab374527f9c5b4c1a0738e3cf663684a
diff --git a/news/fixduplicatepaths.rst b/news/fixduplicatepaths.rst new file mode 100644 index 0000000000..8beed2482a --- /dev/null +++ b/news/fixduplicatepaths.rst @@ -0,0 +1,15 @@ +**Added:** None + +**Changed:** + +* <news item> + +**Deprecated:** None + +**Removed:** None + +**Fixed:** + +* Fix Duplicate paths lef...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }