You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In #110 we fixed a bug where we were trying to load csv not hdf5, but now we can't load hdf5 there. The code snippet is at the start of class stats_trim_dlg(QMainWindow): from silcamgui.py.
There is however a function in class PlotView(QtWidgets.QWidget): from interactive_summary.py. The function is old_data_check().
So the problem is simply that in the bugfix (which was essenrtially this):
diff: - self.stats = pd.read_csv(stats_filename)
diff: + self.stats = pd.read_hdf(stats_filename, 'ParticleStats/stats')
did not allow for backward compatibility.
Describe the solution you'd like
The solution is probably a small->large refactor. Where maybe we create a class that inherits from df's and then we make custom loading and saving functions for those dfs. The additional problem is this loading function needs some gui support (in interactive_summary.py we automatically ask the user in a pop-up box if they want to convert an old csv file), so it would have to be broken down somewhat, and really this gui functionality should be in a central place, but guicalcs.py maybe isn't correct.
Describe alternatives you've considered
The shit solution is that you just reproduce the function in both classes. Clearly this code duplication isn't good.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
In #110 we fixed a bug where we were trying to load csv not hdf5, but now we can't load hdf5 there. The code snippet is at the start of
class stats_trim_dlg(QMainWindow):
from silcamgui.py.There is however a function in
class PlotView(QtWidgets.QWidget):
from interactive_summary.py. The function is old_data_check().So the problem is simply that in the bugfix (which was essenrtially this):
diff: - self.stats = pd.read_csv(stats_filename)
diff: + self.stats = pd.read_hdf(stats_filename, 'ParticleStats/stats')
did not allow for backward compatibility.
Describe the solution you'd like
The solution is probably a small->large refactor. Where maybe we create a class that inherits from df's and then we make custom loading and saving functions for those dfs. The additional problem is this loading function needs some gui support (in interactive_summary.py we automatically ask the user in a pop-up box if they want to convert an old csv file), so it would have to be broken down somewhat, and really this gui functionality should be in a central place, but guicalcs.py maybe isn't correct.
Describe alternatives you've considered
The shit solution is that you just reproduce the function in both classes. Clearly this code duplication isn't good.
The text was updated successfully, but these errors were encountered: