Bugfix: do not open a measurement for writing on constructor of measurement
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Anne de Jong 2023-02-01 22:41:54 +01:00
parent e435dc9ecd
commit 5a7ae3eb33
2 changed files with 5 additions and 6 deletions

View File

@ -1,8 +1,8 @@
// lasp_clip.h
//
// Author: J.A. de Jong - ASCEE
// Author: J.A. de Jong, C.R.D. Jansen - ASCEE
//
// Description: Peak Programme Meter
// Description: Clip handler
#pragma once
#include <memory>
#include "lasp_filter.h"

View File

@ -196,7 +196,7 @@ class Measurement:
# Open the h5 file in read-plus mode, to allow for changing the
# measurement comment.
with h5.File(fn, 'r+') as f:
with h5.File(fn, 'r') as f:
# Check for video data
try:
f['video']
@ -234,10 +234,9 @@ class Measurement:
self._channelNames = [f'Unnamed {i}' for i in range(self.nchannels)]
# comment = read-write thing
try:
if 'comment' in f.keys():
self._comment = f.attrs['comment']
except KeyError:
f.attrs['comment'] = ''
else:
self._comment = ''
# Sensitivity