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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
gargantext
haskell-gargantext
Commits
1103b2c9
Commit
1103b2c9
authored
Nov 16, 2023
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate fromDBid with HasCallStack
parent
e9c12cb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
TreeFirstLevel.hs
src/Gargantext/API/GraphQL/TreeFirstLevel.hs
+2
-2
Core.hs
src/Gargantext/Core.hs
+2
-0
Learn.hs
src/Gargantext/Core/Text/List/Learn.hs
+1
-1
Tree.hs
src/Gargantext/Database/Query/Tree.hs
+2
-3
No files found.
src/Gargantext/API/GraphQL/TreeFirstLevel.hs
View file @
1103b2c9
...
...
@@ -104,7 +104,7 @@ resolveParent (Just pId) = do
resolveParent
Nothing
=
pure
Nothing
nodeToTreeNode
::
NN
.
Node
json
->
Maybe
TreeNode
nodeToTreeNode
::
HasCallStack
=>
NN
.
Node
json
->
Maybe
TreeNode
nodeToTreeNode
N
.
Node
{
..
}
=
if
(
fromDBid
_node_typename
/=
NN
.
NodeFolderShared
)
&&
(
fromDBid
_node_typename
/=
NN
.
NodeTeam
)
then
Just
TreeNode
{
id
=
NN
.
unNodeId
_node_id
...
...
@@ -118,7 +118,7 @@ nodeToTreeNode N.Node {..} = if (fromDBid _node_typename /= NN.NodeFolderShared)
resolveBreadcrumb
::
(
CmdCommon
env
)
=>
BreadcrumbArgs
->
GqlM
e
env
(
BreadcrumbInfo
)
resolveBreadcrumb
BreadcrumbArgs
{
node_id
}
=
dbRecursiveParents
node_id
convertDbTreeToTreeNode
::
T
.
DbTreeNode
->
TreeNode
convertDbTreeToTreeNode
::
HasCallStack
=>
T
.
DbTreeNode
->
TreeNode
convertDbTreeToTreeNode
T
.
DbTreeNode
{
_dt_name
,
_dt_nodeId
,
_dt_typeId
,
_dt_parentId
}
=
TreeNode
{
name
=
_dt_name
,
id
=
NN
.
unNodeId
_dt_nodeId
...
...
src/Gargantext/Core.hs
View file @
1103b2c9
...
...
@@ -186,6 +186,8 @@ instance HasDBid PosTagAlgo where
lookupDBid
_
=
Nothing
-- | Tries to convert the given integer into the relevant DB identifier, failing
-- with an error if the conversion cannot be performed.
fromDBid
::
forall
a
.
(
HasCallStack
,
HasDBid
a
,
Typeable
a
)
=>
Int
->
a
fromDBid
i
=
case
lookupDBid
i
of
Nothing
->
panic
$
"HasDBid "
<>
show
(
typeRep
(
Proxy
::
Proxy
a
))
<>
" not found or not implemented."
...
...
src/Gargantext/Core/Text/List/Learn.hs
View file @
1103b2c9
...
...
@@ -51,7 +51,7 @@ trainList x y = (train x y) . trainList'
vecs2maps
=
map
(
IntMap
.
fromList
.
(
zip
[
1
..
])
.
Vec
.
toList
)
predictList
::
Model
->
[
Vec
.
Vector
Double
]
->
IO
[
Maybe
ListType
]
predictList
::
HasCallStack
=>
Model
->
[
Vec
.
Vector
Double
]
->
IO
[
Maybe
ListType
]
predictList
(
ModelSVM
m
_
_
)
vs
=
map
(
Just
.
fromDBid
.
round
)
<$>
predict
m
vs
------------------------------------------------------------------------
...
...
src/Gargantext/Database/Query/Tree.hs
View file @
1103b2c9
...
...
@@ -248,7 +248,7 @@ findNodesId r nt = tail
<$>
map
_dt_nodeId
<$>
dbTree
r
nt
findNodesWithType
::
RootId
->
[
NodeType
]
->
[
NodeType
]
->
DBCmd
err
[
DbTreeNode
]
findNodesWithType
::
HasCallStack
=>
RootId
->
[
NodeType
]
->
[
NodeType
]
->
DBCmd
err
[
DbTreeNode
]
findNodesWithType
root
target
through
=
filter
isInTarget
<$>
dbTree
root
through
where
...
...
@@ -282,8 +282,7 @@ toTree m =
-- m' ^.. at (Just $ _dt_nodeId root) . _Just . each . to (toTree' m')
toListOf
(
at
(
Just
$
_dt_nodeId
root
)
.
_Just
.
each
.
to
(
toTree'
m'
))
m'
toNodeTree
::
DbTreeNode
->
NodeTree
toNodeTree
::
HasCallStack
=>
DbTreeNode
->
NodeTree
toNodeTree
(
DbTreeNode
nId
tId
_
n
)
=
NodeTree
n
(
fromDBid
tId
)
nId
------------------------------------------------------------------------
...
...
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