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

Deprecate @vectorize_1arg for Dates functions within scope of Dates module #18456

Merged
merged 2 commits into from
Sep 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -924,14 +924,17 @@ for f in (
:erfinc, :erfcinv, # base/special/erf.jl
:trunc, :floor, :ceil, :round, # base/floatfuncs.jl
:rad2deg, :deg2rad, :exponent, :significand, # base/math.jl
:unix2datetime, :rata2datetime, :julian2datetime, # base/dates/conversions.jl
:sind, :cosd, :tand, :asind, :acosd, :atand, :asecd, :acscd, :acotd, # base/special/trig.jl
)
@eval @dep_vectorize_1arg Real $f
end
# base/complex.jl
@dep_vectorize_1arg Complex round
@dep_vectorize_1arg Complex float
# base/dates/*.jl
for f in (:unix2datetime, :rata2datetime, :julian2datetime) # base/dates/conversions.jl
eval(Dates, :(Base.@dep_vectorize_1arg Real $f))
end
Copy link
Member

@ararslan ararslan Sep 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO those parentheses make it kind of hard to read. Might be nicer as

# base/dates/*.jl
for f in (:unix2datetime, :rata2datetime, :julian2datetime) # base/dates/conversions.jl
    eval(Dates, :(Base.@dep_vectorize_1arg Real $f))
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change. Was just matching the surrounding style.

for f in (
# base/dates/accessors.jl
:year, :month, :day, :week, :dayofmonth, :yearmonth, :monthday, :yearmonthday,
Expand All @@ -944,15 +947,15 @@ for f in (
:daysofweekinmonth, :monthname, :monthabbr, :daysinmonth,
:isleapyear, :dayofyear, :daysinyear, :quarterofyear, :dayofquarter,
)
@eval @dep_vectorize_1arg Dates.TimeType $f
eval(Dates, :(Base.@dep_vectorize_1arg Dates.TimeType $f))
end
for f in (
:hour, :minute, :second, :millisecond, # base/dates/accessors.jl
:Date, :datetime2unix, :datetime2rata, :datetime2julian, # base/dates/conversions.jl
)
@eval @dep_vectorize_1arg Dates.DateTime $f
eval(Dates, :(Base.@dep_vectorize_1arg Dates.DateTime $f))
end
@dep_vectorize_1arg Dates.Date Datetime # base/dates/conversions.jl
eval(Dates, :(Base.@dep_vectorize_1arg Dates.Date Datetime)) # base/dates/conversions.jl

# Deprecate @vectorize_2arg-vectorized functions from...
for f in (
Expand Down