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

Raise warning when size_index set to non-numeric dimension #1011

Merged
merged 3 commits into from
Dec 11, 2016

Conversation

philippjfr
Copy link
Member

As suggested in #982 currently you get an uninformative exception when setting the size_index option to a non-numeric dimension. This raises a warning and adds unit tests to ensure the warning is raised.

@jlstevens
Copy link
Contributor

jlstevens commented Dec 11, 2016

I think you could shorten this a bit and avoid some repetition with something like:

sizes =  self._apply_size_index(element, self.size_index)

This could be implemented in a common base class and would always return sizes, issuing the warning when the dimension type is inappropriate.

@philippjfr
Copy link
Member Author

This could be implemented in a common base class and would always return sizes, issuing the warning when the dimension type is inappropriate.

I've so far refrained from shared baseclasses for ElementPlots because a fair amount of the API is different. I'd be happy to factor it out into the shared compute_sizes function that already exists.

@jlstevens
Copy link
Contributor

I'd be happy to factor it out into the shared compute_sizes function that already exists.

That also makes sense.

@philippjfr
Copy link
Member Author

Unfortunately I didn't manage to factor out much, the warning needs the dimension and element name to be useful and I didn't want to add even more arguments to the compute_sizes function.

@jlstevens
Copy link
Contributor

Ok, nevermind then. Merging.

@jlstevens jlstevens merged commit 4d0d2a3 into master Dec 11, 2016
@philippjfr philippjfr deleted the point_size_warning branch January 7, 2017 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants