packages feed

granite 0.7.3.0 → 0.7.3.1

raw patch · 3 files changed

+9/−5 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Revision history for granite +## 0.7.3.1 -- 2026-06-22+* Fix kde computation of average+ ## 0.7.3.0 -- 2026-06-19 * improved long text/axis display * flame graphs
granite.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               granite-version:            0.7.3.0+version:            0.7.3.1 synopsis:           Easy terminal plotting. description:        A terminal plotting library for quick and easy visualisation. license:            MIT
src/Granite/Stat.hs view
@@ -45,6 +45,7 @@     Stat (..),     SummaryFun (..),  )+import Data.Maybe (listToMaybe, fromMaybe)  applyStat :: Stat -> Mapping -> DataFrame -> DataFrame applyStat stat m df = case stat of@@ -107,7 +108,7 @@     which :: [Double] -> Double -> Int     which es v         | length es < 2 = -1-        | v + eps < head es = -1+        | maybe False (v + eps <) (listToMaybe es) = -1         | v > last es + eps = -1         | otherwise = go 0       where@@ -150,7 +151,7 @@ kdeData n xs =     let nn = length xs         mu = sum xs / fromIntegral nn-        var = sum [(x - mu) ** 2 | x <- xs] / fromIntegral (max 1 (nn - 1))+        var = sum [(x - mu) ^ (2 :: Int) | x <- xs] / fromIntegral (max 1 (nn - 1))         sigma = sqrt (max var 1e-12)         h = 1.06 * sigma * fromIntegral nn ** (-0.2)         lo = minimum xs - 3 * h@@ -311,11 +312,11 @@                             then xs' !! (k `div` 2)                             else (xs' !! (k `div` 2 - 1) + xs' !! (k `div` 2)) / 2      in BoxStats-            { yMin = head sorted+            { yMin = fromMaybe 0 (listToMaybe sorted)             , q1 = qq lower             , med = m             , q3 = qq upper-            , yMax = last sorted+            , yMax = fromMaybe 0 (listToMaybe (reverse sorted))             }  runCount :: Mapping -> DataFrame -> DataFrame