Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlanarLarvae.jl
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
PlanarLarvae.jl
Commits
cbcb93c6
Commit
cbcb93c6
authored
2 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
version increment
parent
2a7f6a09
No related branches found
Branches containing commit
Tags
v0.13
Tags containing commit
No related merge requests found
Pipeline
#81626
passed with stage
in 5 minutes and 22 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/Datasets.jl
+19
-2
19 additions, 2 deletions
src/Datasets.jl
with
20 additions
and
3 deletions
Project.toml
+
1
−
1
View file @
cbcb93c6
name
=
"PlanarLarvae"
uuid
=
"c2615984-ef14-4d40-b148-916c85b43307"
authors
=
[
"François Laurent"
,
"Institut Pasteur"
]
version
=
"0.
3
.0"
version
=
"0.
4
.0"
[deps]
DelimitedFiles
=
"8bb1440f-4735-579b-a4ab-409b98df4dab"
...
...
This diff is collapsed.
Click to expand it.
src/Datasets.jl
+
19
−
2
View file @
cbcb93c6
...
...
@@ -852,13 +852,30 @@ asnamedtuple(states, i) = NamedTuple(key=>val[i] for (key, val) in pairs(states)
function
astimeseries
(
track
::
Track
)
firststate
=
asnamedtuple
(
track
.
states
,
1
)
timeseries
=
LarvaBase
.
TimeSeries
{
typeof
(
firststate
)}()
T
=
typeof
(
firststate
)
timeseries
=
LarvaBase
.
TimeSeries
{
T
}()
for
(
i
,
t
)
in
enumerate
(
track
.
timestamps
)
push!
(
timeseries
,
(
t
,
asnamedtuple
(
track
.
states
,
i
)))
end
return
timeseries
end
LarvaBase
.
eachtimeseries
(
tracks
::
Vector
{
Track
})
=
astimeseries
.
(
tracks
)
function
astimeseries
(
tracks
::
Vector
{
Track
})
firststate
=
asnamedtuple
(
tracks
[
1
]
.
states
,
1
)
T
=
typeof
(
firststate
)
run
=
OrderedDict
{
TrackID
,
LarvaBase
.
TimeSeries
{
T
}}()
for
track
in
tracks
run
[
track
.
id
]
=
timeseries
=
LarvaBase
.
TimeSeries
{
T
}()
for
(
i
,
t
)
in
enumerate
(
track
.
timestamps
)
push!
(
timeseries
,
(
t
,
asnamedtuple
(
track
.
states
,
i
)))
end
end
return
run
end
LarvaBase
.
eachtimeseries
(
tracks
::
Vector
{
Track
})
=
astimeseries
(
tracks
)
LarvaBase
.
times
(
track
::
Track
)
=
track
.
timestamps
LarvaBase
.
times
(
track
::
Vector
{
Track
})
=
unique
(
sort
(
collect
(
Iterators
.
flatten
(
LarvaBase
.
times
.
(
track
)))))
end
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment