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

more generic code in next breaking release #24

Closed
xzackli opened this issue Apr 28, 2020 · 1 comment
Closed

more generic code in next breaking release #24

xzackli opened this issue Apr 28, 2020 · 1 comment

Comments

@xzackli
Copy link
Contributor

xzackli commented Apr 28, 2020

Hey @ziotom78, hope you're faring well. I'd like to hear your thoughts on the following enhancement, based on my use of this library.

Since we are already going to make a breaking release to include the SHTs, it would be nice if we also changed Healpix.jl to leverage more of the Julia language. Currently, both Map{T} and Alm{T} contain Array{T} instead of parametrizing on both T and AbstractArray, and there are functions which mention explicitly Array instead of AbstractArray, or Map instead of GenericMap. I think there are just too many strict type hints.

Consider the following interesting array types which could be used for the data in a Map,

  • CUArray for trivial offloading of map processing to the GPU
  • SharedArray or DistributedArray for parallelism
  • FillArray for a lazy constant map / flat spectrum.

External users can't even really inherit from GenericMap since none of the functions dispatch on that, so they would have to rewrite this library for their map type.

One approach is to make a change where we parametrize also on array types like Map{T,AA} or Alm{T,AA}, see AA in OffsetArrays. At the very least, more abstract types in functions could be used. This might be a somewhat large set of changes, so apologies if this is an annoying suggestion.

@ziotom78
Copy link
Owner

Hi @xzackli , I like this idea very much!

I experimented a bit, and it should not be too difficult to do that. I'll start a PR, let's move the discussion there.

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

2 participants