pull_requests: 443610926
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
443610926 | MDExOlB1bGxSZXF1ZXN0NDQzNjEwOTI2 | 4193 | closed | 0 | Fix polyfit fail on deficient rank | 20629530 | <!-- Feel free to remove check-list items aren't relevant to your change --> - [x] Closes #4190 - [x] Tests added - [x] Passes `isort -rc . && black . && mypy . && flake8` - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` - [ ] New functions/methods are listed in `api.rst` Fixes #4190. In cases where the input matrix had a deficient rank (matrix rank != order) because of the number of NaN values, polyfit would fail, simply because numpy's lstsq returned an empty array for the residuals (instead of a size 1 array). This fixes the problem by catching the case and returning `np.nan` instead. The other point in the issue was that `RankWarning` is also not raised in that case. That was due to the fact that `da.polyfit` was computing the rank from the coordinate (Vandermonde) matrix, instead of the masked data. Thus, is a given line has too many NaN values, its deficient rank was not detected. I added a test and warning at all places where a rank is computed (5 different lines). Also, to match np.polyfit behaviour of no warning when `full=True`, I changed the warning filters using a context manager, ignoring the `RankWarning` in that case. Overall, it feels a bi ugly because of the duplicated code and it will print the warning for every line of an array that has a deficient rank, which can be a lot... | 2020-07-02T16:00:21Z | 2020-08-20T14:20:43Z | 2020-08-20T08:34:45Z | 2020-08-20T08:34:45Z | efabe74b1ce8f0666b93658ebb48104aa37b26ac | 0 | 04be2e0fa1f96762798761f08aca7c37d7d8c67d | 26547d19d477cc77461c09b3aadd55f7eb8b4dbf | CONTRIBUTOR | 13221727 | https://github.com/pydata/xarray/pull/4193 |
Links from other tables
- 0 rows from pull_requests_id in labels_pull_requests