chore(growth): move nil logic to scorer behaviour
All checks were successful
continuous-integration/drone/pr Build is passing

Handle `nil` measurement in `Growth.Score.Scorer`.
This commit is contained in:
2024-06-11 14:53:19 +00:00
parent 7fab746ea8
commit 0d7a4cc9c3
3 changed files with 31 additions and 22 deletions

View File

@@ -34,7 +34,7 @@ defmodule Growth.Calc.ZScore do
"""
@type s :: number()
@spec compute(number(), l(), m(), s()) :: Growth.measure()
@spec compute(number(), l(), m(), s()) :: number()
@doc """
Compute the adjusted z-score for a given measurement (`y`) and the Box-Cox values: power (`l`), median (`m`), and
coefficient of variation (`s`).
@@ -49,11 +49,6 @@ defmodule Growth.Calc.ZScore do
1.4698319520484722
"""
def compute(nil, _, _, _) do
nil
end
def compute(y, l, m, s) do
y
|> raw(l, m, s)