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
88f2254f
Unverified
Commit
88f2254f
authored
Oct 03, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TODO comments near undefined/panic calls
parent
d0a57d8c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
20 deletions
+22
-20
API.hs
src/Gargantext/API.hs
+2
-2
Node.hs
src/Gargantext/API/Node.hs
+11
-10
Orchestrator.hs
src/Gargantext/API/Orchestrator.hs
+1
-1
Prefix.hs
src/Gargantext/Core/Utils/Prefix.hs
+1
-1
Count.hs
src/Gargantext/Text/Metrics/Count.hs
+1
-0
Date.hs
src/Gargantext/Text/Parsers/Date.hs
+1
-0
TextFlow.hs
src/Gargantext/TextFlow.hs
+1
-1
Index.hs
src/Gargantext/Viz/Graph/Index.hs
+4
-5
No files found.
src/Gargantext/API.hs
View file @
88f2254f
...
@@ -258,9 +258,9 @@ server env = do
...
@@ -258,9 +258,9 @@ server env = do
:<|>
nodeAPI
conn
:<|>
nodeAPI
conn
:<|>
nodeAPI
conn
:<|>
nodeAPI
conn
:<|>
nodesAPI
conn
:<|>
nodesAPI
conn
:<|>
count
:<|>
count
-- TODO: undefined
:<|>
search
conn
:<|>
search
conn
:<|>
graphAPI
conn
:<|>
graphAPI
conn
-- TODO: mock
:<|>
treeAPI
conn
:<|>
treeAPI
conn
-- :<|> orchestrator
-- :<|> orchestrator
where
where
...
...
src/Gargantext/API/Node.hs
View file @
88f2254f
...
@@ -57,9 +57,9 @@ import Gargantext.Text.Terms (TermType(..))
...
@@ -57,9 +57,9 @@ import Gargantext.Text.Terms (TermType(..))
-------------------------------------------------------------------
-------------------------------------------------------------------
-- | Node API Types management
-- | Node API Types management
type
Roots
=
Get
'[
J
SON
]
[
Node
Value
]
type
Roots
=
Get
'[
J
SON
]
[
Node
Value
]
:<|>
Post
'[
J
SON
]
Int
:<|>
Post
'[
J
SON
]
Int
-- TODO
:<|>
Put
'[
J
SON
]
Int
:<|>
Put
'[
J
SON
]
Int
-- TODO
:<|>
Delete
'[
J
SON
]
Int
:<|>
Delete
'[
J
SON
]
Int
-- TODO
type
NodesAPI
=
Delete
'[
J
SON
]
Int
type
NodesAPI
=
Delete
'[
J
SON
]
Int
...
@@ -106,15 +106,16 @@ type FacetDocAPI = "table"
...
@@ -106,15 +106,16 @@ type FacetDocAPI = "table"
-- | Node API functions
-- | Node API functions
roots
::
Connection
->
Server
Roots
roots
::
Connection
->
Server
Roots
roots
conn
=
liftIO
(
putStrLn
(
"/user"
::
Text
)
>>
getNodesWithParentId
conn
0
Nothing
)
roots
conn
=
liftIO
(
putStrLn
(
"/user"
::
Text
)
>>
getNodesWithParentId
0
Nothing
conn
)
:<|>
pure
(
panic
"not implemented yet"
)
:<|>
pure
(
panic
"not implemented yet"
)
-- TODO
:<|>
pure
(
panic
"not implemented yet"
)
:<|>
pure
(
panic
"not implemented yet"
)
-- TODO
:<|>
pure
(
panic
"not implemented yet"
)
:<|>
pure
(
panic
"not implemented yet"
)
-- TODO
type
GraphAPI
=
Get
'[
J
SON
]
Graph
type
GraphAPI
=
Get
'[
J
SON
]
Graph
graphAPI
::
Connection
->
NodeId
->
Server
GraphAPI
graphAPI
::
Connection
->
NodeId
->
Server
GraphAPI
graphAPI
_
_
=
liftIO
$
textFlow
(
Mono
EN
)
(
Contexts
contextText
)
graphAPI
_
_
=
liftIO
$
textFlow
(
Mono
EN
)
(
Contexts
contextText
)
-- TODO what do we get about the node? to replace contextText
-- TODO(orphan): There should be a proper APIError data type with a case TreeError.
-- TODO(orphan): There should be a proper APIError data type with a case TreeError.
instance
HasTreeError
ServantErr
where
instance
HasTreeError
ServantErr
where
...
@@ -143,10 +144,10 @@ nodesAPI :: Connection -> [NodeId] -> Server NodesAPI
...
@@ -143,10 +144,10 @@ nodesAPI :: Connection -> [NodeId] -> Server NodesAPI
nodesAPI
conn
ids
=
deleteNodes'
conn
ids
nodesAPI
conn
ids
=
deleteNodes'
conn
ids
postNode
::
Connection
->
NodeId
->
Handler
Int
postNode
::
Connection
->
NodeId
->
Handler
Int
postNode
=
undefined
postNode
=
undefined
-- TODO
putNode
::
Connection
->
NodeId
->
Handler
Int
putNode
::
Connection
->
NodeId
->
Handler
Int
putNode
=
undefined
putNode
=
undefined
-- TODO
deleteNodes'
::
Connection
->
[
NodeId
]
->
Handler
Int
deleteNodes'
::
Connection
->
[
NodeId
]
->
Handler
Int
deleteNodes'
conn
ids
=
liftIO
(
deleteNodes
conn
ids
)
deleteNodes'
conn
ids
=
liftIO
(
deleteNodes
conn
ids
)
...
@@ -165,7 +166,7 @@ getFacet conn id offset limit = liftIO (putStrLn ( "/facet" :: Text)) >> liftIO
...
@@ -165,7 +166,7 @@ getFacet conn id offset limit = liftIO (putStrLn ( "/facet" :: Text)) >> liftIO
getChart
::
Connection
->
NodeId
->
Maybe
UTCTime
->
Maybe
UTCTime
getChart
::
Connection
->
NodeId
->
Maybe
UTCTime
->
Maybe
UTCTime
->
Handler
[
FacetChart
]
->
Handler
[
FacetChart
]
getChart
_
_
_
_
=
undefined
getChart
_
_
_
_
=
undefined
-- TODO
query
::
Text
->
Handler
Text
query
::
Text
->
Handler
Text
...
...
src/Gargantext/API/Orchestrator.hs
View file @
88f2254f
...
@@ -64,7 +64,7 @@ pipeline :: FromJSON e => URL -> ClientEnv -> ScraperInput
...
@@ -64,7 +64,7 @@ pipeline :: FromJSON e => URL -> ClientEnv -> ScraperInput
->
(
e
->
IO
()
)
->
IO
ScraperStatus
->
(
e
->
IO
()
)
->
IO
ScraperStatus
pipeline
scrapyurl
client_env
input
log_status
=
do
pipeline
scrapyurl
client_env
input
log_status
=
do
e
<-
runJobMLog
client_env
log_status
$
callScraper
scrapyurl
input
e
<-
runJobMLog
client_env
log_status
$
callScraper
scrapyurl
input
either
(
panic
.
cs
.
show
)
pure
e
either
(
panic
.
cs
.
show
)
pure
e
-- TODO throwError
scrapyOrchestrator
::
Env
->
IO
(
Server
(
WithCallbacks
ScraperAPI
))
scrapyOrchestrator
::
Env
->
IO
(
Server
(
WithCallbacks
ScraperAPI
))
scrapyOrchestrator
env
=
do
scrapyOrchestrator
env
=
do
...
...
src/Gargantext/Core/Utils/Prefix.hs
View file @
88f2254f
...
@@ -54,5 +54,5 @@ parseJSONFromString :: (Read a) => Value -> Parser a
...
@@ -54,5 +54,5 @@ parseJSONFromString :: (Read a) => Value -> Parser a
parseJSONFromString
v
=
do
parseJSONFromString
v
=
do
numString
<-
parseJSON
v
numString
<-
parseJSON
v
case
readMaybe
(
numString
::
String
)
of
case
readMaybe
(
numString
::
String
)
of
Nothing
->
fail
$
"Invalid number for TransactionID: "
++
show
v
Nothing
->
fail
$
"Invalid number for TransactionID: "
++
show
v
-- TODO error message too specific
Just
n
->
return
n
Just
n
->
return
n
src/Gargantext/Text/Metrics/Count.hs
View file @
88f2254f
...
@@ -100,6 +100,7 @@ useLabelPolicy :: Map Grouped [Text] -> Grouped -> [Text]
...
@@ -100,6 +100,7 @@ useLabelPolicy :: Map Grouped [Text] -> Grouped -> [Text]
useLabelPolicy
m
g
=
case
DMS
.
lookup
g
m
of
useLabelPolicy
m
g
=
case
DMS
.
lookup
g
m
of
Just
label
->
label
Just
label
->
label
Nothing
->
panic
$
"Label of Grouped not found: "
<>
(
pack
$
show
g
)
Nothing
->
panic
$
"Label of Grouped not found: "
<>
(
pack
$
show
g
)
-- TODO: use a non-fatal error if this can happen in practice
{-
{-
labelPolicy :: Map Grouped (Map Terms Occs) -> Grouped -> Label
labelPolicy :: Map Grouped (Map Terms Occs) -> Grouped -> Label
labelPolicy m g = case _terms_label <$> fst <$> maximumWith snd <$> DMS.toList <$> lookup g m of
labelPolicy m g = case _terms_label <$> fst <$> maximumWith snd <$> DMS.toList <$> lookup g m of
...
...
src/Gargantext/Text/Parsers/Date.hs
View file @
88f2254f
...
@@ -76,6 +76,7 @@ parserLang _ = panic "not implemented"
...
@@ -76,6 +76,7 @@ parserLang _ = panic "not implemented"
-- currentContext lang = localContext lang <$> utcToDucklingTime <$> getCurrentTime
-- currentContext lang = localContext lang <$> utcToDucklingTime <$> getCurrentTime
-- parseDate1 :: Context -> Text -> SomeErrorHandling Text
-- parseDate1 :: Context -> Text -> SomeErrorHandling Text
-- TODO error handling
parseDate1
::
Lang
->
Text
->
IO
Text
parseDate1
::
Lang
->
Text
->
IO
Text
parseDate1
lang
text
=
do
parseDate1
lang
text
=
do
maybeJson
<-
map
jsonValue
<$>
parseDateWithDuckling
lang
text
maybeJson
<-
map
jsonValue
<$>
parseDateWithDuckling
lang
text
...
...
src/Gargantext/TextFlow.hs
View file @
88f2254f
...
@@ -86,7 +86,7 @@ textFlow termType workType = do
...
@@ -86,7 +86,7 @@ textFlow termType workType = do
CSV
path
->
readCsvOn
[
csv_title
,
csv_abstract
]
path
CSV
path
->
readCsvOn
[
csv_title
,
csv_abstract
]
path
Contexts
ctxt
->
pure
ctxt
Contexts
ctxt
->
pure
ctxt
DB
con
corpusId
->
catMaybes
<$>
map
(
\
n
->
hyperdataDocumentV3_title
(
node_hyperdata
n
)
<>
hyperdataDocumentV3_abstract
(
node_hyperdata
n
))
<$>
getDocumentsV3WithParentId
con
corpusId
DB
con
corpusId
->
catMaybes
<$>
map
(
\
n
->
hyperdataDocumentV3_title
(
node_hyperdata
n
)
<>
hyperdataDocumentV3_abstract
(
node_hyperdata
n
))
<$>
getDocumentsV3WithParentId
con
corpusId
_
->
undefined
_
->
undefined
-- TODO Query not supported
textFlow'
termType
contexts
textFlow'
termType
contexts
...
...
src/Gargantext/Viz/Graph/Index.hs
View file @
88f2254f
...
@@ -38,7 +38,7 @@ import qualified Data.Set as S
...
@@ -38,7 +38,7 @@ import qualified Data.Set as S
import
Data.Map
(
Map
)
import
Data.Map
(
Map
)
import
qualified
Data.Map.Strict
as
M
import
qualified
Data.Map.Strict
as
M
import
Data.Vector
(
Vector
)
--
import Data.Vector (Vector)
import
Gargantext.Prelude
import
Gargantext.Prelude
...
@@ -86,13 +86,12 @@ indexConversion index ms = M.fromList $ map (\((k1,k2),c) -> ( ((M.!) index k1,
...
@@ -86,13 +86,12 @@ indexConversion index ms = M.fromList $ map (\((k1,k2),c) -> ( ((M.!) index k1,
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- TODO
--fromIndex' :: Ord t => Vector t -> Map (Index, Index) a -> Map (t,t) a
--fromIndex' :: Ord t => Vector t -> Map (Index, Index) a -> Map (t,t) a
--fromIndex' vi ns = undefined
--fromIndex' vi ns = undefined
-- TODO
-- TODO
: returing a Vector should be faster than a Map
createIndices'
::
Ord
t
=>
Map
(
t
,
t
)
b
->
(
Map
t
Index
,
Vector
t
)
--
createIndices' :: Ord t => Map (t, t) b -> (Map t Index, Vector t)
createIndices'
=
undefined
--
createIndices' = undefined
createIndices
::
Ord
t
=>
Map
(
t
,
t
)
b
->
(
Map
t
Index
,
Map
Index
t
)
createIndices
::
Ord
t
=>
Map
(
t
,
t
)
b
->
(
Map
t
Index
,
Map
Index
t
)
createIndices
=
set2indices
.
map2set
createIndices
=
set2indices
.
map2set
...
...
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