Commit 82bfdeec authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Use tracePhylo in PhyloMaker

parent ad332461
......@@ -37,7 +37,7 @@ cabal:
- .cabal/
policy: pull-push
script:
- nix-shell --run "./bin/update-project-dependencies $CABAL_STORE_DIR && cabal --store-dir=$CABAL_STORE_DIR v2-build --flags test-crypto --ghc-options='-O0 -fclear-plugins'"
- nix-shell --run "./bin/update-project-dependencies $CABAL_STORE_DIR && cabal --store-dir=$CABAL_STORE_DIR v2-build --flags 'test-crypto no-phylo-debug-logs' --ghc-options='-O0 -fclear-plugins'"
allow_failure: false
bench:
......
......@@ -179,7 +179,7 @@ toBid g bs =
exportToDot :: Phylo -> PhyloExport -> DotGraph DotId
exportToDot phylo export =
trace ("\n-- | Convert " <> show(length $ export ^. export_branches) <> " branches and "
tracePhylo ("\n-- | Convert " <> show(length $ export ^. export_branches) <> " branches and "
<> show(length $ export ^. export_groups) <> " groups "
<> show(length $ nub $ concat $ map (^. phylo_groupNgrams) $ export ^. export_groups)
<> " terms to a dot file\n\n"
......
......@@ -192,7 +192,7 @@ findSeaLadder phylo = case getSeaElevation phylo of
appendGroups :: (a -> Period -> (Text,Text) -> Scale -> Int -> [Cooc] -> Map Int Double -> PhyloGroup) -> Scale -> Map (Date,Date) [a] -> Phylo -> Phylo
appendGroups f lvl m phylo =
trace ("\n" <> "-- | Append "
tracePhylo ("\n" <> "-- | Append "
<> show (length $ concat $ elems m)
<> " groups to scale "
<> show (lvl) <> "\n" :: Text)
......@@ -381,7 +381,7 @@ docsToTimeScaleCooc docs fdt =
mCooc' = fromList
$ map (\t -> (t,empty))
$ toTimeScale (map date docs) 1
in trace ("\n" <> "-- | Build the coocurency matrix for "
in tracePhylo ("\n" <> "-- | Build the coocurency matrix for "
<> show (length $ keys mCooc')
<> " unit of time" <> "\n" :: Text)
$ unionWith sumCooc mCooc mCooc'
......@@ -407,7 +407,7 @@ groupDocsByPeriod' :: (NFData doc, Ord date, Enum date) => (doc -> date) -> [(da
groupDocsByPeriod' f pds docs =
let docs' = groupBy (\d d' -> f d == f d') $ sortOn f docs
periods = parMap rpar (inPeriode f docs') pds
in trace ("\n" <> "-- | Group "
in tracePhylo ("\n" <> "-- | Group "
<> show(length docs)
<> " docs by "
<> show(length pds) <> " periods" <> "\n" :: Text)
......@@ -426,7 +426,7 @@ groupDocsByPeriod _ _ [] = panic "[ERR][Viz.Phylo.PhyloMaker] Empty [Documents
groupDocsByPeriod f pds es =
let periods = parMap rpar (inPeriode f es) pds
in trace ("\n" <> "-- | Group "
in tracePhylo ("\n" <> "-- | Group "
<> show(length es) <> " docs by "
<> show(length pds) <> " periods" <> "\n" :: Text)
$ fromList $ zip pds periods
......@@ -483,7 +483,7 @@ docsToTimeScaleNb :: [Document] -> Map Date Double
docsToTimeScaleNb docs =
let docs' = fromListWith (+) $ map (\d -> (date d,1)) docs
time = fromList $ map (\t -> (t,0)) $ toTimeScale (keys docs') 1
in trace ("\n" <> "-- | Group "
in tracePhylo ("\n" <> "-- | Group "
<> show(length docs)
<> " docs by "
<> show(length time)
......@@ -539,9 +539,9 @@ initPhylo docs conf =
then defaultPhyloParam { _phyloParam_config = setDefault conf timeScale (length docs) }
else defaultPhyloParam { _phyloParam_config = conf }
periods = toPeriods (D.sort $ D.nub $ map date docs) (getTimePeriod timeScale) (getTimeStep timeScale)
in trace ("\n" <> "-- | Init a phylo out of "
in tracePhylo ("\n" <> "-- | Init a phylo out of "
<> show(length docs) <> " docs \n" :: Text)
$ trace ("\n" <> "-- | lambda "
$ tracePhylo ("\n" <> "-- | lambda "
<> show(_qua_granularity $ phyloQuality $ _phyloParam_config params) :: Text)
$ Phylo foundations
docsSources
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment