...
 
Commits (3)
......@@ -16,8 +16,8 @@ fi
# with the `sha256sum` result calculated on the `cabal.project` and
# `cabal.project.freeze`. This ensures the files stay deterministic so that CI
# cache can kick in.
expected_cabal_project_hash="963418e37a17d4bb67d4b885613144b36d290f612eea80355e82abc7e76b450c"
expected_cabal_project_freeze_hash="cd52143d3a9d285360b59c6371d3e258552c1bc115bd612024db3de1f7593ff7"
expected_cabal_project_hash="7d021a8e3d0b68421e26bdfe4e1da82f6ea26b6c420fc984b3c30c14bc5fea98"
expected_cabal_project_freeze_hash="553b98aadb35506a305bd740cdd71f5fadc1e6d55d10f91cf39daa6735a63d78"
cabal --store-dir=$STORE_DIR v2-build --dry-run
......
......@@ -87,7 +87,7 @@ source-repository-package
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/gargantext-graph.git
tag: a08ceed71b297a811f90cb86c3c61dc0b153036b
tag: 316d48b6a89593faaf1f2102e9714cea7e416e56
subdir: gargantext-graph-core
-- Support for GHC 9.6.x
......@@ -99,7 +99,7 @@ source-repository-package
source-repository-package
type: git
location: https://gitlab.iscpif.fr/gargantext/haskell-igraph.git
tag: 9f8a2f4a014539826a4eab3215cc70c0813f20cb
tag: 05e62da3aa466b7d0608d4918b030dc024119b32
source-repository-package
type: git
......
......@@ -25,8 +25,6 @@ constraints: any.Boolean ==0.2.4,
any.StateVar ==1.2.2,
any.accelerate ==1.3.0.0,
accelerate +bounds-checks -debug -internal-checks -nofib -unsafe-checks,
any.accelerate-arithmetic ==1.0.0.1,
any.accelerate-utility ==1.0.0.1,
any.adjunctions ==4.4.2,
any.aeson ==2.1.2.1,
aeson -cffi +ordered-keymap,
......@@ -79,6 +77,8 @@ constraints: any.Boolean ==0.2.4,
any.blaze-builder ==0.4.2.3,
any.blaze-html ==0.9.2.0,
any.blaze-markup ==0.8.3.0,
any.blaze-textual ==0.2.3.1,
blaze-textual -developer -integer-simple +native,
any.boolexpr ==0.3,
any.boring ==0.2.2,
boring +tagged,
......@@ -103,6 +103,7 @@ constraints: any.Boolean ==0.2.4,
cassava-conduit +small_base,
any.cborg ==0.2.10.0,
cborg +optimize-gmp,
any.cborg-json ==0.2.6.0,
any.cereal ==0.5.8.3,
cereal -bytestring-builder,
any.charset ==0.3.11,
......@@ -161,6 +162,8 @@ constraints: any.Boolean ==0.2.4,
any.dense-linear-algebra ==0.1.0.0,
any.digest ==0.0.2.1,
digest -have_arm64_crc32c -have_builtin_prefetch -have_mm_prefetch -have_sse42 -have_strong_getauxval -have_weak_getauxval +pkg-config,
any.direct-sqlite ==2.3.29,
direct-sqlite +dbstat +fulltextsearch +haveusleep +json1 -mathfunctions -systemlib +urifilenames,
any.directory ==1.3.8.5,
any.discrimination ==0.5,
any.distributive ==0.6.2.1,
......@@ -170,7 +173,6 @@ constraints: any.Boolean ==0.2.4,
any.double-conversion ==2.0.5.0,
double-conversion -developer +embedded_double_conversion,
any.easy-file ==0.2.5,
any.eigen ==3.3.7.0,
any.either ==5.0.2,
any.ekg-core ==0.1.1.8,
any.ekg-json ==0.1.1.1,
......@@ -223,7 +225,7 @@ constraints: any.Boolean ==0.2.4,
any.haskell-bee ==0.1.0.0,
any.haskell-bee-pgmq ==0.1.0.0,
any.haskell-bee-tests ==0.1.0.0,
any.haskell-igraph ==0.10.4,
any.haskell-igraph ==0.10.4.1,
any.haskell-lexer ==1.1.2,
any.haskell-pgmq ==0.1.0.0,
any.haskell-src-exts ==1.23.1,
......@@ -300,7 +302,6 @@ constraints: any.Boolean ==0.2.4,
any.linear ==1.23,
linear -herbie +template-haskell,
any.list-t ==1.0.5.7,
any.lockfree-queue ==0.2.4,
any.logict ==0.8.2.0,
any.loop ==0.3.0,
any.lzma ==0.0.1.1,
......@@ -460,6 +461,7 @@ constraints: any.Boolean ==0.2.4,
any.servant-blaze ==0.9.1,
any.servant-client ==0.20.2,
any.servant-client-core ==0.20.2,
any.servant-conduit ==0.16.1,
any.servant-ekg ==0.3.1,
any.servant-openapi3 ==2.0.1.6,
any.servant-routes ==0.1.0.0,
......@@ -487,6 +489,7 @@ constraints: any.Boolean ==0.2.4,
any.split ==0.2.5,
any.splitmix ==0.1.1,
splitmix -optimised-mixer,
any.sqlite-simple ==0.4.19.0,
any.statistics ==0.16.3.0,
statistics -benchpapi,
any.stemmer ==0.5.2,
......@@ -571,7 +574,6 @@ constraints: any.Boolean ==0.2.4,
any.uri-encode ==1.5.0.7,
uri-encode +network-uri -tools,
any.utf8-string ==1.0.2,
any.utility-ht ==0.0.17.2,
any.uuid ==1.3.16,
any.uuid-types ==1.0.6,
any.validity ==0.12.1.0,
......
......@@ -552,7 +552,7 @@ library
, graphviz ^>= 2999.20.1.0
, haskell-bee
, haskell-bee-pgmq
, haskell-igraph ^>= 0.10.4
, haskell-igraph ^>= 0.10.4.1
, haskell-pgmq >= 0.1.0.0 && < 0.2
, haskell-throttle
, hlcm ^>= 0.2.2
......
......@@ -138,11 +138,11 @@ occurrences = occurrencesOn _terms_stem
-- Note: Compared to `occurences`, this is the more elementary function, maybe
-- it would make more sense to rename this one into `occurences` and the other
-- into something more descriptive
countOccurrences :: (Foldable f, Ord a, Num n)
=> f a -- ^ The collection whose items will be counted
-> Map a n -- ^ A map whose keys are items of the input
-- collection, and whose values are the number of
-- times those items appear in the input collection
countOccurrences :: (Foldable f, Ord a)
=> f a -- ^ The collection whose items will be counted
-> Map a Int -- ^ A map whose keys are items of the input
-- collection, and whose values are the number of
-- times those items appear in the input collection
countOccurrences collection =
foldl' (\occurenceMap item -> insertWith (+) item 1 occurenceMap)
empty
......
......@@ -33,7 +33,7 @@ import Gargantext.Core.Viz.Graph.Bridgeness (bridgeness, nodeId2comId, setNodes2
import Gargantext.Core.Viz.Graph.Index (createIndices, toIndex, map2mat, mat2map, Index, MatrixShape(..))
import Gargantext.Core.Viz.Graph.Tools.IGraph (mkGraphUfromEdges, spinglass)
import Gargantext.Core.Viz.Graph.Types (Attributes(..), BridgenessMethod, Edge(..), Graph(..), MultiPartite(..), Node(..), Partite(..), Strength(..), LegendField(..))
import Gargantext.Core.Viz.Graph.Utils (edgesFilter, nodesFilter)
import Gargantext.Core.Viz.Graph.Utils (edgesFilter, filterNodesByCount)
import Gargantext.Prelude
import Graph.BAC.ProxemyOptim qualified as BAC
import Graph.Types (ClusterNode(..))
......@@ -189,7 +189,7 @@ data2graph multi labels' occurences bridge conf partitions =
]
-- Remove vertices not connected to any other node, i.e. vertices that have
-- zero edge joining them to other vertices
(bridge', toKeep) = nodesFilter (> 0) bridge
(bridge', toKeep) = filterNodesByCount (> 0) bridge
edges = [ Edge { edge_source = show s
, edge_hidden = Nothing
......@@ -264,7 +264,7 @@ getCoord ACP labels m n = to2d $ maybe (panic "Graph.Tools no coordinate") ident
-- | KamadaKawai Layout
-- TODO TEST: check labels, nodeId and coordinates
layout :: Map (Int, Int) Double -> Int -> Gen -> (Double, Double)
layout :: Map (Int, Int) Double -> Int -> Gen s -> (Double, Double)
layout m n gen = maybe (panic "") identity $ Map.lookup n $ coord
where
coord :: (Map Int (Double,Double))
......
......@@ -55,8 +55,7 @@ spinglassAux :: (Serialize v, Serialize e, Show v)
=> Int -- ^ Random seed
-> IG.Graph 'U v e -- ^ Input graph
-> IO [[v]] -- ^ List of clusters, in the form of lists of vertex labels
spinglassAux seed graph = do
gen <- IG.withSeed seed pure -- initialize random generator
spinglassAux seed graph = IG.withSeed seed $ \gen -> do -- initialize random generator
rawClusters <- IG.findCommunity graph Nothing Nothing IG.spinglass gen -- perform clustering
-- The clusters we get are composed of vertex IDs corresponding to the internal
-- representation of IGraph graphs, so we need to retrieve the vertex labels:
......
......@@ -81,8 +81,17 @@ edgesFilter m = Map.fromList $ catMaybes results
keys = Set.toList $ Set.fromList (x <> y)
(x,y) = unzip $ Map.keys m
nodesFilter :: (Show a, Show b, Ord a, Ord b, Num b) => (b -> Bool) -> Map (a,a) b -> (Map (a,a) b, Set a)
nodesFilter f m = (m', toKeep)
-- | Filter nodes depending on how many times they (co)occur.
-- More specifically, for a given value `x :: a`, this sums all entries in the
-- map that have `x` as a value, and then it filters by applying `f` to the sum.
-- Warning: This counts the value at `(x, x)` twice.
filterNodesByCount :: (Show node, Ord node)
=> (Int -> Bool) -- ^ Filtering function
-> Map (node, node) b -- ^ Input map
-> (Map (node, node) b, Set node)
-- ^ The map without the filtered out nodes, and the set of
-- remaining nodes
filterNodesByCount f m = (m', toKeep)
where
m' = Map.filterWithKey (\(a,b) _ -> Set.member a toKeep && Set.member b toKeep) m
toKeep = Set.fromList
......
......@@ -170,7 +170,7 @@
git: "https://gitlab.iscpif.fr/gargantext/crawlers/pubmed.git"
subdirs:
- .
- commit: a08ceed71b297a811f90cb86c3c61dc0b153036b
- commit: 316d48b6a89593faaf1f2102e9714cea7e416e56
git: "https://gitlab.iscpif.fr/gargantext/gargantext-graph.git"
subdirs:
- "gargantext-graph-core"
......@@ -190,7 +190,7 @@
git: "https://gitlab.iscpif.fr/gargantext/haskell-gargantext-prelude"
subdirs:
- .
- commit: 9f8a2f4a014539826a4eab3215cc70c0813f20cb
- commit: 05e62da3aa466b7d0608d4918b030dc024119b32
git: "https://gitlab.iscpif.fr/gargantext/haskell-igraph.git"
subdirs:
- .
......