Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EXDF-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dataAnalysis
EXDF-tools
Commits
d73b755a
Commit
d73b755a
authored
9 months ago
by
Philipp Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Fix three bugs from past refactoring that went unnoticed
parent
e082a666
No related branches found
No related tags found
1 merge request
!15
Fix bugs from past refactoring that went unnoticed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/exdf/data_reduction/red_writer.py
+3
-1
3 additions, 1 deletion
src/exdf/data_reduction/red_writer.py
src/exdf/write/sd_writer.py
+6
-4
6 additions, 4 deletions
src/exdf/write/sd_writer.py
with
9 additions
and
5 deletions
src/exdf/data_reduction/red_writer.py
+
3
−
1
View file @
d73b755a
...
...
@@ -18,6 +18,7 @@ from ..write.datafile import write_compressed_frames
import
h5py
from
extra_data.sourcedata
import
SourceData
def
_SourceData_get_index_group_sample
(
self
,
index_group
):
if
self
.
is_control
and
not
index_group
:
# Shortcut for CONTROL data.
...
...
@@ -32,6 +33,7 @@ def _SourceData_get_index_group_sample(self, index_group):
for
f
in
self
.
files
:
return
f
.
file
[
group
].
visititems
(
get_key
)
SourceData
.
_get_index_group_sample
=
_SourceData_get_index_group_sample
...
...
@@ -98,7 +100,7 @@ class ReduceWriter(SourceDataWriter):
elif
input_version
==
Version
(
'
1.2
'
)
and
data
.
control_sources
:
# Check for mislabeled EXDF-v1.3 files.
ctrl_src
=
next
(
iter
(
control_sources
))
ctrl_src
=
next
(
iter
(
data
.
control_sources
))
if
data
[
ctrl_src
,
ctrl_src
.
one_key
()].
attributes
():
input_version
=
Version
(
'
1.3
'
)
...
...
This diff is collapsed.
Click to expand it.
src/exdf/write/sd_writer.py
+
6
−
4
View file @
d73b755a
...
...
@@ -303,10 +303,11 @@ class SourceDataWriter:
# Copy INSTRUMENT data.
for
sd
in
sources
:
h5source
=
f
.
source
[
sd
.
source
]
start_source
=
perf_counter
()
h5source
=
f
.
source
[
sd
.
source
]
keys
=
sd
.
keys
()
for
index_group
in
sd
.
index_groups
:
mask
=
masks
.
get
(
index_group
,
np
.
s_
[:])
...
...
@@ -503,8 +504,9 @@ def get_key_attributes(sd):
if
not
same_keys
or
not
same_values
:
log
.
debug
(
f
'
Attributes for
{
sd
.
source
}
.
{
path
}
in
'
f
'
{
source_file
}
are
{
path_attrs
}
, but got
'
f
'
{
source_attrs
[
path
]
}
from previous file
'
)
f
'
{
basename
(
fa
.
filename
)
}
are
{
path_attrs
}
,
'
f
'
but got
{
source_attrs
[
path
]
}
from
'
f
'
previous file
'
)
raise
ValueError
(
f
'
attribute mismatch on
'
f
'
{
sd
.
source
}
.
{
path
}
'
)
...
...
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