MideTechnology / endaq-python

A comprehensive, user-centric Python API for working with enDAQ data and devices
MIT License
25 stars 12 forks source link

table_plot_from_ide when ide dataset doesn't contain a recordername #204

Closed S-Hanly closed 2 years ago

S-Hanly commented 2 years ago

In the endaq.plot.table_plot_from_ide function we are adding a title that references the IDE file's recorder name which apparently may not exist.

https://github.com/MideTechnology/endaq-python/blob/0ae3c2aba7683011c17fd06d9f0c10a113a77a41/endaq/plot/plots.py#L1428

image

StokesMIDE commented 2 years ago

Seems like a simple enough fix. While we're at it, we should probably replace the explicit item-getting with the .get() method, which will avoid a key error. Like:

recorder_name = doc.recorderInfo.get('RecorderName', 'No Name')
serial = doc.recorderInfo.get('SerialNumber', '')
part_no = doc.recorderInfo.get('PartNumber', '')