Skip to content

Commit

Permalink
use numeric values when computing virtual channels
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Jan 8, 2024
1 parent e485263 commit 43852ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/asammdf/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,16 @@ def compute_signal(
all_timebase,
functions,
):
required_channels = {}
for key, sig in measured_signals.items():
signal = sig.physical(copy=False)
if signal.samples.dtype.kind in "fui":
required_channels[key] = signal
else:
required_channels[key] = sig

measured_signals = required_channels

type_ = description["type"]

try:
Expand Down
6 changes: 0 additions & 6 deletions src/asammdf/gui/widgets/mdi_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,6 @@ def add_new_channels(self, names, widget, mime_data=None):

required_channels.update(measured_signals)

required_channels = {key: sig.physical(copy=False) for key, sig in required_channels.items()}

if required_channels:
all_timebase = np.unique(
np.concatenate(
Expand Down Expand Up @@ -2722,8 +2720,6 @@ def edit_channel(self, channel, item, widget):
else:
all_timebase = []

required_channels = {key: sig.physical(copy=False) for key, sig in required_channels.items()}

computation = channel["computation"]

signal = compute_signal(
Expand Down Expand Up @@ -3197,8 +3193,6 @@ def _load_plot_window(self, window_info):

required_channels.update(measured_signals)

required_channels = {key: sig.physical(copy=False) for key, sig in required_channels.items()}

for sig_uuid, channel in computed.items():
computation = channel["computation"]

Expand Down

0 comments on commit 43852ff

Please sign in to comment.