Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Extended threshold() in functions.py to support nested functions like nP... #117

wants to merge 1 commit into


None yet
4 participants

Extended threshold() in functions.py to support nested functions like nPercentile(). I've not tested this for functions other than nPercentile() but think this may be useful in other scenarios.

This is useful, but this turns threshold into a shortcut for wrapping a series in both color() and alias(). Extracting the single value works fine for functions like nPercentile, but might be surprising if another series or a different function is passed in - an alarm threshold isn't necessarily a constant.

Rather than extract a value out, can we instead modify whatever series is passed in, continuing to create our own (with constantLine) if it's a number for the first argument?

I'd also remove the [0] here so that there's a full "SeriesList" in both cases and loop over them. In the passed-in series case, multiple different series would be a valid concept - say, upper and lower bound thresholds.


mleinart commented Feb 9, 2013

Thanks for this, it's a good idea. I've added a few comments on how we can improve it further

@obfuscurity obfuscurity added this to the 1.1.0 milestone Jul 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment