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

Allow redim.label if no custom label set #1541

Merged
merged 3 commits into from
Jun 14, 2017
Merged

Allow redim.label if no custom label set #1541

merged 3 commits into from
Jun 14, 2017

Conversation

philippjfr
Copy link
Member

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.

@philippjfr philippjfr changed the title Allow redim.label if not custom label set Allow redim.label if no custom label set Jun 14, 2017
@@ -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)
Copy link
Contributor

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.

Copy link
Member Author

@philippjfr philippjfr Jun 14, 2017

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.

Copy link
Contributor

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...

@jlstevens
Copy link
Contributor

Looks good! Happy to merge when the tests pass.

@jlstevens
Copy link
Contributor

I see a display transient in the 2.7 pr build but otherwise the tests are passing. Merging.

@jlstevens jlstevens merged commit fa5c3ef into master Jun 14, 2017
@philippjfr philippjfr deleted the redim_label branch June 17, 2017 17:04
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants