Open
Description
opened on Dec 9, 2024
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 belong
function sunpos(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 in eachindex(jd)
ra[i], dec[i], longmed[i], oblt[i] = sunpos(jd[i], radians=radians)
end
return 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.
Metadata
Assignees
Labels
No labels
Activity