The channel group acquisition properties of a filtered MDF aren't copied across for MDF versions 4.20 and greater. See the example below for a minimal reproducible example:
from asammdf import MDF, Signal
t, v = [0, 1], [2, 4]
acq_name = "ExampleTask"
signal_name = f"Task.Struct.Value"
for version in ("4.10", "4.20"):
mdf1 = MDF(version=version)
mdf1.append([Signal(v, t, name=signal_name)], acq_name=acq_name)
mdf2 = mdf1.filter([signal_name])
cg_nr, _ = mdf2.channels_db[signal_name][0]
result_acq_name = mdf2.groups[cg_nr].channel_group.acq_name
print(f"Version {version}: {result_acq_name}")
I would expect this to print
Version 4.10: ExampleTask
Version 4.20: ExampleTask
A simple fix is to pass the acq_source and acq_name to the append method. However I am unsure if this is the proper solution. Perhaps the current behavior is intended? Or perhaps this change has further ramifications?
The channel group acquisition properties of a filtered MDF aren't copied across for MDF versions 4.20 and greater. See the example below for a minimal reproducible example:
I would expect this to print
However instead we see
This appears to be due to the call to _append_column_oriented for 4.20 version MDFs, which creates multiple groups. However the
filter
method only updates the acquisition properties for the first group.A simple fix is to pass the
acq_source
andacq_name
to theappend
method. However I am unsure if this is the proper solution. Perhaps the current behavior is intended? Or perhaps this change has further ramifications?