From 188b31aa0cf3e9d2a950888a2be29ef81d289717 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:15:05 -0600 Subject: [PATCH] move me and qt salaries to ana.NewDefaultNormalizer --- cmd/http/router.go | 15 +-------------- src/ana/normalize.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/cmd/http/router.go b/cmd/http/router.go index 2af8808..f86792d 100644 --- a/cmd/http/router.go +++ b/cmd/http/router.go @@ -102,20 +102,7 @@ func (router Router) APITransactions(w http.ResponseWriter, r *http.Request) { )) recent := time.Hour * 24 * 365 / 6 - normalizer := ana.NewNormalizer(). - With("^Zach:", "2023-10-05", 139). // to turtle - With("^Zach:", "2021-12-30", 135). // at pluralsight - With("^Zach:", "2020-07-30", 120). // to pluralsight - With("^Zach:", "2019-07-16", 77). // at fedex - With("^Zach:", "2017-02-16", 49). // to fedex - With("^Bel:", "2023-12-05", 190). // to render - With("^Bel:", "2022-12-31", 154). // at q - With("^Bel:", "2022-06-30", 148). // at q - With("^Bel:", "2021-12-31", 122). // at q - With("^Bel:", "2020-12-31", 118). // at q - With("^Bel:", "2019-12-31", 111). // at q - With("^Bel:", "2018-12-31", 92). // at q - With("^Bel:", "2018-02-16", 86) // to q + normalizer := ana.NewDefaultNormalizer(). { deltas := houseRelatedDeltas. diff --git a/src/ana/normalize.go b/src/ana/normalize.go index 42eea75..3982561 100644 --- a/src/ana/normalize.go +++ b/src/ana/normalize.go @@ -17,6 +17,23 @@ type normalize struct { factor float64 } +func NewDefaultNormalizer() Normalizer { + return NewNormalizer(). + With("^Zach:", "2023-10-05", 139). // to turtle + With("^Zach:", "2021-12-30", 135). // at pluralsight + With("^Zach:", "2020-07-30", 120). // to pluralsight + With("^Zach:", "2019-07-16", 77). // at fedex + With("^Zach:", "2017-02-16", 49). // to fedex + With("^Bel:", "2023-12-05", 190). // to render + With("^Bel:", "2022-12-31", 154). // at q + With("^Bel:", "2022-06-30", 148). // at q + With("^Bel:", "2021-12-31", 122). // at q + With("^Bel:", "2020-12-31", 118). // at q + With("^Bel:", "2019-12-31", 111). // at q + With("^Bel:", "2018-12-31", 92). // at q + With("^Bel:", "2018-02-16", 86) // to q +} + func NewNormalizer() Normalizer { return Normalizer{ m: make(map[string][]normalize),