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
saleor__saleor-4018@c18bb40
saleor/saleor
Python
4,018
Implement order events
- [x] For the gql type of OrderEvent we have to include: - [x] New fields for getting data from the JSON parameters. [2] - [x] A payment method field taken from the parameters. - [x] Tests. <!-- yes. --> - [x] The OrderEvent model should have: - [x] A field `user` containing who triggered the event. [4]...
2019-04-25T09:59:04Z
Log order and customer actions and events ### What I'm trying to achieve Keep track of whatever changes and actions were made by the staff. This is useful to catch errors and check data changes. ### Describe a proposed solution #### 1 — Models Introduce a new model containing log entries. A possible model ...
As part of that issue, we should also think of the unified API for using events in the code (see #3966). - For the gql type of OrderEvent we have to include: - A order_customer field of type User. (Null if it's an automated task) [1] - New fields for getting data from the JSON parameters. [2] - A payment method f...
[ { "body": "### What I'm trying to achieve\r\nKeep track of whatever changes and actions were made by the staff.\r\n\r\nThis is useful to catch errors and check data changes.\r\n\r\n\r\n### Describe a proposed solution\r\n\r\n#### 1 — Models\r\nIntroduce a new model containing log entries. A possible model (base...
6ba9f788034ea422b53449ece294a98c35865256
{ "head_commit": "c18bb4057c2bba35059d0b5c299f89ffe0f8b95d", "head_commit_message": "Update migration files", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 48d6613ae90..cf4cb893797 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -47,6 +47,10 @@ All notable, unreleased changes to this proj...
[ { "diff_hunk": "@@ -77,17 +87,15 @@ def create_order_from_draft(request, order_pk):\n msg = pgettext_lazy(\n 'Dashboard message related to an order',\n 'Order created from draft order')\n- order.events.create(\n- user=request.user,\n- type=OrderEvents...
03ad80132b3be92a7c682e26aba026433a8759ea
diff --git a/CHANGELOG.md b/CHANGELOG.md index 48d6613ae90..cf4cb893797 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ All notable, unreleased changes to this project will be documented in this file. - Resort imports and remove unused imports - #4069 by @jxltom - Fix typo in CheckoutBillingAddressUpd...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
saleor__saleor-3948@cd189aa
saleor/saleor
Python
3,948
Implement variant availability, introducing discounts in variants
Fixes #3765. Proposed solution is to add a `availability` field of type `VariantAvailability` based on `ProductAvailability` for the `ProductType` variant as both variants and products have the same availability data fields, except price ranges. ### Changelist - [x] Refactor `get_availability` to `get_product_avail...
2019-04-09T13:51:33Z
Add Discounted Price Field on GraphQL Products ### What I'm trying to achieve It is normal to display the discounted price for a product on any listings. Ideally, we should have both the original price and the discounted price so we can show them side-by-side to the user. This is currently not available when the produ...
What you are looking for is the `availability` field in the `Product` type. This object provides information about the pricing of a product such as a price including/excluding discount, discount amount, information whether a product is on sale etc.: ``` product(id: "UHJvZHVjdDo2NA==") { name availability { ...
[ { "body": "### What I'm trying to achieve\r\nIt is normal to display the discounted price for a product on any listings. Ideally, we should have both the original price and the discounted price so we can show them side-by-side to the user. This is currently not available when the product is retrieved from graph...
9af726ba6d3a8cb11da07dc957a3fd2a92d7ef64
{ "head_commit": "cd189aa0940faffdba8b87c48eae946507194434", "head_commit_message": "Restore the price field to allow back compatibility\nBut yet don't expose the base price", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex a7a5365b781..9e17f530e31 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.m...
[ { "diff_hunk": "@@ -227,6 +231,14 @@ def __str__(self):\n def quantity_available(self):\n return max(self.quantity - self.quantity_allocated, 0)\n \n+ @property\n+ def is_visible(self):\n+ return self.product.is_visible\n+\n+ @property\n+ def is_available(self):\n+ return s...
32b116bc5bd953a7c27cd881edc1d00edbf43e9a
diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a5365b781..9e17f530e31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ All notable, unreleased changes to this project will be documented in this file. - Implement menus items reordering into the GraphQL API - #3958 by @NyanKiyoshi +- Implement varian...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-16066@a430453
scipy/scipy
Python
16,066
DEV,BLD: Move to meson on gitpod
Enables building with meson on gitpod. #### Reference issue Closes #16065 #### What does this implement/fix? Enables building with meson, using the `environment_meson.yml` file on gitpod, including pre-building SciPy and the documentation.
2022-04-28T20:10:47Z
BUG: Gitpod build with `python runtests.py` fails; move to meson on gitpod ### Describe your issue. The current configuration of gitpod for the SciPy repo involves creating the `scipy-dev` environment and building through `python setup.py build_ext --inplace`. However, running `python runtests.py` with this setup resu...
[ { "body": "### Describe your issue.\n\nThe current configuration of gitpod for the SciPy repo involves creating the `scipy-dev` environment and building through `python setup.py build_ext --inplace`. However, running `python runtests.py` with this setup results in test errors. \r\n\r\nOn the other hand, creatin...
7043404d4a7b6c43032de7ea008915fd618ce70f
{ "head_commit": "a430453f07e0bc4690a2abc315b35299233c20be", "head_commit_message": "DEV - Update Meson-gitpod (#1)\n\n* :building_construction: [ENH] - Update Dockerfile - split into Meson and dev\n\n* ENH - Split Dockerbuilds\n\n* DEV: Add pip to avoid warning\n\n* ENH: Add docs to Dockerfile\n\n* DEV: Improve Do...
[ { "diff_hunk": "@@ -12,14 +12,13 @@ tasks:\n init: |\n mkdir -p .vscode\n cp tools/docker_dev/settings.json .vscode/settings.json\n- conda activate scipy-dev\n+ conda activate scipy-meson\n+ python -m pip install docutils", "line": null, "original_line": 16, "original_...
6d8e1659f2a9f06cd27ba58e54d2f412f0f6c841
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b922045dc6fe..374c5027e8fe 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,16 +1,18 @@ name: Build Base Docker Image -# Triggered only if environment.yml in main changes +# Triggered only if environment_...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-16042@02531c2
scipy/scipy
Python
16,042
MAINT: stats.dirichlet: fix interface inconsistency
#### Reference issue Closes gh-6006 gh-4984 #### What does this implement/fix? The `dirichlet` distribution interface is inconsistent with other multivariate distributions and even itself: the `pdf` method expects the transpose of what the `rvs` method produces. This PR introduces `multivariate_beta`, which is th...
2022-04-24T21:58:36Z
Dirichlet doesn't accept its own random variates as input to pdf ``` In [1]: import scipy.stats as ss In [2]: d = ss.dirichlet([1,3,4]) In [3]: d.pdf(d.rvs()) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipyth...
Every distribution should pass this test: ``` for size in [None, 1, 2]: d.pdf(d.rvs(size=size)).shape == (() if size is None else (size,)) ``` Related discussion, starting from https://github.com/scipy/scipy/pull/4984#discussion_r32984650 @ev-br Thanks for the link. Sorry for not searching properly before my su...
[ { "body": "```\n\nIn [1]: import scipy.stats as ss\n\nIn [2]: d = ss.dirichlet([1,3,4])\n\nIn [3]: d.pdf(d.rvs())\n---------------------------------------------------------------------------\nValueError Traceback (most recent call last)\n<ipython-input-3-a6f3762e83cf> in <module>(...
e8bb868d54e58b7479e697db728fcf08797211c6
{ "head_commit": "02531c2a8308f2539cb92d9c3b1f5e8c5224bd65", "head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Tirth Patel <tirthasheshpatel@gmail.com>", "patch_to_review": "diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py\nindex feedc62099e8..c9a7fd720144 100644\n--- a/s...
[ { "diff_hunk": "@@ -160,7 +160,8 @@\n \n multivariate_normal -- Multivariate normal distribution\n matrix_normal -- Matrix normal distribution\n- dirichlet -- Dirichlet\n+ multivariate_beta -- Multivariate beta distribution (Dirichlet)\n+ dirichlet -- Diric...
a71fc15d1d7c974887227023052a53902d43958c
diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py index feedc62099e8..f091a5152c26 100644 --- a/scipy/stats/__init__.py +++ b/scipy/stats/__init__.py @@ -160,7 +160,8 @@ multivariate_normal -- Multivariate normal distribution matrix_normal -- Matrix normal distribution - dirichlet ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-16030@39b745d
scipy/scipy
Python
16,030
MAINT: stats: more accurate error message for `multivariate_normal`
#### Reference issue Closes gh-15508 #### What does this implement/fix? gh-15508 reported that `multivariate_normal` reported the error `singular matrix` with an input that was not singular. This PR makes the error message more accurate and adds notes to the documentation to explain that symmetry of the matrix is ...
2022-04-22T07:03:44Z
BUG: Incorrect error message in multivariate_normal ### Describe your issue. Hi everyone, I'm getting an incorrect (?) error message when using multivariate normal. Here is my minimally reproducible example. ```python from scipy.stats import multivariate_normal cov = [[1., 0.], [1., 1.]] f = multi...
Hey @AtsushiSakai @IgnacioHeredia, I have submitted a PR to fix this error message. Please review it. I'm not sure this is a bug or not, because a correct covariance matrix is always symmetric and positive semi-definite, so I think passing a non-symmetric matrix is a user error. @AtsushiSakai @NamamiShanker I glanced ...
[ { "body": "### Describe your issue.\n\nHi everyone,\r\n\r\nI'm getting an incorrect (?) error message when using multivariate normal. Here is my minimally reproducible example.\r\n\r\n```python\r\nfrom scipy.stats import multivariate_normal\r\n\r\ncov = [[1., 0.],\r\n [1., 1.]]\r\n\r\nf = multivariate_nor...
4d942c5ee551d933a73c66d1566ad17408b5edaa
{ "head_commit": "39b745dd802be5dfbd1e7a931626c982bb5d26cb", "head_commit_message": "Update scipy/stats/_multivariate.py\r\n\r\n[skip ci]\n\nCo-authored-by: Tirth Patel <tirthasheshpatel@gmail.com>", "patch_to_review": "diff --git a/scipy/stats/_multivariate.py b/scipy/stats/_multivariate.py\nindex 025ffe2f924f.....
[ { "diff_hunk": "@@ -683,13 +689,13 @@ def __init__(self, mean=None, cov=1, allow_singular=False, seed=None,\n \n Parameters\n ----------\n- mean : array_like, optional\n- Mean of the distribution (default zero)\n- cov : array_like, optional\n- Covariance matri...
045f4925e7ae4e69b9f7a173179c5ffc338eb6ab
diff --git a/scipy/stats/_multivariate.py b/scipy/stats/_multivariate.py index 025ffe2f924f..23642ffea2af 100644 --- a/scipy/stats/_multivariate.py +++ b/scipy/stats/_multivariate.py @@ -158,10 +158,13 @@ def __init__(self, M, cond=None, rcond=None, lower=True, eps = _eigvalsh_to_eps(s, cond, rcond) ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-16029@19cd743
scipy/scipy
Python
16,029
BUG: Fix meson-info file errors and add more informative exception
Fixes #16020
2022-04-22T05:11:22Z
BUG: dev.py FileNotFoundError ### Describe your issue. Hi, trying to setup a dev environment on a new laptop and have been following the new quickstart guide. I am to build scipy using the `dev.py` interface and am running into the following error: ``` (scipy-meson) [jakeb@jake-vostro157510 scipy]$ python dev.py --b...
Hi, Can you please try removing the `build` directory and use `python dev.py --build-only` again? So what happened here most likely is that you built with `runtests.py` or `python setup.py ...` @j-bowhay, which created a `build/` directory but not with Meson. So now the script is confused. Can you confirm that? @Sm...
[ { "body": "### Describe your issue.\n\nHi, trying to setup a dev environment on a new laptop and have been following the new quickstart guide. I am to build scipy using the `dev.py` interface and am running into the following error:\r\n```\r\n(scipy-meson) [jakeb@jake-vostro157510 scipy]$ python dev.py --build-...
4d942c5ee551d933a73c66d1566ad17408b5edaa
{ "head_commit": "19cd74302f35fcda3a8c81d8e851be6739f32bad", "head_commit_message": "BUG: Fix meson-info file errors and add more informative exception", "patch_to_review": "diff --git a/dev.py b/dev.py\nindex 3101d3e42ca9..b944b6c6cc3f 100644\n--- a/dev.py\n+++ b/dev.py\n@@ -413,23 +413,32 @@ def setup_build(arg...
[ { "diff_hunk": "@@ -413,23 +413,32 @@ def setup_build(args, env):\n run_dir = os.getcwd()\n if build_dir.exists() and not (build_dir / 'meson-info').exists():\n if list(build_dir.iterdir()):\n- raise RuntimeError(\"Can't build into non-empty directory \"\n- ...
fcbb03cc0c878da316ecc2880095de87fafee99e
diff --git a/dev.py b/dev.py index 3101d3e42ca9..89a38693b060 100644 --- a/dev.py +++ b/dev.py @@ -413,23 +413,32 @@ def setup_build(args, env): run_dir = os.getcwd() if build_dir.exists() and not (build_dir / 'meson-info').exists(): if list(build_dir.iterdir()): - raise RuntimeError("Can'...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-3717@efeddef
saleor/saleor
Python
3,717
Generate voucher code if it wasn't provided in mutation
I want to merge this change because it implements generating voucher code if it wasn't provided in `voucherCreate` mutation. `code` argument is still required in the mutation; voucher code is generated only if empty string was passed as `code` value. It closes #3704. <!-- Please mention all relevant issue number...
2019-02-13T13:18:59Z
Generate voucher code if it wasn't provided When creating a voucher through API, a user has to provide the voucher code (it is required by the database model). In Dashboard 1.0 we used to generate the code for users and here we should bring back the same behavior. Once this feature is implemented we'll add a help text...
[ { "body": "When creating a voucher through API, a user has to provide the voucher code (it is required by the database model). In Dashboard 1.0 we used to generate the code for users and here we should bring back the same behavior.\r\nOnce this feature is implemented we'll add a help text in Dashboard 2.0 sayin...
af654d853adc7dbacb3e96417ad1305218453361
{ "head_commit": "efeddef636f8888d330440d6d455a2d76986e87d", "head_commit_message": "Add generating voucher code if an empty string was provided in mutation", "patch_to_review": "diff --git a/saleor/dashboard/discount/forms.py b/saleor/dashboard/discount/forms.py\nindex 240368746f5..bb0af428641 100644\n--- a/sale...
[ { "diff_hunk": "@@ -86,3 +88,11 @@ def get_products_voucher_discount(voucher, prices):\n voucher.get_discount_amount_for(price) for price in prices)\n total_amount = sum(discounts, ZERO_MONEY)\n return total_amount\n+\n+\n+def generate_voucher_code():\n+ \"\"\"Generate new unique voucher code...
3df4b381f0e5bbb4d5ae7c25a1bcb433cd394aea
diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e208228be..2c7b6460bfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable, unreleased changes to this project will be documented in this file. - Improve vouchers country limiting - #3707 by @michaljelonek - Add support for date and datetime compo...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-16004@04fbe9b
scipy/scipy
Python
16,004
MAINT: rename MaximumFlowResult.residual to flow
The attribute `MaximumFlowResult.residual` was poorly named: It in fact represents the flow function of the maximum flow, whereas the residual is given by the difference between the input graph and this flow function. As such, we simply rename it from `residual` to `flow` to avoid the risk of confusion. A differ...
2022-04-18T07:17:11Z
BUG: Incorrect residual graph in scipy.sparse.csgraph.maximum_flow ### Describe your issue. Consider the reproducing example below. This seems to be the incorrect residual graph from the flow. 1-2 has a 5 capacity, 2-3 has a 1 capacity and 3-0 has a 1 capacity. So, while the flow_value is 1 from 1-0 (which is correctl...
Version 1.8 will add an additional ``method`` argument. The residual matrix is the same for both methods. Perhaps some who has worked on this could take a look? You're right, this seems like an instance of incorrect, or at the very least very misleading, naming: The map you're looking at is the flow, and the residual n...
[ { "body": "### Describe your issue.\n\nConsider the reproducing example below. This seems to be the incorrect residual graph from the flow. 1-2 has a 5 capacity, 2-3 has a 1 capacity and 3-0 has a 1 capacity. So, while the flow_value is 1 from 1-0 (which is correctly returned), the residual for 1-2 should be 4....
d4c32e61357ec2256cbbcba4f4ae26f6c88cc58a
{ "head_commit": "04fbe9be5c038b64685ebcba71980435ce48e2ad", "head_commit_message": "MAINT: rename MaximumFlowResult.residual to flow\n\nThe attribute `MaximumFlowResult.residual` was poorly named: It in fact\nrepresents the flow function of the maximum flow, whereas the residual\nis given by the difference between...
[ { "diff_hunk": "@@ -17,17 +18,23 @@ class MaximumFlowResult:\n ----------\n flow_value : int\n The value of the maximum flow.\n- residual : csr_matrix\n- The residual graph with respect to the maximum flow.\n+ flow : csr_matrix\n+ The maximum flow.\n \"\"\"\n \n- def _...
e8137985aca6f6ad715bd1a0005c79efe8d309a0
diff --git a/scipy/sparse/csgraph/_flow.pyx b/scipy/sparse/csgraph/_flow.pyx index e11dfb06d5ef..155632dc238b 100644 --- a/scipy/sparse/csgraph/_flow.pyx +++ b/scipy/sparse/csgraph/_flow.pyx @@ -1,6 +1,7 @@ # cython: wraparound=False, boundscheck=False import numpy as np +import warnings from scipy.sparse import...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
saleor__saleor-3639@b0e6e6b
saleor/saleor
Python
3,639
Expose in API list of supported payment gateways
I want to merge this change because resolve #3617 <!-- Please mention all relevant issue numbers. --> ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Ple...
2019-01-23T08:40:17Z
Expose in API list of supported payment gateways In API we expose the `GatewaysEnum` enum which contains all the available payment gateways, but there is no way for the Storefront 2.0 to determine which of them are actually enabled (currently Braintree is hardcoded over there). We should expose a field that would provi...
[ { "body": "In API we expose the `GatewaysEnum` enum which contains all the available payment gateways, but there is no way for the Storefront 2.0 to determine which of them are actually enabled (currently Braintree is hardcoded over there). We should expose a field that would provide this information, e.g:\r\n`...
8bcb9ee25970275ffed8217e70fecdcf59c7120d
{ "head_commit": "b0e6e6b93257d7831613a94af2972bd89f6f4e73", "head_commit_message": "Add tests", "patch_to_review": "diff --git a/saleor/graphql/shop/types.py b/saleor/graphql/shop/types.py\nindex b5abf085a7c..119c15599b8 100644\n--- a/saleor/graphql/shop/types.py\n+++ b/saleor/graphql/shop/types.py\n@@ -17,6 +17...
[ { "diff_hunk": "@@ -76,6 +77,8 @@ class Shop(graphene.ObjectType):\n required=True)\n default_currency = graphene.String(\n description='Default shop\\'s currency.', required=True)\n+ enabled_gateways = graphene.List(", "line": null, "original_line": 80, "original_start_line":...
1714fcdfc6b2fcc6f3b4298ec0e63da3e3018eb7
diff --git a/CHANGELOG.md b/CHANGELOG.md index c4b1a9e486c..67f5ebb46ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,3 +32,4 @@ All notable, unreleased changes to this project will be documented in this file. - Validate files uploaded in API in a unified way - #3633 by @fowczarek - Add ShopFetchTaxRates mutati...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
scipy__scipy-15998@c0f47f4
scipy/scipy
Python
15,998
BUG: Fix yeojohnson when transformed data has zero variance
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: http://scipy.g...
2022-04-17T18:03:48Z
Errors with the Yeo-Johnson Transform that also Appear in Scikit-Learn My issue is about issues with the Yeo-Johnson transform that also appear in scikit-learn #### Reproducing code example: ``` import numpy as np import scipy import sklearn sklearn.show_versions() a = np.array([ 3251637.22,620695.44,11642...
The issue is that I supply an array with large variance and am returned an array with 0 variance plus many error messages. I have reported a very similar error to scikit-learn, from whence I believe the code originated: https://github.com/scikit-learn/scikit-learn/issues/14959 There is also a comment in a scik...
[ { "body": "My issue is about issues with the Yeo-Johnson transform that also appear in scikit-learn\r\n\r\n#### Reproducing code example:\r\n\r\n```\r\nimport numpy as np\r\nimport scipy\r\nimport sklearn\r\nsklearn.show_versions()\r\na = np.array([\r\n 3251637.22,620695.44,11642969.00,2223468.22,85307500.00,16...
132b9dec3e4d6329672e0d86628cf2366686a630
{ "head_commit": "c0f47f4d84e4c39babe7c251b537fdab12dfcb05", "head_commit_message": "BUG: Fix yeojohnson when transformed data has zero variance", "patch_to_review": "diff --git a/scipy/stats/_morestats.py b/scipy/stats/_morestats.py\nindex 06978177e20d..dd2045ca9003 100644\n--- a/scipy/stats/_morestats.py\n+++ b...
[ { "diff_hunk": "@@ -2103,6 +2103,19 @@ def test_input_dtype_integer(self, dtype):\n assert_allclose(xt_int, xt_float, rtol=1e-7)\n assert_allclose(lmbda_int, lmbda_float, rtol=1e-7)\n \n+ def test_input_high_variance(self):\n+ # non-regression test for gh-10821\n+ x = np.array([...
8e5c8906e1ecac5c0781bd38a7c218575fc2eab0
diff --git a/scipy/stats/_morestats.py b/scipy/stats/_morestats.py index 06978177e20d..a4628819defa 100644 --- a/scipy/stats/_morestats.py +++ b/scipy/stats/_morestats.py @@ -1579,10 +1579,17 @@ def yeojohnson_llf(lmb, data): return np.nan trans = _yeojohnson_transform(data, lmb) + trans_var = trans....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-3587@6c6baf0
saleor/saleor
Python
3,587
Add checkout assignment to the logged in customer
I want to merge this change because resolve #3584 <!-- Please mention all relevant issue numbers. --> ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Ple...
2019-01-11T12:28:35Z
Checkout should be assigned to the logged in customer When we create checkout as a logged in customer it should be assigned to him. ### Steps to reproduce the problem 1. Login to GraphQL API 2. Create checkout 3. Check user assigned to checkout
[ { "body": "When we create checkout as a logged in customer it should be assigned to him.\r\n\r\n### Steps to reproduce the problem\r\n1. Login to GraphQL API \r\n2. Create checkout\r\n3. Check user assigned to checkout \r\n", "number": 3584, "title": "Checkout should be assigned to the logged in custome...
1ff45172aa6536bbfea4c5375365f75f8f910c13
{ "head_commit": "6c6baf0a8dac8af0f2babd8341e4ff01fb406bbf", "head_commit_message": "Changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex dae59518547..801602d0fdd 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -5,3 +5,4 @@ All notable, unreleased changes to this project will be docu...
[ { "diff_hunk": "@@ -77,6 +77,16 @@ def check_lines_quantity(variants, quantities):\n return errors\n \n \n+def get_validated_address_data(checkout, errors, user, address_data):", "line": null, "original_line": 80, "original_start_line": null, "path": "saleor/graphql/checkout/mutations.py", ...
df0681a1cbb9031a8cd19ed121eafb50310f62e5
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c5f1156794..180be7cc35d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,3 +10,4 @@ All notable, unreleased changes to this project will be documented in this file. - Order by id by default for CartLine - #3593 by @jxltom - Fix bug where products in homepage should b...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-3563@ecbd5a4
saleor/saleor
Python
3,563
Fix checkoutLinesAdd mutation when empty checkout
I want to merge this change because resolve #3562 <!-- Please mention all relevant issue numbers. --> ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Ple...
2019-01-08T08:33:29Z
Mutation checkoutLinesAdd doesn't work when empty checkout ### What I'm trying to achieve Add a new product to empty checkout. ### Steps to reproduce the problem 1. Create new checkout. 2. If checkout has any product then remove it. 3. Add a new product to empty checkout.
[ { "body": "### What I'm trying to achieve\r\nAdd a new product to empty checkout.\r\n\r\n### Steps to reproduce the problem\r\n1. Create new checkout.\r\n2. If checkout has any product then remove it.\r\n3. Add a new product to empty checkout.\r\n", "number": 3562, "title": "Mutation checkoutLinesAdd do...
04a15be26af015896334b68305ef515b6e45c742
{ "head_commit": "ecbd5a42aed0deb209b65962f2e64b5f50bb73f7", "head_commit_message": "Changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 8f2b612a2a7..2c7a139624c 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -51,3 +51,4 @@ All notable, unreleased changes to this project will be do...
[ { "diff_hunk": "@@ -311,21 +309,20 @@ def mutate(cls, root, info, checkout_id, shipping_address):\n checkout = cls.get_node_or_error(\n info, checkout_id, errors, 'checkout_id', only_type=Checkout)\n \n- shipping_address, errors = cls.validate_address(\n- shipping_address, ...
588025684b5cbd9bd0ea1f92e2699f05292d7416
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2b612a2a7..2c7a139624c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,3 +51,4 @@ All notable, unreleased changes to this project will be documented in this file. - Unique validation SKU when default variant create in GraphQL API - #3555 by @fowczarek - Bump backen...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-15965@526b470
scipy/scipy
Python
15,965
MAINT: stats: ensure that `rv_continuous._fitstart` shapes do not violate `_argcheck`
#### Reference issue Closes gh-15689 #### What does this implement/fix? gh-15689 reported that when using the `fit` method of `rv_continuous`, the `_fitstart` still needs to be overridden for several distributions because the default value of shape parameters (all `1`) violates `_argcheck`. This PR overrides `_fit...
2022-04-09T19:58:25Z
BUG: default value of shape parameter in fit method of rv_continuous might not be admissible ### Describe your issue. If no guess of the shape parameter is provided to `rv_continuous.fit`, the value of 1.0 is taken as a guess. However, it is not guaranteed that this value is allowed as a shape parameter, e.g., if `_ar...
To explain the root cause, I tried to replicate the behaviour of `fit` in `stats\_distn_infrastructure.py`: ``` args = () kwds = {'floc': 0.0, 'fscale': 1.0} start = [None]*2 # fitstart will set the guess for a to 1.0 start = myDist._fitstart(data) args += start[:-2] loc = kwds.pop('loc', start[-2]) scale ...
[ { "body": "### Describe your issue.\n\nIf no guess of the shape parameter is provided to `rv_continuous.fit`, the value of 1.0 is taken as a guess. However, it is not guaranteed that this value is allowed as a shape parameter, e.g., if `_argcheck(1.0)` is True\n\n### Reproducing Code Example\n\n```python\nimpor...
24beed8d35bddaccd3c2bcfd88d34c9ed055f381
{ "head_commit": "526b470c069ffb72c7feba72899cff844e517c1d", "head_commit_message": "MAINT: stats: ensure that _fitstart is not trivially invalid", "patch_to_review": "diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py\nindex 28793457feca..06f56cb5f557 100644\n--- a/scipy/stats/_co...
[ { "diff_hunk": "@@ -3338,6 +3342,11 @@ def _shape_info(self):\n ib = _ShapeInfo(\"b\", False, (-np.inf, np.inf), (False, False))\n return [ip, ia, ib]\n \n+ def _fitstart(self, data):\n+ # Arbitrary, but the default a=b=1 is not valid\n+ return super()._fitstart(data, args=(1, 1...
21fcdd06424660aff5bb8a60bed9b4abb56ae98c
diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py index 28793457feca..92a5ecc67454 100644 --- a/scipy/stats/_continuous_distns.py +++ b/scipy/stats/_continuous_distns.py @@ -2316,6 +2316,10 @@ def _shape_info(self): ib = _ShapeInfo("b", False, (0, np.inf), (False, False)) ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-15967@e4392d1
scipy/scipy
Python
15,967
TST/DOC: stats: explain/check 100% interval for discrete distributions
#### Reference issue Closes gh-11026 #### What does this implement/fix? gh-11026 reported that discrete distributions returned incorrect values for `interval` with `confidence=1` (i.e. 100% confidence interval). They are not incorrect, per se, but it is somewhat surprising that the left end of the interval is beyo...
2022-04-10T07:07:38Z
rv_discrete.interval returning wrong values for alpha = 1 <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear ...
According to the documentation, `interval`, produces a > Confidence interval with equal areas around the median. Here, presumably, "equal areas" means "equal mass". If you use the definition that a *median* of a random variable $X$ is any number $m$ satisfying $P(X \geq m) \geq \frac{1}{2}$, $P(X \leq m) \geq ...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
e73ceface03503a7937a520494e5eb34df84b5ac
{ "head_commit": "e4392d1aa53b29db678bbc71c20ba2576d3f932f", "head_commit_message": "TST/DOC: stats: explain/check 100% interval for discrete distributions", "patch_to_review": "diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py\nindex 57dc3fa43ac8..a105523101f0 100644\n--- a...
[ { "diff_hunk": "@@ -1532,6 +1532,15 @@ def interval(self, confidence=None, *args, **kwds):\n end-points of range that contain ``100 * alpha %`` of the rv's\n possible values.\n \n+ Notes\n+ -----\n+ This is typically implemented as ``ppf([p_tail, 1-p_tail])``, where"...
ac4980301b4501f0f482d208947f4142995ed040
diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py index 521262ab6ccd..d46dbef51b41 100644 --- a/scipy/stats/_distn_infrastructure.py +++ b/scipy/stats/_distn_infrastructure.py @@ -1532,6 +1532,18 @@ def interval(self, confidence=None, *args, **kwds): end-points of ran...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-15920@daed2a4
scipy/scipy
Python
15,920
ENH: stats.mannwhitneyu: add iterative implementation
#### Reference issue Closes gh-14622 Supersedes gh-14854 #### What does this implement/fix? gh-14622 reported that `mannwhitenyu`'s implementation fails for sufficiently large samples because it reached the maximum recursion depth. This PR adds an iterative implementation that kicks in when either of the sample s...
2022-04-02T14:47:49Z
BUG: (sort of) mannwhitneyu hits max recursion limit with imbalanced input sizes due to selection of 'exact' method; could method selection depend on max(n1,n2)? ### Reproducing Code Example ```python from scipy.stats import mannwhitneyu import numpy as np a = np.random.randn(5) b = np.random.randn(5000) mannwhitn...
Hi there, sorry if this isn't a BUG per se, but it did break our code when we updated to the newest scipy. Of course, there's an easy work-around, but I wonder if the method selection logic could take into account the sizes of both inputs. Good idea. You can add `method='asymptotic'` to get the same p-values you were...
[ { "body": "### Reproducing Code Example\n\n```python\nfrom scipy.stats import mannwhitneyu\r\nimport numpy as np\r\na = np.random.randn(5)\r\nb = np.random.randn(5000)\r\nmannwhitneyu(a,b)\n```\n\n\n### Error message\n\n```shell\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n ...
a596aef81d7c4910d7c89c08e67866330578ddac
{ "head_commit": "daed2a4576c276aa29a0e907adef52d86112839e", "head_commit_message": "ENH: stats.mannwhitenyu: enhance iterative exact method", "patch_to_review": "diff --git a/scipy/stats/_mannwhitneyu.py b/scipy/stats/_mannwhitneyu.py\nindex d1e2ef9f127c..eac9efb76a7b 100644\n--- a/scipy/stats/_mannwhitneyu.py\n...
[ { "diff_hunk": "@@ -23,15 +23,32 @@ class _MWU:\n def __init__(self):\n '''Minimal initializer'''\n self._fmnks = -np.ones((1, 1, 1))\n+ self._recursive = None\n \n def pmf(self, k, m, n):\n- '''Probability mass function'''\n+ if (self._recursive is None and m <= 500...
1136ec0a9c0644eeefa299e2b104f05c8d4f3bc8
diff --git a/scipy/stats/_mannwhitneyu.py b/scipy/stats/_mannwhitneyu.py index d1e2ef9f127c..bdf7c067788b 100644 --- a/scipy/stats/_mannwhitneyu.py +++ b/scipy/stats/_mannwhitneyu.py @@ -23,9 +23,17 @@ class _MWU: def __init__(self): '''Minimal initializer''' self._fmnks = -np.ones((1, 1, 1)) + ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-15905@171e94e
scipy/scipy
Python
15,905
MAINT: stats._moment: warn when catastrophic cancellation occurs
#### Reference issue Closes gh-15554 gh-13254 gh-13245 gh-11086 gh-10896 #### What does this implement/fix? We get reports every once in a while of `skew` and/or `kurtosis` being unreliable with degenerate input. This PR would report a warning rather than trying to produce a correct result. Alternatively, we c...
2022-03-31T07:03:54Z
BUG: stats.skew: unreliable when all values in axis slice are identical ### Describe your issue. computing the skewness of a numpy ndarray will produce two result with following method for a column in ndarray (x): 1. skew(x[:, i]) 2. skew(x)[i] the issues happens when this column has equal float value ### Repr...
Hi @ronzhou, thanks for reporting. I can reproduce and indeed there is an issue here. It's a resolution issue when we compute the moments with `_moment`. ```python from scipy.stats._stats_py import _moment _moment(a[:, 0], 2, axis, mean=a[:, 0].mean(axis=0, keepdims=True)) # 4.930380657631324e-32 _moment(...
[ { "body": "### Describe your issue.\n\ncomputing the skewness of a numpy ndarray will produce two result with following method for a column in ndarray (x):\r\n1. skew(x[:, i])\r\n2. skew(x)[i]\r\n\r\nthe issues happens when this column has equal float value\r\n\n\n### Reproducing Code Example\n\n```python\nimpo...
e3cd846ef353b10cc66972a5c7718e80948362ac
{ "head_commit": "171e94e3637d42bbb75d9ac3b085bd3319f7f6e4", "head_commit_message": "MAINT: stats: ignore invalid comparison w/ nans\n\n[skip actions][skip circleci]", "patch_to_review": "diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py\nindex db49bdcadee1..7ae69eac2482 100644\n--- a/scipy/stats/_...
[ { "diff_hunk": "@@ -1013,6 +1013,16 @@ def _moment(a, moment, axis, *, mean=None):\n # Starting point for exponentiation by squares\n mean = a.mean(axis, keepdims=True) if mean is None else mean\n a_zero_mean = a - mean\n+\n+ eps = np.finfo(a_zero_mean.dtype).resolution * 1e6\n+ ...
aa7c923f5f98555caa89494811136bbe1ac9cdcd
diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py index db49bdcadee1..45d172e74c30 100644 --- a/scipy/stats/_stats_py.py +++ b/scipy/stats/_stats_py.py @@ -1013,6 +1013,18 @@ def _moment(a, moment, axis, *, mean=None): # Starting point for exponentiation by squares mean = a.mean(axis, k...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-15855@75ebe1e
scipy/scipy
Python
15,855
ENH: stats.rv_continuous.expect: split interval to improve reliability
#### Reference issue Closes gh-8928 #### What does this implement/fix? gh-8928 reported many examples where `rv_continuous.expect` gave inaccurate results. Since it relies on `quad`, we cannot expect `expect` to be perfect for all intervals and integrands, but it can be improved based on knowledge of where the dis...
2022-03-23T17:06:45Z
BUG: scipy.stats.norm wrong expected value of function when loc is large The expected value of a normal distribution should be the center of the distribution, but scipy gives wrong results when loc/scale is large. ### Reproducing code example: ``` >>> import scipy.stats as stats >>> stats.norm.expect(loc=10, scale=...
The `expect` method is implemented with `scipy.integrate.quad`. When `func` is not given, it is assumed that `func(x) = x`. `quad` is used to numerically integrate `func(x)*pdf(x)` over the support of the distribution. For the normal distribution, the integral is over [-inf, inf]. Apparently this use of `quad` isn'...
[ { "body": "The expected value of a normal distribution should be the center of the distribution, but scipy gives wrong results when loc/scale is large.\r\n### Reproducing code example:\r\n```\r\n>>> import scipy.stats as stats\r\n>>> stats.norm.expect(loc=10, scale=1)\r\n10.000000000000004\r\n>>> stats.norm.exp...
0dfb5d600299af16b1482731def7c91f7662ec28
{ "head_commit": "75ebe1e1a96c01659069fdde252c19e4eb74eb90", "head_commit_message": "TST: stats.rv_continuous_expect: add tests to demonstrate improvement", "patch_to_review": "diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py\nindex f3d90e044f89..c2dfd45b9356 100644\n--- a/...
[ { "diff_hunk": "@@ -66,10 +64,10 @@ def check_mean_expect(distfn, arg, m, msg):\n \n \n def check_var_expect(distfn, arg, m, v, msg):\n+ kwargs = {'rtol': 5e-6} if msg==\"rv_histogram_instance\" else {}", "line": null, "original_line": 67, "original_start_line": null, "path": "scipy/stats/tes...
924d0f6e15f69113ef9699b9c178783f6becc493
diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py index f3d90e044f89..3c0d7a836f5a 100644 --- a/scipy/stats/_distn_infrastructure.py +++ b/scipy/stats/_distn_infrastructure.py @@ -2885,6 +2885,13 @@ def expect(self, func=None, args=(), loc=0, scale=1, lb=None, ub=None, fi...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-15847@e87dc09
scipy/scipy
Python
15,847
BUG: adds warning to scipy.stats.brunnermunzel
#### Reference issue closes #15843 #### What does this implement/fix? emits a warning when `scipy.stats.brunnermunzel` cannot compute p-value because both numerator and denominator are 0, and therefore p-value is nan also suggests an alternative (using distribution="normal") ~~This change does not change an...
2022-03-22T17:50:21Z
BUG: scipy.stats.brunnermunzel incorrectly returns nan for undocumented reason ### Describe your issue. ```python x = np.array([1,2,3]) y = np.array([5,6,7,8,9]) scipy.stats.brunnermunzel(x,y) ``` returns: ``` BrunnerMunzelResult(statistic=inf, pvalue=nan) ``` ### Reproducing Code Example ```python...
I haven't investigated carefully, but it does not have to do with the sample sizes being unequal: ```python3 x1 = [1,2,3,4,5] x2 = [5,6] w, p_value = scipy.stats.brunnermunzel(x1, x2) # OK ``` or simply that the total sample size is too small. It looks to me like it depends on the particular values. This should ...
[ { "body": "### Describe your issue.\n\n```python\r\n\r\nx = np.array([1,2,3])\r\ny = np.array([5,6,7,8,9])\r\n\r\nscipy.stats.brunnermunzel(x,y)\r\n\r\n```\r\n\r\nreturns:\r\n\r\n```\r\nBrunnerMunzelResult(statistic=inf, pvalue=nan)\r\n```\n\n### Reproducing Code Example\n\n```python\nx = np.array([1,2,3])\r\ny...
59d974bf14ff8c82f3353e2d2a9282d9bda67db5
{ "head_commit": "e87dc0985350d742a272e32d10da05d16ff503b3", "head_commit_message": "BUG: adds warning to scipy.stats.brunnermunzel\n\nscipy.stats.brunnermunzel returns a p-value of nan\nin some cases, because the numerator and denominator\nof the t-distribution were 0. It is not clear\nwhy nan is returned, especia...
[ { "diff_hunk": "@@ -8232,7 +8232,16 @@ def brunnermunzel(x, y, alternative=\"two-sided\", distribution=\"t\",\n df_denom = np.power(nx * Sx, 2.0) / (nx - 1)\n df_denom += np.power(ny * Sy, 2.0) / (ny - 1)\n df = df_numer / df_denom\n+\n+ if (df_numer == 0) and (df_denom == 0):\n+ ...
48c6556c826eb1a7316b49167a4d1e2bd088b5c9
diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py index 577be6732ff7..108f1fc80844 100644 --- a/scipy/stats/_stats_py.py +++ b/scipy/stats/_stats_py.py @@ -8232,6 +8232,13 @@ def brunnermunzel(x, y, alternative="two-sided", distribution="t", df_denom = np.power(nx * Sx, 2.0) / (nx - 1) ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
saleor__saleor-3248@83360a1
saleor/saleor
Python
3,248
3245/extract resolvers and mutations
I want to merge this change because resolve #3245 <!-- Please mention all relevant issue numbers. --> ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Ple...
2018-11-06T13:47:28Z
Extract app-related resolvers and mutations to smaller modules Currently, most of the API resolvers and mutations are imported in `api.py` which makes the file large and unreadable. A much cleaner approach has been already implemented in `graphql/product` module, where all resolvers and mutations live in `schema.py` fi...
[ { "body": "Currently, most of the API resolvers and mutations are imported in `api.py` which makes the file large and unreadable. A much cleaner approach has been already implemented in `graphql/product` module, where all resolvers and mutations live in `schema.py` file. We should apply this pattern to all othe...
5d95eaa3be3affe8d6d6226f4c4a248a616c2daa
{ "head_commit": "83360a19474d5a53ee8339384f25d869d9d34392", "head_commit_message": "Fix review remarks", "patch_to_review": "diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.py\nnew file mode 100644\nindex 00000000000..003a77cf4e5\n--- /dev/null\n+++ b/saleor/graphql/account/schema.p...
[ { "diff_hunk": "@@ -0,0 +1,61 @@\n+import graphene\n+from graphql_jwt.decorators import permission_required\n+\n+from ..core.fields import PrefetchingConnectionField\n+from ..descriptions import DESCRIPTIONS\n+from .mutations import (\n+ AddressCreate, AddressDelete, AddressUpdate, CustomerCreate,\n+ Cust...
4670d0cd86bebed61acf39d44f0657152715debf
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.py new file mode 100644 index 00000000000..3340d22da71 --- /dev/null +++ b/saleor/graphql/account/schema.py @@ -0,0 +1,61 @@ +import graphene +from graphql_jwt.decorators import permission_required + +from ..core.fields import PrefetchingConn...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
saleor__saleor-3275@3ba7b03
saleor/saleor
Python
3,275
3134/description field to collection model
I want to merge this change because resolve #3134 <!-- Please mention all relevant issue numbers. --> ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Plea...
2018-11-12T15:21:14Z
Add description field to collection model ### What I'm trying to achieve To add a description to a collection. ### Describe a proposed solution Add `description` field to `Collection` model. ### TODO - [ ] Add description field to `Collection` model - [ ] Add description field to `CollectionTranslation` mode...
``` class Collection(SeoModel): name = models.CharField(max_length=128, unique=True) slug = models.SlugField(max_length=128) products = models.ManyToManyField( Product, blank=True, related_name='collections') background_image = VersatileImageField( upload_to='collection-background...
[ { "body": "### What I'm trying to achieve\r\nTo add a description to a collection.\r\n\r\n### Describe a proposed solution\r\nAdd `description` field to `Collection` model.\r\n\r\n### TODO \r\n- [ ] Add description field to `Collection` model\r\n- [ ] Add description field to `CollectionTranslation` model\r\n- ...
cffccecbcff1c13ac5c458b630abb38f3e74517a
{ "head_commit": "3ba7b0305726d18767088128458628afcb170c9d", "head_commit_message": "Sort import", "patch_to_review": "diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py\nindex 5b2ed0bf96f..69105a6a63a 100644\n--- a/saleor/core/utils/random_data.py\n+++ b/saleor/core/utils/random_dat...
[ { "diff_hunk": "@@ -454,6 +453,7 @@ class Collection(SeoModel):\n background_image = VersatileImageField(\n upload_to='collection-backgrounds', blank=True, null=True)\n is_published = models.BooleanField(default=False)\n+ description = models.TextField(blank=True, null=True)", "line": nul...
912dc3c7ac6dca50cb79e29ddc0b59e834556cdc
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py index 5b2ed0bf96f..69105a6a63a 100644 --- a/saleor/core/utils/random_data.py +++ b/saleor/core/utils/random_data.py @@ -5,6 +5,7 @@ import uuid from collections import defaultdict from datetime import date +from textwrap import dedent ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-15846@dff892c
scipy/scipy
Python
15,846
DOC: Add efficiency condition for CSC sparse matrix and remove CSC warning.
Closes gh-11145. Remove warnings for efficiency when using CSC matrices.
2022-03-22T17:46:52Z
unexpected SparseEfficiencyWarning at scipy.sparse.linalg.splu Hey I get a warning for using CSR format in splu. This is a bit confusing because in the documentation it a permissible format. "Sparse matrix to factorize. Should be in CSR or CSC format." #### Reproducing code example: ``` from scipy.sparse im...
Agreed, if CSC is preferred then it needs a doc update. Alternatively, the warning isn't justified and needs to be removed.
[ { "body": "Hey\r\nI get a warning for using CSR format in splu. This is a bit \r\nconfusing because in the documentation it a permissible format. \r\n\r\n\"Sparse matrix to factorize. Should be in CSR or CSC format.\"\r\n\r\n#### Reproducing code example:\r\n```\r\nfrom scipy.sparse import csr_matrix\r\nfrom sc...
38261c1141b8aa80bceeef419911fb4f31df5372
{ "head_commit": "dff892cd1c44148bdabf6fbe0313e2b6a2abae24", "head_commit_message": "add warning for sparse efficiency format", "patch_to_review": "diff --git a/scipy/sparse/linalg/_dsolve/linsolve.py b/scipy/sparse/linalg/_dsolve/linsolve.py\nindex b661d53941ad..4019450c989e 100644\n--- a/scipy/sparse/linalg/_ds...
[ { "diff_hunk": "@@ -265,7 +265,9 @@ def splu(A, permc_spec=None, diag_pivot_thresh=None,\n Parameters\n ----------\n A : sparse matrix\n- Sparse matrix to factorize. Should be in CSR or CSC format.\n+ Sparse matrix to factorize. Should be in CSR or CSC format. The CSC\n+ format ...
dd005f8966bbe9ce717931006715872b397d7a69
diff --git a/scipy/sparse/linalg/_dsolve/linsolve.py b/scipy/sparse/linalg/_dsolve/linsolve.py index 076f7ed7c3cd..dcb4fa3e0dbc 100644 --- a/scipy/sparse/linalg/_dsolve/linsolve.py +++ b/scipy/sparse/linalg/_dsolve/linsolve.py @@ -277,7 +277,8 @@ def splu(A, permc_spec=None, diag_pivot_thresh=None, Parameters ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scipy__scipy-15923@8e57eb9
scipy/scipy
Python
15,923
MAINT: stats: attempt to consolidate warnings and errors
#### Reference issue Closes gh-13462 #### What does this implement/fix? This attempts to resolve gh-13462, which reported that there are too many warnings in the `scipy.stats` public API, and that we need a better way to organize them. Things got messy because I tried to put all the warnings and errors into th...
2022-04-02T20:05:49Z
Too many warnings and results objects in public API for scipy.stats When working on gh-13461, I noticed these new objects listed on the overview page for `scipy.stats`: - `BinomTestResult` - `F_onewayConstantInputWarning` - `F_onewayBadInputSizesWarning` - `PearsonRConstantInputWarning` - `PearsonRNearConstantIn...
I've re-opened gh-13118 about what statistical tests should return, and I'll send a note to the mailing list this time. We may need something for statistical tests results in the public API, though, because it is beginning to look natural for the returned objects to have methods rather than just contain data. I don'...
[ { "body": "When working on gh-13461, I noticed these new objects listed on the overview page for `scipy.stats`:\r\n\r\n- `BinomTestResult`\r\n- `F_onewayConstantInputWarning`\r\n- `F_onewayBadInputSizesWarning`\r\n- `PearsonRConstantInputWarning`\r\n- `PearsonRNearConstantInputWarning`\r\n- `SpearmanRConstantIn...
eac57c8517ca675703d79c29ac3df7ab60332f8d
{ "head_commit": "8e57eb9000d2abf8470764a497504e06af201ab6", "head_commit_message": "MAINT: stats: link additional custom warnings\n\n[skip azp] [skip actions]", "patch_to_review": "diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py\nindex feedc62099e8..dfbdc4067af2 100644\n--- a/scipy/stats/__init__....
[ { "diff_hunk": "@@ -3836,7 +3836,7 @@ def _alexandergovern_input_validation(samples, nan_policy):\n \"pvalue\"))\n \n \n-class AlexanderGovernConstantInputWarning(RuntimeWarning):\n+class AlexanderGovernConstantInputWarning(stats.ConstantInputWarn...
5cc7f9503b48b3cb40e764827092cbd3d09a1364
diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py index feedc62099e8..d24bfe55dee7 100644 --- a/scipy/stats/__init__.py +++ b/scipy/stats/__init__.py @@ -455,15 +455,15 @@ .. autosummary:: :toctree: generated/ - F_onewayConstantInputWarning - F_onewayBadInputSizesWarning - PearsonRConstantInpu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
scipy__scipy-15817@c47e8ef
scipy/scipy
Python
15,817
MAINT: stats.fisher_exact: improve docs and fix bugs
#### Reference issue Closes gh-4130 Closes gh-9231 #### What does this implement/fix? gh-4130 was originally about inaccurate p-values due to a large fudge factor of 1e-4 used in the implementation. IIUC, the fudge factor is a relative tolerance used to compare numerically distinct but theoeretically equal probab...
2022-03-18T17:14:23Z
BUG: stats: fisher_exact returns incorrect p-value For some tables, `fisher_exact` incorrectly returns a p-value of 1. For example, ``` In [1]: from scipy.stats import fisher_exact In [2]: m = np.array([[345, 455], [260, 345]]) In [3]: fisher_exact(m) Out[3]: (1.0061284868977176, 1.0) ``` The correct p-value for t...
If there is no unit test explaining that special case then could the extra code just be removed? @argriffing: Possibly. I'll do some experimenting. I poked around a bit more, and found that some sort of "fudge factor" is necessary in the current implementation. For example, suppose `table = np.array([[5, 0], [1, 4...
[ { "body": "For some tables, `fisher_exact` incorrectly returns a p-value of 1. For example,\n\n```\nIn [1]: from scipy.stats import fisher_exact\n\nIn [2]: m = np.array([[345, 455], [260, 345]])\n\nIn [3]: fisher_exact(m)\nOut[3]: (1.0061284868977176, 1.0)\n```\n\nThe correct p-value for the array `m` is 0.956...
6660830eb7d7590d56f1377d27bf7ee97bb3adec
{ "head_commit": "c47e8ef889289a136d4c0137c2d07012af826fb5", "head_commit_message": "Update scipy/stats/tests/test_stats.py\n\nCo-authored-by: Pamphile Roy <roy.pamphile@gmail.com>", "patch_to_review": "diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py\nindex c8efffaa961d..e14d31a368c8 100644\n--- ...
[ { "diff_hunk": "@@ -4236,6 +4236,15 @@ def pearsonr(x, y, *, alternative='two-sided'):\n def fisher_exact(table, alternative='two-sided'):\n \"\"\"Perform a Fisher exact test on a 2x2 contingency table.\n \n+ The null hypothesis is that the true odds ratio of the populations\n+ underlying the observat...
fca903c883feff37e26ef0cb87c826266e63093e
diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py index c8efffaa961d..966ddf44538e 100644 --- a/scipy/stats/_stats_py.py +++ b/scipy/stats/_stats_py.py @@ -53,6 +53,7 @@ from ._hypotests_pythran import _compute_outer_prob_inside_method from ._axis_nan_policy import (_axis_nan_policy_factory, ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
saleor__saleor-3106@01e0763
saleor/saleor
Python
3,106
Add createdb note to getting started for Windows
I want to merge this change because it fixes #2680 ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's life easier. --> 1. [ ] Privileged views and APIs are guarded by proper permission checks. 1. [ ] All visible strings are translated with proper context. 1. [ ] All data-for...
2018-10-12T17:29:52Z
Update Windows installation guide In windows installation guide we've missed a point, stating that database should be created. Something like: ``` Create a PostgreSQL database: Unless configured otherwise the store will use saleor as the database name. $ createdb saleor ``` However, this information is...
Windows docs tell the user to create a SUPERUSER so that Django can create the DB for itself. @patrys does it? On Linux I get `django.db.utils.OperationalError: FATAL: database "saleor" does not exist`. Maybe a parameter to pass? Or I am missing something? Edit: looks like there is no such thing in the django mi...
[ { "body": "In windows installation guide we've missed a point, stating that database should be created. Something like:\r\n\r\n```\r\nCreate a PostgreSQL database:\r\n\r\nUnless configured otherwise the store will use saleor as the database name.\r\n\r\n $ createdb saleor\r\n```\r\n\r\nHowever, this informati...
cbc72d3417482d20ae9f64b61a0f8964e728e56b
{ "head_commit": "01e07637ef7a1cff616601906d1255f7738a263c", "head_commit_message": "Add createdb note to getting started for Windows", "patch_to_review": "diff --git a/docs/gettingstarted/installation-windows.rst b/docs/gettingstarted/installation-windows.rst\nindex db456345624..cee96dc673f 100644\n--- a/docs/ge...
[ { "diff_hunk": "@@ -98,6 +98,14 @@ All commands need to be performed in either PowerShell or a Command Shell.\n \n Unless configured otherwise the store will use ``saleor`` as both username and password. Remeber to give your user the ``SUPERUSER`` privilege so it can create databases and database extensions....
b5831bda004bda99acd5a22573a31eecb8bac4d5
diff --git a/docs/gettingstarted/installation-windows.rst b/docs/gettingstarted/installation-windows.rst index db456345624..51ceb4d2de7 100644 --- a/docs/gettingstarted/installation-windows.rst +++ b/docs/gettingstarted/installation-windows.rst @@ -98,6 +98,14 @@ All commands need to be performed in either PowerShell o...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scipy__scipy-15794@0558eee
scipy/scipy
Python
15,794
MAINT: stats: give frozen distributions pdf or pmf, not both
#### Reference issue Closes gh-14827 #### What does this implement/fix? Previously, all frozen distributions had attributes `pmf`, `pdf`, `logpmf`, and `logpdf`; only when these methods were called would an error occur because the underlying `rv_continuous` or `rv_discrete` did not have that method. This change g...
2022-03-16T19:49:06Z
BUG: Frozen distributions does not raise AttributeError on certain attributes ### Describe your issue. Frozen distributions have a poor knowledge of its attributes, and won't raise `AttributeError` until it's called with appropriate arguments. `hasattr(frozen_dist, "pmf")` will return `True`, even if `pmf` is not appl...
[ { "body": "### Describe your issue.\n\nFrozen distributions have a poor knowledge of its attributes, and won't raise `AttributeError` until it's called with appropriate arguments. `hasattr(frozen_dist, \"pmf\")` will return `True`, even if `pmf` is not applicable to the distribution.\r\n\r\n---\r\n\r\nUse case:...
ef53758efffec6cd8e225f54686894d1b54b8ba3
{ "head_commit": "0558eeea7a34bd71bba0b51a8a5457c0556f28bd", "head_commit_message": "MAINT: stats: check distribution type with isinstance instead of hasattr", "patch_to_review": "diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py\nindex 23f733e2025b..94797bb00493 100644\n---...
[ { "diff_hunk": "@@ -865,3 +866,7 @@ def test_frozen_attributes():\n stats.norm().pmf\n with pytest.raises(AttributeError, match=message):\n stats.norm().logpmf\n+ stats.norm.pmf = \"herring\"\n+ frozen_norm = stats.norm()\n+ assert isinstance(frozen_norm, rv_continuous_frozen)\n+ ...
a8190dee88bb7cea7c9bba48925b43d17de15f9d
diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py index 23f733e2025b..94797bb00493 100644 --- a/scipy/stats/_distn_infrastructure.py +++ b/scipy/stats/_distn_infrastructure.py @@ -449,12 +449,6 @@ def random_state(self): def random_state(self, seed): self.dist._rando...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-3016@e00e759
saleor/saleor
Python
3,016
This Supposed to Be a Simple Test Client Change, You Won't Believe What This Developer Did Next!
In this PR: - `post_graphql` was adjusted to automatically test permissions if provided - Changed admin_api_client to staff_api_client(no more superuser-testing) - Moved api-related fixtures to tests/api/conftest.py - Basically, added proper permissions to all API tests close #3003 close #2650
2018-10-03T08:29:39Z
API tests don't test permissions ### What I'm trying to achieve Tests suite should be precise. Now all non-user actions are tested using `admin_api_client` fixture which operates on superuser privileges level. This way, we don't test if staff API endpoints contain correct permissions checking. In the future, it may l...
I'll handle it after merging #3002 and #2988 as it will create tons of conflicts Also, GraphQL related set up should live in `tests/api/conftest.py`, instead of the regular one. We could also try to tackle the problem that we have now three clients: `admin_api_client`, `staff_api_client` and `user_api_client`. I don't...
[ { "body": "### What I'm trying to achieve\r\nTests suite should be precise. Now all non-user actions are tested using `admin_api_client` fixture which operates on superuser privileges level. This way, we don't test if staff API endpoints contain correct permissions checking.\r\nIn the future, it may lead to a p...
0f29b4e2d7b3ec393b6afea9d88a6d9e067a1adc
{ "head_commit": "e00e759ddc6859bd17f9b66d3a88bcb11d1c6a32", "head_commit_message": "Test permissions in pages's API", "patch_to_review": "diff --git a/tests/api/conftest.py b/tests/api/conftest.py\nnew file mode 100644\nindex 00000000000..381878e860f\n--- /dev/null\n+++ b/tests/api/conftest.py\n@@ -0,0 +1,79 @@\...
[ { "diff_hunk": "@@ -0,0 +1,79 @@\n+import json\n+\n+import pytest\n+\n+from django.shortcuts import reverse\n+from django.test.client import MULTIPART_CONTENT, Client\n+from graphql_jwt.shortcuts import get_token\n+\n+from .utils import assert_no_permission\n+\n+API_PATH = reverse('api')\n+\n+\n+class ApiClient...
6651f5523a8391cd9c76d7035a0fd9e70c9ab01e
diff --git a/saleor/graphql/account/mutations.py b/saleor/graphql/account/mutations.py index 24a3df09d30..178a41a410a 100644 --- a/saleor/graphql/account/mutations.py +++ b/saleor/graphql/account/mutations.py @@ -229,7 +229,7 @@ class Meta: @classmethod def user_is_allowed(cls, user, input): - return...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Security Patches / Vulnerability Fixes" }
scipy__scipy-15781@78361f4
scipy/scipy
Python
15,781
DOC: stats.energy_distance: disambiguate definition vs squared energy distance
#### Reference issue Closes gh-14161 #### What does this implement/fix? The quantity returned by `stats.energy_distance` is the square root of a quantity also referred to as the "energy distance". However, only the square root version (as used by SciPy) satisfies all axioms of a distance function / metric. This PR...
2022-03-14T17:02:30Z
energy_distance is the squared value The `energy_distance` function does not compute the energy distance (as defined by Székely and used in the scientific literature). Instead it computes the **square root** of that distance (which is a metric, as the original energy distance does not verify the triangle inequality, bu...
It depends on the reference which quantity is called "the energy distance". Our references 1 and 3, at least, label the metric quantity as "the energy distance", but some others label the square of the metric quantity as "the energy distance" (reference 4 notes the variability). The variability in the literature is wor...
[ { "body": "The `energy_distance` function does not compute the energy distance (as defined by Székely and used in the scientific literature). Instead it computes the **square root** of that distance (which is a metric, as the original energy distance does not verify the triangle inequality, but its square root ...
7de016a87e0c72c60c83617aadc5cc442820cf0d
{ "head_commit": "78361f498a7571794724e8818c826d3c84736945", "head_commit_message": "Update scipy/stats/_stats_py.py\r\n\r\n[skip ci]", "patch_to_review": "diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py\nindex 6d01a4eb6f37..1aac83c9f57a 100644\n--- a/scipy/stats/_stats_py.py\n+++ b/scipy/stats/_...
[ { "diff_hunk": "@@ -8567,6 +8567,10 @@ def energy_distance(u_values, v_values, u_weights=None, v_weights=None):\n independent random variables whose probability distribution is :math:`u`\n (resp. :math:`v`).\n \n+ Sometimes the square of this quantity is referred to as the \"energy\n+ distance\" (...
90f4594cf84a8b154cdc689d9286345d2f401d70
diff --git a/scipy/stats/_stats_py.py b/scipy/stats/_stats_py.py index 6d01a4eb6f37..3416f8ed14d8 100644 --- a/scipy/stats/_stats_py.py +++ b/scipy/stats/_stats_py.py @@ -8567,6 +8567,10 @@ def energy_distance(u_values, v_values, u_weights=None, v_weights=None): independent random variables whose probability distr...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
saleor__saleor-3369@3e1a539
saleor/saleor
Python
3,369
Add publication date to collections
I want to merge this change because... resolves #3125 1. [x] Privileged views and APIs are guarded by proper permission checks. 1. [x] All visible strings are translated with proper context. 1. [x] All data-formatting is locale-aware (dates, numbers, and so on). 1. [x] Database queries are optimized and the n...
2018-12-01T12:54:45Z
Add publication date to collections ### What I'm trying to achieve To publish collection with some delay. ### Describe a proposed solution Add `published_at`field to collection model and check if the current date is greater than `published_at`. Basically the same as `available_on` in products.
Can I take this up? @lokesh005 go for it, there's similar mechanism already live on `Page` model, you might want to take some inspiration out of it Any questions- I'm here to help
[ { "body": "### What I'm trying to achieve\r\nTo publish collection with some delay.\r\n\r\n### Describe a proposed solution\r\nAdd `published_at`field to collection model and check if the current date is greater than `published_at`. Basically the same as `available_on` in products.", "number": 3125, "ti...
8106049257cf71d55fbb13b06ba43ed402715784
{ "head_commit": "3e1a5396396ca69b360437e84c8e4f7d73dec170", "head_commit_message": "Review fixes - renaming of published_at field and available property, changes in collections logic in templates", "patch_to_review": "diff --git a/saleor/core/templatetags/status.py b/saleor/core/templatetags/status.py\nindex 24f...
[ { "diff_hunk": "@@ -435,10 +435,9 @@ class VariantImage(models.Model):\n class CollectionQuerySet(models.QuerySet):\n \n def public(self):\n- today = datetime.datetime.today()\n return self.filter(\n Q(is_published=True),\n- Q(published_at__lte=today) | Q(published_at__...
de9ce0e4c02ab679657064574d2dec76ba3eefaa
diff --git a/CHANGELOG.md b/CHANGELOG.md index 32ecd68156c..9bd4026453f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,3 +33,4 @@ All notable, unreleased changes to this project will be documented in this file. - Replace `thumbnailUrl` with `thumbnail { url }` - #3484 by @dominik-zeglen - Change mutation errors ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
saleor__saleor-2970@e252374
saleor/saleor
Python
2,970
Improve naming of attributes
close #2969 Renamed `ProductAttribtue` to `Attribute` Renamed `AttributeChoiceValue` to `AttributeValue`
2018-09-25T15:26:57Z
Improve naming of ProductAttribute and AttributeChoiceValue I think it's quite confusing that we have `ProductAttribute` with a corresponding value named as `AttributeChoiceValue` In my opinion, we should unify this to `Attribute` and `AttributeValue`. `ProductAttribute` is used for both products and variants.
[ { "body": "I think it's quite confusing that we have `ProductAttribute` with a corresponding value named as `AttributeChoiceValue`\r\n\r\nIn my opinion, we should unify this to `Attribute` and `AttributeValue`. \r\n`ProductAttribute` is used for both products and variants. ", "number": 2969, "title": "I...
dfc9e1be715387d8cbee99c0f083b7e692e9d879
{ "head_commit": "e2523744fe54c74e3af4b7309bee3ffbb20a4feb", "head_commit_message": "Rename ProductAttribute to Attribute in docstrings and help texts", "patch_to_review": "diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py\nindex a25fb7f60fd..a9c3136cff4 100644\n--- a/saleor/core/ut...
[ { "diff_hunk": "@@ -24,93 +24,93 @@ class AttributeChoiceValueInput(graphene.InputObjectType):\n required=True, description='Real value eg. HEX color.')\n \n \n-class AttributeChoiceValueUpdateInput(graphene.InputObjectType):\n+class AttributeValueUpdateInput(graphene.InputObjectType):\n slug = grap...
5a75ca3b91c76289c67680e543e0837ef1c5269a
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py index a25fb7f60fd..a9c3136cff4 100644 --- a/saleor/core/utils/random_data.py +++ b/saleor/core/utils/random_data.py @@ -29,8 +29,8 @@ from ...order.utils import update_order_status from ...page.models import Page from ...product.models ...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
saleor__saleor-2911@484cee9
saleor/saleor
Python
2,911
Make product variant attributes required in API
I want to merge this change because... closes #2879 ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's li...
2018-09-19T13:55:59Z
User can create a variant without attributes Currently user is able to create a variant with partly set attributes or without attributes at all. ### What I expected to happen All attributes set in product type should be required in variant creating form.
[ { "body": "Currently user is able to create a variant with partly set attributes or without attributes at all. \r\n\r\n### What I expected to happen\r\nAll attributes set in product type should be required in variant creating form. \r\n\r\n\r\n", "number": 2879, "title": "User can create a variant witho...
306802dc5e15e0edf0f30cb6226a3c87a809fa40
{ "head_commit": "484cee9f55318c17277a46e806e6dd44a553c11f", "head_commit_message": "Make product variant attributes required in API", "patch_to_review": "diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py\nindex c9dd01e67a3..77baa4e24e4 100644\n--- a/saleor/g...
[ { "diff_hunk": "@@ -332,7 +332,19 @@ class Meta:\n model = models.ProductVariant\n \n @classmethod\n- def clean_input(cls, info, instance, input, errors):\n+ def check_all_product_type_attributes_provided(\n+ cls, attributes_qs, attributes_input, errors):\n+ product_type_attr...
d41655481f61812841ed141012df2fbdbfd20c4b
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py index c9dd01e67a3..28d58fb787d 100644 --- a/saleor/graphql/product/mutations/products.py +++ b/saleor/graphql/product/mutations/products.py @@ -331,6 +331,17 @@ class Meta: description = 'Creates a new vari...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-15892@e1a9bd1
scipy/scipy
Python
15,892
BUG: stats: use mean behavior for percentileofscore in bootstrap
#### Reference issue Closes gh-15883. #### What does this implement/fix? This updates the behavior of the percentileofscore implementation used by bootstrap to use the 'mean' behavior for calculating percentile, which avoids the 'strict' behavior of assigning the min value the zeroth percentile.
2022-03-29T04:13:29Z
BUG: stats.bootstrap bca implementation triggers ValueError for `min` statistic ### Describe your issue. `stats.bootstrap` uses a custom implementation of `percentileofscore` that exclusively uses the `strict` behavior from the primary implementation. As a result, the `min` statistic is always identified as the z...
I'm not able to reproduce this `ValueError` issue in `main`. This is the output I get for the provided example: ``` C:\Users\matth\scipy\scipy\stats\_resampling.py:134: RuntimeWarning: invalid value encountered in double_scalars alpha_1 = ndtr(z0_hat + num1/(1 - a_hat*num1)) C:\Users\matth\scipy\scipy\stats\_res...
[ { "body": "### Describe your issue.\r\n\r\n`stats.bootstrap` uses a custom implementation of `percentileofscore` that exclusively uses the `strict` behavior from the primary implementation.\r\n\r\nAs a result, the `min` statistic is always identified as the zeroth percentile, for all datasets. The bca then choo...
d00c69c13769f7dcbf171407b61c90a3dcf21781
{ "head_commit": "e1a9bd1b406df948973ecda3b376b18a9f57c494", "head_commit_message": "Update scipy/stats/tests/test_resampling.py", "patch_to_review": "diff --git a/scipy/stats/_resampling.py b/scipy/stats/_resampling.py\nindex 55a99d4edc4e..9bdabec6e46c 100644\n--- a/scipy/stats/_resampling.py\n+++ b/scipy/stats/...
[ { "diff_hunk": "@@ -388,6 +388,23 @@ def test_bootstrap_gh15678(method):\n assert isinstance(res.standard_error, np.float64)\n \n \n+def test_bootstrap_min():\n+ # Check that gh-15883 is fixed: percentileofscore should\n+ # behave according to the 'mean' behavior and not trigger nan for BCa\n+ rng ...
12f170924027fff031a57322ee9a26711857f59f
diff --git a/scipy/stats/_resampling.py b/scipy/stats/_resampling.py index 1d683d1cac15..3f29da6c68f6 100644 --- a/scipy/stats/_resampling.py +++ b/scipy/stats/_resampling.py @@ -69,12 +69,13 @@ def _bootstrap_resample(sample, n_resamples=None, random_state=None): def _percentile_of_score(a, score, axis): """Ve...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-2786@c656faa
saleor/saleor
Python
2,786
Separate input for ProductCreate and ProductUpdate
I want to merge this change because... closes #2677 ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's l...
2018-09-04T12:54:52Z
It's possible to change the product's type using the GraphQL mutation Currently `productCreate` and `productUpdate` share the same input type. This causes `productCreate` to list `productType` (an ID field) as optional (not providing it is invalid). It also causes `productUpdate` to accept a new value for `produc...
[ { "body": "Currently `productCreate` and `productUpdate` share the same input type.\r\n\r\nThis causes `productCreate` to list `productType` (an ID field) as optional (not providing it is invalid).\r\n\r\nIt also causes `productUpdate` to accept a new value for `productType` which should be illegal as it could ...
7d987e7f132a24b02a0cd7cd8efc5dfdfd460715
{ "head_commit": "c656faa04b382b2ad0081f25f0d59183615f712d", "head_commit_message": "Separate input for ProductCreate and ProductUpdate", "patch_to_review": "diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py\nindex 7dad6e2fd00..d8dd5722aca 100644\n--- a/saleo...
[ { "diff_hunk": "@@ -196,7 +196,7 @@ class AttributeValueInput(InputObjectType):\n required=True, description='Value of an attribute.')\n \n \n-class ProductInput(graphene.InputObjectType):\n+class ProductPropertiesInput(graphene.InputObjectType):", "line": null, "original_line": 199, "origin...
9f7cc664bad9d56ae694fc7463d4129ce3950340
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py index 7dad6e2fd00..1de59bbec2d 100644 --- a/saleor/graphql/product/mutations/products.py +++ b/saleor/graphql/product/mutations/products.py @@ -214,9 +214,6 @@ class ProductInput(graphene.InputObjectType): is_p...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-2785@e63a233
saleor/saleor
Python
2,785
Add separate input for ProductVariantCreate and ProductVariantUpdate
I want to merge this change because... closes #2674 ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's l...
2018-09-04T12:39:15Z
It's possible to reparent a product variant using the GraphQL mutation Currently `productVariantCreate` and `productVariantUpdate` share the same input type. This causes `productVariantCreate` to list `product` (an ID field) as optional (which is invalid). It also causes `productVariantUpdate` to accept a new val...
[ { "body": "Currently `productVariantCreate` and `productVariantUpdate` share the same input type.\r\n\r\nThis causes `productVariantCreate` to list `product` (an ID field) as optional (which is invalid).\r\n\r\nIt also causes `productVariantUpdate` to accept a new value for `product` which should be illegal as ...
7d987e7f132a24b02a0cd7cd8efc5dfdfd460715
{ "head_commit": "e63a23335385bf80c7ba57df0e421b2a9f2843ef", "head_commit_message": "Add separate input for ProductVariantCreate and ProductVariantUpdate", "patch_to_review": "diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py\nindex 7dad6e2fd00..9d9930c12fd 1...
[ { "diff_hunk": "@@ -294,16 +294,13 @@ def user_is_allowed(cls, user, input):\n return user.has_perm('product.manage_products')\n \n \n-class ProductVariantInput(graphene.InputObjectType):\n+class ProductVariantPropertiesInput(graphene.InputObjectType):", "line": null, "original_line": 297, "...
e472e432766533e9a42fbafd2bd725936cec3ae6
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py index 7dad6e2fd00..89d89aa4f31 100644 --- a/saleor/graphql/product/mutations/products.py +++ b/saleor/graphql/product/mutations/products.py @@ -301,9 +301,6 @@ class ProductVariantInput(graphene.InputObjectType): ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-2781@fbcf794
saleor/saleor
Python
2,781
Allow to query variants by list of ids
I want to merge this change because it closes #2741 ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's life easier. --> 1. [x] Privileged views and APIs are guarded by proper permission checks. 1. [x] All visible strings are translated with proper context. 1. [x] All data-fo...
2018-09-04T09:18:33Z
Add productVariants query ### What I'm trying to achieve I would like to get more than one variant from API by ids, right now we support only the `productVariant(id: "xyz"}` query. I need this feature for the cart feature in the client app. A query which I am thinking of should look like: ```graphql productVari...
[ { "body": "### What I'm trying to achieve\r\nI would like to get more than one variant from API by ids, right now we support only the `productVariant(id: \"xyz\"}` query.\r\n\r\nI need this feature for the cart feature in the client app. A query which I am thinking of should look like:\r\n```graphql\r\n produc...
4b235e4454d9ed996af8658e6e732e25534e96fa
{ "head_commit": "fbcf7948ac2699d63af0d9d794b69dbb7e31641d", "head_commit_message": "Allow to query variants by list of ids", "patch_to_review": "diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py\nindex 451d572b83e..7d4ecf6ee86 100644\n--- a/saleor/graphql/api.py\n+++ b/saleor/graphql/api.py\n@@ -51,7 +5...
[ { "diff_hunk": "@@ -65,3 +65,7 @@ def resolve_products(info, category_id, query):\n \n def resolve_product_types():\n return models.ProductType.objects.all().distinct()\n+\n+\n+def resolve_product_variants(info, ids):", "line": null, "original_line": 70, "original_start_line": null, "path": ...
784884d23eb05934d9b474f595dbc2ea8b7e8c45
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py index 451d572b83e..805f10a9486 100644 --- a/saleor/graphql/api.py +++ b/saleor/graphql/api.py @@ -51,7 +51,7 @@ ProductVariantUpdate, VariantImageAssign, VariantImageUnassign) from .product.resolvers import ( resolve_attributes, resolve_categories, r...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
saleor__saleor-2760@8259d1f
saleor/saleor
Python
2,760
Fix minor bugs
I want to merge this change because it fixes various bugs in dashboard. Fixes #2722 Fixes #2736 Fixes #2737 Fixes #2756 ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's life easier. --> 1. [ ] Privileged views and APIs are guarded by proper permission checks. 1. [ ] ...
2018-08-31T13:08:20Z
Deleting a product image doesn't refresh the UI ### Steps to reproduce the problem 1. Go to the product details page. 2. Delete a product image. ### What I expected to happen UI should be refreshed. Instead, a success message is displayed but the image remains on the list. Deleting a product redirects to categ...
Also, I've noticed that after I manually navigate back to the product list, the product that I just deleted stays on the list until the "product list" GraphQL call returns - shouldn't the cache be updated when the successful response from the "delete" mutations comes?
[ { "body": "### Steps to reproduce the problem\r\n1. Go to the product details page.\r\n2. Delete a product image.\r\n\r\n### What I expected to happen\r\nUI should be refreshed. Instead, a success message is displayed but the image remains on the list.\r\n", "number": 2722, "title": "Deleting a product ...
50ce265230a59dc46c7a13a76d89b99139f586b7
{ "head_commit": "8259d1f47ff90db196881fa29730513229247011", "head_commit_message": "Refresh UI after image removal", "patch_to_review": "diff --git a/saleor/static/dashboard-next/components/SaveButtonBar/SaveButtonBar.tsx b/saleor/static/dashboard-next/components/SaveButtonBar/SaveButtonBar.tsx\nindex 35f6b01da9...
[ { "diff_hunk": "@@ -0,0 +1,16 @@\n+import * as React from \"react\";\n+import { RouteComponentProps, withRouter } from \"react-router-dom\";\n+\n+class ScrollToTop extends React.Component<RouteComponentProps<{}>> {", "line": null, "original_line": 4, "original_start_line": null, "path": "saleor/...
c9090e76d61cb1bcff9d742ea1b9cd4656960cfe
diff --git a/saleor/static/dashboard-next/components/Navigator.tsx b/saleor/static/dashboard-next/components/Navigator.tsx index bd087620fc7..0b3e86f598d 100644 --- a/saleor/static/dashboard-next/components/Navigator.tsx +++ b/saleor/static/dashboard-next/components/Navigator.tsx @@ -16,8 +16,10 @@ const Navigator: Rea...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-2237@b428f43
saleor/saleor
Python
2,237
[GDPR] Ability to remove a customer
close #2235 ### TODO - [x] Ability to delete user from the dashboard - [x] Ability to delete user from the storefront - [x] Documentation - [x] Tests - [x] Confirmation email
2018-05-30T12:05:40Z
[GDPR] Data removal tool A logged in user should have the ability to remove their own data (and effectively close their account). We should likely require a confirmation link to be clicked to prove that the person has access to the email address of the logged in account, otherwise, data removal could become a DoS at...
To be clear, the focus here is on being able to remove registered accounts. It's unlikely that we'll be able to build a tool that automatically removes anonymous user's info without staff assisting. When deleting User's account, should we remove `user_email` from `Order` and `phone number` from order's addresses as we...
[ { "body": "A logged in user should have the ability to remove their own data (and effectively close their account).\r\n\r\nWe should likely require a confirmation link to be clicked to prove that the person has access to the email address of the logged in account, otherwise, data removal could become a DoS atta...
9ff0b721d960350a9cf81f378a75e297daf74ac6
{ "head_commit": "b428f4320d692f655f64134d0385f5ac742e7f6d", "head_commit_message": "Rebase with latest master", "patch_to_review": "diff --git a/docs/architecture.rst b/docs/architecture.rst\nindex bc35e2e1a60..0db35e3f4cc 100644\n--- a/docs/architecture.rst\n+++ b/docs/architecture.rst\n@@ -14,3 +14,4 @@ Archit...
[ { "diff_hunk": "@@ -0,0 +1,24 @@\n+{% extends 'base.html' %}\n+\n+{% load bootstrap_form from bootstrap4 %}\n+{% load staticfiles %}\n+{% load i18n %}\n+{% load placeholder %}\n+\n+{% block title %}{% trans \"Account deleted\" context \"Account deleted page title\" %} — {{ block.super }}{% endblock %}\n+\n+{% b...
03de1661ea9c2e34a01c1ad8aaeea3ff3cb15130
diff --git a/docs/architecture.rst b/docs/architecture.rst index bc35e2e1a60..0db35e3f4cc 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -14,3 +14,4 @@ Architecture architecture/payments architecture/settings architecture/page + architecture/gdpr diff --git a/docs/architecture/gdpr.rst ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
saleor__saleor-2496@947dfde
saleor/saleor
Python
2,496
Api change image thumbnail arg 2445
I want to merge this change because... closes #2445 ### Screenshots <!-- If your changes affect the UI, providing "before" and "after" screenshots will greatly reduce the amount of work needed to review your work. --> ### Pull Request Checklist <!-- Please keep this section. It will make maintainer's li...
2018-08-02T09:42:18Z
Add image thumbnails to ProductImage type API should be able to return image thumbnails in specified size - something like this: ``` { product { images{ edges{ node{ thumbnail(x:256, y:256) } } } } } ``` This could help us avoid situations where API co...
As we won't be able to provide an exact match for 99% of requests, I think this would make more sense: ```graphql { node { thumbnail(width: 100, height: 100) { height width url } } } ``` or maybe: ```graphql { node { thumbnail(type: "product_gallery") } } `...
[ { "body": "API should be able to return image thumbnails in specified size - something like this:\r\n```\r\n{\r\n product {\r\n images{\r\n edges{\r\n node{\r\n thumbnail(x:256, y:256)\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nThis could help us avoid situations where...
7a3024bc15c22c5c18391f503eafea8f3b2a7f6b
{ "head_commit": "947dfdef96d505b560152b6cf689ded50fabe88f", "head_commit_message": "One more fix for cognitive complexity of get_thumbnail_size", "patch_to_review": "diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py\nindex 745a50f4d9e..1b8b289d0c7 100644\n--- a/saleor/graphql/product...
[ { "diff_hunk": "@@ -45,26 +45,56 @@ def choose_placeholder(size=''):\n return placeholder\n \n \n+def get_available_sizes_by_method(method):\n+ sizes = []\n+ for available_size in AVAILABLE_SIZES:\n+ available_method, avail_size_str = available_size.split('__')\n+ if available_method != ...
8a74df28e0fc3cfb68282731fab18ae33a09b457
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py index 745a50f4d9e..ccd7247f671 100644 --- a/saleor/graphql/product/types.py +++ b/saleor/graphql/product/types.py @@ -3,7 +3,8 @@ from graphene_django.filter import DjangoFilterConnectionField from ...product import models -from ...produ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
saleor__saleor-2525@f575fbc
saleor/saleor
Python
2,525
Add Translation docs
close #2524
2018-08-08T05:15:31Z
Add docs section about models translations We should add a section in the "Architecture" chapter where we'll describe how the model translations mechanism works, as it's not an obvious thing. We can also add a note that this feature is currently only available from the code and lacks any interface, but we'll add API en...
[ { "body": "We should add a section in the \"Architecture\" chapter where we'll describe how the model translations mechanism works, as it's not an obvious thing. We can also add a note that this feature is currently only available from the code and lacks any interface, but we'll add API endpoints and UI in the ...
21b436e1d74b90d3a547d6debd0f30c7d2e37414
{ "head_commit": "f575fbc5426d01441ade970c8e806062915235b8", "head_commit_message": "Translation docs", "patch_to_review": "diff --git a/docs/architecture.rst b/docs/architecture.rst\nindex 4801ce861c6..077459ba35a 100644\n--- a/docs/architecture.rst\n+++ b/docs/architecture.rst\n@@ -7,6 +7,7 @@ Architecture\n ...
[ { "diff_hunk": "@@ -0,0 +1,84 @@\n+Model Translations\n+==================\n+\n+.. note::\n+\n+ The Model Translations are in the early version. They are fully functional, however, translations can be created only via custom code.\n+\n+ An API and UI for the translation interface will be added in the futu...
f2f43033ceabc0908bfb7b98f33c91c239298b7f
diff --git a/docs/architecture.rst b/docs/architecture.rst index 4801ce861c6..59d76c9b93f 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -10,6 +10,7 @@ Architecture architecture/stock architecture/orders architecture/i18n + architecture/translations architecture/search architect...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
scipy__scipy-14805@dd8cc29
scipy/scipy
Python
14,805
BUG: optimize: fix max function call validation for minimize with Nelder-Mead
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: http://scipy.g...
2021-10-04T14:27:31Z
scipy.optimize.minimize method='Nelder-Mead': 'maxfev' is not checked before initial simplex is evaluated **Is your feature request related to a problem? Please describe.** In the instance that you have N variables, and hence an initial simplex of size N+1, but request maxfev < N +1, the initial simplex is assessed be...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nIn the instance that you have N variables, and hence an initial simplex of size N+1, but request maxfev < N +1, the initial simplex is assessed before checking maxfev, hence maxfev is violated.\r\n\r\nI realize this example makes n...
5938242bbfedd14fa2fa6ce5a9fa1b1a535585df
{ "head_commit": "dd8cc2927098fadcdc0e5a5622f4dbb786331531", "head_commit_message": "BUG: optimize: add a test to check iteration number of nelder-mead optimization", "patch_to_review": "diff --git a/scipy/optimize/optimize.py b/scipy/optimize/optimize.py\nindex 3ee2381d6a60..5b3e30c3e2d2 100644\n--- a/scipy/opti...
[ { "diff_hunk": "@@ -786,8 +784,17 @@ def _minimize_neldermead(func, x0, args=(), callback=None,\n one2np1 = list(range(1, N + 1))\n fsim = np.empty((N + 1,), float)", "line": null, "original_line": 785, "original_start_line": null, "path": "scipy/optimize/optimize.py", "start_line": ...
d6c0cf176461a5d63e164c7d3c54db8ef9dc54ba
diff --git a/scipy/optimize/optimize.py b/scipy/optimize/optimize.py index 3ee2381d6a60..84d612a60ffe 100644 --- a/scipy/optimize/optimize.py +++ b/scipy/optimize/optimize.py @@ -479,7 +479,7 @@ class _MaxFuncCallError(RuntimeError): pass -def _wrap_scalar_function_with_validation(function, args, maxfun): +def...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-14781@62967b3
scipy/scipy
Python
14,781
BUG: stats: handle infinite `df` in `t` distribution
#### Reference issue fixes #14777 #### What does this implement/fix? `t` distribution returned garbage values when `df` was infinity. It is known that the `t` distribution limits to the normal distribution when `df` approaches infinity. It is much better to handle infinite `df` by branching to the normal di...
2021-09-28T06:55:07Z
BUG: Wrong limit and no warning in stats.t for df=np.inf ### Describe your issue. Scipy's stats module for Student's t distribution does not have the correct limit of a Gaussian distribution if the degree-of-freedom (`df`) parameter is set to `np.inf`. Most importantly, Scipy does not print a warning nor does it raise...
Thanks for reporting, @Edenhofer! > ... I think it would make sense to branch for `df=np.inf` ... I agree. In fact, that's exactly what `multivariate_t` does right now: ```py In [1]: from scipy.stats import norm, multivariate_t ...
[ { "body": "### Describe your issue.\n\nScipy's stats module for Student's t distribution does not have the correct limit of a Gaussian distribution if the degree-of-freedom (`df`) parameter is set to `np.inf`. Most importantly, Scipy does not print a warning nor does it raise an error, instead it simply yields ...
a3821e0e2df99d11840f4f952f38168566978d9f
{ "head_commit": "62967b3b04ef614d8b4f49fef545d9eb70dff1e7", "head_commit_message": "MAINT: stats: use lazy functions only", "patch_to_review": "diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py\nindex 4d4274d537fb..f025d4d132dc 100644\n--- a/scipy/stats/_continuous_distns.py\n+++...
[ { "diff_hunk": "@@ -5909,19 +5914,33 @@ def _isf(self, q, df):\n return -sc.stdtrit(df, q)\n \n def _stats(self, df):\n- mu = np.where(df > 1, 0.0, np.inf)\n- mu2 = _lazywhere(df > 2, (df,),\n- lambda df: df / (df-2.0),\n- np.inf)\n- ...
ad2379dee2c505476a27fecbdc23f23a48ba93bd
diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py index 4d4274d537fb..b0ce6cac9a02 100644 --- a/scipy/stats/_continuous_distns.py +++ b/scipy/stats/_continuous_distns.py @@ -5881,20 +5881,25 @@ def _rvs(self, df, size=None, random_state=None): return random_state.standard_t(df,...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-14685@3d293be
scipy/scipy
Python
14,685
MAINT: static typing of entropy
DOC: fix return type in entropy maintenance: Add type hints for entropy function. doc: return type of entropy is an ndarray if the argument pk isn't 1d. This wasn't reflected in documentation, and was therefore misleading. Additionally, the documentation now specifies pk and qk arguments as array_like and not as...
2021-09-02T18:55:46Z
BUG: misleading documentation in scipy.stats.entropy ### Reproducing Code Example The entropy function allows calculation of entropy along an axis for multi-variate distributions. It works as expected, and returns an ndarray as a result. However in the documentation, the return value is specified as a float (which...
Thanks @YairMZ. This function is not yet typed and the IDE is inferring from the doc. Would you like to make a PR? (At least to fix the doc) @tupui Thanks for the quick response. I'd love to help and make a PR. The truth is however, that my coding experience has been mostly on my my own projects, and therefore I don'...
[ { "body": "### Reproducing Code Example\r\n\r\nThe entropy function allows calculation of entropy along an axis for multi-variate distributions. It works as expected, and returns an ndarray as a result. However in the documentation, the return value is specified as a float (which is indeed returned for univaria...
79457bd1f571c0dd8a3d7086a65434ea73f375d7
{ "head_commit": "3d293bee31fb3ba9ef0b6117f3ee76b0ea557851", "head_commit_message": "MAINT: static typing of entropy\nDOC: fix return type in entropy\n\nmaintenance: Add type hints for entropy function.\ndoc: return type of entropy is an ndarray if the argument pk isn't 1d.\nThis wasn't reflected in documentation, ...
[ { "diff_hunk": "@@ -27,10 +31,10 @@ def entropy(pk, qk=None, base=None, axis=0):\n \n Parameters\n ----------\n- pk : sequence\n+ pk : array_like\n Defines the (discrete) distribution. ``pk[i]`` is the (possibly", "line": null, "original_line": 35, "original_start_line": null, ...
0ab6a2b600061aa47fc33b42010eaca94475491a
diff --git a/scipy/stats/_entropy.py b/scipy/stats/_entropy.py index 1cb5a1104096..9daec8af28a9 100644 --- a/scipy/stats/_entropy.py +++ b/scipy/stats/_entropy.py @@ -14,7 +14,11 @@ __all__ = ['entropy', 'differential_entropy'] -def entropy(pk, qk=None, base=None, axis=0): +def entropy(pk: np.typing.ArrayLike, + ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
scipy__scipy-14628@d589a6d
scipy/scipy
Python
14,628
DOC: clarify usage of options param in scipy.optimize.linprog
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-08-21T10:31:41Z
linprog kwargs not recognised `scipy.optimize.linprog` is supposed to accept keywords `rr_method` and `autoscale`, but they are not recognised (c.1.7.0 at least), raising a TypeError #### Reproducing code example: ``` result = linprog(np.array([1,1]), A_eq=np.array([[1,0]]), b_eq=1, A_ub=np.array([[0,1]]), b_ub=...
They are not keywords; they need to be part of the `options` dictionary, e.g. ``` result = linprog(np.array([1,1]), A_eq=np.array([[1,0]]), b_eq=1, A_ub=np.array([[0,1]]), b_ub=np.array([2]), options={'rr_method':'SVD'}) ``` This is documented: ![image](https://user-images.gi...
[ { "body": "`scipy.optimize.linprog` is supposed to accept keywords `rr_method` and `autoscale`, but they are not recognised (c.1.7.0 at least), raising a TypeError\r\n\r\n#### Reproducing code example:\r\n\r\n```\r\nresult = linprog(np.array([1,1]), A_eq=np.array([[1,0]]), b_eq=1, A_ub=np.array([[0,1]]), b_ub=n...
75ef7dbcbee1fa5114de86a3238333978350056a
{ "head_commit": "d589a6da973a5b007074981d64eb303de999f768", "head_commit_message": "DOC: removing trailing whitespace", "patch_to_review": "diff --git a/scipy/optimize/_linprog.py b/scipy/optimize/_linprog.py\nindex 71ea32faa26c..9ff866ac136c 100644\n--- a/scipy/optimize/_linprog.py\n+++ b/scipy/optimize/_linpro...
[ { "diff_hunk": "@@ -575,6 +575,26 @@ def linprog(c, A_ub=None, b_ub=None, A_eq=None, b_eq=None,\n success: True\n x: array([10., -3.]) # may vary\n \n+ You can use the ``options`` parameter, e.g.,\n+ to restrict the maximum number of iterations.\n+\n+ >>> res = linprog(\n+ c,...
6190afbc57e3bd29a37262767401398e9c60d4a3
diff --git a/scipy/optimize/_linprog.py b/scipy/optimize/_linprog.py index 71ea32faa26c..c996f08596e8 100644 --- a/scipy/optimize/_linprog.py +++ b/scipy/optimize/_linprog.py @@ -575,6 +575,21 @@ def linprog(c, A_ub=None, b_ub=None, A_eq=None, b_eq=None, success: True x: array([10., -3.]) # may vary ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
saleor__saleor-2206@324849a
saleor/saleor
Python
2,206
Merge Checkout with Cart
I want to merge this change because it closes #2004. Checkout class is removed and all data needed for that process are now saved in database within Cart model. Also, the business logic standing behind handling shipping and billing addresses in checkout is simplified. ### TODO's * [x] Simplify and refactor existing...
2018-05-23T14:42:21Z
Saving checkouts in database Checkout should have a dedicated model that would be stored in the database. This will allow other features such as: - sharing checkouts - creating better checkout API (multiple calls to create/edit checkout) - tracking abandoned checkouts
As we talked internally, we could try with moving fields from `Checkout` object to `Cart` model.
[ { "body": "Checkout should have a dedicated model that would be stored in the database. This will allow other features such as:\r\n- sharing checkouts\r\n- creating better checkout API (multiple calls to create/edit checkout)\r\n- tracking abandoned checkouts", "number": 2004, "title": "Saving checkouts...
e2fb44dfcb466413bfc0c402d8b7e36f2cfcbca9
{ "head_commit": "324849ac553815a4712343d0842fc4a0ed65a7d5", "head_commit_message": "Fix Django 1.11 compatibility", "patch_to_review": "diff --git a/saleor/account/forms.py b/saleor/account/forms.py\nindex 63cd65f72d0..564fd41a9ef 100644\n--- a/saleor/account/forms.py\n+++ b/saleor/account/forms.py\n@@ -25,10 +2...
[ { "diff_hunk": "@@ -1,27 +1,619 @@\n-from django.utils.translation import pgettext\n+\"\"\"Cart-related utility functions.\"\"\"\n+from datetime import date, timedelta\n+from functools import wraps\n+from uuid import UUID\n \n-from ..cart.utils import (\n- get_category_variants_and_prices, get_product_varian...
66872a605e7c970bc206cd0afa0047e893a86f9f
diff --git a/saleor/account/forms.py b/saleor/account/forms.py index 63cd65f72d0..564fd41a9ef 100644 --- a/saleor/account/forms.py +++ b/saleor/account/forms.py @@ -25,10 +25,8 @@ def get_address_form( address_form_class = get_address_form_class(country_code) if not preview and instance is not None: - ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-14703@23a2014
scipy/scipy
Python
14,703
MAINT: stats: shift `NumericalInverseHermite` to UNU.RAN
#### Reference issue #14600 Closes gh-14875 #### What does this implement/fix? Begin translation of FNI to UNU.RAN. Minimal changes have been done to the existing docs, tests, and benchmarks. What's left: - [x] Tutorial - [x] Stronger tests - [x] More docs - [x] Doc deprecate `tol` parameter - [x] Add...
2021-09-08T09:11:46Z
BUG: midpoint_error of NumericalInverseHermite returns array instead of float ### Describe your issue. The midpoint_error attribute should return the maximum error (float), not the array of all errors. ### Reproducing Code Example ```python from scipy import stats dist = stats.norm() rng = stats.NumericalInverse...
[ { "body": "### Describe your issue.\n\nThe midpoint_error attribute should return the maximum error (float), not the array of all errors.\n\n### Reproducing Code Example\n\n```python\nfrom scipy import stats\r\n\r\ndist = stats.norm()\r\nrng = stats.NumericalInverseHermite(dist)\r\nrng.midpoint_error\n```\n\n\n...
27dd4b0b3897c867aa0dc31d7cd5841a9194f973
{ "head_commit": "23a201448bc0ab3e5d6f4adddaaacabcce576a90", "head_commit_message": "DOC: stats: add a note that tol has been doc-deprecated", "patch_to_review": "diff --git a/benchmarks/benchmarks/stats.py b/benchmarks/benchmarks/stats.py\nindex aa185a13cfa5..0f105b3948ee 100644\n--- a/benchmarks/benchmarks/stat...
[ { "diff_hunk": "@@ -0,0 +1,191 @@\n+.. _sampling-hinv:\n+\n+Hermite interpolation based INVersion of CDF (HINV)\n+===================================================\n+\n+.. currentmodule:: scipy.stats\n+\n+* Required: CDF\n+* Optional: PDF, dPDF\n+* Speed:\n+\n+ * Set-up: (very) slow\n+ * Sampling: (very) fa...
4442c95f43f0d2e5d9e339e542975baf34d61570
diff --git a/benchmarks/benchmarks/stats.py b/benchmarks/benchmarks/stats.py index aa185a13cfa5..0f105b3948ee 100644 --- a/benchmarks/benchmarks/stats.py +++ b/benchmarks/benchmarks/stats.py @@ -494,32 +494,6 @@ def time_halton(self, d, scramble, n, workers): seq.random(n, workers=workers) -class Numerical...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-14552@c81da26
scipy/scipy
Python
14,552
BUG: Fix LSODA interpolation scheme
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-08-06T10:25:05Z
LSODA implementation of dense output yields incorrect result <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appe...
Hi, do you have a minimal code sample that we can directly copy/paste to reproduce such an issue ? Thanks for looking into this. I have sort of a reproducer, but considering some values within `func` are calculated through complex functions, I figured it would be best to just dump them into dictionaries. As a result...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
c4e7f1146556f4b038bfbfc0912ac3843e844c55
{ "head_commit": "c81da262a215f719d936be700673796ff3906eb4", "head_commit_message": "BUG: Fix LSODA interpolant.", "patch_to_review": "diff --git a/scipy/integrate/_ivp/common.py b/scipy/integrate/_ivp/common.py\nindex 7f6d2331100a..271e73ea9905 100644\n--- a/scipy/integrate/_ivp/common.py\n+++ b/scipy/integrate/...
[ { "diff_hunk": "@@ -168,10 +168,12 @@ def _dense_output_impl(self):\n iwork = self._lsoda_solver._integrator.iwork\n rwork = self._lsoda_solver._integrator.rwork\n \n- order = iwork[14]\n+ order = iwork[13]\n h = rwork[11]\n yh = np.reshape(rwork[20:20 + (order + 1)...
b83c24f584aedaff7b64a2bdacb35ebf43f64b56
diff --git a/scipy/integrate/_ivp/common.py b/scipy/integrate/_ivp/common.py index 7f6d2331100a..1721d1a41c73 100644 --- a/scipy/integrate/_ivp/common.py +++ b/scipy/integrate/_ivp/common.py @@ -144,13 +144,21 @@ class OdeSolution: interpolants : list of DenseOutput with n_segments elements Local interpol...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
saleor__saleor-1780@7084dc2
saleor/saleor
Python
1,780
Static page creation from dashboard
close #1778 ### TODO: - [x] Tests - [x] Include public pages in sitemap - [x] Static Page middleware - [x] Dashboard permissions and tests for them - [x] Models and migrations ### Pull Request Checklist (Please keep this section. It will make maintainer's life easier.) 1. [x] Privileged views and APIs...
2018-02-13T14:31:33Z
Add static pages We would like to have ability to add static pages editor in dashboard, which could be visible in storefront. A proper model should consist of page title, content, visibility and maybe also predefined template for example contact form. Content should be rich text editor with ability to insert images...
[ { "body": "We would like to have ability to add static pages editor in dashboard, which could be visible in storefront.\r\nA proper model should consist of page title, content, visibility and maybe also predefined template for example contact form. \r\nContent should be rich text editor with ability to insert ...
18f582ce30581edf63a9fe1afe42415e30c0c85e
{ "head_commit": "7084dc257b03087533cbd64e2c7f17221ee74b99", "head_commit_message": "Fix docs", "patch_to_review": "diff --git a/docs/architecture/page.rst b/docs/architecture/page.rst\nnew file mode 100644\nindex 00000000000..d9a992f8b63\n--- /dev/null\n+++ b/docs/architecture/page.rst\n@@ -0,0 +1,41 @@\n+Saleor...
[ { "diff_hunk": "@@ -0,0 +1,41 @@\n+Saleor Pages", "line": null, "original_line": 1, "original_start_line": null, "path": "docs/architecture/page.rst", "start_line": null, "text": "@user1:\nStatic pages\n\n@user2:\nAre \"static pages\" a good name? They are not really static (as you can e...
b9121a5e7b7e0405963467f6e5155424061b6746
diff --git a/docs/architecture/page.rst b/docs/architecture/page.rst new file mode 100644 index 00000000000..878d6237bb2 --- /dev/null +++ b/docs/architecture/page.rst @@ -0,0 +1,21 @@ +Pages +===== + + +Setting up custom pages +----------------------- + +You can set up pages such as "About us" or "Important Announceme...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
saleor__saleor-1407@66c4fea
saleor/saleor
Python
1,407
Delete duplicated product_list fixture
Delete duplicated product_list fixture. Update product_list with data from duplicated fixture. Updated tests. Fixes #1369 I want to merge this change because... We have two product_list fixtures in conftest.py ### Pull Request Checklist 1. [x] Privileged views and APIs are guarded by proper permission...
2017-12-04T11:17:54Z
Duplicated pytest fixture product_list We have duplicated 'product_list' fixture in conftest.py. ### What I'm trying to achieve I want to have only one fixture which returns product list. ### Steps to reproduce the problem This is not affecting any of the functionalities. ### What I expected to happen ...
[ { "body": "We have duplicated 'product_list' fixture in conftest.py.\r\n\r\n### What I'm trying to achieve\r\n\r\nI want to have only one fixture which returns product list.\r\n\r\n### Steps to reproduce the problem\r\n\r\nThis is not affecting any of the functionalities.\r\n\r\n### What I expected to happen\r\...
fbbedaa3f87735aa1e0afa930f969d5acc939f8c
{ "head_commit": "66c4feaaef25f688a51152052054d29d7fef0d76", "head_commit_message": "Delete duplicated product_list fixture\n\nDelete duplicated product_list fixture.\nUpdate product_list with data from duplicated fixture.\nUpdated tests.", "patch_to_review": "diff --git a/tests/conftest.py b/tests/conftest.py\ni...
[ { "diff_hunk": "@@ -542,7 +542,7 @@ def test_product_bulk_update_form_can_unpublish_products(product_list):\n \n def test_product_list_filters(admin_client, product_list):\n db_products = Product.objects.all()\n- assert len(db_products) == 2\n+ assert len(db_products) == 3", "line": null, "ori...
7a35d9a9b58c48aed8ca6ac2aba110daa7c3c22a
diff --git a/tests/conftest.py b/tests/conftest.py index 79712001d02..cd65395912d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -283,15 +283,20 @@ def product_list(product_class, default_category): product_1 = Product.objects.create( name='Test product 1', price=Decimal('10.00'), - pr...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
scipy__scipy-14524@3b7bce4
scipy/scipy
Python
14,524
ENH: Rotation.concatenate
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-08-02T16:18:32Z
Initialize Rotation using list or array of Rotations Currently you can convert a Rotation object of multiple rotations into an array with `np.asarray`. You can't however convert a list of N (single) Rotation objects into a Rotation object with N rotations (as far as I can tell). This is useful when you have a list of...
[ { "body": "Currently you can convert a Rotation object of multiple rotations into an array with `np.asarray`.\r\nYou can't however convert a list of N (single) Rotation objects into a Rotation object with N rotations (as far as I can tell).\r\nThis is useful when you have a list of Rotations and want to use e.g...
28e4811d48c99b7c68e41992eda5cff859c1fa2b
{ "head_commit": "3b7bce42ea4b88bab23ebebeabedc1c2f9b47deb", "head_commit_message": "simplify concatenate logic", "patch_to_review": "diff --git a/scipy/spatial/transform/rotation.pyx b/scipy/spatial/transform/rotation.pyx\nindex 2e5a90d1c775..711b0fd3e70a 100644\n--- a/scipy/spatial/transform/rotation.pyx\n+++ b...
[ { "diff_hunk": "@@ -1572,6 +1573,30 @@ cdef class Rotation:\n else:\n return np.asarray(mrps)\n \n+ @classmethod\n+ def concatenate(cls, rotations):\n+ \"\"\"Concatenate a sequence of `Rotation` objects.\n+\n+ Parameters\n+ ----------\n+ rotations : sequence...
a85cf4be49f72daf438272b28bf9c57e1e5a41fc
diff --git a/scipy/spatial/transform/rotation.pyx b/scipy/spatial/transform/rotation.pyx index 2e5a90d1c775..d3c0f051e566 100644 --- a/scipy/spatial/transform/rotation.pyx +++ b/scipy/spatial/transform/rotation.pyx @@ -333,6 +333,7 @@ cdef class Rotation: as_rotvec as_mrp as_euler + concatenate a...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
saleor__saleor-1899@2cbdee9
saleor/saleor
Python
1,899
SEO friendly description for products.
This pull request has for goal to close #1845. ---- ### Proposal My current proposal is to add a new column inside the `Product` table which would only be used for the SEO friendly description. This column, `Product.seo_description`, is set to: - a max length of 255, which should be way enough; - opti...
2018-03-11T22:41:53Z
SEO: meta description are showing HTML tags Hello, If we create a product, let's say the following description: ---- Saleor is the **best** brand. And here is a new line as well. ---- It results to: ```html <meta name="description" content="&lt;p&gt;Saleor is the &lt;b&gt;best&lt;/b&gt; brand.&lt;/p&gt;...
I think we may use [builtin strip_tags templatetag](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#striptags) Input length is another thing, as I remember there's some SEO related ticket in the roadmap, which should provide additional fields for overriding such properties. But I think it should also b...
[ { "body": "Hello,\r\n\r\nIf we create a product, let's say the following description:\r\n\r\n----\r\nSaleor is the **best** brand.\r\nAnd here is a new line as well.\r\n\r\n----\r\n\r\nIt results to:\r\n```html\r\n<meta name=\"description\" content=\"&lt;p&gt;Saleor is the &lt;b&gt;best&lt;/b&gt; brand.&lt;/p&g...
5a1a8aaa46b5e8014939661ea757c76d66cafa0f
{ "head_commit": "2cbdee9b9de42bc6487bacc502e981d0cd1f9d83", "head_commit_message": "Two more cases added:\n - punctuation at the end of the last word of the cut sentence means there is nothing to process (should fix partial);\n - make sure a line that is not too long is not trimmed.", "patch_to_review": "diff ...
[ { "diff_hunk": "@@ -0,0 +1,45 @@\n+# Generated by Django 2.0.2 on 2018-03-11 18:54\n+import html\n+\n+from django.core.validators import MaxLengthValidator\n+from django.db import migrations, models\n+from saleor.core.utils.text import generate_seo_description\n+\n+\n+def to_seo_friendly(cls, text):", "line...
f5bd4e41344bc5cea84a8fb84bd6c83040ebec64
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py index af3ffed8b84..bbaf8ae98ae 100644 --- a/saleor/core/utils/random_data.py +++ b/saleor/core/utils/random_data.py @@ -15,6 +15,7 @@ from ...account.models import Address, User from ...account.utils import store_user_address +from ......
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-1305@455a5db
saleor/saleor
Python
1,305
Toggle publish product by post request
fixes #1302
2017-11-14T12:07:19Z
Switch to publish/unpublish products uses GET instead of POST The switch that lives in the product details dashboard does GET requests to change the product state (`product_toggle_is_published` view). We should always use POST for requests that modify the state or trigger actions.
[ { "body": "The switch that lives in the product details dashboard does GET requests to change the product state (`product_toggle_is_published` view). We should always use POST for requests that modify the state or trigger actions. ", "number": 1302, "title": "Switch to publish/unpublish products uses GE...
a23c7cf688ccc5f314b69209bf3bf2aac73ff0d0
{ "head_commit": "455a5db45d9dab43cd718124290f0b0f28332f5c", "head_commit_message": "Toggle publish product by post request", "patch_to_review": "diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.py\nindex 0c985c88290..d62c99e302f 100644\n--- a/saleor/dashboard/product/views.py\n+++ ...
[ { "diff_hunk": "@@ -20,11 +20,16 @@ export default $(document).ready((e) => {\n });\n \n $('#product-is-published').on('click', (e) => {\n- const input = $(e.currentTarget).find('input')[0];\n+ const form = $(e.currentTarget).closest('form');", "line": null, "original_line": 23, "original_...
86974b1dfce22d520c0c2b92052240a906edbba3
diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.py index 0c985c88290..d62c99e302f 100644 --- a/saleor/dashboard/product/views.py +++ b/saleor/dashboard/product/views.py @@ -178,6 +178,7 @@ def product_detail(request, pk): return TemplateResponse(request, 'dashboard/product/detail.ht...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
saleor__saleor-1159@b311932
saleor/saleor
Python
1,159
Add staff member management
Fixes #1143 Fixes #1171 TODO: - [x] add create action - [x] add delete action - [x] update form with 'is_staff' and 'is_superuser' checkboxes - [x] add option to promote customer to staff member - [x] send email with password form - [x] fix password reset view - [x] move promoting customer staff to modal ...
2017-10-04T11:30:54Z
Staff management AFAIK there's still no easy way to grant/remove `staff membership` to one, from the dashboard. `staff list`/`groups` could be grouped under one dropdown in 'Configuration' settings. `staff list` could be expanded for granting/removing `staff membership` Password reset doesn't work after update t...
I'm not sure what you're proposing? I was thinking about the functionality to grant staff membership to existing customer, by his email. Would simplify the process of creating new store admins. I think a more common use-case we should also solve is demoting existing staff members when someone leaves the company (remo...
[ { "body": "AFAIK there's still no easy way to grant/remove `staff membership` to one, from the dashboard. \r\n`staff list`/`groups` could be grouped under one dropdown in 'Configuration' settings.\r\n`staff list` could be expanded for granting/removing `staff membership`\r\n ", "number": 1143, "title": ...
e106cc5b289950b3afd1a3242490e8cbdcfd39f2
{ "head_commit": "b31193289e363b459fc97130517d6c63150ad891", "head_commit_message": "Update email sending to use celery\n\nChange send_set_password_email in staff/emails to use Celery while sending emails.", "patch_to_review": "diff --git a/saleor/dashboard/customer/urls.py b/saleor/dashboard/customer/urls.py\nin...
[ { "diff_hunk": "@@ -0,0 +1,29 @@\n+{% load i18n %}\n+\n+<form action=\"{% block action_url %}#!{% endblock %}\" method=\"post\" novalidate>", "line": null, "original_line": 3, "original_start_line": null, "path": "templates/dashboard/customer/modal/confirm_promote.html", "start_line": null, ...
b5f67b8e9d55b0d5d8e1306a41406d139d7e6aba
diff --git a/saleor/dashboard/customer/urls.py b/saleor/dashboard/customer/urls.py index ffcd04b1341..f9f565f988f 100644 --- a/saleor/dashboard/customer/urls.py +++ b/saleor/dashboard/customer/urls.py @@ -5,5 +5,7 @@ urlpatterns = [ url(r'^$', views.customer_list, name='customers'), - url(r'^(?P<pk>[0-9]+)/$...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-14454@953fc08
scipy/scipy
Python
14,454
MAINT: Begin translation of hyp2f1 for complex numbers into Cython
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-07-22T14:19:52Z
SciPy Hypergeometric function hyp2f1 producing infinities <<Please describe the issue in detail here, and for bug reports fill in the fields below.>> The SciPy hypergeometric function special.hyp2f1 seems to be producing infinities for instances where third argument is negative, and fourth argument is complex. The cor...
This issue is caused by code in both `specfun_wrappers.c` and `specfun.f` that immediately return `inf` whenever c is a negative integer *without* checking if a or b is a negative integer smaller in magnitude than c (in which case the hypergeometric function is a well defined polynomial). Since I'm working on hyperg...
[ { "body": "<<Please describe the issue in detail here, and for bug reports fill in the fields below.>>\r\nThe SciPy hypergeometric function special.hyp2f1 seems to be producing infinities for instances where third argument is negative, and fourth argument is complex. The corresponding implementation in MATLAB g...
97089947eef7351e82718b105c244329d76138ac
{ "head_commit": "953fc08018d015f7def27c1f793b4a2416a0c5aa", "head_commit_message": "DOC: Improve variable name and clarify comments", "patch_to_review": "diff --git a/scipy/special/_hyp2f1.pxd b/scipy/special/_hyp2f1.pxd\nnew file mode 100644\nindex 000000000000..34ca03a6e6cf\n--- /dev/null\n+++ b/scipy/special/...
[ { "diff_hunk": "@@ -0,0 +1,195 @@\n+\"\"\"\n+Implementation of Gauss's hypergeometric function for complex values. This is\n+an effort to incrementally translate the Fortran implementation from specfun.f\n+into Cython so that it's easier to maintain and it's easier to correct defects\n+in the original implement...
76775f635614b608e57e1025003b53863c2b8672
diff --git a/scipy/special/_hyp2f1.pxd b/scipy/special/_hyp2f1.pxd new file mode 100644 index 000000000000..a4f394f96c9a --- /dev/null +++ b/scipy/special/_hyp2f1.pxd @@ -0,0 +1,205 @@ +""" +Implementation of Gauss's hypergeometric function for complex values. This is +an effort to incrementally translate the Fortran i...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-14432@c28eb7a
scipy/scipy
Python
14,432
BUG/ENH: more stable recursion for 2-sample ks test exact p-values
Fixes: #12999 So this follows @mdhaber's in #12999 request to leave the code structure as is. However, in the test sent by @sigallev (which I adapted into a test), this is about 30x slower on my laptop. I think we can recover quite a bit of that by moving into cython/pythran/ whatever (I used [numba before](https:/...
2021-07-18T21:40:43Z
Bug in scipy.stats.ks_2samp for two-sided auto and exact modes on a few thousand samples (when n1!=n2) <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button abov...
There were some bugs of `ks_2samp` in SciPy 1.4, e.g. #11184, that were fixed in 1.5. Could you check if the problem still exists if you upgrade SciPy? The results actually changed, *and are now even weirder*. My code is very simple: import random import scipy import scipy.stats print(scipy.__version__) for x in rang...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
ce782b6a805b4d98e40ccb444203ddfff4eb74ac
{ "head_commit": "c28eb7a8fe13132fdf6c10887445a2be8d990c28", "head_commit_message": "more stable recursion for 2-sample ks test\n\nFixes: #12999", "patch_to_review": "diff --git a/scipy/stats/_hypotests_pythran.py b/scipy/stats/_hypotests_pythran.py\nindex f965bbe60937..d83b497738e9 100644\n--- a/scipy/stats/_hyp...
[ { "diff_hunk": "@@ -3885,6 +3886,17 @@ def test_gh11184_bigger(self):\n self._testOne(x, y, 'greater', 0.10597913208679133, 2.7947433906389253e-41, mode='asymp')\n self._testOne(x, y, 'less', 0.09658002199780022, 2.7947433906389253e-41, mode='asymp')\n \n+ @pytest.mark.slow", "line": null...
444c22e4f193dd04d3ed3e4ee9098c0f0eb02c72
diff --git a/scipy/stats/_hypotests_pythran.py b/scipy/stats/_hypotests_pythran.py index f965bbe60937..34a283cd387e 100644 --- a/scipy/stats/_hypotests_pythran.py +++ b/scipy/stats/_hypotests_pythran.py @@ -1,3 +1,5 @@ +import numpy as np + #pythran export _Aij(float[:,:], int, int) #pythran export _Aij(int[:,:], int...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-14426@80a5eec
scipy/scipy
Python
14,426
ENH: Add args argument for callable in quad_vec
#### Reference issue Fixes #14412 #### What does this implement/fix? Provision to provide arguments for the callable function we wish to integrate with `scipy.integrate.quad_vec`. #### Additional information `scipy.integrate.quadrature` and `scipy.integrate.quad` both provide this argument. So it makes sense ...
2021-07-17T22:03:33Z
Extra function arguments to `scipy.integrate.quad_vec` Hello, thanks for the work on scipy! I was looking at the docs/source for `scipy.integrate.quad_vec` and I noticed that there isn't a provision to provide arguments for the callable function we wish to integrate. For the `scipy.integrate.quadrature`, we have th...
Thanks for the suggestion. In the meantime, you can pass the parameters by using [functools.partial](https://docs.python.org/3/library/functools.html#functools.partial) for instance. Ah thanks! I forgot about partial, for some reason. I'll do that for now. But it'll be great to have this feature built-in too in future!...
[ { "body": "Hello, thanks for the work on scipy! \r\n\r\nI was looking at the docs/source for `scipy.integrate.quad_vec` and I noticed that there isn't a provision to provide arguments for the callable function we wish to integrate. For the `scipy.integrate.quadrature`, we have the `args` argument that we can pa...
f91728ab47e0702a06ff448dbc5d6e5705227679
{ "head_commit": "80a5eec4d44a9e732618a223b9e2b7fc143cbceb", "head_commit_message": "TST: Add tests for args kwarg in quad_vec", "patch_to_review": "diff --git a/scipy/integrate/_quad_vec.py b/scipy/integrate/_quad_vec.py\nindex 0c25f8db6653..ff4b401fd951 100644\n--- a/scipy/integrate/_quad_vec.py\n+++ b/scipy/in...
[ { "diff_hunk": "@@ -101,8 +101,21 @@ def __repr__(self):\n for k in self.__keys))\n \n \n+class _FunctionWrapper:", "line": null, "original_line": 104, "original_start_line": null, "path": "scipy/integrate/_quad_vec.py", "start_line": null, "t...
e93862a356d4dab931433f201e3d10f4d41d9feb
diff --git a/scipy/_lib/_util.py b/scipy/_lib/_util.py index 2b0326313ae6..22923ae3f743 100644 --- a/scipy/_lib/_util.py +++ b/scipy/_lib/_util.py @@ -401,6 +401,18 @@ def getfullargspec_no_self(func): kwdefaults or None, annotations) +class _FunctionWrapper: + """ + Object to wrap use...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-14283@0ad27b6
scipy/scipy
Python
14,283
BUG: fix refguide-check namedtuple handling
Handle scipy.stats namedtyple *Result type classes, e.g. `ConfidenceInterval(low=0.9950085825848624, high=0.9971212407917498)` which can show up in both expected and actual doctest output. Here "handle" means convert these into tuples of numeric values and compare those. Previously, refuide-check only handled the c...
2021-06-23T10:53:49Z
DOC, CI: stats skewtest refguide failure This is showing up in the CI of unrelated PRs like gh-14281 and appears to be related to small floating point precision difference (a bit outside my expertise, but pasting the raw log contents below): ``` 021-06-22T22:42:06.0038137Z =========== 2021-06-22T22:42:06.0038731Z ...
There's an issue in refguide-check, I'll take a look. Locally a different one fails for me, but it's numerical noise anyway and hopefully gh-14283 makes it more robust by delegating these cases to `np.allclose`.
[ { "body": "This is showing up in the CI of unrelated PRs like gh-14281 and appears to be related to small floating point precision difference (a bit outside my expertise, but pasting the raw log contents below):\r\n\r\n```\r\n021-06-22T22:42:06.0038137Z ===========\r\n2021-06-22T22:42:06.0038731Z scipy.stats\r\...
4aebbd953fec41b2f3ff3ebbeb2bf91e88d0da2d
{ "head_commit": "0ad27b6c232227307ceb470d770314551b8f3a55", "head_commit_message": "BUG: fix refguide-check namedtuple handling\n\nHandle scipy.stats namedtyple *Result type classes, e.g.\n`ConfidenceInterval(low=0.9950085825848624, high=0.9971212407917498)`\nwhich can show up in both expected and actual doctest o...
[ { "diff_hunk": "@@ -595,23 +611,25 @@ def check_output(self, want, got, optionflags):\n s_got = \", \".join(s_got[1:-1].split())\n return self.check_output(s_want, s_got, optionflags)\n \n+ if \"=\" not in want and \"=\" not in got:\n+ # if we're here, w...
f4f45fc93a28391d1b1cf24cfe218fcd3c99a297
diff --git a/tools/refguide_check.py b/tools/refguide_check.py index 6c3e2db5e8f0..03481eb0c93c 100755 --- a/tools/refguide_check.py +++ b/tools/refguide_check.py @@ -490,6 +490,22 @@ def check_rest(module, names, dots=True): 'Inf': np.inf,} +def try_convert_namedtuple(got): + # suppose that "got" is smth...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Test Suite / CI Enhancements" }
scipy__scipy-14248@27b866c
scipy/scipy
Python
14,248
MAINT:linalg: Make lu_factor accept rectangular arrays
#### Reference issue closes #14243 #### What does this implement/fix? Removes check that matrix is square for `linalg.lu_factor`. This function is valid for rectangular matrices as well. The check was probably there because `lu_solve` only works for square matrices, but `lu_factor` can be used on its own. (My pe...
2021-06-17T08:44:22Z
Sparse pivot for linalg.lu Currently `p, l, u = scipy.linalg.lu(a)` returns a dense permutation matrix `p` for the pivots of shape `(M, M)` for `a` of shape `(M, N)`. If the input matrix is tall and skinny (`M` >> `N`), then the storage costs of `p` are unacceptable. A workaround is to make LAPACK calls directly, e...
If you only need the permutation you can use `scipy.linalg.lu_factor` which is a bit more labourous to use the L, U matrices but it is meant to be used with `scipy.linalg.lu_solve` `scipy.linalg.lu_factor` is only for square matrices. My use case is precisely tall skinny matrices. Also, it seems `dgetrf` is faster than...
[ { "body": "Currently `p, l, u = scipy.linalg.lu(a)` returns a dense permutation matrix `p` for the pivots of shape `(M, M)` for `a` of shape `(M, N)`. If the input matrix is tall and skinny (`M` >> `N`), then the storage costs of `p` are unacceptable. \r\n\r\nA workaround is to make LAPACK calls directly, e.g. ...
773ee7611deb9390bbc7d0e0a8d449b1f6d63981
{ "head_commit": "27b866c5890d01f13df130b26c5d32f5ad1b95be", "head_commit_message": "Merge remote-tracking branch 'upstream/main'", "patch_to_review": "diff --git a/scipy/linalg/_decomp_lu.py b/scipy/linalg/_decomp_lu.py\nindex 3375409c30d0..ac1a37197401 100644\n--- a/scipy/linalg/_decomp_lu.py\n+++ b/scipy/linal...
[ { "diff_hunk": "@@ -45,11 +45,14 @@ def lu_factor(a, overwrite_a=False, check_finite=True):\n \n See Also\n --------\n+ lu : gives lu factorization in more user-friendly format\n lu_solve : solve an equation system using the LU factorization of a matrix\n \n Notes\n -----\n- This is a ...
69e2787884df64d8bb30e276c53a50d4ab238846
diff --git a/scipy/linalg/_decomp_lu.py b/scipy/linalg/_decomp_lu.py index 3375409c30d0..1f1244354087 100644 --- a/scipy/linalg/_decomp_lu.py +++ b/scipy/linalg/_decomp_lu.py @@ -25,7 +25,7 @@ def lu_factor(a, overwrite_a=False, check_finite=True): Parameters ---------- - a : (M, M) array_like + a : (...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-13990@4d78fa6
scipy/scipy
Python
13,990
MAINT, DOC: optimize: Make the input validation explanation clear for `optimize.leastsq` and add a test.
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-05-05T13:31:09Z
N=4 must not exceed M=3 <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in the output. --> My issue is...
The code is here: https://github.com/scipy/scipy/blob/4ec4ab8d6ccc1cdb34b84fdcb66fde2cc0210dbf/scipy/optimize/minpack.py#L413-L415 `optimize.leastsq` docstring has meanings of `N` and `M` here: https://github.com/scipy/scipy/blob/4ec4ab8d6ccc1cdb34b84fdcb66fde2cc0210dbf/scipy/optimize/minpack.py#L293-L295 I ...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
690a653335f4b6c1db77367bf7eae5db45f20ed1
{ "head_commit": "4d78fa64797d5c71b006aeb6f9b23779ab58c415", "head_commit_message": "MAINT, TET: optimize: Make the input validation explanation clear for `optimize.leastsq` and add a test.", "patch_to_review": "diff --git a/scipy/optimize/minpack.py b/scipy/optimize/minpack.py\nindex 668ea4a1d93e..94b859ed0205 1...
[ { "diff_hunk": "@@ -292,7 +292,7 @@ def leastsq(func, x0, args=(), Dfun=None, full_output=0,\n func : callable\n Should take at least one (possibly length N vector) argument and\n returns M floating point numbers. It must not return NaNs or\n- fitting might fail.\n+ fitting mig...
0bd68d621653f5244b1e998039fd688e668a6024
diff --git a/scipy/optimize/minpack.py b/scipy/optimize/minpack.py index 668ea4a1d93e..32e68f8eb0b1 100644 --- a/scipy/optimize/minpack.py +++ b/scipy/optimize/minpack.py @@ -290,9 +290,9 @@ def leastsq(func, x0, args=(), Dfun=None, full_output=0, Parameters ---------- func : callable - Should tak...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-13956@c1082d0
scipy/scipy
Python
13,956
ENH: spatial: add `axis` and `keepdims` optional argument for `distance.jensenshannon`.
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-04-29T07:50:01Z
Add axis parameter for scipy.spatial.distance.jensenshannon My suggestion is to add an axis parameter for `scipy.spatial.distance.jensenshannon`, to be consistent with `scipy.stats.entropy`, instead of assuming an axis of `0` as it currently does. I'm happy to open a PR when I get time, if this is something that wou...
`jensenshannon` docs say that only 1-D arrays are supported, which is the case for all metrics in `distance` - the only difference seems to be that the former doesn't raise. adding an `axis` argument I'm not sure about. `stats.entropy` also doesn't have an `axis` keyword. do you have an actual problem? beyond in...
[ { "body": "My suggestion is to add an axis parameter for `scipy.spatial.distance.jensenshannon`, to be consistent with `scipy.stats.entropy`, instead of assuming an axis of `0` as it currently does.\r\n\r\nI'm happy to open a PR when I get time, if this is something that would be useful.", "number": 11325, ...
f97ce31736bb3c4a0a0c7db8fde2ee4ebc69e39d
{ "head_commit": "c1082d07fd5117960f7e6f73432a1592f6292e4c", "head_commit_message": "ENH: spatial: fix doctests.", "patch_to_review": "diff --git a/scipy/spatial/distance.py b/scipy/spatial/distance.py\nindex 1c89741d965c..97fbed15eadf 100644\n--- a/scipy/spatial/distance.py\n+++ b/scipy/spatial/distance.py\n@@ -...
[ { "diff_hunk": "@@ -1211,7 +1211,7 @@ def canberra(u, v, w=None):\n return d\n \n \n-def jensenshannon(p, q, base=None):\n+def jensenshannon(p, q, base=None, axis=0):\n \"\"\"\n Compute the Jensen-Shannon distance (metric) between\n two 1-D probability arrays. This is the square root", "line...
0974c048129d08bb6e843143091ea55b39e2c3c0
diff --git a/scipy/spatial/distance.py b/scipy/spatial/distance.py index 1c89741d965c..dc1aece40c10 100644 --- a/scipy/spatial/distance.py +++ b/scipy/spatial/distance.py @@ -1211,10 +1211,10 @@ def canberra(u, v, w=None): return d -def jensenshannon(p, q, base=None): +def jensenshannon(p, q, base=None, *, axi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-13918@c98fbe5
scipy/scipy
Python
13,918
ENH: Poisson Disk sampling for QMC
#### Reference issue Adding Poisson Disk sampling to QMC #13912 #### What does this implement/fix? Poisson disk sampling in arbitrary dimensions using Bridson's algorithm, implemented using ``numpy`` and ``scipy``. Generates so-called "blue noise" that prevents clustering by ensuring each two points are at leas...
2021-04-22T08:15:24Z
Adding Poisson Disc sampling to QMC Hi @tupui, I have looked at the class definition for QMC engines, and I'm having some trouble adapting Bridson's algorithm for PD to these definitions. As far as I see, I should be able to produce an arbitrary number of samples when `random (n)` is called. There are two issues ...
Thanks for tackling this! Poisson disk sampling is quite useful and would definitely be valuable. I am not certain yet about the final interface. For 1. we could raise a warning. And for 2. We could also do like with `LatinHypercube` where calling again `random` would produce a new sampling (uncorrelated from the fi...
[ { "body": "Hi @tupui,\r\n\r\nI have looked at the class definition for QMC engines, and I'm having some trouble adapting Bridson's algorithm for PD to these definitions.\r\n\r\nAs far as I see, I should be able to produce an arbitrary number of samples when `random (n)` is called. There are two issues there due...
8627df31ab07d66b438c7e5d5880e3f4d435f248
{ "head_commit": "c98fbe57908f9fd3beaf5347a2a6feb3dd8261e3", "head_commit_message": "MAINT: refactor code.\n\n[skip ci]", "patch_to_review": "diff --git a/scipy/stats/_qmc.py b/scipy/stats/_qmc.py\nindex fcc11dd92347..41d1d340711a 100644\n--- a/scipy/stats/_qmc.py\n+++ b/scipy/stats/_qmc.py\n@@ -30,6 +30,7 @@\n i...
[ { "diff_hunk": "@@ -1597,117 +1597,180 @@ def fast_forward(self, n: IntNumber) -> Sobol:\n \n \n class PoissonDisc(QMCEngine):\n+ \"\"\"Poisson disk sampling.\n \n- # Uniform sampling in a hypersphere\n- # Based on Matlab implementation by Roger Stafford\n- # Can be optimized for Bridson algorithm b...
8889fbd13a61edf4f64c1f012cb96500b1044d08
diff --git a/scipy/stats/_qmc.py b/scipy/stats/_qmc.py index fcc11dd92347..65bc0fdc930e 100644 --- a/scipy/stats/_qmc.py +++ b/scipy/stats/_qmc.py @@ -30,6 +30,7 @@ import scipy.stats as stats from scipy._lib._util import rng_integers from scipy.spatial import distance, Voronoi +from scipy.special import gammainc f...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-13797@b29325c
scipy/scipy
Python
13,797
MAINT: stats: probplot: don't plot least-squares fit line unless `fit== True`
#### Reference issue <!--Example: Closes gh-WXYZ.--> closes gh-13769 #### What does this implement/fix? <!--Please explain your changes.--> `probplot` would draw a least-squares fit line even when `fit==False`. The fit was always calculated; `fit` only controlled whether the information was returned. With this...
2021-04-04T08:00:58Z
probplot draws fit line even when fit=False The documentation for `probplot` states: ``` fit : bool, optional Fit a least-squares regression (best-fit) line to the sample data if True (default). ``` This implies that a best-fit line is only produced if `fit` is True. But in the code, a fit i...
[ { "body": "The documentation for `probplot` states:\r\n```\r\n fit : bool, optional\r\n Fit a least-squares regression (best-fit) line to the sample data if\r\n True (default).\r\n```\r\n\r\nThis implies that a best-fit line is only produced if `fit` is True. But in the code, a fit is always ca...
08c3953e1ad8370de61de5a7ecf646f576939fed
{ "head_commit": "b29325c6c62af497fb75f3fd9a4ac34decae6047", "head_commit_message": "MAINT: stats: probploy: don't plot least-squares fit line unless `fit == True`", "patch_to_review": "diff --git a/scipy/stats/morestats.py b/scipy/stats/morestats.py\nindex 3631887cdcef..d04c79c54d6a 100644\n--- a/scipy/stats/mor...
[ { "diff_hunk": "@@ -494,7 +494,8 @@ def probplot(x, sparams=(), dist='norm', fit=True, plot=None, rvalue=False):\n Fit a least-squares regression (best-fit) line to the sample data if\n True (default).\n plot : object, optional\n- If given, plots the quantiles and least squares fit.\n...
41170174d1b0afb93a1ee26d5b7a5739405b567d
diff --git a/scipy/stats/morestats.py b/scipy/stats/morestats.py index 3631887cdcef..70d237c36125 100644 --- a/scipy/stats/morestats.py +++ b/scipy/stats/morestats.py @@ -494,7 +494,8 @@ def probplot(x, sparams=(), dist='norm', fit=True, plot=None, rvalue=False): Fit a least-squares regression (best-fit) line ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-13581@f06744d
scipy/scipy
Python
13,581
MAINT: stats: fix truncnorm stats with array shapes
#### Reference issue Closes gh-13580. Closes gh-13642 (Fixes the `mean`/`var` parts; the rest is a duplicate of gh-12192 to be fixed by gh-12197) #### What does this implement/fix? `truncnorm._stats` was not written to handle array shape parameters. This vectorizes it and enhances the `check_moments` test to ca...
2021-02-18T05:36:30Z
truncnorm gives incorrect means and variances `truncnorm.mean` and `truncnorm.var` appear to give incorrect outputs when `loc` or `scale` are array-like and contain more than one number: ``` >>> import scipy.stats as stats >>> stats.truncnorm.mean(-1, 2, loc=0) 0.229637179091329 >>> stats.truncnorm.mean(-1, 2, l...
gh-12192 fixes `moment`'s issues with input arrays. That's a problem for all stats distributions. (Potential reviewers: that PR is waiting for review. I was reviewing, but ended up writing a fair amount of code, so I think it needs an independent review.) I'll take a look into `truncnorm` mean and variance. I hope ...
[ { "body": "`truncnorm.mean` and `truncnorm.var` appear to give incorrect outputs when `loc` or `scale` are array-like and contain more than one number: \r\n```\r\n>>> import scipy.stats as stats\r\n>>> stats.truncnorm.mean(-1, 2, loc=0)\r\n0.229637179091329\r\n>>> stats.truncnorm.mean(-1, 2, loc=[0])\r\narray([...
c73cddc2ca144638139c0cd4eec2bacfa14bd83a
{ "head_commit": "f06744db2a83f4ead72b3df423e9f4bf762ec835", "head_commit_message": "Update scipy/stats/tests/test_continuous_basic.py\n\nCo-authored-by: Samuel Wallan <44255917+swallan@users.noreply.github.com>", "patch_to_review": "diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns....
[ { "diff_hunk": "@@ -633,7 +636,9 @@ def check_vecentropy(distfn, args):\n \n \n def check_loc_scale(distfn, arg, m, v, msg):\n- loc, scale = 10.0, 10.0\n+ # Make `loc` and `scale` arrays to catch bugs like gh-13580 where\n+ # `loc` and `scale` arrays improperly broadcast with shapes. ", "line": nul...
0137f080286d5387dee96e23fb27a30b4a43c2fc
diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py index 025917174722..b9a87476c8ee 100644 --- a/scipy/stats/_continuous_distns.py +++ b/scipy/stats/_continuous_distns.py @@ -8222,31 +8222,37 @@ def n_th_moment(n, a, b): np.nan) def _stats(self, a, b, mo...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-13403@4066b56
scipy/scipy
Python
13,403
BUG: sparse: Propagate dtype through CSR/CSC constructors
#### Reference issue Fixes gh-13329 #### What does this implement/fix? Propagates the `dtype` parameter through the intermediate COO format constructor.
2021-01-19T19:42:51Z
Large sparse matrices of big integers lose information <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in ...
When you create your data like that, you will almost certainly have some repeated occurrences of (row, col) pairs, and when you create the sparse matrix, the values associated with the repeated coordinates will be added. This could result in an overflow of the 64 bit unsigned integers. Actually, the problem isn't ne...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
9da1c4bad19f434e7e511a164e0a7af954a4202d
{ "head_commit": "4066b56c8ffd4972306f24efb2752106fd89e3d1", "head_commit_message": "Fix the regression tests, and the underlying bug", "patch_to_review": "diff --git a/scipy/sparse/compressed.py b/scipy/sparse/compressed.py\nindex 17b9a23ce7e5..a9e6d114fdd2 100644\n--- a/scipy/sparse/compressed.py\n+++ b/scipy/s...
[ { "diff_hunk": "@@ -51,7 +51,7 @@ def __init__(self, arg1, shape=None, dtype=None, copy=False):\n if len(arg1) == 2:\n # (data, ij) format\n from .coo import coo_matrix\n- other = self.__class__(coo_matrix(arg1, shape=shape))\n+ ...
817f564f08d24019e3bfde54b42321b72dff874e
diff --git a/scipy/sparse/compressed.py b/scipy/sparse/compressed.py index 17b9a23ce7e5..c25c256be38d 100644 --- a/scipy/sparse/compressed.py +++ b/scipy/sparse/compressed.py @@ -51,7 +51,8 @@ def __init__(self, arg1, shape=None, dtype=None, copy=False): if len(arg1) == 2: # (data,...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-13381@75d094f
scipy/scipy
Python
13,381
DOC: update MacOS quickstart with conda-forge compiler, make more similar to ubuntu
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-01-13T03:23:49Z
Build problem on macOS with numpy 1.19.4 I'm currently experiencing a build problem on macOS 10.15.7 (Catalina) with numpy 1.19.4 installed. ``` (dev3) teapot:scipy andrew$ gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/...
I saw that a while ago too. Installing the `compilers` package from conda-forge fixed it. Hi @rgommers. I had a different error (below), but adding `compilers` from conda forge fixed it for me. Thank you! I'm on Big Sur 11.1: hopefully if anyone else has this same issue they can see this. ``` (scipydev) samuels-mbp...
[ { "body": "I'm currently experiencing a build problem on macOS 10.15.7 (Catalina) with numpy 1.19.4 installed.\r\n```\r\n(dev3) teapot:scipy andrew$ gcc --version\r\nConfigured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/i...
255d49cd63d4341c4d95b28ee8272657bf5e8e42
{ "head_commit": "75d094fb5cbd8f01c5a0dd733602ab828fffaed3", "head_commit_message": "DOC: advise users to install command line tools", "patch_to_review": "diff --git a/doc/source/dev/contributor/quickstart_mac.rst b/doc/source/dev/contributor/quickstart_mac.rst\nindex 4cf5f3cdff00..dfb32f4f9a87 100644\n--- a/doc/...
[ { "diff_hunk": "@@ -2,189 +2,101 @@\n \n .. _quickstart-mac:\n \n-================================================\n-Development environment quickstart guide (macOS)\n-================================================\n+=======================================================\n+Development environment quickstart ...
05ab97bede8d09ab788817340ff69f638a8db3ed
diff --git a/doc/source/building/faq.rst b/doc/source/building/faq.rst index 8f0a74ff66b7..44e9e78a327f 100644 --- a/doc/source/building/faq.rst +++ b/doc/source/building/faq.rst @@ -8,7 +8,7 @@ Build/Install FAQ version that I use to do my job/research?* If you use the ``conda`` package manager, this is covered in...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Dependency Updates & Env Compatibility" }
scipy__scipy-13893@4fcbd8b
scipy/scipy
Python
13,893
ENH: linprog HiGHS marginals/sensitivy analysis
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-04-19T04:03:21Z
scipy.optimize.linprog(method='simplex') needs to return duals I have a huge linprog problem of almost 1k variables and restrictions. I can calculate the solution with scipy.optimize.linprog(method='simplex') but I need shadow prices (or opportunity costs / duals) of ~100 inequalities. I'm able to calculate them by ...
@j6e I'd be happy to help with this. The simplex method could use some maintenance, and it sounds like you have the background for it. BTW I wrote the `interior-point` method but didn't return duals because the solution is, in general, on an optimal face - not necessarily at a vertex. The duals are not useful in thi...
[ { "body": "I have a huge linprog problem of almost 1k variables and restrictions. I can calculate the solution with scipy.optimize.linprog(method='simplex') but I need shadow prices (or opportunity costs / duals) of ~100 inequalities.\r\n\r\nI'm able to calculate them by adding 1 to the right side of the inequa...
b2a003360d4a1d0ea0c8fe8b7834edf21761613c
{ "head_commit": "4fcbd8b022a4a4a143acc945090697676e0a7c6f", "head_commit_message": "TST: add complementary slackness test for HiGHS marginals", "patch_to_review": "diff --git a/scipy/optimize/_highs/cython/src/HConst.pxd b/scipy/optimize/_highs/cython/src/HConst.pxd\nindex 6cdad205f705..316c208a1421 100644\n--- ...
[ { "diff_hunk": "@@ -1675,6 +1676,68 @@ def test_crossover(self):\n # there should be nonzero crossover iterations for IPM (only)\n assert_equal(res.crossover_nit == 0, self.method != \"highs-ipm\")\n \n+ def test_marginals(self):\n+ # Ensure lagrange multipliers are correct by comparin...
8e5256f7c9944f7ccfc74abe95d854e82c9366c9
diff --git a/scipy/optimize/_highs/cython/src/HConst.pxd b/scipy/optimize/_highs/cython/src/HConst.pxd index 6cdad205f705..316c208a1421 100644 --- a/scipy/optimize/_highs/cython/src/HConst.pxd +++ b/scipy/optimize/_highs/cython/src/HConst.pxd @@ -35,14 +35,14 @@ cdef extern from "HConst.h" nogil: cdef enum Hig...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-13322@cfd6c0b
scipy/scipy
Python
13,322
Bug: setting iprint=0 hides all output from fmin_l_bfgs_b, but it should print convergence info from final iteration.
This pull request fixes #13321. In `scipy.optimize.fmin_l_bfgs_b`, the `disp` argument was handled by setting: ```python if disp is None: disp = iprint ``` However, both `disp` and `iprint` are fed into `scipy.optimize._minimize_lbfgsb`, which handles the `disp` argument again, with this code: ```python...
2021-01-01T09:30:58Z
Bug: setting iprint=0 hides all output from fmin_l_bfgs_b, but it should print convergence info from final iteration. `scipy.optimize.fmin_l_bfgs_b` provides an option to print a report after the optimisation procedure with the keyword argument `iprint=0`. However, this option does not work, as demonstrated by the code...
[ { "body": "`scipy.optimize.fmin_l_bfgs_b` provides an option to print a report after the optimisation procedure with the keyword argument `iprint=0`. However, this option does not work, as demonstrated by the code below. This bug is likely caused by how the display option (required for the minimize wrapper) is ...
91bf8fa0b81b3007479b2db53e7e18ac99b940db
{ "head_commit": "cfd6c0bb6a868f3c2233dc02f38694016a6b41b5", "head_commit_message": "TST: optimize.fmin_l_bfgs_b: test console output behavior", "patch_to_review": "diff --git a/scipy/optimize/_lbfgsb_py.py b/scipy/optimize/_lbfgsb_py.py\nindex a39e179f6aa3..c030f80dd7d3 100644\n--- a/scipy/optimize/_lbfgsb_py.py...
[ { "diff_hunk": "@@ -1065,6 +1065,39 @@ def custmin(fun, x0, args=(), maxfev=None, stepsize=0.1,\n options=dict(stepsize=0.05))\n assert_allclose(res.x, 1.0, rtol=1e-4, atol=1e-4)\n \n+ def test_gh13321(self, capfd):", "line": 1069, "original_line": 1068, "o...
b0fbe27e638a4cde998e18b7147d727e2ab99c3d
diff --git a/scipy/optimize/_lbfgsb_py.py b/scipy/optimize/_lbfgsb_py.py index a39e179f6aa3..c030f80dd7d3 100644 --- a/scipy/optimize/_lbfgsb_py.py +++ b/scipy/optimize/_lbfgsb_py.py @@ -183,8 +183,6 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(), jac = fprime # build options - if disp is None: ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-13320@dca1889
scipy/scipy
Python
13,320
ENH: x0 for differential_evolution
closes #13300
2021-01-01T09:11:00Z
Add a single individual to a latinhypercube initial population in differential_evolution **Is your feature request related to a problem? Please describe.** I'd like to pass a single individual to `differential_evolution`, where it still starts with a `latinhypercube`, but adds the individual. Currently `init=array` re...
I've thought about this kind of thing before. What can happen is that the solve process spends a lot of time converging around the supplied `x0` to start with, unless `x0` is a really bad solution. If `x0` is a pretty good global solution then it's not clear to me that `differential_evolution` will necessarily improve ...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nI'd like to pass a single individual to `differential_evolution`, where it still starts with a `latinhypercube`, but adds the individual. Currently `init=array` requires an array of size `(M, len(x))` where `M>=4`. This seems also ...
7df7d350fb3156d6e1554eec6997be8bb59cb052
{ "head_commit": "dca18896f38456f6741876db1545f5626c99d6dc", "head_commit_message": "MAINT: ensure parameters are within bounds", "patch_to_review": "diff --git a/scipy/optimize/_differentialevolution.py b/scipy/optimize/_differentialevolution.py\nindex 34448100beea..e54babb1f42a 100644\n--- a/scipy/optimize/_dif...
[ { "diff_hunk": "@@ -580,21 +592,29 @@ def __init__(self, func, bounds, args=(),\n else:\n self.init_population_array(init)\n \n- # infrastructure for constraints\n- # dummy parameter vector for preparing constraints, this is required so\n- # that the number of constraint...
ab62768b65617826f8eff3ad65a72b4d52461ce7
diff --git a/scipy/optimize/_differentialevolution.py b/scipy/optimize/_differentialevolution.py index 34448100beea..cfb56600298c 100644 --- a/scipy/optimize/_differentialevolution.py +++ b/scipy/optimize/_differentialevolution.py @@ -24,7 +24,7 @@ def differential_evolution(func, bounds, args=(), strategy='best1bin', ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-13313@b564f3b
scipy/scipy
Python
13,313
ENH: static typing for qhull
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-12-31T05:10:28Z
Typing for scipy.spatial **Is your feature request related to a problem? Please describe.** It would be great to have typing for spatial (e.g. Voronoi) as some fields are undocumented (e.g. ridge_dict), and some are not detected by IDE introspection (e.g. vertices). **Describe the solution you'd like** Add typing ...
There is no `qhull.py`, it's Cython code. Adding type annotations directly in Cython code seems to be possible (http://docs.cython.org/en/latest/src/tutorial/pure.html#pep-484-type-annotations), but it seems a little unusual and I'd expect some problems like conflicts with the regular way of typing parameters in Cython...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nIt would be great to have typing for spatial (e.g. Voronoi) as some fields are undocumented (e.g. ridge_dict), and some are not detected by IDE introspection (e.g. vertices).\r\n\r\n**Describe the solution you'd like**\r\nAdd typin...
7df7d350fb3156d6e1554eec6997be8bb59cb052
{ "head_commit": "b564f3b270a10b541cbd6b0cc6252cb498cda241", "head_commit_message": "TYPE: don't ignore qhull missing imports", "patch_to_review": "diff --git a/mypy.ini b/mypy.ini\nindex bb4f43a997e9..a8c055c18c81 100644\n--- a/mypy.ini\n+++ b/mypy.ini\n@@ -94,9 +94,6 @@ ignore_missing_imports = True\n [mypy-sci...
[ { "diff_hunk": "@@ -0,0 +1,98 @@\n+'''\n+Static type checking stub file for scipy/spatial/qhull.pyx\n+'''\n+\n+from typing import TYPE_CHECKING, List, Tuple, Any\n+\n+if TYPE_CHECKING:\n+ from numpy.typing import ArrayLike\n+else:\n+ ArrayLike = Any\n+\n+import numpy as np\n+\n+class _Qhull:\n+ def __i...
a934b96bbb17d436159bc62e088a0caef1ebdba5
diff --git a/mypy.ini b/mypy.ini index bb4f43a997e9..a8c055c18c81 100644 --- a/mypy.ini +++ b/mypy.ini @@ -94,9 +94,6 @@ ignore_missing_imports = True [mypy-scipy.interpolate.dfitpack] ignore_missing_imports = True -[mypy-scipy.spatial.qhull] -ignore_missing_imports = True - [mypy-scipy.interpolate.interpnd] igno...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-13238@a12f8ed
scipy/scipy
Python
13,238
BUG: stats: fix wrong shape output of burr and fisk distributions
#### Reference issue closes gh-13234 #### What does this implement/fix? As described in gh-13234, 'burr' and 'fisk' distributions returned a bad shaped array when scalar arguments were passed to the 'moment' method leading to an API inconsistency. This was because the call to '_stats' method from the 'moment' ...
2020-12-13T17:42:45Z
BUG: stats: Wrong shape of burr.moment() and fisk.moment() when given scalars. The `moment` method of the distribution `scipy.stats.burr` returns a 1-d array of length 1 instead of returning a scalar: ``` In [36]: from scipy.stats import burr In [37]: burr.moment(1, 5, 4) # Result should be a scalar, but we get a...
The distribution `fisk` has the same problem: ``` In [134]: from scipy.stats import fisk In [135]: fisk.moment(1, 8) Out[135]: array([1.02617215]) ```
[ { "body": "The `moment` method of the distribution `scipy.stats.burr` returns a 1-d array of length 1 instead of returning a scalar:\r\n```\r\nIn [36]: from scipy.stats import burr\r\n\r\nIn [37]: burr.moment(1, 5, 4) # Result should be a scalar, but we get a 1-d array.\r\nOut[37]: array([1.50509474])\r\n```\r...
37b7e0081157433f10e9310985c95bd57289f15a
{ "head_commit": "a12f8edca4177780ca41925baf76c3d462341ed9", "head_commit_message": "MAINT: stats: apply suggestions from code review\r\n\r\nRemove the call to `np.broadcast_arrays` and use `np.ndim` instead to get the dimensions of the argument.\n\nCo-authored-by: Warren Weckesser <warren.weckesser@gmail.com>", ...
[ { "diff_hunk": "@@ -654,3 +654,11 @@ def test_methods_with_lists(method, distname, args):\n npt.assert_allclose(result,\n [f(*v) for v in zip(x, *shape2, loc, scale)],\n rtol=1e-14, atol=5e-14)\n+\n+\n+def test_burr_fisk_moment_gh13234_regression():\n+ vals...
a718703b45e5bd3080080460d65fe7feae135c3a
diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py index cc7e090a7867..96b791df9d04 100644 --- a/scipy/stats/_continuous_distns.py +++ b/scipy/stats/_continuous_distns.py @@ -957,6 +957,8 @@ def _stats(self, c, d): lambda c, e1, e2, e3, e4, mu2_if_c: ( ((e4 ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-13283@ca70690
scipy/scipy
Python
13,283
BUG: stats: fix the cdf method of rv_discrete class
#### Reference issue closes gh-13280 #### What does this implement/fix? As described in gh-13280, the cdf method failed for 'hypergeom' and 'nhypergeom' distributions when invalid arguments were passed. The fix is to fill in the 'nan' values for invalid arguments after filling in the '1' values for quantiles great...
2020-12-22T02:42:59Z
Wrong results with hypergeom cdf <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in the output. --> Th...
@ricardoV94, thanks for reporting the issue. I see that `nhypergeom` has the same problem: ``` In [32]: from scipy.stats import nhypergeom In [33]: k = np.arange(-2, 6) In [34]: nhypergeom.cdf(k, 5, 2, 8) Out[34]: array([nan, nan, nan, nan, 1., 1., 1., 1.]) ``` Neither of these distributions implement...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
624fd766e2886c458012d98e3c6ec85551ab2916
{ "head_commit": "ca706906f992413c63b87417e2b0f1e173f7d33e", "head_commit_message": "TST: stats: add tests for all discrete distributions\n\nAdd tests for the cdf method of all the discrete distribution.", "patch_to_review": "diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py...
[ { "diff_hunk": "@@ -271,3 +271,30 @@ def test_methods_with_lists(method, distname, args):\n npt.assert_allclose(result,\n [dist.pmf(*v) for v in zip(z, *p2, loc)],\n rtol=1e-15, atol=1e-15)\n+\n+\n+@pytest.mark.parametrize(\n+ 'dist, x, args',\n+ [\n+ ...
4c5d6ab3f9c3bdbf43688f8eb5c715c8fd1f6429
diff --git a/scipy/stats/_distn_infrastructure.py b/scipy/stats/_distn_infrastructure.py index 0691d0989697..0e120f5dcbac 100644 --- a/scipy/stats/_distn_infrastructure.py +++ b/scipy/stats/_distn_infrastructure.py @@ -3182,8 +3182,8 @@ def cdf(self, k, *args, **kwds): cond2 = (k >= _b) cond = cond0 &...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-13232@31029ee
scipy/scipy
Python
13,232
MAINT: stats: raise error when input to kruskal has >1 dim
#### Reference issue Closes gh-9981 #### What does this implement/fix? `scipy.stats.kruskal` only works on 1D arrays (and scalars), but this isn't documented, and no error is raised if this condition is not met. This PR adds a check that the samples have no more than 1 non-singleton dimension
2020-12-12T05:09:36Z
stats.kruskal : add a warning for an input with 2 or more columns <!-- Thank you for taking the time to report a SciPy issue. Please describe the issue in detail, and for bug reports fill in the fields below. You can delete the sections that don't apply to your issue. You can view the final output by clicking th...
I can confirm that the behavior is strange. When a 2D array goes in, it's not doing any of the things I might expect: ``` import numpy as np from scipy.stats import kruskal np.random.seed(0) x = np.random.rand(10, 2) print(kruskal(x, x)) # this is not the same as any of the following print(kruskal(x.ravel()...
[ { "body": "<!-- \r\nThank you for taking the time to report a SciPy issue.\r\nPlease describe the issue in detail, and for bug reports\r\nfill in the fields below. You can delete the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\n-->\r\n\r\...
ec0541e314785cbfe94a8f8be6d1a17f7116db39
{ "head_commit": "31029eef5b04fe4ea79556fee41119d0a2a8db19", "head_commit_message": "MAINT: stats: raise error when input to kruskal has >1 dim", "patch_to_review": "diff --git a/scipy/stats/stats.py b/scipy/stats/stats.py\nindex c3cd1f7818bb..46612d33b6cd 100644\n--- a/scipy/stats/stats.py\n+++ b/scipy/stats/sta...
[ { "diff_hunk": "@@ -7324,13 +7324,18 @@ def kruskal(*args, nan_policy='propagate'):\n \n \"\"\"\n args = list(map(np.asarray, args))\n+\n num_groups = len(args)\n if num_groups < 2:\n raise ValueError(\"Need at least two groups in stats.kruskal()\")\n \n for arg in args:\n if...
eb488214ea5edb12cb11a91c97d1a142c4f70987
diff --git a/scipy/stats/stats.py b/scipy/stats/stats.py index c3cd1f7818bb..da70a905ba77 100644 --- a/scipy/stats/stats.py +++ b/scipy/stats/stats.py @@ -7271,7 +7271,7 @@ def kruskal(*args, nan_policy='propagate'): ---------- sample1, sample2, ... : array_like Two or more arrays with the sample meas...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
scipy__scipy-13216@ca6d9b0
scipy/scipy
Python
13,216
TST: stats: break up and mark slow tests
#### Reference issue Closes gh-12132 #### What does this implement/fix? Skips some slow stats tests, including 16.43s call scipy/stats/tests/test_mstats_basic.py::test_kendall_p_exact_large (split up into medium and large) 1.64s call scipy/stats/tests/test_stats.py::TestKSTwoSamples::test_gh12218 1.50s ...
2020-12-09T04:42:11Z
Slow tests to be trimmed or moved to test('full') Running: ``` $ python -c "import scipy as s; s.test(extra_argv=['--durations=20'])" ``` on current master (`1.5.0.dev0+9f1addd`) gives: ``` ============================== slowest 20 test durations =============================== 19.01s call stats/tests/test_c...
We can now use the numpy pre-built wheels for arm. That will save some time. And in fact when you look at the slowest tests on CI the list changes a lot. Sure, both true - this is still worth doing though, tests shouldn't as long as the slowest ones here, and this help help both on CI and local development. The travisC...
[ { "body": "Running:\r\n```\r\n$ python -c \"import scipy as s; s.test(extra_argv=['--durations=20'])\"\r\n```\r\non current master (`1.5.0.dev0+9f1addd`) gives:\r\n```\r\n============================== slowest 20 test durations ===============================\r\n19.01s call stats/tests/test_continuous_basic...
77b491b11a5e111f5851025baf185d6e6870cc74
{ "head_commit": "ca6d9b01937f86dac71e04ed23e1d59fa949a09e", "head_commit_message": "TST: stats: break up and mark slow tests", "patch_to_review": "diff --git a/scipy/stats/tests/test_continuous_basic.py b/scipy/stats/tests/test_continuous_basic.py\nindex c37b86fa78da..45e086c657ab 100644\n--- a/scipy/stats/tests...
[ { "diff_hunk": "@@ -332,6 +332,14 @@ def test_kendalltau(self):\n 25, 80, 80, 80, 80, 80, 80, 0, 10, 45, np.nan, 0])\n result = mstats.kendalltau(x, y)\n assert_almost_equal(np.asarray(result), [-0.1585188, 0.4128009])\n+\n+ # test for namedtuple attributes\n+ ...
180f646d1855fa768646aae904de62dde60da513
diff --git a/scipy/stats/tests/test_continuous_basic.py b/scipy/stats/tests/test_continuous_basic.py index c37b86fa78da..45e086c657ab 100644 --- a/scipy/stats/tests/test_continuous_basic.py +++ b/scipy/stats/tests/test_continuous_basic.py @@ -45,9 +45,9 @@ ] -distslow = ['kstwo', 'ksone', 'kappa4', 'gausshyper', '...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
scipy__scipy-13292@9452ceb
scipy/scipy
Python
13,292
DOC: stats: note another common parameterization of nbinom
#### Reference issue gh-11465 (does not close) Closes gh-13287 Checks a box in gh-4538 #### What does this implement/fix? SciPy parameterized the negative binomial distribution in terms of the probability of success `p`. Another common parameterization of the negative binomial distribution is in terms of the me...
2020-12-24T08:43:58Z
Generate binomial CDF with mu instead of prob **Is your feature request related to a problem? Please describe.** The feature is related to a problem where I am unclear as to how to translate my data into parameters: `n` and `p` for `nbinom.cdf`. I am sort of lost translating R to Python here given different params: ...
statsmodels is supposed to have some functions to convert from GLM/Regression parameterization of negbin to the standard negbin. scipy avoids duplicating distributions with just changes in parameterization Wow thanks again for all your time and help. Are you able to help me better understand how I can determine `n` ...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nThe feature is related to a problem where I am unclear as to how to translate my data into parameters: `n` and `p` for `nbinom.cdf`. I am sort of lost translating R to Python here given different params:\r\n\r\n```\r\ntest_arr ...
c0aed3bceb49c1fc6ff286c05b1f9ba6924d37df
{ "head_commit": "9452ceb38e9d3a272c2c2fbc629057a71f7f1e91", "head_commit_message": "DOC: stats: fixup in nbinom", "patch_to_review": "diff --git a/scipy/stats/_discrete_distns.py b/scipy/stats/_discrete_distns.py\nindex 1fe26de158e8..b76e9d57a5f0 100644\n--- a/scipy/stats/_discrete_distns.py\n+++ b/scipy/stats/_...
[ { "diff_hunk": "@@ -258,8 +258,29 @@ class nbinom_gen(rv_discrete):\n for :math:`k \\ge 0`, :math:`0 < p \\leq 1`\n \n `nbinom` takes :math:`n` and :math:`p` as shape parameters where n is the\n- number of successes, :math:`p` is the probability of a single success, \n- and :math:`1-p` is the prob...
aba369de74fb364694cc1f0a7e1322dea76f6bdb
diff --git a/scipy/stats/_discrete_distns.py b/scipy/stats/_discrete_distns.py index 1f0ed3a88dbd..3fad2347b9c0 100644 --- a/scipy/stats/_discrete_distns.py +++ b/scipy/stats/_discrete_distns.py @@ -261,6 +261,26 @@ class nbinom_gen(rv_discrete): number of successes, :math:`p` is the probability of a single succes...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "New Feature Additions" }
scipy__scipy-13193@a21ab96
scipy/scipy
Python
13,193
MAINT: stats: chisquare check sum of observed/expected frequencies
#### Reference issue Closes gh-12282 #### What does this implement/fix? There was no check in `scipy.stats.chisquare` that the sum of observed frequencies matched the sum of expected frequencies. This PR raises an error if the two do not agree within a certain tolerance. #### Additional information The side e...
2020-12-02T21:40:57Z
API: stats.chisquare: must observed and expected frequencies add to same total? <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comm...
The two proposed changes sound reasonable to me and I can implement either. A third option, if this is a "feature", would be to change nothing about the way the test functions but to document why the test is performed the way it is. I don't have an informed opinion. As I said, the test output is nonsensical since the ...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
e177ccfc31862b824feac491bb1fc0d2877587b1
{ "head_commit": "a21ab9615f84180a82732545eaf4f52ade832543", "head_commit_message": "MAINT: stats: redefine relative difference in a more standard way", "patch_to_review": "diff --git a/scipy/stats/stats.py b/scipy/stats/stats.py\nindex 79e0930bad11..531724cf8d80 100644\n--- a/scipy/stats/stats.py\n+++ b/scipy/st...
[ { "diff_hunk": "@@ -6134,9 +6145,25 @@ def power_divergence(f_obs, f_exp=None, ddof=0, axis=0, lambda_=None):\n lambda_ = 1\n \n f_obs = np.asanyarray(f_obs)\n+ f_obs_float = f_obs.astype(np.float64)\n \n if f_exp is not None:\n- f_exp = np.asanyarray(f_exp)\n+ f_exp = _m_broadc...
f55260fe126b29bd9637b8723b54641375f6fb65
diff --git a/scipy/stats/stats.py b/scipy/stats/stats.py index 79e0930bad11..6b9ec4603e92 100644 --- a/scipy/stats/stats.py +++ b/scipy/stats/stats.py @@ -5966,6 +5966,13 @@ def _count(a, axis=None): return num +def _m_broadcast_to(a, shape): + if np.ma.isMaskedArray(a): + return np.ma.masked_array(n...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-13166@a290006
scipy/scipy
Python
13,166
ENH: stats: Add nan_policy to zmap.
The change moves the zscore code to zmap, with the obvious change at the end to compute the z-scores for `scores`. zscore is now just a one-liner that calls zmap. Closes gh-12403.
2020-11-29T15:20:48Z
Add nan_policy to stats.zmap `stats.zscore` has a `nan_policy`. `stats.zmap`, being an almost identical function, should probably have the same option. As an alternative, it might be better to refactor `zscore` in terms of `zmap`, as I think `zscore(x) == zmap(x, x)`.
@mdhaber, I see you added this to the list of stats issues to watch. After working on `zscore` recently, I started looking at `zmap`. As @chrism2671 pointed out, we can refactor the code so that all the work currently in `zscore` can be done in `zmap` instead, and `zscore` will just call `zmap`. I'll have a PR for t...
[ { "body": "`stats.zscore` has a `nan_policy`. `stats.zmap`, being an almost identical function, should probably have the same option.\r\n\r\nAs an alternative, it might be better to refactor `zscore` in terms of `zmap`, as I think `zscore(x) == zmap(x, x)`.\r\n", "number": 12403, "title": "Add nan_polic...
60dc9730d5652f0632cd43caef437f01a734e374
{ "head_commit": "a29000636b7a9bd2843034530ad78616042170b1", "head_commit_message": "ENH: stats: Add nan_policy to zmap.\n\nThe change moves the zscore code to zmap, with the obvious\nchange at the end to compute the z-scores for `scores`.\nzscore is now just a one-liner that calls zmap.\n\nCloses gh-12403.", "pa...
[ { "diff_hunk": "@@ -2614,10 +2592,36 @@ def zmap(scores, compare, axis=0, ddof=0):\n array([-1.06066017, 0. , 0.35355339, 0.70710678])\n \n \"\"\"\n- scores, compare = map(np.asanyarray, [scores, compare])\n- mns = compare.mean(axis=axis, keepdims=True)\n- sstd = compare.std(axis=axis...
7e64ca02e3e6ac1fd6f48eb7c4b00ca5f917ca09
diff --git a/scipy/stats/stats.py b/scipy/stats/stats.py index 79e0930bad11..917c4c7ac365 100644 --- a/scipy/stats/stats.py +++ b/scipy/stats/stats.py @@ -2457,7 +2457,7 @@ def _quiet_nanmean(x): return np.mean(y, keepdims=True) -def _quiet_nanstd(x): +def _quiet_nanstd(x, ddof=0): """ Compute na...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scipy__scipy-13036@ef7496c
scipy/scipy
Python
13,036
BUG: forward port lint_diff shims
Fixes #13030 * forward port the Travis CI shallow clone-related fixes required for `lint_diff.py` to run properly on backport PRs from gh-13028 * a better fix might happen with the Python module itself so that the module may be used within any CI service (or at least provide some kind of warning in the prese...
2020-11-03T21:49:58Z
BUG: lint_diff.py still fails for backport PRs Despite including gh-12974; see gh-13028: ``` $ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then python tools/lint_diff.py --branch $TRAVIS_BRANCH fi fatal: ambiguous argument 'maintenance/1.5.x': unknown revision or path not in the working tree. Use '--' to sepa...
I've pushed a small attempted fix into the backport PR for now; this almost certainly looks like an issue with Travis CI using shallow clones. If it works in the backport PR then I'll forward port the 1-liner.
[ { "body": "Despite including gh-12974; see gh-13028: \r\n\r\n```\r\n$ if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ]; then\r\n python tools/lint_diff.py --branch $TRAVIS_BRANCH\r\nfi\r\nfatal: ambiguous argument 'maintenance/1.5.x': unknown revision or path not in the working tree.\r\nUse '--' to separate paths...
f59666fe6cbdc7631e19fe2ae38ae135449c3fd2
{ "head_commit": "ef7496cfd45d9fb74410c477e5fe233447b7fcc5", "head_commit_message": "BUG: forward port lint_diff shims\n\n* forward port the Travis CI shallow clone-related\nfixes required for `lint_diff.py` to run properly\non backport PRs from gh-13028\n\n* a better fix might happen with the Python module\nitself...
[ { "diff_hunk": "@@ -40,7 +40,10 @@ matrix:\n - pycodestyle scipy benchmarks/benchmarks\n - |\n if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ]; then\n- python tools/lint_diff.py --branch $TRAVIS_BRANCH\n+ git fetch --unshallow\n+ git config remote.origi...
a6261f8970530cbbe3e9e7793fb37adc11e1c007
diff --git a/.travis.yml b/.travis.yml index bab8f7edc604..d4cfdb0cc3d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,10 @@ matrix: - pycodestyle scipy benchmarks/benchmarks - | if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - python tools/lint_diff.py --branch $TRAVIS...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-12989@3fdac55
scipy/scipy
Python
12,989
BUG: improved the stability of kde for highly (1000s) multi-dimension inputs
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-10-21T15:17:47Z
BUG: Highly multi-dimensional `gaussian_kde` giving `-inf` logpdf <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
9d60a26ed35dbab302daf4e23545f29a56a6d453
{ "head_commit": "3fdac550f56965a5d2fc1a62902a048e018c41fa", "head_commit_message": "account for lack of float96 setup in np.linalg", "patch_to_review": "diff --git a/scipy/stats/kde.py b/scipy/stats/kde.py\nindex 9015593bf61e..f0ff88c437c6 100644\n--- a/scipy/stats/kde.py\n+++ b/scipy/stats/kde.py\n@@ -569,7 +56...
[ { "diff_hunk": "@@ -569,7 +569,13 @@ def _compute_covariance(self):\n \n self.covariance = self._data_covariance * self.factor**2\n self.inv_cov = self._data_inv_cov / self.factor**2\n- self._norm_factor = sqrt(linalg.det(2*pi*self.covariance))\n+ itemsize = self.covariance.dtype.i...
9af9cf3df18fa2e395f9c6b68228eb7468bac9fd
diff --git a/scipy/stats/kde.py b/scipy/stats/kde.py index 9015593bf61e..3fc95931df7d 100644 --- a/scipy/stats/kde.py +++ b/scipy/stats/kde.py @@ -569,7 +569,8 @@ def _compute_covariance(self): self.covariance = self._data_covariance * self.factor**2 self.inv_cov = self._data_inv_cov / self.factor**...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-12936@c924af4
scipy/scipy
Python
12,936
MAINT: fix numerical precision in nct.stats
#### Reference issue Closes gh-12919 #### What does this implement/fix? For values of df > 344 the stats method of nct would raise runtime warnings and become nan unnecessarily. #### Additional information There are other known numerical issues with `nct` that ***are not*** fixed by this PR. For exam...
2020-10-11T20:11:41Z
BUG: numerical precision, use gammaln in nct.mean possible precision improvement, no bug yet I was looking at the mean for nct. I didn't find any problems in my examples with nct mean, but the gamma values were very large 1e60. using gammaln should improve precision `np.exp(special.gammaln(df/2.-0.5) - special....
ok bug, when it overflows ``` stats.nct.mean(1000, 2) nan ``` at df=1000, the gamma values are inf at df=350 it already overflows, mean is nan AFAIU: c11 should converge to 1 (roughly normal distribution limit of large df) ``` df = 10000 gfac = np.exp(special.gammaln(df/2.-0.5) - special.gammaln(df/2...
[ { "body": "possible precision improvement, no bug yet\r\n\r\nI was looking at the mean for nct.\r\nI didn't find any problems in my examples with nct mean, but the gamma values were very large 1e60.\r\n\r\nusing gammaln should improve precision\r\n`np.exp(special.gammaln(df/2.-0.5) - special.gammaln(df/2.))`\r\...
799b4fe5766eb433393e49816cbaa1e14955e64c
{ "head_commit": "c924af498758bed8b4591e3cacf64d7c802f87aa", "head_commit_message": "MAINT: fix numerical precision in nct.stats\n\n * for values of df > 344 the stats method\n of nct would raise runtime warnings and\n become nan unnecessarily.\n\nMAINT: add fix for df < 2 cases to nan\n\nUpdate scipy/stats/...
[ { "diff_hunk": "@@ -3429,14 +3429,39 @@ def test_variance_gh_issue_2401(self):\n \n def test_nct_inf_moments(self):\n # n-th moment of nct only exists for df > n\n+ m, v, s, k = stats.nct.stats(df=0.9, nc=0.3, moments='mvsk')\n+ assert_equal([m, v, s, k], [np.nan, np.nan, np.nan, np.na...
a1699b0a14bd3e49804f5389b154e8fa8ffead68
diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py index 48891e226fe8..5e4304b8e793 100644 --- a/scipy/stats/_continuous_distns.py +++ b/scipy/stats/_continuous_distns.py @@ -5912,12 +5912,12 @@ def _stats(self, df, nc, moments='mv'): # mu, mu2, g1, g2 = None, None, Non...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-12875@9c06b36
scipy/scipy
Python
12,875
BUG: segfault in ndimage.fourier_ellipsoid with length-1 dims
#### Reference issue Closes gh-12763 #### What does this implement/fix? Replaces a segmentation fault with a `ValueError`. The three python functions `ndimage.fourier_ellipsoid`, `fourier_gaussian` and `fourier_uniform` call the C function `NI_FourierFilter` in `ndimage/src/ni_fourier.c`. If the size of any of ...
2020-09-22T13:22:16Z
ndimage.fourier_ellipsoid segmentation fault On Scipy 1.5.2. Tested on mac and linux: ``` Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> x = np.ones((1,128)) >>> from scipy im...
This problem originates in the C file `ni_fourier.c`: https://github.com/scipy/scipy/blob/2850365e2e447b8e4c1d5ede5193afa5bc682804/scipy/ndimage/src/ni_fourier.c#L227-L229 For each dimension in the `input` array that has a size greater than 1 it allocates a buffer to store calculations. If the size of the dimensi...
[ { "body": "On Scipy 1.5.2. Tested on mac and linux:\r\n\r\n```\r\nPython 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) \r\n[GCC 7.3.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import numpy as np\r\n>>> x = np.ones((1,128))\r\n>>> from scipy impo...
8de4fa75b126416627978baaf137c05cb00f847e
{ "head_commit": "9c06b366168a78a57d2b8aea557dc9f21906988c", "head_commit_message": "BUG: avoid segfault in ndimage.fourier_ellipsoid with length-1 dims.\n\nCloses #12763.", "patch_to_review": "diff --git a/scipy/ndimage/src/ni_fourier.c b/scipy/ndimage/src/ni_fourier.c\nindex 700878305c45..a018e3641e67 100644\n-...
[ { "diff_hunk": "@@ -225,12 +225,10 @@ int NI_FourierFilter(PyArrayObject *input, PyArrayObject* parameter_array,\n params[kk] = NULL;\n }\n for (kk = 0; kk < PyArray_NDIM(input); kk++) {\n- if (PyArray_DIM(input, kk) > 1) {\n- params[kk] = malloc(PyArray_DIM(input, kk) * sizeof...
e1b918da336eda8335568e340915c6f491425743
diff --git a/scipy/ndimage/src/ni_fourier.c b/scipy/ndimage/src/ni_fourier.c index 700878305c45..c923cc3f4545 100644 --- a/scipy/ndimage/src/ni_fourier.c +++ b/scipy/ndimage/src/ni_fourier.c @@ -225,7 +225,7 @@ int NI_FourierFilter(PyArrayObject *input, PyArrayObject* parameter_array, params[kk] = NULL; }...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-12760@b6df6b2
scipy/scipy
Python
12,760
BUG: special: erfinv(x<<1) loses precision
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-08-23T08:32:05Z
BUG: special: erfinv(y) is inaccurate for small abs(y). `erfinv(y)` is implemented as `ndtri(0.5 * (y+1)) * NPY_SQRT1_2` (where `NPY_SQRT1_2` is `1/sqrt(2)`). This limits the precision that can be obtained for small `abs(y)`, because for any `y` such that `abs(y)` is less than ~1e-16, `y + 1` is `1`. So, for example,...
[ { "body": "`erfinv(y)` is implemented as `ndtri(0.5 * (y+1)) * NPY_SQRT1_2` (where `NPY_SQRT1_2` is `1/sqrt(2)`). This limits the precision that can be obtained for small `abs(y)`, because for any `y` such that `abs(y)` is less than ~1e-16, `y + 1` is `1`. So, for example, `erfinv(1e-20)` returns 0, but the c...
da02c95d594ad260a30942bfa6d4ec49671c1ee8
{ "head_commit": "b6df6b2ae3ed0fc8c910d91d1499c208eb6e68e4", "head_commit_message": "TST: special: roundtrip erf(erfinv(x<<1))", "patch_to_review": "diff --git a/scipy/special/cephes/erfinv.c b/scipy/special/cephes/erfinv.c\nindex 4bdbc5c725aa..28f180f7d59f 100644\n--- a/scipy/special/cephes/erfinv.c\n+++ b/scipy...
[ { "diff_hunk": "@@ -57,3 +57,19 @@ def test_literal_values(self):\n )\n def test_domain_bounds(self, f, x, y):\n assert_equal(f(x), y)\n+\n+ def test_erfinv_asympt(self):\n+ # regression test for gh-12758: erfinv(x) loses precision at small x\n+ # This test checks erfinv against...
c9bfacab562c13adf6e625eefa6844af0a91da0d
diff --git a/scipy/special/cephes/erfinv.c b/scipy/special/cephes/erfinv.c index 4bdbc5c725aa..28f180f7d59f 100644 --- a/scipy/special/cephes/erfinv.c +++ b/scipy/special/cephes/erfinv.c @@ -17,6 +17,17 @@ double erfinv(double y) { const double domain_lb = -1; const double domain_ub = 1; + const double t...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-12605@a8eeea1
scipy/scipy
Python
12,605
BUG: correct `np.asanyarray` use in `scipy.constants.lambda2nu`
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-07-22T21:01:18Z
unintuitive conversion in `scipy.constants.lambda2nu` Instead of converting the input with `np.asanyarray`, the const float speed of light is converted. It is working fine but it would be more intuitive when the argument gets converted (as it is done in `nu2lambda`). However, it is questionable if these functions do ...
[ { "body": "Instead of converting the input with `np.asanyarray`, the const float speed of light is converted.\r\nIt is working fine but it would be more intuitive when the argument gets converted (as it is done in `nu2lambda`).\r\nHowever, it is questionable if these functions do serve any benefit.\r\nFurthermo...
0765482e9a7cd7a7975f6161d2ab91994762ac8e
{ "head_commit": "a8eeea1268499ff8fae22a45a871238652d55782", "head_commit_message": "add testing lists for `lambda2nu` and `nu2lambda`", "patch_to_review": "diff --git a/scipy/constants/constants.py b/scipy/constants/constants.py\nindex 3ee960b83a37..6f61c88b8e9e 100644\n--- a/scipy/constants/constants.py\n+++ b/...
[ { "diff_hunk": "@@ -27,9 +27,9 @@ def test_convert_temperature():\n \n \n def test_lambda_to_nu():\n- assert_equal(sc.lambda2nu(sc.speed_of_light), 1)\n+ assert_equal(sc.lambda2nu([sc.speed_of_light, 1]), [1, sc.speed_of_light])\n \n \n def test_nu_to_lambda():\n- assert_equal(sc.nu2lambda(1), sc.speed...
2b8f1f765e0dbe0bf060045e3dc0e47c0f386e2c
diff --git a/scipy/constants/constants.py b/scipy/constants/constants.py index 3ee960b83a37..6f61c88b8e9e 100644 --- a/scipy/constants/constants.py +++ b/scipy/constants/constants.py @@ -273,7 +273,7 @@ def lambda2nu(lambda_): array([ 2.99792458e+08, 1.00000000e+00]) """ - return _np.asanyarray(c) / l...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
scipy__scipy-12602@9b99cab
scipy/scipy
Python
12,602
BUG: add const for Read-only views in interpnd.pyx
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-07-22T11:59:50Z
LinearNDInterpolator raises ValueError when value array has writeable=False flag. LinearNDInterpolator and CloughToucher2DInterppolator raise ValueError when value array has writeable=False flag. This is unanticipated and undocumented. Suggest that documentation or code should be changed. Given that they work with writ...
A similar issue arises with CloughToucher2DInterpolator, but with instantiation: ``` import numpy as np from scipy.interpolate import LinearNDInterpolator, CloughTocher2DInterpolator print(70*'*') print('CloughTocher2DInterpolator') xs = np.arange(0, 4, dtype=float) xs, ys = np.meshgrid(xs, xs) values = np....
[ { "body": "LinearNDInterpolator and CloughToucher2DInterppolator raise ValueError when value array has writeable=False flag. This is unanticipated and undocumented. Suggest that documentation or code should be changed. Given that they work with writeable\r\narrays, other bugs might result as well such as side-e...
102cfa6cc55ece537fe5b0b72a7aae63c877b3b2
{ "head_commit": "9b99cab6b9e21ef587742778d51440d187858d57", "head_commit_message": "add const for Read-only views in interpnd.pyx and add a test", "patch_to_review": "diff --git a/scipy/interpolate/interpnd.pyx b/scipy/interpolate/interpnd.pyx\nindex 44707e11b93c..dac18d95cff7 100644\n--- a/scipy/interpolate/int...
[ { "diff_hunk": "@@ -2613,6 +2613,29 @@ def test_broadcastable_input(self):\n interp_points3.size ==\n interp_points4.size, True)\n \n+ def test_read_only(self):\n+ # input data\n+ np.random.seed(0)\n+ x = np.random.random(10)\n+ y ...
f7d1611fa071b8deed7b4ddfe733b813c8aaf34e
diff --git a/scipy/interpolate/interpnd.pyx b/scipy/interpolate/interpnd.pyx index 44707e11b93c..13ecbf875304 100644 --- a/scipy/interpolate/interpnd.pyx +++ b/scipy/interpolate/interpnd.pyx @@ -256,10 +256,10 @@ class LinearNDInterpolator(NDInterpolatorBase): @cython.boundscheck(False) @cython.wraparound(F...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-12385@38d5cf1
scipy/scipy
Python
12,385
DOC: improve docstrings of interpolate.NearestNDInterpolator.__call__ & LinearNDInterpolator.__call__
#### Reference issue fix #12378 #### What does this implement/fix? I improved docstrings `interpolate.NearestNDInterpolator.__call__` & `LinearNDInterpolator.__call__`. Because, these functions also accepts ndim broadcastible arrays as an argument.
2020-06-19T12:19:37Z
interpolate.NearestNDInterpolator.__call__ & LinearNDInterpolator.__call__ documentation Documentation states that __call__ method takes a single argument xi as an array of points with shape=(..., ndim), but the __call__ method also accepts ndim broadcastible arrays as an argument. This capability stems from code line:...
That behavior is implemented, but it's untested as far as I can tell. Using scalars as input (as in the given example, `interp(3, 3, 3, 3)`) doesn't seem like a good use case, because that adds very little. I can see how it would help if one has a set of 1-D arrays (say `x`, `y`, `z`) for a n-D set of points. So I t...
[ { "body": "Documentation states that __call__ method takes a single argument xi as an array of points with shape=(..., ndim), but the __call__ method also accepts ndim broadcastible arrays as an argument. This capability stems from code line:\r\n\r\n`xi = _ndim_coords_from_arrays(args, ndim=self.points.shape[1]...
7022ef5dd4935a7664f230b6af17bdb4f834e1eb
{ "head_commit": "38d5cf10221f569063744c1bdaab81c6699d07d6", "head_commit_message": "add test_broadcastable_input and fix typos.", "patch_to_review": "diff --git a/scipy/interpolate/interpnd.pyx b/scipy/interpolate/interpnd.pyx\nindex 4941d308daf5..e94ba5830f8d 100644\n--- a/scipy/interpolate/interpnd.pyx\n+++ b/...
[ { "diff_hunk": "@@ -2581,6 +2582,32 @@ def test_fillvalue_type(self):\n RegularGridInterpolator(points, values)\n RegularGridInterpolator(points, values, fill_value=0.)\n \n+ def test_broadcastable_input(self):\n+ # input data\n+ np.random.seed(0)\n+ x = np.random.random(...
a9013131710c1868870eea66e545c4ca075a796b
diff --git a/scipy/interpolate/interpnd.pyx b/scipy/interpolate/interpnd.pyx index 4941d308daf5..44707e11b93c 100644 --- a/scipy/interpolate/interpnd.pyx +++ b/scipy/interpolate/interpnd.pyx @@ -133,8 +133,10 @@ class NDInterpolatorBase(object): Parameters ---------- - xi : ndarray of float, ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scipy__scipy-12434@8504611
scipy/scipy
Python
12,434
ENH:linalg: Add LAPACK wrappers pptrf/pptrs/ppsv/pptri/ppcon
As title mentions. Closes #12431
2020-06-26T23:46:39Z
Request for Python wrapper for LAPACK's ?pptrf (Cholesky factorization in packed format) **Is your feature request related to a problem? Please describe.** scipy.linalg.lapack already has wrappers for ?tpsv (triangular solve in packed format). ?pptrf (Cholesky factorization in packed format) seems to be a common en...
@anntzer consider adding items for all wrappers you want? - [ ] `?pptrf` - [ ] `?ZZZZ` etc. in that way one can have more in one. (Right now that's the only one I need, but I will add more as needed :))
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nscipy.linalg.lapack already has wrappers for ?tpsv (triangular solve in packed format). ?pptrf (Cholesky factorization in packed format) seems to be a common enough function that can be used to generate the matrix passed to ?t...
e4238172b1925e1bf6a554678fd765553f0e069c
{ "head_commit": "8504611b6554a83f9858844ba863ea7d70a088c0", "head_commit_message": "ENH:linalg: Add wrappers pptrf/pptrs/ppsv", "patch_to_review": "diff --git a/scipy/linalg/flapack_other.pyf.src b/scipy/linalg/flapack_other.pyf.src\nindex 39c3ac7a2365..c1567b6c49c1 100644\n--- a/scipy/linalg/flapack_other.pyf.s...
[ { "diff_hunk": "@@ -2923,3 +2924,29 @@ def test_ptsvx_NAG(d, e, b, x):\n df, ef, x_ptsvx, rcond, ferr, berr, info = ptsvx(d, e, b)\n # determine ptsvx's solution and x are the same.\n assert_array_almost_equal(x, x_ptsvx)\n+\n+\n+@pytest.mark.parametrize('dtype', DTYPES)", "line": 2930, "ori...
510652f21d20dc78292988d2c3199ce9c65535db
diff --git a/scipy/linalg/flapack_other.pyf.src b/scipy/linalg/flapack_other.pyf.src index 39c3ac7a2365..5619ec1ab9c6 100644 --- a/scipy/linalg/flapack_other.pyf.src +++ b/scipy/linalg/flapack_other.pyf.src @@ -1170,6 +1170,112 @@ subroutine <prefix>gglse_lwork(m,n,p,a,lda,b,ldb,c,d,x,work,lwork,info) end subroutine...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-12476@ea7bb36
scipy/scipy
Python
12,476
ENH: add IIR comb filter to scipy.signal
#### Reference issue Closes #11558 #### What does this implement/fix? Implements IIR notching and peaking comb filters in the scipy.signal module.
2020-07-02T22:31:05Z
ENH: IIR comb filter **Describe the solution you'd like** I think it would be very useful to support the design of IIR comb filters. **Describe alternatives you've considered** The only alternative I could think of would be the use of multiple IIR notch filters, but doesn't seem like a great idea.
I think this is a reasonable feature request. Would you be interested in putting together a PR for this? Incidentally, I notice that the current peak and notch design functions only output TF form, these should get zpk and sos output options as well. Happy to give it a go. Likely that I will need some help at some p...
[ { "body": "**Describe the solution you'd like**\r\nI think it would be very useful to support the design of IIR comb filters. \r\n\r\n**Describe alternatives you've considered**\r\nThe only alternative I could think of would be the use of multiple IIR notch filters, but doesn't seem like a great idea.", "nu...
f2f10b043aa4042bf0db833cc30448bb4e1f8d00
{ "head_commit": "ea7bb36f374af72c1b7c19d3e8c9201f95925d81", "head_commit_message": "ENH: add IIR comb filter to scipy.signal", "patch_to_review": "diff --git a/scipy/signal/__init__.py b/scipy/signal/__init__.py\nindex 97a49f73f6a3..66944e1c35a6 100644\n--- a/scipy/signal/__init__.py\n+++ b/scipy/signal/__init__...
[ { "diff_hunk": "@@ -3611,6 +3611,83 @@ def test_fs_param(self):\n assert_allclose(abs(hp[2]), 1, rtol=1e-10)\n \n \n+class TestIIRComb(object):\n+ # Test erroneus input cases\n+ def test_invalid_input(self):\n+ # w0 is <= 0 or >= fs / 2\n+ fs = 1000\n+ with pytest.raises(Value...
9c1116a50915457184f73dfef2302f657fa2a0b3
diff --git a/scipy/signal/__init__.py b/scipy/signal/__init__.py index 97a49f73f6a3..436498431f2d 100644 --- a/scipy/signal/__init__.py +++ b/scipy/signal/__init__.py @@ -159,6 +159,7 @@ bessel -- Bessel (no order selection available -- try butterod) iirnotch -- Design second-order IIR notch digital filter...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-12375@06c1770
scipy/scipy
Python
12,375
ENH: Add fast path for minkowski distance with p=1,2 and support p=inf
I noticed that `spatial.distance_matrix(x, y)` was much faster than `spatial.distance.cdist(x, y, metric='minkowski')`. But only when `p` is left at the default of two. I'm guessing NumPy special cases `x**2` and turns it into `x*x`. This special cases `p=2` and `p=1` in `cdist` and `pdist` so that it doesn't use `p...
2020-06-17T12:40:03Z
cdist behavior with Minkowsky and np.inf Using `scipy.spatial.distance.cdist` with the Minkowski distance and `p=np.inf` does not produce expected result. In particular, I'm not sure how `cdist` is producing all distance of only 1's (see Minkowski below). Using Chebyshev distance produce expected results, but they shou...
The reason it returns incorrect results are because the implemntation doesn't special-case ``p=np.inf``, and so ends up raising every distance to the zero power; see the implementation here: https://github.com/scipy/scipy/blob/5e22b2e447cec5588fb42303a1ae796ab2bf852d/scipy/spatial/src/distance_impl.h#L338-L349 Tw...
[ { "body": "Using `scipy.spatial.distance.cdist` with the Minkowski distance and `p=np.inf` does not produce expected result. In particular, I'm not sure how `cdist` is producing all distance of only 1's (see Minkowski below). Using Chebyshev distance produce expected results, but they should be equivalent for $...
c2da12b1bc4a62a985658e04b9c0777c0e34cf5a
{ "head_commit": "06c1770ac0410482b2cf2ac034e27998a89b7011", "head_commit_message": "ENH: Add fast path for minkowski distance with p=1,2", "patch_to_review": "diff --git a/benchmarks/benchmarks/spatial.py b/benchmarks/benchmarks/spatial.py\nindex 4fb18ce8a47b..b537a6068b42 100644\n--- a/benchmarks/benchmarks/spa...
[ { "diff_hunk": "@@ -347,24 +347,26 @@ class Xdist(Benchmark):\n def setup(self, num_points, metric):\n np.random.seed(123)\n self.points = np.random.random_sample((num_points, 3))\n- # use an equal weight vector to satisfy those metrics\n- # that require weights\n- if me...
b3b16721876119d22ee4c4a9387834956a16fbf5
diff --git a/benchmarks/benchmarks/spatial.py b/benchmarks/benchmarks/spatial.py index 4fb18ce8a47b..73cf8893042b 100644 --- a/benchmarks/benchmarks/spatial.py +++ b/benchmarks/benchmarks/spatial.py @@ -341,30 +341,34 @@ class Xdist(Benchmark): 'seuclidean', 'sqeuclidean', 'cosine', 'correlation', 'hamming', 'jacc...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-12159@42f85a9
scipy/scipy
Python
12,159
BUG: Fix length calculation in upfirdn
Closes #9844. Implements the suggestion implemented in that issue by @grlee77 and @sirtom67, except I kept `ceil` instead of floor as now the length matches both the naive `upfirdn` calculation with `np.convolve` and slicing, as well as MATLAB outputs (calculated and put in the test). Also refactors a few tests t...
2020-05-18T17:13:48Z
scipy.signal.upfirdn gives different length matrix versus MATLAB upfirdn This is something I am not sure is a bug, a mistake in my code, or just a difference in design or implementation. Now everything before my call to upfirdn looks to be the same in both languages, floating point precision notwithstanding. So I ge...
So right now I'm just deleting those trailing zeros. It seems like in all the cases I've tried, I always get four of them. I don't know where they're coming from, but I'm using np.delete to remove them. Best I've got right now. I'd love to understand why there are differences between the Scipy and MATLAB methods. I wou...
[ { "body": "This is something I am not sure is a bug, a mistake in my code, or just a difference in design or implementation.\r\n\r\nNow everything before my call to upfirdn looks to be the same in both languages, floating point precision notwithstanding. So I get to this call:\r\n\r\nMATLAB:\r\n>y = upfirdn(x,h...
9f61c6530c994d020e51fc176f67c93ffb4e07a8
{ "head_commit": "42f85a977cee9080c2800d59a2a9671f741e6348", "head_commit_message": "BUG: Better protection", "patch_to_review": "diff --git a/scipy/signal/_upfirdn.py b/scipy/signal/_upfirdn.py\nindex 578fb1772415..c449a40ed6ba 100644\n--- a/scipy/signal/_upfirdn.py\n+++ b/scipy/signal/_upfirdn.py\n@@ -70,8 +70,...
[ { "diff_hunk": "@@ -63,14 +63,15 @@ def _output_len(np.intp_t len_h,\n np.intp_t up,\n np.intp_t down):\n \"\"\"The output length that results from a given input\"\"\"\n- cdef np.intp_t nt\n- cdef np.intp_t in_len_copy\n- in_len_copy = in_len + (len_h + (-len_h % up)...
75f96e77d1f603c38b744b158367f4226976f966
diff --git a/scipy/signal/_upfirdn.py b/scipy/signal/_upfirdn.py index 578fb1772415..c449a40ed6ba 100644 --- a/scipy/signal/_upfirdn.py +++ b/scipy/signal/_upfirdn.py @@ -70,8 +70,9 @@ def _check_mode(mode): class _UpFIRDn(object): + """Helper for resampling.""" + def __init__(self, h, x_dtype, up, down): ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11820@2863346
scipy/scipy
Python
11,820
ENH: Raise an error on incorrect bounds format in optimize.fmin_l_bfgs_b
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-04-07T19:20:01Z
optimize.fmin_l_bfgs_b needs bound check and appropiate error message <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and w...
Hello, I'd like to tackle this issue. I'm in favor of raising an exception. It will help in debugging, if user used incorrect bounds(since in documentation it's specified as `(min, max)`). Does anyone have a reason to use another approach instead? My preference would be for a neat way of fixing the bounds, possibly lo...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
3fc8aec56d5378fd191dbcea294219147bd93ccc
{ "head_commit": "286334628ec202f550e701a8a3e36c5db410863a", "head_commit_message": "ENH: Raise an error on incorrect bounds format in optimize.fmin_l_bfgs_b", "patch_to_review": "diff --git a/scipy/optimize/lbfgsb.py b/scipy/optimize/lbfgsb.py\nindex 87b1a5251276..5925136e9814 100644\n--- a/scipy/optimize/lbfgsb...
[ { "diff_hunk": "@@ -1145,6 +1145,17 @@ def test_l_bfgs_b_bounds(self):\n assert_(d['warnflag'] == 0, d['task'])\n assert_allclose(x, self.solution, atol=1e-6)\n \n+ @pytest.mark.parametrize('bounds', [\n+ ([(10, 1), (1, 10)]),\n+ ([(1, 10), (10, 1)]),\n+ ([(10, 1), (10, 1...
10eec9a7644b168a74b000c12aa516e5b1e081f8
diff --git a/scipy/optimize/lbfgsb.py b/scipy/optimize/lbfgsb.py index 87b1a5251276..f06982e6e5bc 100644 --- a/scipy/optimize/lbfgsb.py +++ b/scipy/optimize/lbfgsb.py @@ -288,6 +288,11 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None, # LBFGSB is sent 'old-style' bounds, 'new-style' bounds are requi...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-13054@71aa8f5
scipy/scipy
Python
13,054
BUG: fix `scipy.optimize.show_options` for unknown methods. and add *_METHODS list for each solver script and fix show_options doc
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-11-09T12:29:30Z
BUG: optimize: methods unknown to `scipy.optimize.show_options` Some `scipy.optimize.minimize` and `scipy.optimize.linprog` solvers aren't known to `scipy.optimize.show_options`. #### Reproducing code example: <!-- If you place your code between the triple backticks below, it will be rendered as a code block. ...
This can be fixed by adding the required information to [`optimize.py` `show_options`](https://github.com/scipy/scipy/blob/master/scipy/optimize/optimize.py). Should probably add a test like: ``` solver_methods = {'linprog':['simplex', 'revised simplex', 'interior-point']} for solver, methods in solver_methods.i...
[ { "body": "Some `scipy.optimize.minimize` and `scipy.optimize.linprog` solvers aren't known to `scipy.optimize.show_options`.\r\n\r\n#### Reproducing code example:\r\n<!-- \r\nIf you place your code between the triple backticks below, \r\nit will be rendered as a code block. \r\n-->\r\n\r\n```\r\nfrom scipy.opt...
2a1dc2ae8d2c944209f3053d1285dbe5edaff6cc
{ "head_commit": "71aa8f54b9a8cee76230e7df716a69c2bbae73c9", "head_commit_message": "fix lint error", "patch_to_review": "diff --git a/scipy/optimize/_linprog.py b/scipy/optimize/_linprog.py\nindex 1d9ca90d7bed..dbe0d21b3e34 100644\n--- a/scipy/optimize/_linprog.py\n+++ b/scipy/optimize/_linprog.py\n@@ -31,6 +31,...
[ { "diff_hunk": "@@ -31,6 +31,8 @@\n \n __docformat__ = \"restructuredtext en\"\n \n+LINPROG_METHODS = ['simplex', 'revised simplex', 'interior-point']", "line": null, "original_line": 34, "original_start_line": null, "path": "scipy/optimize/_linprog.py", "start_line": null, "text": "@use...
f14aa3ca28703f2bd95d6b3ebe8c18602ca1a40e
diff --git a/scipy/optimize/_linprog.py b/scipy/optimize/_linprog.py index cd15e6723496..64dd1c0ac6e2 100644 --- a/scipy/optimize/_linprog.py +++ b/scipy/optimize/_linprog.py @@ -35,6 +35,8 @@ __docformat__ = "restructuredtext en" +LINPROG_METHODS = ['simplex', 'revised simplex', 'interior-point', 'highs', 'highs-...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11954@b362e3a
scipy/scipy
Python
11,954
ENH: improve ARGUS rv generation in scipy.stats
#### Reference issue Closes #11699 #### What does this implement/fix? Follow-up PR to #11188 that improves performance of the ARGUS rvs method. Fixes numerical issues in `argus.rvs` if shape parameter chi is small #### Additional information The performance is improved for chi > 1.8 (direct transformation of G...
2020-04-27T20:58:07Z
Numerical issues in stats.argus for small shape parameters Some methods of stats.argus do not work for very small values of the shape parameter chi. #### Reproducing code example: Example involving the cdf: ``` stats.argus.cdf(0.5, 1e-3) # 0.35048001182184085 stats.argus.cdf(0.5, 1e-4) # 0.3505843071786311 ...
Looks like it's caused by subtractive cancellation in `_argus_phi`. @chrisb83 Do you have thoughts on how to fix it? @mdhaber > Do you have thoughts on how to fix it? yes, I am working on it. `argus_phi` behaves like `const * chi**3` for small `chi`. this approximation should be useful to fix the issue. the p...
[ { "body": "Some methods of stats.argus do not work for very small values of the shape parameter chi.\r\n\r\n#### Reproducing code example:\r\n\r\nExample involving the cdf:\r\n\r\n```\r\nstats.argus.cdf(0.5, 1e-3) # 0.35048001182184085\r\nstats.argus.cdf(0.5, 1e-4) # 0.3505843071786311\r\nstats.argus.cdf(0.5, 1...
71dcdbe717cc455cd9073c8183cda461a21ebd7f
{ "head_commit": "b362e3ac1261a986e3e6fb4c01c08652810656e2", "head_commit_message": "MAINT: improve comments on ARGUS sampling approach (reviewer feedback)\n\nCo-authored-by: Matt Haberland <mhaberla@calpoly.edu>", "patch_to_review": "diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns...
[ { "diff_hunk": "@@ -9124,76 +9123,88 @@ def _rvs(self, chi, size=None, random_state=None):\n return out\n \n def _rvs_scalar(self, chi, numsamples=None, random_state=None):\n- # if chi <= 2.611:\n+ # if chi <= 1.8:\n # use rejection method, see Devroye:\n # Non-Uniform ...
a30eb02a15813c453ed9dedc6e9acd549d652bfd
diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py index 0c92eb9c96f4..5a9cf5c863e6 100644 --- a/scipy/stats/_continuous_distns.py +++ b/scipy/stats/_continuous_distns.py @@ -21,7 +21,6 @@ import scipy.special._ufuncs as scu from scipy._lib._util import _lazyselect, _lazywhere from . ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-11753@2293ddf
scipy/scipy
Python
11,753
ENH: add input validation for dendrogram and a test.
#### Reference issue To fix #11492 #### What does this implement/fix? add input validation of Z and labels dimension consistency for dendrogram and a test.
2020-03-30T03:25:16Z
Confusing dendrogram labelling <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in the output. --> `sci...
This is a small issue - it would be nice to have input validation for the `labels` keyword (as well as for other keywords probably), but basically this is user error (providing the wrong length input for `labels`). EDIT: it's not even a bug, because the needed length for `labels` is clearly specified in the docstrin...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
b818978f3580e05a3885006cae337f28bd2aaf7d
{ "head_commit": "2293ddfc34499f1bc20537a3b0e46434f6448e45", "head_commit_message": "ENH: add input validation for dendrogram and a test.", "patch_to_review": "diff --git a/scipy/cluster/hierarchy.py b/scipy/cluster/hierarchy.py\nindex fc4bec5e93ae..0f64927c41ba 100644\n--- a/scipy/cluster/hierarchy.py\n+++ b/sci...
[ { "diff_hunk": "@@ -3093,6 +3093,8 @@ def dendrogram(Z, p=30, truncate_mode=None, color_threshold=None,\n -sized list (or tuple). The ``labels[i]`` value is the text to put\n under the :math:`i` th leaf node only if it corresponds to an original\n observation and not a non-singleton clus...
bb0604433f91b009194d136ab4b5790c58cfe5e7
diff --git a/scipy/cluster/hierarchy.py b/scipy/cluster/hierarchy.py index fc4bec5e93ae..c0bd0999487d 100644 --- a/scipy/cluster/hierarchy.py +++ b/scipy/cluster/hierarchy.py @@ -3089,10 +3089,10 @@ def dendrogram(Z, p=30, truncate_mode=None, color_threshold=None, labels : ndarray, optional By default, ...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-11809@7b639db
scipy/scipy
Python
11,809
Duplicate entries are added together in csr_matrix constructor
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-04-06T13:10:18Z
Document implicit sum in csr_matrix() constructor <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in the o...
This is indeed the intended behavior, and it's documented (albeit not very prominently) here: https://docs.scipy.org/doc/scipy/reference/sparse.html#example-2 I agree that we should make this more prominent in the docs. I think, it will be ok if you add notice right to https://docs.scipy.org/doc/scipy/reference/gen...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
9eb4f55c619addc6ce29318e076c2481ecdfc909
{ "head_commit": "7b639db872d3b9bdb3207ea54b882dd5e28b3554", "head_commit_message": "Duplicate entries are added together in csr_matrix", "patch_to_review": "diff --git a/scipy/sparse/csr.py b/scipy/sparse/csr.py\nindex 86869f8e43c1..8ab81633c53b 100644\n--- a/scipy/sparse/csr.py\n+++ b/scipy/sparse/csr.py\n@@ -1...
[ { "diff_hunk": "@@ -100,6 +100,16 @@ class csr_matrix(_cs_matrix):\n [0, 0, 3],\n [4, 5, 6]])\n \n+ Duplicate entries are summed together:\n+\n+ >>> row = np.array(0, 1, 2, 0)", "line": null, "original_line": 105, "original_start_line": null, "path": "scipy/sparse/csr...
be7a2e7834c31443c0f88de08678007c4a003fb0
diff --git a/scipy/sparse/csr.py b/scipy/sparse/csr.py index 86869f8e43c1..f6316a376d01 100644 --- a/scipy/sparse/csr.py +++ b/scipy/sparse/csr.py @@ -100,6 +100,16 @@ class csr_matrix(_cs_matrix): [0, 0, 3], [4, 5, 6]]) + Duplicate entries are summed together: + + >>> row = np.array([0,...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scipy__scipy-13899@4a6c737
scipy/scipy
Python
13,899
ENH: stats: add general permutation hypothesis test
#### Reference issue <!--Example: Closes gh-WXYZ.--> gh-4824 - this PR is a generalization of that PR to a user-provided statistic of any number of samples gh-4399 - probably closes this (see "Additional Information") gh-4519 - supersedes that PR (see "Additional Information") gh-13263 - in a followup PR, this fun...
2021-04-19T18:44:44Z
Incorporating in fast permutation tests Recently, I've been developing fast permutation tests that can make use of numpy/scipy matrix operations. So far, I have developed 3 permutation tests: a mean test, a t-test and a pearson correlation test. To get an idea for the timings, I've benchmarked the mean test to a naiv...
@mortonjt I don't quite understand what the difference is between the tests with the same names that are already in `scipy.stats`. Can you elaborate? And do you have them up on Github somewhere already? I really appreciate the response. I've add the code a simple test case to the following code https://github.com/mor...
[ { "body": "Recently, I've been developing fast permutation tests that can make use of numpy/scipy matrix operations.\n\nSo far, I have developed 3 permutation tests: a mean test, a t-test and a pearson correlation test.\n\nTo get an idea for the timings, I've benchmarked the mean test to a naive implementation ...
393a05ee927883ad6316b7092c851afea8f16816
{ "head_commit": "4a6c7374929c518f478f863bae3cdb923ebe6e10", "head_commit_message": "DOC: stats: fixes/improvements to docstring per review\n\n[skip azp] [skip actions]", "patch_to_review": "diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py\nindex f410f5410d25..cbd02bf331c0 100644\n--- a/scipy/stats/...
[ { "diff_hunk": "@@ -1393,3 +1396,692 @@ def cramervonmises_2samp(x, y, method='auto'):\n p = max(0, 1. - _cdf_cvm_inf(tn))\n \n return CramerVonMisesResult(statistic=t, pvalue=p)\n+\n+\n+attributes = ('statistic', 'pvalue', 'null_distribution')\n+PermutationTestResult = make_dataclass('Permutati...
c79170a99dac0d2263e771a60f615b75c80e8b32
diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py index f643c3d5ccb8..971c45d3c8f8 100644 --- a/scipy/stats/__init__.py +++ b/scipy/stats/__init__.py @@ -301,6 +301,7 @@ combine_pvalues jarque_bera page_trend_test + permutation_test tukey_hsd .. autosummary:: diff --git a/scipy/stats/_...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scipy__scipy-14476@affdc4d
scipy/scipy
Python
14,476
BUG: levy_stable _fitstart fixes
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2021-07-25T17:39:06Z
levy_stable._fitstart() incorrect parameter estimates for negative beta, negative loc, or alpha==1 <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. N...
The issues all occur in the last few lines of _fitstart(). The first three issues are fixed in the code snippet below, though the issue remains with trying to return an arbitrarily large negative location parameter when alpha==1. I haven't tracked down the relevant reference to determine what value should be returned...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
c4829bddb859ffe5716a88f6abd5e0d2dc1d9045
{ "head_commit": "affdc4d54142cdcfedcfa06e1185c2ed0441c36c", "head_commit_message": "Update _continuous_distns.py\n\nFix estimate of alpha when beta < 0, and allow negative values of loc (delta)", "patch_to_review": "diff --git a/scipy/stats/_continuous_distns.py b/scipy/stats/_continuous_distns.py\nindex 1a97039...
[ { "diff_hunk": "@@ -0,0 +1,91 @@\n+# Test scipy.stats.levy_stable._fitstart().\n+\n+import numpy as np\n+import pytest\n+\n+from scipy.stats import levy_stable\n+from scipy.stats import rv_continuous as rvc\n+\n+class TestLevy_stable:\n+ def test_neg_beta(self):\n+ # Confirm that _fitstart() gets same...
bea64a083bf37e55a92fe826ebd0f42a8b13ba07
diff --git a/scipy/stats/_levy_stable/__init__.py b/scipy/stats/_levy_stable/__init__.py index e1aaedb77ed9..68660802b7d1 100644 --- a/scipy/stats/_levy_stable/__init__.py +++ b/scipy/stats/_levy_stable/__init__.py @@ -578,6 +578,11 @@ def _fitstart_S1(data): psi_1 = interpolate.interp2d( nu_beta_range, n...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11741@c8b1e87
scipy/scipy
Python
11,741
BUG: fix small tolerances handling for minpack and add a test.
#### Reference issue fix #11572 #### What does this implement/fix? fix small tolerances handling for minpack and add a test. #### Additional information The root cause of this issue is that, minimum tolerance of minpack is bigger than computer EPS. In my environment, EPS is 2e-16, but minpack cannot handle t...
2020-03-29T00:08:17Z
least_squares: too small tolerances not catched with method='lm' <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't ...
@Gattocrucco What if you try to fix it? It looks like a good easy issue to become familiar with scipy development process.
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
1150c4c033899a5a4556b7d34d6b137352b36b9e
{ "head_commit": "c8b1e87de848e8f6c4746b2019c598a6ce59a6a9", "head_commit_message": "fix tolerance check for method lm.", "patch_to_review": "diff --git a/scipy/optimize/_lsq/least_squares.py b/scipy/optimize/_lsq/least_squares.py\nindex c70656c0cde7..9e8ab211742e 100644\n--- a/scipy/optimize/_lsq/least_squares.p...
[ { "diff_hunk": "@@ -744,3 +746,30 @@ def test_basic():\n # test that 'method' arg is really optional\n res = least_squares(fun_trivial, 2.0)\n assert_allclose(res.x, 0, atol=1e-10)\n+\n+\n+def test_small_tolerances_for_lm():\n+ def res(p):\n+ return y - H @ p\n+\n+ p0 = np.array([-0.626...
e6137a5a93389f729c87d970cf46803617a6fa60
diff --git a/scipy/optimize/_lsq/least_squares.py b/scipy/optimize/_lsq/least_squares.py index c70656c0cde7..bec7e9758de7 100644 --- a/scipy/optimize/_lsq/least_squares.py +++ b/scipy/optimize/_lsq/least_squares.py @@ -102,7 +102,7 @@ def prepare_bounds(bounds, n): return lb, ub -def check_tolerance(ftol, xtol...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11726@e7c7581
scipy/scipy
Python
11,726
Handle constant input for scipy.stats.f_oneway
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-03-25T15:36:14Z
p-value varies with the order of the data <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in the output. ...
Your data is degenerate, in that the values in each group are constant. If you work through the analysis of variance calculation, you'll find that this data leads to division by zero when computing the F statistic, so in theory, F should be infinite, and the p-value should be 0. In the actual numerical calculation, ...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
66348b0fd5d71441ab590b3cb5081c63d27d61e5
{ "head_commit": "e7c7581c85a977275ad3e05f7fc32d0e1caa6669", "head_commit_message": "Add warning for constant input case\n\nAnd bunch of minor changes", "patch_to_review": "diff --git a/scipy/stats/stats.py b/scipy/stats/stats.py\nindex 80615f5e6b97..ee364697f959 100644\n--- a/scipy/stats/stats.py\n+++ b/scipy/st...
[ { "diff_hunk": "@@ -3116,6 +3117,17 @@ def trim_mean(a, proportiontocut, axis=0):\n F_onewayResult = namedtuple('F_onewayResult', ('statistic', 'pvalue'))\n \n \n+class F_onewayConstantInputWarning(RuntimeWarning):\n+ \"\"\"Warning generated by `f_oneway` when an input is constant, e.g.\n+ each of the ...
ffafe8724a69be61d1017610e5e3c0e868685037
diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py index aadfe95b1128..cd70fe00a8aa 100644 --- a/scipy/stats/__init__.py +++ b/scipy/stats/__init__.py @@ -373,6 +373,7 @@ .. autosummary:: :toctree: generated/ + F_onewayConstantInputWarning PearsonRConstantInputWarning PearsonRNearConstantIn...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11672@55a7202
scipy/scipy
Python
11,672
Add warning to medfilt when array size < kernel_size
Warn when array size is lesser than kernel size along any axis <!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and ...
2020-03-15T18:04:24Z
medfilt produces 0 on input of length 1 scipy.signal.medfilt returns zero when filtering a singleton list, rather than the the value in the singleton. This feels wrong, but if it's as intended, could the documentation be clearer? ``` >>> for i in range(5, -1, -1): print(scipy.signal.medfilt([99]*i)) [ 99. 99. ...
Hi! I would like to work on this issue. I'll share some thoughts soon @aardvarkkrill it's said in documentation that "default size is 3 for each dimension" and "array will be automatically 0-padded", so when You have 1-element array it should add 2 zeros, and then return 0 as median value. I think it maybe be helpful...
[ { "body": "scipy.signal.medfilt returns zero when filtering a singleton list, rather than the the value in the singleton. This feels wrong, but if it's as intended, could the documentation be clearer?\r\n\r\n```\r\n>>> for i in range(5, -1, -1): print(scipy.signal.medfilt([99]*i))\r\n\r\n[ 99. 99. 99. 99. ...
27a5729600854d8ed05cbbd6c68d70f9451c1793
{ "head_commit": "55a72024ae656019201654c7217969829426cdc5", "head_commit_message": "Add pytest.warns to test suite", "patch_to_review": "diff --git a/scipy/signal/signaltools.py b/scipy/signal/signaltools.py\nindex 0ee89b13fe68..59c96873d81f 100644\n--- a/scipy/signal/signaltools.py\n+++ b/scipy/signal/signaltoo...
[ { "diff_hunk": "@@ -1378,6 +1379,11 @@ def medfilt(volume, kernel_size=None):\n An array the same size as input containing the median filtered\n result.\n \n+ Raises\n+ -------\n+ UserWarning", "line": null, "original_line": 1384, "original_start_line": null, "path":...
cbc910aa4353b27b0e838980155795e0c045672b
diff --git a/scipy/signal/signaltools.py b/scipy/signal/signaltools.py index 0ee89b13fe68..56aa9ca12b33 100644 --- a/scipy/signal/signaltools.py +++ b/scipy/signal/signaltools.py @@ -19,6 +19,7 @@ from .filter_design import cheby1, _validate_sos from .fir_filter_design import firwin from ._sosfilt import _sosfilt +i...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scipy__scipy-11534@b890b8f
scipy/scipy
Python
11,534
FIX: Allow non-native byte order inputs to scipy.fft
#### Reference issue Fixes https://github.com/scipy/scipy/issues/10422#issuecomment-587040183 #### What does this implement/fix? `_pocketfft` transforms now accept inputs in non-native byte-order by copying the data to native byte-order first.
2020-02-17T17:43:15Z
BUG: scipy.fft does not support multiprocessing `scipy.fft` interacts badly with `joblib`, specifically when using the "processes" method. @peterbell10 tested and reports that it also fails for `multiprocessing.Pool` directly. But here was my MWE with joblib: ```Python >>> import numpy as np >>> from joblib import P...
Does rfft use openmp? It's unrelated. The root cause is comparing dtypes using `is` which breaks after `fork`. I have a fix locally, PR soon. Some aspects of this bug still seem to exist in 1.4.1: I now get this error in fftconvolve unless I specifically cast my data (original dtype: ">f4") as a numpy.float32 dtype, wh...
[ { "body": "`scipy.fft` interacts badly with `joblib`, specifically when using the \"processes\" method. @peterbell10 tested and reports that it also fails for `multiprocessing.Pool` directly. But here was my MWE with joblib:\r\n```Python\r\n>>> import numpy as np\r\n>>> from joblib import Parallel, delayed\r\n>...
d667e1537874e6634b3a2fc256e1ab3cfbbe2ebf
{ "head_commit": "b890b8f502418ab0d2c03f1e3661d6ca3b042472", "head_commit_message": "FIX: Allow non-native byte order inputs to scipy.fft", "patch_to_review": "diff --git a/scipy/fft/_pocketfft/helper.py b/scipy/fft/_pocketfft/helper.py\nindex 89b32ab88379..b75514e0c151 100644\n--- a/scipy/fft/_pocketfft/helper.p...
[ { "diff_hunk": "@@ -1001,3 +1006,18 @@ def test_invalid_norm(func):\n with assert_raises(ValueError,\n match='Invalid norm value o, should be None or \"ortho\"'):\n func(x, norm='o')\n+\n+\n+@pytest.mark.parametrize('func', [fft, ifft, fftn, ifftn,\n+ ...
748a3ad2f8a2cf8edc2da142bd019cfd9e4e6611
diff --git a/scipy/fft/_pocketfft/helper.py b/scipy/fft/_pocketfft/helper.py index 89b32ab88379..b75514e0c151 100644 --- a/scipy/fft/_pocketfft/helper.py +++ b/scipy/fft/_pocketfft/helper.py @@ -91,8 +91,11 @@ def _asfarray(x): elif x.dtype.kind not in 'fc': return np.asarray(x, np.float64) + # Requi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11483@ed36407
scipy/scipy
Python
11,483
BUG: Fixed `_kpp` initialization on `scipy.cluster.vq`, closing #11463
The function `_kpp` used the wrong dimension to sample the data. <!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and de...
2020-02-07T13:02:02Z
Bug on "++" initialization on "kmeans2" <!-- Thank you for taking the time to file a bug report. Please fill in the fields below, deleting the sections that don't apply to your issue. You can view the final output by clicking the preview button above. Note: This is a comment, and won't appear in the output. --...
[ { "body": "<!-- \r\nThank you for taking the time to file a bug report. \r\nPlease fill in the fields below, deleting the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\nNote: This is a comment, and won't appear in the output.\r\n-->\r\n\r\n...
ff8b9d9e87a585a820846d7f459d6156ba621c4d
{ "head_commit": "ed364074b780395a4b30eda1bb9c39370ef4e4f9", "head_commit_message": "Added new line to end of file", "patch_to_review": "diff --git a/scipy/cluster/tests/test_vq.py b/scipy/cluster/tests/test_vq.py\nindex a8ffcd0a6a16..246556e24c63 100644\n--- a/scipy/cluster/tests/test_vq.py\n+++ b/scipy/cluster/...
[ { "diff_hunk": "@@ -289,3 +289,25 @@ def test_kmeans_large_thres(self):\n res = kmeans(x, 1, thresh=1e16)\n assert_allclose(res[0], np.array([4.]))\n assert_allclose(res[1], 2.3999999999999999)\n+ \n+ def test_kmeans2_kpp_low_dim(self):\n+ # Regression test for gh-11462\...
5005157892cb2f496a8f09d7ecafebb38380d8bc
diff --git a/scipy/cluster/tests/test_vq.py b/scipy/cluster/tests/test_vq.py index a8ffcd0a6a16..0895d250ce2b 100644 --- a/scipy/cluster/tests/test_vq.py +++ b/scipy/cluster/tests/test_vq.py @@ -289,3 +289,25 @@ def test_kmeans_large_thres(self): res = kmeans(x, 1, thresh=1e16) assert_allclose(res[0],...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scipy__scipy-11431@efbeb32
scipy/scipy
Python
11,431
Make median_absolute_deviation scale argument aligned w/iqr
#### Reference issue Closes gh-11090 -> #11090 #### What does this implement/fix? In gh-11090 there was some confusion around the default value of scale in `median_absolute_deviation` function and there is also an inconsistency between how `median_absolute_deviation` and `iqr` accept `scale=` argument. In `...
2020-01-29T04:12:44Z
Misconception of the median absolute deviation in stats? As far as I know, the median absolute deviation (MAD) is simply defined to be ```MAD = median(|x - median(x)|)``` However, `stats.median_absolute_deviation` is misleading in that it returns `1.4826 * MAD`, which is really an approximation for the standard devi...
hi @tcjansen, in statistics, for better or worse, many things are compared against the Gaussian distribution. Here is a reference: https://en.wikipedia.org/wiki/Median_absolute_deviation#Relation_to_standard_deviation I agree that this should perhaps be better documented to make it more clear to the user. You can...
[ { "body": "As far as I know, the median absolute deviation (MAD) is simply defined to be \r\n```MAD = median(|x - median(x)|)```\r\nHowever, `stats.median_absolute_deviation` is misleading in that it returns `1.4826 * MAD`, which is really an approximation for the standard deviation of a gaussian distributed da...
40bf81b2855aeb32b0d4d6784f5ab57846e12dbc
{ "head_commit": "efbeb32414dc4e240717c80a964734f98621beb6", "head_commit_message": "MAINT: make 'raw' default scale behavior and clarify docstring and test\n\nTST: change default scaling behaviour in median_absolute_deviation\n\n * This assumes the change of scale in tests would be from\n `\\sqrt(2)\\times erf...
[ { "diff_hunk": "@@ -2686,7 +2687,8 @@ def iqr(x, axis=None, rng=(25, 75), scale='raw', nan_policy='propagate',\n 'raw' : No scaling, just return the raw IQR.\n 'normal' : Scale by :math:`2 \\sqrt{2} erf^{-1}(\\frac{1}{2}) \\approx 1.349`.", "line": null, "original_line": 2688, "o...
6d6deb678ef98b98636738bd7b15a4971980edc6
diff --git a/scipy/stats/__init__.py b/scipy/stats/__init__.py index cd4849b00201..10ce7a356e7c 100644 --- a/scipy/stats/__init__.py +++ b/scipy/stats/__init__.py @@ -201,6 +201,7 @@ mvsdist entropy median_absolute_deviation + median_abs_deviation Frequency statistics ==================== diff --git a...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scipy__scipy-11368@b6e4ed0
scipy/scipy
Python
11,368
ENH: add optional argument, "include_nyquist", for freqz()
<!-- Thanks for contributing a pull request! Please ensure that your PR satisfies the checklist before submitting: http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checklist-before-submitting-a-pr Also, please name and describe your PR as you would write a commit message: https://docs.s...
2020-01-15T21:11:35Z
freqz() does not include evaluation at pi by default The default, or when specifying worN as an integer, the frequencies are evaluated at ``` linspace(0, 2*pi if whole else pi, N, endpoint=False) ``` However, I believe it would make more sense to *include* the endpoint, as the complex value of the frequency at ...
I agree in principle but changing this would be backward incompatible, and not worth introducing a deprecation cycle to change because the number of affected scripts and downstream libs would probably be quite large. We could add a new keyword argument like `nyquist=False`, or perhaps simpler, allow `whole='nyquist'...
[ { "body": "The default, or when specifying worN as an integer, the frequencies are evaluated at\r\n\r\n```\r\nlinspace(0, 2*pi if whole else pi, N, endpoint=False)\r\n```\r\n\r\nHowever, I believe it would make more sense to *include* the endpoint, as the complex value of the frequency at pi is valuable informa...
16116d1b4699b86ee57eefc7477f723628409790
{ "head_commit": "b6e4ed0ceab141d77e4ff742a762a32eaa9a8a73", "head_commit_message": "add optional argment, nyquist, for freqz", "patch_to_review": "diff --git a/scipy/signal/filter_design.py b/scipy/signal/filter_design.py\nindex 3b537f18fd33..b66535bc7d6f 100644\n--- a/scipy/signal/filter_design.py\n+++ b/scipy/...
[ { "diff_hunk": "@@ -436,7 +438,8 @@ def freqz(b, a=1, worN=512, whole=False, plot=None, fs=2*pi):\n if N < 0:\n raise ValueError('worN must be nonnegative, got %s' % (N,))\n lastpoint = 2 * pi if whole else pi\n- w = np.linspace(0, lastpoint, N, endpoint=False)\n+ # if ...
9135045703045ad5cff452d16d28bfffe51ee6d6
diff --git a/scipy/signal/filter_design.py b/scipy/signal/filter_design.py index 3b537f18fd33..e53301a23db2 100644 --- a/scipy/signal/filter_design.py +++ b/scipy/signal/filter_design.py @@ -272,7 +272,7 @@ def freqs_zpk(z, p, k, worN=200): return w, h -def freqz(b, a=1, worN=512, whole=False, plot=None, fs=2*...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }