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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
7beb5d72
Commit
7beb5d72
authored
Oct 24, 2024
by
Alfredo Di Napoli
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
computeTime field in now optional
parent
2fd9c3e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
19 deletions
+14
-19
Phylo.hs
src/Gargantext/Core/Viz/Phylo.hs
+13
-18
PhyloMaker.hs
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
+1
-1
No files found.
src/Gargantext/Core/Viz/Phylo.hs
View file @
7beb5d72
...
@@ -430,13 +430,10 @@ type Period = (Date,Date)
...
@@ -430,13 +430,10 @@ type Period = (Date,Date)
type
PeriodStr
=
(
DateStr
,
DateStr
)
type
PeriodStr
=
(
DateStr
,
DateStr
)
data
ComputeTimeHistory
newtype
ComputeTimeHistory
=
NoHistoricalDataAvailable
=
ComputeTimeHistory
(
NonEmpty
ElapsedSeconds
)
|
ComputeTimeHistory
(
NonEmpty
ElapsedSeconds
)
deriving
stock
(
Show
,
Eq
,
Generic
)
deriving
(
Show
,
Eq
,
Generic
,
ToExpr
)
deriving
newtype
ToExpr
noComputeTimeHistory
::
ComputeTimeHistory
noComputeTimeHistory
=
NoHistoricalDataAvailable
instance
ToSchema
ComputeTimeHistory
where
instance
ToSchema
ComputeTimeHistory
where
declareNamedSchema
_
=
declareNamedSchema
(
Proxy
@
[
ElapsedSeconds
])
declareNamedSchema
_
=
declareNamedSchema
(
Proxy
@
[
ElapsedSeconds
])
...
@@ -459,8 +456,9 @@ data Phylo =
...
@@ -459,8 +456,9 @@ data Phylo =
-- See #409, store historical data on
-- See #409, store historical data on
-- how many seconds it took to generate
-- how many seconds it took to generate
-- a given phylomemy graph, to give a rough
-- a given phylomemy graph, to give a rough
-- estimate to end users.
-- estimate to end users. The field is optional
,
_phylo_computeTime
::
!
ComputeTimeHistory
-- to make it backward compatible.
,
_phylo_computeTime
::
!
(
Maybe
ComputeTimeHistory
)
}
}
deriving
(
Generic
,
Show
,
Eq
,
ToExpr
)
deriving
(
Generic
,
Show
,
Eq
,
ToExpr
)
...
@@ -706,13 +704,10 @@ instance ToJSON PhyloGroup
...
@@ -706,13 +704,10 @@ instance ToJSON PhyloGroup
instance
ToJSON
ComputeTimeHistory
where
instance
ToJSON
ComputeTimeHistory
where
toJSON
=
\
case
toJSON
=
\
case
NoHistoricalDataAvailable
->
JS
.
Null
ComputeTimeHistory
runs
ComputeTimeHistory
runs
->
toJSON
runs
->
toJSON
runs
instance
FromJSON
ComputeTimeHistory
where
instance
FromJSON
ComputeTimeHistory
where
parseJSON
JS
.
Null
=
pure
NoHistoricalDataAvailable
parseJSON
(
JS
.
Array
runs
)
=
ComputeTimeHistory
<$>
parseJSON
(
JS
.
Array
runs
)
parseJSON
(
JS
.
Array
runs
)
=
ComputeTimeHistory
<$>
parseJSON
(
JS
.
Array
runs
)
parseJSON
ty
=
JS
.
typeMismatch
"ComputeTimeHistory"
ty
parseJSON
ty
=
JS
.
typeMismatch
"ComputeTimeHistory"
ty
...
@@ -832,7 +827,7 @@ instance Arbitrary PhyloParam where
...
@@ -832,7 +827,7 @@ instance Arbitrary PhyloParam where
arbitrary
=
pure
defaultPhyloParam
arbitrary
=
pure
defaultPhyloParam
instance
Arbitrary
ComputeTimeHistory
where
instance
Arbitrary
ComputeTimeHistory
where
arbitrary
=
oneof
[
pure
NoHistoricalDataAvailable
,
ComputeTimeHistory
.
NE
.
fromList
.
getNonEmpty
<$>
arbitrary
]
arbitrary
=
oneof
[
ComputeTimeHistory
.
NE
.
fromList
.
getNonEmpty
<$>
arbitrary
]
-- The 'resize' ensure our tests won't take too long as
-- The 'resize' ensure our tests won't take too long as
-- we won't be generating very long lists.
-- we won't be generating very long lists.
...
@@ -857,9 +852,9 @@ trackComputeTime elapsedSecs = over phylo_computeTime update_time
...
@@ -857,9 +852,9 @@ trackComputeTime elapsedSecs = over phylo_computeTime update_time
where
where
-- In case we have more than one historical data available, we take only the last 5
-- In case we have more than one historical data available, we take only the last 5
-- runs, to not make the list unbounded.
-- runs, to not make the list unbounded.
update_time
::
ComputeTimeHistory
->
ComputeTimeHistory
update_time
::
Maybe
ComputeTimeHistory
->
Maybe
ComputeTimeHistory
update_time
No
HistoricalDataAvailable
update_time
No
thing
=
ComputeTimeHistory
(
NE
.
singleton
elapsedSecs
)
=
Just
$
ComputeTimeHistory
(
NE
.
singleton
elapsedSecs
)
update_time
(
ComputeTimeHistory
(
r
NE
.:|
runs
))
=
update_time
(
Just
(
ComputeTimeHistory
(
r
NE
.:|
runs
)
))
=
ComputeTimeHistory
(
elapsedSecs
NE
.:|
(
r
:
take
3
runs
))
Just
$
ComputeTimeHistory
(
elapsedSecs
NE
.:|
(
r
:
take
3
runs
))
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
View file @
7beb5d72
...
@@ -551,4 +551,4 @@ initPhylo docs conf =
...
@@ -551,4 +551,4 @@ initPhylo docs conf =
(
fromList
$
map
(
\
prd
->
(
prd
,
PhyloPeriod
prd
(
""
,
""
)
(
initPhyloScales
1
prd
)))
periods
)
(
fromList
$
map
(
\
prd
->
(
prd
,
PhyloPeriod
prd
(
""
,
""
)
(
initPhyloScales
1
prd
)))
periods
)
0
0
(
_qua_granularity
$
phyloQuality
$
_phyloParam_config
params
)
(
_qua_granularity
$
phyloQuality
$
_phyloParam_config
params
)
noComputeTimeHistory
Nothing
Przemyslaw Kaminski
@cgenie
mentioned in commit
83c8708f
·
Nov 07, 2024
mentioned in commit
83c8708f
mentioned in commit 83c8708f08e563243a0ff361e51a46c7d7822bb7
Toggle commit list
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