Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Issue 2547133002: Added n-ary vector summation (Closed)

Created:
4 years ago by wrengr
Modified:
4 years ago
CC:
chromium-reviews, infra-reviews+infra_chromium.org, aarya, stgao
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 9

Patch Set 2 : addressing nits #

Patch Set 3 : Adding docstrings for tests #

Patch Set 4 : rebase #

Patch Set 5 : removed todo #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -0 lines) Patch
A appengine/findit/libs/math/__init__.py View 1 chunk +3 lines, -0 lines 0 comments Download
A appengine/findit/libs/math/test/__init__.py View 1 chunk +3 lines, -0 lines 0 comments Download
A appengine/findit/libs/math/test/vectors_test.py View 1 2 1 chunk +70 lines, -0 lines 2 comments Download
A appengine/findit/libs/math/vectors.py View 1 2 3 4 1 chunk +42 lines, -0 lines 4 comments Download

Messages

Total messages: 21 (8 generated)
wrengr
PTAL
4 years ago (2016-12-02 19:44:12 UTC) #3
Martin Barbella
https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py File appengine/findit/libs/math/test/vectors_test.py (right): https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py#newcode14 appengine/findit/libs/math/test/vectors_test.py:14: class VectorsTest(unittest.TestCase): 2 blank lines before this one. Does ...
4 years ago (2016-12-02 19:52:37 UTC) #4
wrengr
nits addressed https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py File appengine/findit/libs/math/test/vectors_test.py (right): https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py#newcode14 appengine/findit/libs/math/test/vectors_test.py:14: class VectorsTest(unittest.TestCase): On 2016/12/02 19:52:37, Martin Barbella ...
4 years ago (2016-12-02 20:54:46 UTC) #6
Martin Barbella
lgtm (still need someone else to stamp it) https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py File appengine/findit/libs/math/test/vectors_test.py (right): https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py#newcode14 appengine/findit/libs/math/test/vectors_test.py:14: class ...
4 years ago (2016-12-02 22:12:11 UTC) #7
Sharu Jiang
lgtm https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/vectors.py File appengine/findit/libs/math/vectors.py (right): https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/vectors.py#newcode31 appengine/findit/libs/math/vectors.py:31: # TODO(wrengr): reimplement this in C, inling CPython's ...
4 years ago (2016-12-02 22:17:51 UTC) #8
Sharu Jiang
https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py File appengine/findit/libs/math/test/vectors_test.py (right): https://codereview.chromium.org/2547133002/diff/1/appengine/findit/libs/math/test/vectors_test.py#newcode14 appengine/findit/libs/math/test/vectors_test.py:14: class VectorsTest(unittest.TestCase): On 2016/12/02 22:12:11, Martin Barbella wrote: > ...
4 years ago (2016-12-02 22:26:12 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2547133002/80001
4 years ago (2016-12-02 23:22:33 UTC) #12
wrengr
On 2016/12/02 22:26:12, Sharu Jiang wrote: > On 2016/12/02 22:12:11, Martin Barbella wrote: > > ...
4 years ago (2016-12-02 23:29:09 UTC) #13
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/infra/infra/+/b17938f2101a3ed9c608d058a0a65da1984dc1f3
4 years ago (2016-12-02 23:37:29 UTC) #16
Martin Barbella
On 2016/12/02 23:29:09, wrengr wrote: > On 2016/12/02 22:26:12, Sharu Jiang wrote: > > On ...
4 years ago (2016-12-02 23:38:43 UTC) #17
inferno
lgtm with nits. https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/math/test/vectors_test.py File appengine/findit/libs/math/test/vectors_test.py (right): https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/math/test/vectors_test.py#newcode21 appengine/findit/libs/math/test/vectors_test.py:21: def testFsumKeepsPrecision(self): Should a test be ...
4 years ago (2016-12-05 00:12:38 UTC) #19
wrengr
https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/math/test/vectors_test.py File appengine/findit/libs/math/test/vectors_test.py (right): https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/math/test/vectors_test.py#newcode21 appengine/findit/libs/math/test/vectors_test.py:21: def testFsumKeepsPrecision(self): On 2016/12/05 00:12:37, inferno wrote: > Should ...
4 years ago (2016-12-05 19:06:43 UTC) #20
inferno
4 years ago (2016-12-05 20:46:18 UTC) #21
Message was sent while issue was closed.
On 2016/12/05 19:06:43, wrengr wrote:
>
https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/m...
> File appengine/findit/libs/math/test/vectors_test.py (right):
> 
>
https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/m...
> appengine/findit/libs/math/test/vectors_test.py:21: def
> testFsumKeepsPrecision(self):
> On 2016/12/05 00:12:37, inferno wrote:
> > Should a test be there for testing precision with BIG for
> testFsumKeepsPrecision
> > and testVsumKeepsPrecision
> 
> I don't know what you mean.
> 
> As math.fsum ships with Python, there's no point in testing it for itself;
this
> test (testFsumKeepsPrecision) is a meta-test to ensure that
> testVsumKeepsPrecision is valid as a test of our code. That is, if we pick
some
> self._xs which causes even math.fsum to fail to keep precision, then vsum has
no
> hope of doing any better. The key aspect of both tests is that if we evaluate
> (BIG + LITTLE - BIG) naively then we will get an answer of zero because the
> intermediate value (BIG + LITTLE) looses precision and its absolute difference
> against BIG is zero. (FWIW, reordering the summands to the order (LITTLE + BIG
-
> BIG) would achieve the same result.)
> 
> Conversely, testing (BIG + LITTLE - LITTLE) == BIG doesn't achieve the same
> purpose. If the intermediate value (BIG + LITTLE) rounds to BIG that's as
> expected.
> 
>
https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/m...
> File appengine/findit/libs/math/vectors.py (right):
> 
>
https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/m...
> appengine/findit/libs/math/vectors.py:10: """Accurate summation of a list of
> vectors.
> On 2016/12/05 00:12:37, inferno wrote:
> > Where is this implementation based off ? Can you add wiki link or point to
> > source.
> 
> This implementation is a gross hack to compute the sums element by element,
> since mbarbella@ et al thought it wouldn't be worth the maintenance cost to
> actually vectorize Shewchuk's algorithm. There is no source to link; though I
> can provide links for where numpy said they WontFix their not providing this
> function.

Yes, link to that and add comment.

> 
>
https://codereview.chromium.org/2547133002/diff/80001/appengine/findit/libs/m...
> appengine/findit/libs/math/vectors.py:35: # cost for the performance benefit.
> On 2016/12/05 00:12:37, inferno wrote:
> > typo: of a maintenance
> 
> Done.

Powered by Google App Engine
This is Rietveld 408576698