-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Allow redim.label if no custom label set #1541
Conversation
@@ -158,6 +158,13 @@ def value_format(self, specs=None, **values): | |||
def range(self, specs=None, **values): | |||
return self._redim('range', specs, **values) | |||
|
|||
def label(self, specs=None, **values): | |||
for k, v in values.items(): | |||
dim = self.parent.get_dimension(k) |
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.
Seems like None
is returned if there is no match for dim
? In which case a suitable exception/warning should be given if dim==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.
redim
doesn't validate Dimensions so you can apply it nested datastructures. That said I'd possibly be open to tightening that up when explicit specs
are supplied, not in this PR though.
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.
Ah right, thanks for the reminder. It is annoying but I can't see a way around that issue right now...
Looks good! Happy to merge when the tests pass. |
I see a display transient in the 2.7 pr build but otherwise the tests are passing. Merging. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As the title says this allows using redim.relabel to set a custom label as long as the current label is the same as the name, i.e. no custom label has been supplied previously.