capn-freako/PyBERT

rx_in is saved in the results file but has no plot to return too.

jdpatt opened this issue · 3 comments

When loading any saved results file, an exception is silently printed in the console saying that there is no rx_in_ref plot which there isn't.

Exception occurred in traits notification handler for event object: TraitChangeEvent(object=<chaco.array_plot_data.ArrayPlotData object at 0x131737ae0>, name='data_changed', old=<undefined>, new={'added': ['rx_in_ref']})
Traceback (most recent call last):
  File "/git/PyBERT/.venv/lib/python3.9/site-packages/traits/observation/_trait_event_notifier.py", line 122, in __call__
    self.dispatcher(handler, event)
  File "/git/PyBERT/.venv/lib/python3.9/site-packages/traits/observation/observe.py", line 27, in dispatch_same
    handler(event)
  File "/git/PyBERT/.venv/lib/python3.9/site-packages/chaco/plot.py", line 1466, in _data_update_handler
    self._get_or_create_datasource(name)
  File "/git/PyBERT/.venv/lib/python3.9/site-packages/chaco/plot.py", line 1423, in _get_or_create_datasource
    raise ValueError(
ValueError: Unhandled array shape in creating new plot: ()

Looking back at the commit history, 0ef8d8f adds rx_in to the items that should be loaded back into plots. @capn-freako was the intent to just reload rx_in and should be a new attribute that is loaded back in differently than the plots or is there something that I'm missing?

tx_out is saved and reloaded. self.plotdata.set_data("tx_out", self.rx_in[:len_t])

Currently, rx_in is never reloaded since this exception is raised. However, it is the last item so everything else is correctly loaded.

Hi @jdpatt ,

Would you assign these to me when the ball is in my court, please?
I only found this, because I was perusing the issues you placed in the v4.0.0 milestone you created.
Thanks for creating that milestone and adding the relevant issues to it, by the way!
I never knew about this feature, previously. :(
It's perfect for a new release. :)

Thanks,
-db

P.S. - Looking into this, now...

Ah yeah, I should have done that. Wilco!

@jdpatt ,

After reviewing the code, I saw no reason not to simply remove rx_in from the list of saved items.
Let me know if you think that was a mistake.

Thanks,
-db