Suggested changes during cleanup code
-
Parameter Dialog not show
param_dialog.py
get_data_list():
# ...
return [[d[0],
'' if d[1] is None else d[1],
d[2]]
for d in param_rows]
# =>
return [[d[0],
'' if d[1] is None else d[1],
d[2],
d[3]],
for d in param_rows]
get_row_input(): change to work with get_data_list()
-
Should disable shift+click on TimePowerSquareWidget:
time_power_squared_dialog.py
on_pick():
if (modifiers == QtCore.Qt.ShiftModifier and self.name == "time power squared widget"):
# not start zoom from TimePowerSquareWidget
return
-
Remove outer loop for better performance
handdling_data.py
sortData():
remove: for staID in dataDict:
mseed.py
readWFFiles():
sortData(self.waveformData[staID]
-
util.py - display_tracking_info(): need to show where error code line is -
File "/Users/ldam/Documents/GIT/soh_gar/sohstationviewer/sohstationviewer/view/mainwindow.py", line 237, in replotLoadedData wfChans = list(do.waveformData[do.selectedKey].keys()) KeyError: ('92E9', 0) -
Look at plotting_widget.py get_zoom_data(). If comment out try and except like below and test rt130 9BB3_D3, KeyError for 'channels' will take place. This key was given before but then the structure of data object changed but the key still remains => should change this.
if 'ax' not in c_data:
linked_ax = None
if chan_db['linkedChan'] not in [None, 'None', '']:
# try:
linked_ax = plotting_data['channels'][
chan_db['linkedChan']]['ax']
# except KeyError:
# pass
ax = getattr(self, dbConf['plotFunc'][plot_type][1])(
c_data, chan_db, chan_id, None, linked_ax)
if ax is None:
return
c_data['ax'] = ax
ax.chan = chan_id
self.axes.append(ax)
-
processing.py - detect_data_type() should only return the data type and not the detected channel. There are two locations where we can do that.
# First way
# Current
dataTypeList = {d for d in dirDataTypeDict.values()}
# =>
dataTypeList = {d[0] for d in dirDataTypeDict.values()}
# Second way
# Current
return list(dirDataTypeDict.values())[0]
# =>
return list(dirDataTypeDict.values())[0][0]
To cover when only 'Unknown' data type detected, add condition:
elif data_type_list == [('Unknown', '_')]: # ['Unknown'] if applying first way of the above suggestion
msg = ("There are no known data detected.\n"
"Please select different folder(s).")
displayTrackingInfo(tracking_box, msg, "error")
return
-
mseed: currently read and index all waveform header, then exclude non-requested channels when read data => should exclude non-requested channels before index waveform header, then don't need to do it when read data to be consistent with reftek and better performance -
handling_data.py: create a common function to read mseed trace to reuse between readSOHTrace(), readMPTrace(), readWaveformTrace(). Can't use readSOHTrace() for that purpose because we don't want waveform to keep values of times and data. -
handling_data.py - readWaveformMSeed(): remove unnecessary fileName argument -
Modify handling_data.py - checkWFChan() to cover different wild card from MainWindow. Also check wild card from MainWindow to be in the correct format. -
handling_data.py - trim_downsample_SOHchan(): chan['logIdx'] should be included when downsample. -
handling_data.py: part that exclude the non-included times index in trim_downsample_SOHChan() and get_trimTPSData are similar and long, should create a function for it to reuse. get_trimTPSData only do one for the first time. If (11) is done, may not need this section in get_trimTPSData. -
Mass position color option menu should only have either regular or trillium selected at a time. -
Can't save changes in channels database dialog. If OK is clicked, there is an error with the SQL statement. If Cancel is clicked, an error is raised. Both of these are caused by the fixPoint column. The first problem is caused by us assigning fixPoint an integer in the SQL statement even though fixPoint contains TEXT data. The second problem is caused by us resetting the value of fixPoint cells in the table by calling int() on the original value of the cell, which is None (even though it is displayed as 0). -
Database dialogs do not close when main screen is closed. Might be intended. -
Add a way to prevent user from selecting an end time that is earlier than the start time. -
plottingData.py - getTimeTicks() returns a tuple of three empty lists if the given time range is exactly a second, a minute, or an hour. -
util.py - getDirSize() always return (0, 0). -
util.py - getTime4() does not increment tracking_year when the day of year is 1 and yAdded is false. -
handling_data.py - saveData2File() does not free memory used to store the data. -
handling_data.py - sortData() does not do anything. -
Zooming does not work when there is an empty gap in the zoom range. -
Cancel does not work when changing directory.