chore(growth): adjust indicator lookup to use atoms for unit
This commit is contained in:
parent
82d7009b34
commit
7e041ae6c9
@ -28,7 +28,7 @@ defmodule Growth.Score.Scorer do
|
||||
{precision, scores(indicator, growth, l, m, s)}
|
||||
end)
|
||||
|
||||
%{growth | results: [Map.new([{indicator.measure_name(), result}]) | growth.results]}
|
||||
%{growth | results: Keyword.put(growth.results, indicator.measure_name(), result)}
|
||||
end
|
||||
|
||||
@spec lms(Growth.t(), module()) :: [{String.t(), {number(), number(), number()}}]
|
||||
@ -42,9 +42,9 @@ defmodule Growth.Score.Scorer do
|
||||
"""
|
||||
def lms(growth, indicator) do
|
||||
[
|
||||
{growth.gender, "day", growth.age_in_days},
|
||||
{growth.gender, "week", growth.age_in_weeks},
|
||||
{growth.gender, "month", growth.age_in_months}
|
||||
{growth.gender, :day, growth.age_in_days},
|
||||
{growth.gender, :week, growth.age_in_weeks},
|
||||
{growth.gender, :month, growth.age_in_months}
|
||||
]
|
||||
|> Enum.map(fn {_, precision, _} = key ->
|
||||
case :ets.lookup(indicator, key) do
|
||||
|
Loading…
x
Reference in New Issue
Block a user