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

Make SIUnits compatible with Gadfly #67

Merged
merged 2 commits into from
Sep 11, 2015
Merged

Make SIUnits compatible with Gadfly #67

merged 2 commits into from
Sep 11, 2015

Conversation

mdavezac
Copy link
Contributor

@mdavezac mdavezac commented Sep 4, 2015

The point is to be able to plot quantities with units:

using Gadfly
using SIUnits
using SIUnits.Shorthand
x = [1:16]m
plot(x=x, y=x.*x)

The example above issues warnings about function clashes with a * in Compose and isless in DualNumbers, both used by Gadfly.

This pull-request corrects both issues by declaring the functions with more specific types.

This pull-request would close #19.

Mayeul d'Avezac added 2 commits September 4, 2015 18:16
DualNumbers.jl (used by Gadfly) and SIUnits declare ambiguous isless
function. Since isless is only meaningfull for real numbers, and since
both DualNumbers and SIUnit declare it for Number rather than Real
arguments, the trick is for SIUnit to downgrade its declaration to the
more specific type. Number is a supertype of both Real and Complex.
@ssfrr
Copy link
Contributor

ssfrr commented Sep 11, 2015

LGTM

Keno added a commit that referenced this pull request Sep 11, 2015
Make SIUnits compatible with Gadfly
@Keno Keno merged commit 6a53571 into Keno:master Sep 11, 2015
@mdavezac mdavezac deleted the issue-19 branch September 12, 2015 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method ambiguity interaction with Compose.jl
3 participants