-
Notifications
You must be signed in to change notification settings - Fork 2
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
issue 14: Multi dims horizontal labels #63
base: master
Are you sure you want to change the base?
issue 14: Multi dims horizontal labels #63
Conversation
I didn't think this was on the roadmap for 0.26... There is already much on our plate. I reckon we did not discuss this, but for the next release I think we should discuss together the features to work on and stick to them.
Seems sensible. Should only reset when going from one array to another, like for filters.
Reproducing what you see seems sensible.
Unsure. My guess is that plotting "what you see" would be best. I.e. considering all columns dimensions as being the x axis. |
Well, I started to work on that weeks ago so it took me only few hours yesterday to have something that doesn't crash at first side. Concerning It's totally OK if this PR is not included in version 0.26. I just think that including this feature with the use of buffer to load data in the same release would be quite dangerous. Anyway, this PR will need a kind of "monkey test". |
Ok, sorry. I did not realize this. I still think it would be a good idea to discuss what to include in the new releases when starting a new cycle.
That should be fixed there and could be done later.
Ok, I will try to be your monkey :) |
Jehan also proposed to play the monkey (before a release). |
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.
unsure I like the {xy}label -> {hv}label change. Either is fine by me, but here matplotlib use xlabels so in the end we end up using both xlabels and hlabels which is kinda confusing IMO.
But QTable use horizontal and vertical headers. IMO xlabels and ylabels are for a 2D plot, not for a table. I actually found using x/ylabels in QTable models and views quite confusing when I started to work on the viewer. |
Ok, makes sense. |
c6b4a23
to
c2c5072
Compare
c2c5072
to
078dd32
Compare
078dd32
to
9635f14
Compare
fdf8fe9
to
dcd6f13
Compare
dcd6f13
to
3d441b1
Compare
Not urgent but I would like to finish and merge this PR before to start to work on issue larray-project/larray#411 |
Note: I'm not sure what to do with methods |
prod = Product(axes.labels) | ||
return [_LazyDimLabels(prod, i) for i in range(len(axes.labels))] | ||
vlabels = get_labels_product(axes[:nb_dims_vlabels]) | ||
hlabels = get_labels_product(axes[nb_dims_vlabels:], nb_dims_vlabels > 0) |
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 seems odd. I would have thought vlabels would get the extra/fake axis instead of hlabels and that the condition would be nb_dims_vlabels == 0, not nb_dims_vlabels > 0???
@@ -810,6 +820,9 @@ def _update_digits_scientific(self, data): | |||
|
|||
self.gradient_chooser.setEnabled(self.model_data.bgcolor_possible) | |||
|
|||
self.nb_horizontal_dims_spinbox.setMinimum(1) |
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.
move this out of the function (to set_data)
# # ndim == 1 | ||
# list_data = [list_data[1][1:]] | ||
# new_data = np.array(list_data) | ||
if self._raw_data_selection is None: |
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.
Ouch. This is no good. This prevents copy/paste from other applications!
@@ -125,7 +125,8 @@ class LabelsArrayModel(AbstractArrayModel): | |||
font : QFont, optional | |||
Font. Default is `Calibri` with size 11. | |||
""" | |||
def __init__(self, parent=None, data=None, readonly=False, font=None): | |||
def __init__(self, parent=None, data=None, readonly=False, font=None, orientation=Qt.Horizontal): |
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.
If it turns out to be indeed necessary to differentiate on the orientation (I am unsure about this), then having two different subclasses of LabelsArrayModel depending on the orientation would make things cleaner.
First attempt to implement multiple horizontal dimensions.
Need further discussion and tests.
Not sure what to do with: