GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
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 nPercentile(). I've not tested this for functions other than nPercentile() but think this may be useful in other scenarios.
Extended threshold() in functions.py to support nested functions like…
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  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.
Thanks for this, it's a good idea. I've added a few comments on how we can improve it further