Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upadd a cumsum transform to cumulatively sum a single column #7961
Conversation
bryevdv
added
the
status: WIP
label
Jun 5, 2018
This comment has been minimized.
This comment has been minimized.
With this PR the SO question can be achieved much more cleanly with:
|
bryevdv
added
type: feature
tag: component: bokehjs
labels
Jun 5, 2018
bryevdv
added this to the 0.13.0 milestone
Jun 5, 2018
bryevdv
added
status: ready
and removed
status: WIP
labels
Jun 5, 2018
bryevdv
requested a review
from
mattpap
Jun 5, 2018
mattpap
reviewed
Jun 5, 2018
result[0] = 0 | ||
else | ||
result[0] = col[0] | ||
debugger |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bryevdv
Jun 5, 2018
Author
Member
We should really just make a code quality check that looks for this
This comment has been minimized.
This comment has been minimized.
mattpap
Jun 5, 2018
Contributor
Sure, there's a built-in rule for this (https://palantir.github.io/tslint/rules/no-debugger/).
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mattpap
Jun 5, 2018
Contributor
If your are at fixing things, you can add "no-debugger": true
to bokehjs/tslint.json
.
This comment has been minimized.
This comment has been minimized.
mattpap
Jun 5, 2018
•
Contributor
It's a part of codebase
job on travis ci. Otherwise you have to run node make tslint
. Perhaps we could make it part of quality
tests at some point.
This comment has been minimized.
This comment has been minimized.
mattpap
Jun 5, 2018
Contributor
but it doesn't currently actually fail when there is a violation:
It was supposed to get --emit-error
, the same as scripts:compile
and test:compile
have. Must have forgotten about this or maybe there is a regression since then new build is in place.
This comment has been minimized.
This comment has been minimized.
bryevdv
Jun 5, 2018
Author
Member
OK I added it, tho as I said it's not clear to me that a linter failure results in a test failure since the exit always seems to be 0
This comment has been minimized.
This comment has been minimized.
bryevdv
Jun 5, 2018
Author
Member
I tried adding --emit-error
locally, that still did not result in a nonzero exit code when a lint violation was present
This comment has been minimized.
This comment has been minimized.
mattpap
Jun 5, 2018
Contributor
In fact this was done on purpose, because initially tslint reported a lot of errors and it was tedious dealing with this. Now all were resolved, so failing tslint
build task on error should be implemented. I will do it with the next round of build improvements.
philippjfr
reviewed
Jun 5, 2018
source = ColumnDataSource(data=dict(foo=[1, 2, 3, 4])) | ||
CumSum('foo') |
This comment has been minimized.
This comment has been minimized.
philippjfr
Jun 5, 2018
Contributor
Do Expressions
actually allow positional arguments? Might be the case but maybe you confused it with the cumsum helper function signature?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mattpap
reviewed
Jun 5, 2018
if (this.include_zero) | ||
result[0] = 0 | ||
else | ||
result[0] = col[0] |
bryevdv commentedJun 5, 2018
I ran across the SO question Create pie-chart using bokeh with dictionary
and thought I woudl see if it could be done with
Stack
but soon realized that it could not, sinceStack
stacks multiple entire columns element-wise. It occured to me that a cummulative sum was a very useful but missing piece that would also be trivial to implement, so I threw together this PR.I will add docs and tests in subsequent commits.