Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TaggingBackends
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
TaggingBackends
Commits
0c98393a
Commit
0c98393a
authored
1 year ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
check_larva_dataset_hdf5
parent
2fad2e23
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!9
Set of commits to be tagged 0.16
,
!7
Save larva_dataset file along with model files
,
!6
sample_size argument and check_larva_dataset_hdf5 function
Pipeline
#110750
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Manifest.toml
+3
-3
3 additions, 3 deletions
Manifest.toml
src/LarvaDatasets.jl
+27
-1
27 additions, 1 deletion
src/LarvaDatasets.jl
with
30 additions
and
4 deletions
Manifest.toml
+
3
−
3
View file @
0c98393a
...
...
@@ -312,11 +312,11 @@ version = "1.9.2"
[[deps.PlanarLarvae]]
deps
=
[
"DelimitedFiles"
,
"HDF5"
,
"JSON3"
,
"LinearAlgebra"
,
"MAT"
,
"Meshes"
,
"OrderedCollections"
,
"Random"
,
"SHA"
,
"StaticArrays"
,
"Statistics"
,
"StatsBase"
,
"StructTypes"
]
git-tree-sha1
=
"
c3397f0c8a6ce76acdbe0517a060e39b90a30db8
"
repo-rev
=
"
dev
"
git-tree-sha1
=
"
25dede7c9e34786f3c9a576fc2da3c3448c12d80
"
repo-rev
=
"
main
"
repo-url
=
"https://gitlab.pasteur.fr/nyx/planarlarvae.jl"
uuid
=
"c2615984-ef14-4d40-b148-916c85b43307"
version
=
"0.1
3
.0"
version
=
"0.1
4
.0"
[[deps.PrecompileTools]]
deps
=
[
"Preferences"
]
...
...
This diff is collapsed.
Click to expand it.
src/LarvaDatasets.jl
+
27
−
1
View file @
0c98393a
...
...
@@ -26,7 +26,7 @@ using Statistics
using
Memoization
using
OrderedCollections
export
write_larva_dataset_hdf5
,
first_stimulus
,
labelcounts
export
write_larva_dataset_hdf5
,
first_stimulus
,
labelcounts
,
check_larva_dataset_hdf5
"""
labelcounts(files)
...
...
@@ -848,4 +848,30 @@ end
runid
(
file
)
=
splitpath
(
file
.
source
)[
end
-
1
]
"""
check_larva_dataset_hdf5(path)
Read the total label counts and return example time points.
"""
function
check_larva_dataset_hdf5
(
path
;
print
=
true
)
h5open
(
path
,
"r"
)
do
h5
labels
=
read
(
h5
,
"labels"
)
labelcounts
=
read
(
h5
,
"label_counts"
)
labelcounts
=
Dict
(
Symbol
(
label
)
=>
count
for
(
label
,
count
)
in
zip
(
labels
,
labelcounts
))
print
&&
@info
"Labels:"
pairs
(
labelcounts
)
...
examples
=
Dict
{
Symbol
,
NamedTuple
{(
:
path
,
:
larva_number
,
:
reference_time
),
Tuple
{
String
,
Int
,
Float64
}}}()
g
=
h5
[
"samples"
]
for
sampleid
in
1
:
read
(
attributes
(
g
),
"n_samples"
)
h
=
g
[
"sample_
$
sampleid"
]
label
=
Symbol
(
read
(
attributes
(
h
),
"behavior"
))
if
label
∉
keys
(
examples
)
examples
[
label
]
=
(
path
=
read
(
attributes
(
h
),
"path"
),
larva_number
=
read
(
attributes
(
h
),
"larva_number"
),
reference_time
=
read
(
attributes
(
h
),
"reference_time"
))
@info
"
$(label)
example"
examples
[
label
]
...
length
(
examples
)
==
length
(
labels
)
&&
break
end
end
return
labelcounts
,
examples
end
end
end
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