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
07b69622
Commit
07b69622
authored
2 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
revert locking
parent
3228ce82
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#104139
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Manifest.toml
+1
-1
1 addition, 1 deletion
Manifest.toml
src/LarvaDatasets.jl
+27
-43
27 additions, 43 deletions
src/LarvaDatasets.jl
with
28 additions
and
44 deletions
Manifest.toml
+
1
−
1
View file @
07b69622
...
...
@@ -312,7 +312,7 @@ version = "1.9.0"
[[deps.PlanarLarvae]]
deps
=
[
"DelimitedFiles"
,
"HDF5"
,
"JSON3"
,
"LinearAlgebra"
,
"MAT"
,
"Meshes"
,
"OrderedCollections"
,
"Random"
,
"SHA"
,
"StaticArrays"
,
"Statistics"
,
"StatsBase"
,
"StructTypes"
]
git-tree-sha1
=
"
bff9bdff96050dffcb681e950ac2547e33c5341
7"
git-tree-sha1
=
"
fe89d5f592c8ba763a13330cde6696f721f828c
7"
repo-rev
=
"dev"
repo-url
=
"https://gitlab.pasteur.fr/nyx/planarlarvae.jl"
uuid
=
"c2615984-ef14-4d40-b148-916c85b43307"
...
...
This diff is collapsed.
Click to expand it.
src/LarvaDatasets.jl
+
27
−
43
View file @
07b69622
...
...
@@ -628,12 +628,7 @@ function new_write_larva_dataset_hdf5(output_dir, input_data;
output_file
=
joinpath
(
output_dir
,
output_file
)
c
=
Threads
.
Condition
()
h5open
(
output_file
,
"w"
)
do
h5
lock
(
c
)
g
=
try
create_group
(
h5
,
"samples"
)
finally
unlock
(
c
)
end
sample
(
loader
,
:
spine
)
do
_
,
file
,
counts
,
segments
sampleid
,
nsegments
=
counts
@assert
length
(
segments
)
==
nsegments
...
...
@@ -662,26 +657,18 @@ function new_write_larva_dataset_hdf5(output_dir, input_data;
name
=
"sample_
$
sampleid"
# transpose for compatibility with h5py
# see issue https://github.com/JuliaIO/HDF5.jl/issues/785
lock
(
c
)
try
g
[
name
]
=
permutedims
(
sample
,
reverse
(
1
:
ndims
(
sample
)))
sampleid
+=
1
#
d
=
g
[
name
]
attributes
(
d
)[
"larva_number"
]
=
convert
(
Int
,
trackid
)
# we should set `start_point` instead of `reference_time`, to comply with
# the original format, but this would not make sense here due to
# interpolation:
# we should set `start_point` instead of `reference_time`, to comply with the
# original format, but this would not make sense here due to interpolation:
attributes
(
d
)[
"reference_time"
]
=
anchortime
attributes
(
d
)[
"behavior"
]
=
string
(
label
)
attributes
(
d
)[
"path"
]
=
file
.
source
finally
unlock
(
c
)
end
end
end
lock
(
c
)
try
attributes
(
g
)[
"len_traj"
]
=
window_length
attributes
(
g
)[
"len_pred"
]
=
window_length
attributes
(
g
)[
"n_samples"
]
=
total_sample_size
...
...
@@ -699,9 +686,6 @@ function new_write_larva_dataset_hdf5(output_dir, input_data;
if
!
isnothing
(
frameinterval
)
attributes
(
g
)[
"frame_interval"
]
=
frameinterval
end
finally
unlock
(
c
)
end
end
return
output_file
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