-
Notifications
You must be signed in to change notification settings - Fork 13
Update method fix #85
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| import logging | ||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class CrossSectionMainWindow(QtGui.QMainWindow): | ||
| """ | ||
| MainWindow | ||
|
|
@@ -100,6 +101,17 @@ def __init__(self, data_list, key_list, | |
| # trigger the image to draw | ||
| self._messenger.sl_update_image(0) | ||
|
|
||
| self.key_list = key_list | ||
|
|
||
| def add_data(self, new_data, new_key_names): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doc strings in this would be appreciated. Please use the numpy doc string format. |
||
| old_length = len(self.key_list) | ||
| for key in new_key_names: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You most likely could do this in one line as self.key_list.extend(new_key_names) |
||
| self.key_list.append(key) | ||
| for i in range(old_length, len(self.key_list)): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might be able to state this more pythonicly as: for new_key, new_value in zip(new_key_names, new_data):
# enter the data |
||
| self._messenger._view._data_dict[self.key_list[i]] = new_data[i-old_length] | ||
| self._messenger._ctrl_widget._slider_img.setMaximum(len(self.key_list)-1) | ||
| self._messenger._ctrl_widget._spin_img.setMaximum(len(self.key_list)-1) | ||
|
|
||
|
|
||
| class Stack1DMainWindow(QtGui.QMainWindow): | ||
| """ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not performed at the messenger level?