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
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
PlanarLarvae.jl
Commits
3bffeb68
Commit
3bffeb68
authored
1 year ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
labels2tags
parent
b348b926
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!6
Set of commits to be tagged v0.16
,
!5
Experimental support for MaggotUBA's larva_dataset hdf5 files
Pipeline
#115890
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Artifacts.toml
+1
-1
1 addition, 1 deletion
Artifacts.toml
src/Formats.jl
+30
-1
30 additions, 1 deletion
src/Formats.jl
with
31 additions
and
2 deletions
Artifacts.toml
+
1
−
1
View file @
3bffeb68
...
@@ -51,5 +51,5 @@ git-tree-sha1 = "1dec5e1c33044d972466d03ca5b8816b9861eb5f"
...
@@ -51,5 +51,5 @@ git-tree-sha1 = "1dec5e1c33044d972466d03ca5b8816b9861eb5f"
lazy
=
true
lazy
=
true
[[sample_training_dataset.download]]
[[sample_training_dataset.download]]
url
=
"https://dl.pasteur.fr/fop/
Wa2niN3o
/sample_training_dataset.tgz"
url
=
"https://dl.pasteur.fr/fop/
DKgeHrAl
/sample_training_dataset.tgz"
sha256
=
"5f1fc870185252a6c4d79ce113c6d98e30107610ee11029642e2e72b7d62c1a0"
sha256
=
"5f1fc870185252a6c4d79ce113c6d98e30107610ee11029642e2e72b7d62c1a0"
This diff is collapsed.
Click to expand it.
src/Formats.jl
+
30
−
1
View file @
3bffeb68
...
@@ -352,7 +352,8 @@ function astimeseries(track::Track)
...
@@ -352,7 +352,8 @@ function astimeseries(track::Track)
return
timeseries
return
timeseries
end
end
function
astimeseries
(
run
::
Run
)
function
astimeseries
(
run
::
Run
;
labels2tags
=
false
)
labels2tags
&&
return
astimeseries
(
Formats
.
labels2tags
(
run
))
track
=
first
(
values
(
run
.
tracks
))
track
=
first
(
values
(
run
.
tracks
))
firststate
=
asnamedtuple
(
track
.
states
,
1
)
firststate
=
asnamedtuple
(
track
.
states
,
1
)
T
=
typeof
(
firststate
)
T
=
typeof
(
firststate
)
...
@@ -433,6 +434,34 @@ function appendtags(timeseries, run)
...
@@ -433,6 +434,34 @@ function appendtags(timeseries, run)
return
newtimeseries
return
newtimeseries
end
end
"""
labels2tags(run)
Make a copy with labels converted into behavior tags.
"""
function
labels2tags
(
run
::
Run
)
labels
,
attr
=
Datasets
.
getlabels
(
run
)
if
labels
isa
AbstractDict
labels
=
labels
[
:
names
]
end
if
eltype
(
labels
)
!==
Symbol
labels
=
Symbol
.
(
labels
)
end
labels2tags′
(
label
)
=
labels2tags
(
labels
,
label
)
#
tracks′
=
Track
[]
for
track
in
values
(
run
.
tracks
)
records′
=
OrderedDict
(
rec
===
attr
?
:
tags
=>
labels2tags′
.
(
vals
)
:
rec
=>
vals
for
(
rec
,
vals
)
in
pairs
(
track
.
states
))
track′
=
Track
(
track
.
id
,
track
.
attributes
,
track
.
timestamps
,
records′
)
push!
(
tracks′
,
track′
)
end
Run
(
run
.
id
,
run
.
attributes
,
tracks′
)
end
labels2tags
(
labels
::
Vector
{
Symbol
},
label
)
=
BehaviorTags
(
Symbol
.
(
labels
),
label
isa
Vector
?
(
isempty
(
label
)
?
Symbol
[]
:
Symbol
.
(
label
))
:
[
Symbol
(
label
)])
function
asrun
(
runid
::
Datasets
.
RunID
,
timeseries
::
LarvaBase
.
Larvae
,
function
asrun
(
runid
::
Datasets
.
RunID
,
timeseries
::
LarvaBase
.
Larvae
,
attributes
::
Datasets
.
Attributes
=
Datasets
.
ConcreteAttributes
())
attributes
::
Datasets
.
Attributes
=
Datasets
.
ConcreteAttributes
())
tracks
=
Track
[]
tracks
=
Track
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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