Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
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
Przemyslaw Kaminski
haskell-gargantext
Commits
fa2c713b
Commit
fa2c713b
authored
Dec 17, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Warnings unused imports
parent
4ab99758
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
13 additions
and
45 deletions
+13
-45
Metrics.hs
src/Gargantext/API/Metrics.hs
+10
-12
NgramsTree.hs
src/Gargantext/API/Ngrams/NgramsTree.hs
+0
-2
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+0
-3
Export.hs
src/Gargantext/API/Node/Corpus/Export.hs
+0
-3
List.hs
src/Gargantext/Core/Text/List.hs
+0
-1
Group.hs
src/Gargantext/Core/Text/List/Group.hs
+0
-3
Prelude.hs
src/Gargantext/Core/Text/List/Group/Prelude.hs
+0
-2
WithScores.hs
src/Gargantext/Core/Text/List/Group/WithScores.hs
+0
-2
WithStem.hs
src/Gargantext/Core/Text/List/Group/WithStem.hs
+0
-1
Merge.hs
src/Gargantext/Core/Text/List/Merge.hs
+0
-1
Social.hs
src/Gargantext/Core/Text/List/Social.hs
+0
-1
History.hs
src/Gargantext/Core/Text/List/Social/History.hs
+0
-1
Patch.hs
src/Gargantext/Core/Text/List/Social/Patch.hs
+0
-1
Prelude.hs
src/Gargantext/Core/Text/List/Social/Prelude.hs
+0
-1
Scores.hs
src/Gargantext/Core/Text/List/Social/Scores.hs
+1
-3
Chart.hs
src/Gargantext/Core/Viz/Chart.hs
+0
-1
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+0
-1
Pairing.hs
src/Gargantext/Database/Action/Flow/Pairing.hs
+0
-1
Metrics.hs
src/Gargantext/Database/Action/Metrics.hs
+0
-3
Lists.hs
src/Gargantext/Database/Action/Metrics/Lists.hs
+2
-2
No files found.
src/Gargantext/API/Metrics.hs
View file @
fa2c713b
...
...
@@ -19,7 +19,6 @@ module Gargantext.API.Metrics
where
import
Control.Lens
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Text
(
Text
)
import
Data.Time
(
UTCTime
)
import
Data.Vector
(
Vector
)
...
...
@@ -42,8 +41,7 @@ import Gargantext.Database.Query.Table.Node.UpdateOpaleye (updateHyperdata)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
import
Servant
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.Vector
as
Vector
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Gargantext.Database.Action.Metrics
as
Metrics
-------------------------------------------------------------
...
...
@@ -80,7 +78,7 @@ getScatter cId maybeListId tabType _maybeLimit = do
Nothing
->
defaultList
cId
node
<-
getNodeWith
listId
(
Proxy
::
Proxy
HyperdataList
)
let
HyperdataList
{
_hl_scatter
=
scatterMap
}
=
node
^.
node_hyperdata
mChart
=
H
M
.
lookup
tabType
scatterMap
mChart
=
H
ashMap
.
lookup
tabType
scatterMap
chart
<-
case
mChart
of
Just
chart
->
pure
chart
...
...
@@ -115,7 +113,7 @@ updateScatter' cId maybeListId tabType maybeLimit = do
let
metrics
=
fmap
(
\
(
Scored
t
s1
s2
)
->
Metric
(
unNgramsTerm
t
)
s1
s2
(
listType
t
ngs'
))
$
fmap
normalizeLocal
scores
listType
t
m
=
maybe
(
panic
errorMsg
)
fst
$
H
M
.
lookup
t
m
listType
t
m
=
maybe
(
panic
errorMsg
)
fst
$
H
ashMap
.
lookup
t
m
errorMsg
=
"API.Node.metrics: key absent"
listId
<-
case
maybeListId
of
...
...
@@ -124,7 +122,7 @@ updateScatter' cId maybeListId tabType maybeLimit = do
node
<-
getNodeWith
listId
(
Proxy
::
Proxy
HyperdataList
)
let
hl
=
node
^.
node_hyperdata
scatterMap
=
hl
^.
hl_scatter
_
<-
updateHyperdata
listId
$
hl
{
_hl_scatter
=
H
M
.
insert
tabType
(
Metrics
metrics
)
scatterMap
}
_
<-
updateHyperdata
listId
$
hl
{
_hl_scatter
=
H
ashMap
.
insert
tabType
(
Metrics
metrics
)
scatterMap
}
pure
$
Metrics
metrics
...
...
@@ -174,7 +172,7 @@ getChart cId _start _end maybeListId tabType = do
Nothing
->
defaultList
cId
node
<-
getNodeWith
listId
(
Proxy
::
Proxy
HyperdataList
)
let
chartMap
=
node
^.
node_hyperdata
^.
hl_chart
mChart
=
H
M
.
lookup
tabType
chartMap
mChart
=
H
ashMap
.
lookup
tabType
chartMap
chart
<-
case
mChart
of
Just
chart
->
pure
chart
...
...
@@ -211,7 +209,7 @@ updateChart' cId maybeListId tabType _maybeLimit = do
let
hl
=
node
^.
node_hyperdata
chartMap
=
hl
^.
hl_chart
h
<-
histoData
cId
_
<-
updateHyperdata
listId
$
hl
{
_hl_chart
=
H
M
.
insert
tabType
(
ChartMetrics
h
)
chartMap
}
_
<-
updateHyperdata
listId
$
hl
{
_hl_chart
=
H
ashMap
.
insert
tabType
(
ChartMetrics
h
)
chartMap
}
pure
$
ChartMetrics
h
...
...
@@ -260,7 +258,7 @@ getPie cId _start _end maybeListId tabType = do
Nothing
->
defaultList
cId
node
<-
getNodeWith
listId
(
Proxy
::
Proxy
HyperdataList
)
let
pieMap
=
node
^.
node_hyperdata
^.
hl_pie
mChart
=
H
M
.
lookup
tabType
pieMap
mChart
=
H
ashMap
.
lookup
tabType
pieMap
chart
<-
case
mChart
of
Just
chart
->
pure
chart
...
...
@@ -298,7 +296,7 @@ updatePie' cId maybeListId tabType _maybeLimit = do
pieMap
=
hl
^.
hl_pie
p
<-
chartData
cId
(
ngramsTypeFromTabType
tabType
)
MapTerm
_
<-
updateHyperdata
listId
$
hl
{
_hl_pie
=
H
M
.
insert
tabType
(
ChartMetrics
p
)
pieMap
}
_
<-
updateHyperdata
listId
$
hl
{
_hl_pie
=
H
ashMap
.
insert
tabType
(
ChartMetrics
p
)
pieMap
}
pure
$
ChartMetrics
p
...
...
@@ -351,7 +349,7 @@ getTree cId _start _end maybeListId tabType listType = do
node
<-
getNodeWith
listId
(
Proxy
::
Proxy
HyperdataList
)
let
treeMap
=
node
^.
node_hyperdata
^.
hl_tree
mChart
=
H
M
.
lookup
tabType
treeMap
mChart
=
H
ashMap
.
lookup
tabType
treeMap
chart
<-
case
mChart
of
Just
chart
->
pure
chart
...
...
@@ -389,7 +387,7 @@ updateTree' cId maybeListId tabType listType = do
let
hl
=
node
^.
node_hyperdata
treeMap
=
hl
^.
hl_tree
t
<-
treeData
cId
(
ngramsTypeFromTabType
tabType
)
listType
_
<-
updateHyperdata
listId
$
hl
{
_hl_tree
=
H
M
.
insert
tabType
(
ChartMetrics
t
)
treeMap
}
_
<-
updateHyperdata
listId
$
hl
{
_hl_tree
=
H
ashMap
.
insert
tabType
(
ChartMetrics
t
)
treeMap
}
pure
$
ChartMetrics
t
...
...
src/Gargantext/API/Ngrams/NgramsTree.hs
View file @
fa2c713b
...
...
@@ -16,7 +16,6 @@ module Gargantext.API.Ngrams.NgramsTree
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
catMaybes
)
import
Data.Set
(
Set
)
import
Data.Swagger
...
...
@@ -30,7 +29,6 @@ import Gargantext.Prelude
import
Test.QuickCheck
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Set
as
Set
type
Children
=
Text
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
fa2c713b
...
...
@@ -19,9 +19,7 @@ import Control.Lens (_Just, (^.), at, view, At, Index, IxValue)
import
Control.Monad.Reader
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Hashable
(
Hashable
)
import
Data.Map.Strict
(
Map
)
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
import
Data.Validity
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
ListId
)
...
...
@@ -30,7 +28,6 @@ import Gargantext.Prelude
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Set
as
Set
import
qualified
Gargantext.Data.HashMap.Strict.Utils
as
HM
mergeNgramsElement
::
NgramsRepoElement
->
NgramsRepoElement
->
NgramsRepoElement
mergeNgramsElement
_neOld
neNew
=
neNew
...
...
src/Gargantext/API/Node/Corpus/Export.hs
View file @
fa2c713b
...
...
@@ -16,12 +16,9 @@ Main exports of Gargantext:
module
Gargantext.API.Node.Corpus.Export
where
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
import
Gargantext.API.Node.Corpus.Export.Types
import
Gargantext.API.Ngrams.Types
import
Gargantext.API.Ngrams.Tools
(
filterListWithRoot
,
mapTermListRoot
,
getRepo
)
...
...
src/Gargantext/Core/Text/List.hs
View file @
fa2c713b
...
...
@@ -21,7 +21,6 @@ import Data.Map (Map)
import
Data.Monoid
(
mempty
)
import
Data.Ord
(
Down
(
..
))
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
import
Data.Tuple.Extra
(
both
)
import
Gargantext.API.Ngrams.Types
(
NgramsElement
,
RepoCmdM
,
NgramsTerm
(
..
))
import
Gargantext.Core.Text
(
size
)
...
...
src/Gargantext/Core/Text/List/Group.hs
View file @
fa2c713b
...
...
@@ -20,17 +20,14 @@ module Gargantext.Core.Text.List.Group
import
Control.Lens
(
view
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Monoid
(
Monoid
,
mempty
)
import
Data.Text
(
Text
)
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
))
import
Gargantext.Core.Text.List.Group.Prelude
import
Gargantext.Core.Text.List.Group.WithScores
import
Gargantext.Core.Text.List.Social.Prelude
import
Gargantext.Prelude
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.Map
as
Map
------------------------------------------------------------------------
toGroupedTree
::
(
Ord
a
,
Monoid
a
)
=>
FlowCont
NgramsTerm
FlowListScores
...
...
src/Gargantext/Core/Text/List/Group/Prelude.hs
View file @
fa2c713b
...
...
@@ -18,7 +18,6 @@ module Gargantext.Core.Text.List.Group.Prelude
import
Control.Lens
(
makeLenses
,
view
,
set
,
over
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Monoid
import
Data.Semigroup
...
...
@@ -30,7 +29,6 @@ import Gargantext.Database.Admin.Types.Node (NodeId)
import
Gargantext.Prelude
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Set
as
Set
type
Stem
=
NgramsTerm
...
...
src/Gargantext/Core/Text/List/Group/WithScores.hs
View file @
fa2c713b
...
...
@@ -17,7 +17,6 @@ module Gargantext.Core.Text.List.Group.WithScores
import
Control.Lens
(
view
,
set
,
over
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Monoid
(
Monoid
,
mempty
)
import
Data.Semigroup
...
...
@@ -25,7 +24,6 @@ import Gargantext.API.Ngrams.Types (NgramsTerm(..))
import
Gargantext.Core.Text.List.Group.Prelude
import
Gargantext.Core.Text.List.Social.Prelude
import
Gargantext.Prelude
import
qualified
Data.Map
as
Map
import
qualified
Data.HashMap.Strict
as
HashMap
------------------------------------------------------------------------
...
...
src/Gargantext/Core/Text/List/Group/WithStem.hs
View file @
fa2c713b
...
...
@@ -20,7 +20,6 @@ module Gargantext.Core.Text.List.Group.WithStem
import
Data.HashSet
(
HashSet
)
import
Data.Map
(
Map
)
import
Data.Maybe
(
catMaybes
)
import
Data.Text
(
Text
)
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Text.List.Group.Prelude
...
...
src/Gargantext/Core/Text/List/Merge.hs
View file @
fa2c713b
...
...
@@ -20,7 +20,6 @@ module Gargantext.Core.Text.List.Merge
import
Control.Lens
(
view
)
import
Data.Map
(
Map
)
import
Data.Text
(
Text
)
import
Gargantext.API.Ngrams
import
Gargantext.API.Ngrams.Types
import
Gargantext.Prelude
...
...
src/Gargantext/Core/Text/List/Social.hs
View file @
fa2c713b
...
...
@@ -14,7 +14,6 @@ module Gargantext.Core.Text.List.Social
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Monoid
(
mconcat
)
import
Data.Text
(
Text
)
import
Gargantext.API.Ngrams.Tools
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Text.List.Social.Find
...
...
src/Gargantext/Core/Text/List/Social/History.hs
View file @
fa2c713b
...
...
@@ -21,7 +21,6 @@ import Gargantext.Database.Schema.Ngrams (NgramsType(..))
import
Gargantext.Prelude
import
qualified
Data.List
as
List
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.HashMap.Strict
as
HashMap
-- TODO put this in Prelude
cons
::
a
->
[
a
]
...
...
src/Gargantext/Core/Text/List/Social/Patch.hs
View file @
fa2c713b
...
...
@@ -17,7 +17,6 @@ import Data.Hashable (Hashable)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Monoid
import
Data.Semigroup
import
Data.Text
(
Text
)
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Text.List.Social.Prelude
import
Gargantext.Core.Types
(
ListId
)
...
...
src/Gargantext/Core/Text/List/Social/Prelude.hs
View file @
fa2c713b
...
...
@@ -24,7 +24,6 @@ import Data.HashMap.Strict (HashMap)
import
Data.Hashable
(
Hashable
)
import
Data.Monoid
import
Data.Semigroup
(
Semigroup
(
..
))
import
Data.Text
(
Text
)
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Types.Main
...
...
src/Gargantext/Core/Text/List/Social/Scores.hs
View file @
fa2c713b
...
...
@@ -21,12 +21,10 @@ import Control.Lens
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Monoid
(
mempty
)
import
Data.Set
(
Set
)
import
Data.Text
(
Text
)
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Text.List.Social.Prelude
import
Gargantext.Core.Types.Main
import
Gargantext.Prelude
import
qualified
Gargantext.Data.HashMap.Strict.Utils
as
HashMap
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.Set
as
Set
...
...
src/Gargantext/Core/Viz/Chart.hs
View file @
fa2c713b
...
...
@@ -17,7 +17,6 @@ module Gargantext.Core.Viz.Chart
import
Data.List
(
sortOn
)
import
Data.Map
(
toList
)
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
Data.Maybe
(
catMaybes
)
import
qualified
Data.Vector
as
V
...
...
src/Gargantext/Core/Viz/Graph/API.hs
View file @
fa2c713b
...
...
@@ -48,7 +48,6 @@ import Servant
import
Servant.Job.Async
import
Servant.XML
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.Map
as
Map
------------------------------------------------------------------------
-- | There is no Delete specific API for Graph since it can be deleted
-- as simple Node.
...
...
src/Gargantext/Database/Action/Flow/Pairing.hs
View file @
fa2c713b
...
...
@@ -42,7 +42,6 @@ import Gargantext.Prelude hiding (sum)
import
Opaleye
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Set
as
Set
import
qualified
Data.Text
as
DT
...
...
src/Gargantext/Database/Action/Metrics.hs
View file @
fa2c713b
...
...
@@ -14,8 +14,6 @@ module Gargantext.Database.Action.Metrics
where
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Text
(
Text
)
import
Data.Vector
(
Vector
)
import
Gargantext.API.Ngrams.Tools
(
filterListWithRoot
,
groupNodesByNgrams
,
Diagonal
(
..
),
getCoocByNgrams
,
mapTermListRoot
,
RootTerm
,
getRepo
)
import
Gargantext.API.Ngrams.Types
(
TabType
(
..
),
ngramsTypeFromTabType
,
NgramsTerm
)
...
...
@@ -29,7 +27,6 @@ import Gargantext.Database.Query.Table.Node (defaultList)
import
Gargantext.Database.Query.Table.Node.Select
import
Gargantext.Prelude
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.Map
as
Map
getMetrics
::
FlowCmdM
env
err
m
=>
CorpusId
->
Maybe
ListId
->
TabType
->
Maybe
Limit
...
...
src/Gargantext/Database/Action/Metrics/Lists.hs
View file @
fa2c713b
...
...
@@ -19,16 +19,16 @@ Portability : POSIX
module
Gargantext.Database.Action.Metrics.Lists
where
import
Gargantext.API.Ngrams.Types
(
TabType
(
..
)
,
NgramsTerm
(
..
)
)
import
Gargantext.API.Ngrams.Types
(
TabType
(
..
))
import
Gargantext.Core.Text.Metrics
(
Scored
(
..
))
import
Gargantext.Core.Types
-- (NodePoly(..), NodeCorpus, ListId)
import
Gargantext.Database.Action.Flow.Types
(
FlowCmdM
)
import
Gargantext.Prelude
hiding
(
sum
,
head
)
import
Prelude
hiding
(
null
,
id
,
map
,
sum
)
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.Map
as
Map
import
qualified
Data.Vector
as
Vec
import
qualified
Gargantext.Database.Action.Metrics
as
Metrics
import
qualified
Data.HashMap.Strict
as
HashMap
{-
trainModel :: FlowCmdM env ServantErr m
=> Username -> m Score
...
...
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