-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[ENH] OWLinePlot: Move from prototypes to core #3440
Conversation
I'll do the docs! <3 |
bbc0ae1
to
e1c7f81
Compare
Codecov Report
@@ Coverage Diff @@
## master #3440 +/- ##
==========================================
+ Coverage 83.27% 83.42% +0.15%
==========================================
Files 365 367 +2
Lines 64293 65045 +752
==========================================
+ Hits 53540 54267 +727
- Misses 10753 10778 +25 |
Codecov Report
@@ Coverage Diff @@
## master #3440 +/- ##
==========================================
+ Coverage 83.3% 83.42% +0.12%
==========================================
Files 365 367 +2
Lines 64409 65067 +658
==========================================
+ Hits 53654 54284 +630
- Misses 10755 10783 +28 |
I have used the widget and looked at some recent changes, but have not really gone over the whole code layout/structure and wouldn't say I know it. I can give it a semi-quick look sometime next week, otherwise I will be relying on the fact that it has been in prototypes for a long time and seems to be working well. |
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.
These are mostly local comments and nitpicking. I haven't found any bugs, but I won't pretend I understand the entire logic of the widget.
if self.__groups is not None: | ||
for group in self.__groups: | ||
group.remove_items() | ||
self.graph.view_box.remove_profiles() |
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.
self.__groups = None
, I suppose. Don't leave any removed items in __groups
.
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 that really necessary? self.__groups is set to [] right after.
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.
I saw it's set to []
in the method that calls this method. But I'd still prefer to have it here; what if someday we call this method from another place? As a matter of principle I prefer that methods that remove items from graph also remove them from lists.
Compromise: put self.__groups = []
into this method. But if you do this, you should also set it to []
in __init__
and clear
, and change all if self.__groups is not None
into if self.__groups
.
If you dislike both suggestions, ignore them. Or consider them in further development. :)
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.
Ok, I like the compromise.
group.set_visible_mean(**kwargs) | ||
group.set_visible_range(**kwargs) | ||
group.set_visible_profiles(**kwargs) | ||
self.__groups.append(group) |
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.
I quite dislike this. It just hides argument names without any benefit. Why not
group.set_visible_error(self.show_error)
group.set_visible_mean(self.show_mean)
group.set_visible_range(self.show_range)
group.set_visible_profiles(self.show_profiles)
One line shorter and four lines cleaner.
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.
This does not work correctly (and I should add a test).
Open the widget -> check only mean, close the widget -> open it again -> only mean is checked, but range is also shown.
Two of the set_visible_ methods need two arguments..
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.
I see. But still, give them two arguments then...
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.
This one, I would leave it as it is.
I have the documentation ready, I was just unable to push it on Friday. Git experts welcome for advice. |
Oh well, the docs are here: #3461 |
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.
Issue
Needs merge of #3432Description of changes
Includes