sunpy / ndcube

A base package for multi-dimensional contiguous and non-contiguous coordinate-aware arrays.
http://docs.sunpy.org/projects/ndcube/
BSD 2-Clause "Simplified" License
44 stars 48 forks source link

A little more infos in the docs? #75

Closed cdeil closed 6 years ago

cdeil commented 6 years ago

I just saw the release announcement: https://groups.google.com/forum/#!topic/sunpy/EcT8kWIfVrU

Could you please add some install instructions to the docs, i.e. the pip and conda install you have in the release email? http://docs.sunpy.org/projects/ndcube/en/stable/index.html

The other thing I was surprised about is that ndcube depends on sunpy. I see that you use it (https://github.com/sunpy/ndcube/search?p=2&q=sunpy&type=&utf8=%E2%9C%93), but it wasn't obvious from the description on the docs page that / why it's needed. Maybe you can add a little more info about dependencies for ndcube there? I presume sunpy is and will remain a required dependency for ndcube?

PS: In Gammapy we have been developing something similar, hence my interest: http://docs.gammapy.org/dev/maps/index.html I'll look at your class in the coming days and see if we can steal some good ideas. :-)

Out of curiosity: did you look at xarray.pydata.org for guidance? It's one of the packages we looked at. It seems a lot of the concepts you have in ndcube are very close to xarray.

DanRyanIrish commented 6 years ago

Hi @cdeil. Thanks for your getting in contact with this issue. The install instructions are also in the REAME.rst file. So you don't have to worry about saving the email. But we certainly could consider adding them to the to the docs as well.

Regarding SunPy, yes it will remain a dependency for the foreseeable future. In fact it's possible down the road that ndcube could be moved into SunPy core which would have a number of maintenance advantages for us. However, there is no plan to do that in the foreseeable future. At the moment, one of the things ndcube relies on from SunPy is the visualization objects which are ultimately subclassed from matplotlib. But perhaps future versions of ndcube could have more sophisticated visualization tools.

I would be very interested to hear what you guys are doing in gammapy. Perhaps there is scope for collaboration? Or at least communication about overlapping solutions. Or perhaps you might even find that subclassing ndcube could provide you solutions to some of your challenges?

Yes, we did look at xarray. In fact we started looking at xarray for another project but found that although it did provide some similar things to what we needed but ultimately didn't satisfy our requirements. So that's why we developed ndcube.

cdeil commented 6 years ago

Perhaps there is scope for collaboration? Or at least communication about overlapping solutions. Or perhaps you might even find that subclassing ndcube could provide you solutions to some of your challenges?

Both your ndcube and our gammapy.maps doesn't have much domain-specific stuff, but then little domain-specific things creep in and it's not feasible any more to directly use for others. E.g. you won't import gammapy in sunpy, and we won't import ndcube if it depends on sunpy. Only if you were to aim to develop it in a non-domain-specific way and target Astropy core would it become an option for us to re-use code directly, but even then it would be a major effort to rewrite gammapy.maps and not clear if there's enough motivation / manpower to do it.

But I think we could learn a lot by doing a bit of compare and contrast and then maybe even talking at some point over phone instead of just here.

Would you say your design / class is complete? Or is something major still missing or in development? Do you have a way to serialise your objects, e.g. to FITS, ASDF or HDF5?

Developing formats and I/O for the extra axes was a major effort (done by @woodmd) for gamma-ray astronomy, and I don't think the solutions are as-generic that they will catch on in other domains of astronomy (but would be happy to hear if they are; see http://gamma-astro-data-formats.readthedocs.io/en/latest/skymaps/index.html for what we use)

cdeil commented 6 years ago

The install instructions are also in the REAME.rst file.

OK, then alternatively a link to Github or the README from the docs front page would also be sufficient IMO. Most packages have a little docs page where they mention how to install and what the dependencies are, e.g. http://xarray.pydata.org/en/stable/installing.html .

DanRyanIrish commented 6 years ago

Although I've heard of gammapy I'm not very familiar with it. So it would be interesting to read your docs and get a better sense of the problems you are trying to solve, particularly relating to any overlap with ndcube. Then I agree that I phone conversation could be very helpful.

At this stage I don't anticipate the parts of the API currently in version 1.0 changing very much other than to keep up-to-date with how general astropy or sunpy API evolves. That being said, I have several ideas for additions to the API. For example, I would like to see the ability to upsample/downsample the cubes, perform arithmetic operations, and give NDCube and NDCubeSequence some kind of parallelization capability. I know @Cadair has other ideas about using ndcube in developing software for the future DKIST telescope. I would think of these not as major things that are missing but as future enhancements.

Regarding I/O, we haven't developed anything like at this stage. I certainly think output to FITS, and possibly ASDF and HDF5 as well could be included in future versions. I'm not sure that writing generalized input functionality is something we should do as I would think it's very hard to predict all possible ways files can be arranged. I think that should be left to users as they will know the specifics of the files they are dealing with.

Finally, yes I think that we should include something in the docs about installation. Thanks for bringing this to our attention :)

DanRyanIrish commented 6 years ago

@cdeil We've added installation instructions to the docs. Hope you find them helpful!