Opened 11 years ago

Closed 10 years ago

#8644 closed enhancement (fixed)

dojox.math could use a sum function

Reported by: foobarfighter Owned by: Tom Trenka
Priority: high Milestone: 1.4
Component: Dojox Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

Submitting a patch for a dojox.math.sum function.

Attachments (2)

patch.txt (1.7 KB) - added by foobarfighter 11 years ago.
Patch for adding sum
patch2.txt (1.7 KB) - added by foobarfighter 11 years ago.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by foobarfighter

Attachment: patch.txt added

Patch for adding sum

Changed 11 years ago by foobarfighter

Attachment: patch2.txt added

comment:1 Changed 11 years ago by foobarfighter

Use patch2.txt. It has the dojo doc comments in the right spot.

comment:2 Changed 11 years ago by Adam Peller

Owner: changed from Adam Peller to Tom Trenka

dojox.lang.functional.reduce does this. Do we need a shortcut?

comment:3 Changed 11 years ago by foobarfighter

ttrenka, it wouldn't have been obvious for me to use that function (especially since it's in another package where I wouldn't have looked) so I don't think it's a bad idea. I was also considering submitting a patch for dojox.math.avg, but my guess is that there might be something in dojox.math or dojox.lang for this as well.

What are your thoughts? I don't mind submitting the patch.

comment:4 Changed 11 years ago by Tom Trenka

foobarfighter, I think you're right. While reduce can do this, it's not an obvious solution at all.

Some time ago we had a GSoC project that was supposed to be bringing statistical analysis functions to dojox.math but that sort of got canned; I think a list of simple functions such as sum, average, mean etc. would not be a bad idea to include directly with dojox.math (maybe dojox.math.stats or something).

If you'd like to work on this and submit a patch, I'll review and push as needed.

comment:5 Changed 11 years ago by Eugene Lazutkin

Don't get me started on statistics and its current state in the JavaScript community. I cannot look without pity at all attempts to benchmark things, when people got some senseless numbers to begin with, and cannot even interpret them correctly.

We have to have a stat package. And I am not talking about something fancy, just some basic 101 functionality: average, median, percentiles, deviations, curves, the simplest 5 number summary for goodness sake.

And we have to have a benchmarking facility on par with DOH. With proper charts.

comment:6 Changed 11 years ago by Tom Trenka

Milestone: tbd1.4

comment:7 Changed 10 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

This was added with the new dojox.math.stats package.

Note: See TracTickets for help on using tickets.