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
157
Issues
157
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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)
type
PeriodStr
=
(
DateStr
,
DateStr
)
data
ComputeTimeHistory
=
NoHistoricalDataAvailable
|
ComputeTimeHistory
(
NonEmpty
ElapsedSeconds
)
deriving
(
Show
,
Eq
,
Generic
,
ToExpr
)
noComputeTimeHistory
::
ComputeTimeHistory
noComputeTimeHistory
=
NoHistoricalDataAvailable
newtype
ComputeTimeHistory
=
ComputeTimeHistory
(
NonEmpty
ElapsedSeconds
)
deriving
stock
(
Show
,
Eq
,
Generic
)
deriving
newtype
ToExpr
instance
ToSchema
ComputeTimeHistory
where
declareNamedSchema
_
=
declareNamedSchema
(
Proxy
@
[
ElapsedSeconds
])
...
...
@@ -459,8 +456,9 @@ data Phylo =
-- See #409, store historical data on
-- how many seconds it took to generate
-- a given phylomemy graph, to give a rough
-- estimate to end users.
,
_phylo_computeTime
::
!
ComputeTimeHistory
-- estimate to end users. The field is optional
-- to make it backward compatible.
,
_phylo_computeTime
::
!
(
Maybe
ComputeTimeHistory
)
}
deriving
(
Generic
,
Show
,
Eq
,
ToExpr
)
...
...
@@ -706,13 +704,10 @@ instance ToJSON PhyloGroup
instance
ToJSON
ComputeTimeHistory
where
toJSON
=
\
case
NoHistoricalDataAvailable
->
JS
.
Null
ComputeTimeHistory
runs
->
toJSON
runs
instance
FromJSON
ComputeTimeHistory
where
parseJSON
JS
.
Null
=
pure
NoHistoricalDataAvailable
parseJSON
(
JS
.
Array
runs
)
=
ComputeTimeHistory
<$>
parseJSON
(
JS
.
Array
runs
)
parseJSON
ty
=
JS
.
typeMismatch
"ComputeTimeHistory"
ty
...
...
@@ -832,7 +827,7 @@ instance Arbitrary PhyloParam where
arbitrary
=
pure
defaultPhyloParam
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
-- we won't be generating very long lists.
...
...
@@ -857,9 +852,9 @@ trackComputeTime elapsedSecs = over phylo_computeTime update_time
where
-- In case we have more than one historical data available, we take only the last 5
-- runs, to not make the list unbounded.
update_time
::
ComputeTimeHistory
->
ComputeTimeHistory
update_time
No
HistoricalDataAvailable
=
ComputeTimeHistory
(
NE
.
singleton
elapsedSecs
)
update_time
(
ComputeTimeHistory
(
r
NE
.:|
runs
))
=
ComputeTimeHistory
(
elapsedSecs
NE
.:|
(
r
:
take
3
runs
))
update_time
::
Maybe
ComputeTimeHistory
->
Maybe
ComputeTimeHistory
update_time
No
thing
=
Just
$
ComputeTimeHistory
(
NE
.
singleton
elapsedSecs
)
update_time
(
Just
(
ComputeTimeHistory
(
r
NE
.:|
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 =
(
fromList
$
map
(
\
prd
->
(
prd
,
PhyloPeriod
prd
(
""
,
""
)
(
initPhyloScales
1
prd
)))
periods
)
0
(
_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