You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are trivial vectorized versions of algorithms (such as sunpos) that are not appropriate for a Julia library. These reflect the (false in Julia) assumption that it is always faster to call a library function to process things in a batch than to loop over all the elements in user code calling a scalar library function. It would be simpler and in some cases more performant to use broadcasting or for loops than to provide additional methods for vectors of inputs.
This would be breaking.
# This function doesn't belongfunctionsunpos(jd::AbstractVector{J}; radians::Bool=false) where {J<:Real}
typej =float(J)
ra =similar(jd, typej)
dec =similar(jd, typej)
longmed =similar(jd, typej)
oblt =similar(jd, typej)
for i ineachindex(jd)
ra[i], dec[i], longmed[i], oblt[i] =sunpos(jd[i], radians=radians)
endreturn ra, dec, longmed, oblt
end
The primary reason to make this change is to shrink the API surface area without reducing functionality or ease of use.
The text was updated successfully, but these errors were encountered:
The problem is that the broadcast version of these functions returns vectors of tuples, instead of tuples of vectors. This is basically to work around JuliaLang/julia#22129.
There are trivial vectorized versions of algorithms (such as
sunpos
) that are not appropriate for a Julia library. These reflect the (false in Julia) assumption that it is always faster to call a library function to process things in a batch than to loop over all the elements in user code calling a scalar library function. It would be simpler and in some cases more performant to use broadcasting or for loops than to provide additional methods for vectors of inputs.This would be breaking.
The primary reason to make this change is to shrink the API surface area without reducing functionality or ease of use.
The text was updated successfully, but these errors were encountered: