Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV loading, refactoring, gui #125

Open
WillRNaylor opened this issue Mar 16, 2021 · 0 comments
Open

CSV loading, refactoring, gui #125

WillRNaylor opened this issue Mar 16, 2021 · 0 comments
Labels
enhancement New feature or request PyQt Gui issues specific to PyQt

Comments

@WillRNaylor
Copy link
Collaborator

WillRNaylor commented Mar 16, 2021

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.

@WillRNaylor WillRNaylor added enhancement New feature or request PyQt Gui issues specific to PyQt labels Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PyQt Gui issues specific to PyQt
Projects
None yet
Development

No branches or pull requests

1 participant