Title: Incorrect calculation method for "∑(y)" in `CurveStatsTool` · Issue #44 · PlotPyStack/PlotPy · GitHub
Open Graph Title: Incorrect calculation method for "∑(y)" in `CurveStatsTool` · Issue #44 · PlotPyStack/PlotPy
X Title: Incorrect calculation method for "∑(y)" in `CurveStatsTool` · Issue #44 · PlotPyStack/PlotPy
Description: Summary In the CurveStatsTool class, the summation of y-values "∑(y)" was incorrectly implemented using scipy.integrate.trapezoid instead of the appropriate numpy.sum function. This resulted in incorrect statistical values being displaye...
Open Graph Description: Summary In the CurveStatsTool class, the summation of y-values "∑(y)" was incorrectly implemented using scipy.integrate.trapezoid instead of the appropriate numpy.sum function. This resulted in inc...
X Description: Summary In the CurveStatsTool class, the summation of y-values "∑(y)" was incorrectly implemented using scipy.integrate.trapezoid instead of the appropriate numpy.sum function. This resul...
Opengraph URL: https://github.com/PlotPyStack/PlotPy/issues/44
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect calculation method for \"∑(y)\" in `CurveStatsTool`","articleBody":"### Summary\n\nIn the `CurveStatsTool` class, the summation of y-values \"∑(y)\" was incorrectly implemented using `scipy.integrate.trapezoid` instead of the appropriate `numpy.sum` function. This resulted in incorrect statistical values being displayed when using the curve statistics tool.\n\n### Problem Description\n\nThe `CurveStatsTool` provides various statistical calculations for curves, including sum of y-values, denoted as \"∑(y)\". However, the implementation was using the trapezoidal integration method (`spt.trapezoid`) which calculates the area under a curve. This is mathematically incorrect for a simple summation operation, which should simply add all y-values without any weighting or integration.\n\n#### Incorrect Implementation (before fix)\n\n```python\n(\"∑(y)=%g\", lambda *args: spt.trapezoid(args[1], args[0])),\n```\n\n#### Correct Implementation (after fix)\n\n```python\n(\"∑(y)=%g\", lambda *args: np.sum(args[1])),\n```\n\n### Impact\n\nUsers relying on the \"∑(y)\" calculation from the curve statistics tool were receiving incorrect values that represented an approximation of the integral rather than the actual sum of y-values.","author":{"url":"https://github.com/PierreRaybaut","@type":"Person","name":"PierreRaybaut"},"datePublished":"2025-06-16T13:30:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/44/PlotPy/issues/44"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:41856323-6626-8eca-6716-1fc998195706 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D610:1C8E6D:2DFEAB4:3F17002:6972B4B9 |
| html-safe-nonce | 65a8238832c24b3df895820a3c3faf40d5bd47241822c4c120ee3802c00c3213 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjEwOjFDOEU2RDoyREZFQUI0OjNGMTcwMDI6Njk3MkI0QjkiLCJ2aXNpdG9yX2lkIjoiMzIwMTcyOTMwMjk1MjU4ODQ3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 76f0d69850234878a4cd7e64db0ffe4ca3c544fcb4672e57513072e18e116d1c |
| hovercard-subject-tag | issue:3150031082 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PlotPyStack/PlotPy/44/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f1466cb5522c02723f3cbcaec03b758d531ce169476c9451a4f2ef6be4619fb2/PlotPyStack/PlotPy/issues/44 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f1466cb5522c02723f3cbcaec03b758d531ce169476c9451a4f2ef6be4619fb2/PlotPyStack/PlotPy/issues/44 |
| og:image:alt | Summary In the CurveStatsTool class, the summation of y-values "∑(y)" was incorrectly implemented using scipy.integrate.trapezoid instead of the appropriate numpy.sum function. This resulted in inc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PierreRaybaut |
| hostname | github.com |
| expected-hostname | github.com |
| None | 51c0d0848f5569c6fa2198e9d69bd5f8f94a83c9fa3659e40728e7732afab130 |
| turbo-cache-control | no-preview |
| go-import | github.com/PlotPyStack/PlotPy git https://github.com/PlotPyStack/PlotPy.git |
| octolytics-dimension-user_id | 145201262 |
| octolytics-dimension-user_login | PlotPyStack |
| octolytics-dimension-repository_id | 671159499 |
| octolytics-dimension-repository_nwo | PlotPyStack/PlotPy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 671159499 |
| octolytics-dimension-repository_network_root_nwo | PlotPyStack/PlotPy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10c5e2f2307495b2750073db87e9a5d3356a924f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width