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

Type piracy #4

Open
oxinabox opened this issue Nov 19, 2018 · 3 comments
Open

Type piracy #4

oxinabox opened this issue Nov 19, 2018 · 3 comments

Comments

@oxinabox
Copy link
Member

The following methods are pirated from Base and Unitful.

round(x::AbstractArray{<:Quantity}, r::Int) 
round{T<:Quantity}(x::T, r::Int)
mean(x::AbstractArray{<:Quantity}, r::Int)
ustrip(x::Missings.Missing)
*{T<:Unitful.FreeUnits}(y::Missings.Missing, x::T)
*(x::Unitful.Units, y::Number)
*(x::Unitful.Units, y::Period)
*(x::Period, y::Unitful.Units)
convert(a::Unitful.Units, x::Period)

The piracy can be resolved by moving them into Unitful itself.

@iamed2
Copy link
Member

iamed2 commented Nov 22, 2018

Although, these two should probably be removed and usage should change to broadcast instead:

mean(x::AbstractArray{<:Quantity}, r::Int)
round(x::AbstractArray{<:Quantity}, r::Int) 

@oxinabox
Copy link
Member Author

round was removed from Unitful.jl on purpose.
PainterQubits/Unitful.jl#78

@nicoleepp
Copy link
Collaborator

Actually Unitful still has round methods for objects of type DimensionlessQuantity (https://github.com/ajkeller34/Unitful.jl/blob/master/src/quantities.jl#L279) but I agree that these methods should be deprecated and moved to Unitful or removed completely.

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

No branches or pull requests

3 participants