Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
haskell-gargantext
Commits
55f89c13
Commit
55f89c13
authored
May 27, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] add debug info for graph, no partition error
parent
cdcf9903
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+1
-0
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+15
-6
Prelude.hs
src/Gargantext/Prelude.hs
+5
-1
No files found.
src/Gargantext/Core/Viz/Graph/API.hs
View file @
55f89c13
...
...
@@ -165,6 +165,7 @@ computeGraph cId d nt repo = do
<$>
getNodesByNgramsOnlyUser
cId
(
lIds
<>
[
lId
])
nt
(
HashMap
.
keys
ngs
)
-- printDebug "myCooc" myCooc
saveAsFileDebug
"debug/my-cooc"
myCooc
graph
<-
liftBase
$
cooc2graphWith
Spinglass
d
0
myCooc
pure
graph
...
...
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
55f89c13
...
...
@@ -82,14 +82,14 @@ cooc2graph'' :: Ord t => Distance
->
Double
->
Map
(
t
,
t
)
Int
->
Map
(
Index
,
Index
)
Double
cooc2graph''
distance
threshold
myCooc
=
neighbouMap
cooc2graph''
distance
threshold
myCooc
=
neighbou
r
Map
where
(
ti
,
_
)
=
createIndices
myCooc
myCooc'
=
toIndex
ti
myCooc
matCooc
=
map2mat
Triangle
0
(
Map
.
size
ti
)
$
Map
.
filter
(
>
1
)
myCooc'
distanceMat
=
measure
distance
matCooc
neighbouMap
=
filterByNeighbours
threshold
$
mat2map
distanceMat
neighbou
r
Map
=
filterByNeighbours
threshold
$
mat2map
distanceMat
-- Quentin
...
...
@@ -151,11 +151,20 @@ cooc2graphWith' doPartitions distance threshold myCooc = do
n'
=
Set
.
size
$
Set
.
fromList
$
as
<>
bs
ClustersParams
rivers
_level
=
clustersParams
nodesApprox
saveAsFileDebug
"debug/the-matrix"
theMatrix
saveAsFileDebug
"debug/my-cooc-prime"
myCooc'
saveAsFileDebug
"debug/mat-cooc"
matCooc
saveAsFileDebug
"debug/similarities"
similarities
saveAsFileDebug
"debug/links"
links
saveAsFileDebug
"debug/distanceMap"
distanceMap
saveAsFileDebug
"debug/nodesApprox"
nodesApprox
printDebug
"similarities"
similarities
partitions
<-
if
(
Map
.
size
distanceMap
>
0
)
then
doPartitions
distanceMap
else
panic
"Text.Flow: DistanceMap is empty"
-- partitions <- if (Map.size distanceMap > 0)
-- then doPartitions distanceMap
-- else panic "Text.Flow: DistanceMap is empty"
partitions
<-
doPartitions
distanceMap
let
-- bridgeness' = distanceMap
...
...
src/Gargantext/Prelude.hs
View file @
55f89c13
...
...
@@ -38,7 +38,7 @@ import Data.Map (Map, lookup)
import
Data.Maybe
(
isJust
,
fromJust
,
maybe
)
import
Data.Monoid
(
Monoid
,
mempty
)
import
Data.Semigroup
(
Semigroup
,
(
<>
))
import
Data.Text
(
Text
)
import
Data.Text
(
Text
,
pack
)
import
Data.Typeable
(
Typeable
)
import
Protolude
(
Bool
(
True
,
False
),
Int
,
Int64
,
Double
,
Integer
,
Fractional
,
Num
,
Maybe
(
Just
,
Nothing
)
...
...
@@ -66,6 +66,7 @@ import Protolude ( Bool(True, False), Int, Int64, Double, Integer
,
panic
,
seq
)
import
qualified
Protolude
as
Protolude
(
writeFile
)
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
,
putStrLn
)
-- TODO import functions optimized in Utils.Count
...
...
@@ -87,6 +88,9 @@ printDebug :: (Show a, MonadBase IO m) => [Char] -> a -> m ()
printDebug
msg
x
=
liftBase
.
putStrLn
$
msg
<>
" "
<>
show
x
-- printDebug _ _ = pure ()
saveAsFileDebug
::
(
Show
a
,
MonadBase
IO
m
)
=>
[
Char
]
->
a
->
m
()
saveAsFileDebug
fname
x
=
liftBase
.
Protolude
.
writeFile
fname
$
pack
$
show
x
-- | splitEvery n == chunkAlong n n
splitEvery
::
Int
->
[
a
]
->
[[
a
]]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment