Conversation
|
I think there is some thinking to do about how we would subclass. I raise that as there is an example given as Spectrum1D, yet I think lots of spectral functionality can be done without regard to whether it is 1D, 2D, or 3D. And the same spectral capability could coexist with image capability (e.g., in the 3D case). I'd like to avoid having to cover all possible combinations of things in these subclasses (one could almost look at this as cases for mix-ins) |
|
@perrygreenfield - I agree that we have to think about how to avoid having Spectrum1D/2D/3D and Image duplicate too much code. Since Spectrum1D, Spectrum2D, and Image can be represented as Spectrum3D with one element along specific dimensions, we may be able to make them re-use Spectrum3D with on-the-fly slicing. However, I would say this is beyond the scope of the APE because there are also other kinds of NDData, for example 3d spatial volumes, that are distinctly separate. Regarding the slicing, the way you worded it is what I meant - I will try and clarify this. In fact, the WCS class in astropy already supports basic slicing. |
|
I agree with the details of subclassing being beyond the scope. The main point is to avoid examples that imply how it will be done (e.g., Spectrum1D). |
|
@perrygreenfield - ah yes, I see what you mean. I'll fix that. |
There was a problem hiding this comment.
No function in Astropy or in affiliated packages would be required to be able to handle generic
NDDataobjects.
But having NDData is only useful if there are lots of functions that can handle NDData.
So in practice most functions in astropy.image, astropy.convolution, photutils, ... should be changed and the decorator proposed below added, no?
Am I misunderstanding this sentence or is it indeed misleading?
There was a problem hiding this comment.
What I meant was that no function should be expected to be able to handle an instance of the base NDData class - for example astropy.image can accept just Image sub-classes, same for photutils. It's going to be very rare that a function is so general it can operate on an instance of the base class directly. Do you have a suggestion how to re-word this?
There was a problem hiding this comment.
I agree this should have some clarification.
What does it imply for the modeling framework for example? Can a model be evaluated on an NDData input? It generally doesn't care if it represents an image, or a spectrum, or what have you.
|
I've left a few comments inline. If we do keep this modified I mean this is what happened two years ago ... an Maybe this could simply be mentioned in a sentence here: before the Astropy 1.0 release we encourage X, Y, Z (the classes and functions we have in mind) to use this and give feedback? |
|
Not sure where best to insert this, but the new base Subclasses might provide these methods (it is convenient in |
|
@cdeil - you raise good points. I think that certainly before we actually decide on this we should demonstrate some real-life examples using the proposed decorator and functions. I think that this is what was lacking until now - actual applications! |
|
Sorry, I missed that there was a PR for this. I've been making my comments in e71e6e0 (though it looks like GitHub is helpfully copying them over here automatically). |
I actually think this APE would strongly benefit from an example of how it would be done. For example an at least partially working example of a (Agreed though that "Spectrum1D" much less "SpectrumAnyD" is not a good example.) |
|
Seems like my last comment mirrors a lot of @cdeil's feelings about it to. Though to be clear I'm in favor of this APE in general. Also I agree with @mwcraig that there probably should not be a guarantee of direct compatibility with |
|
@astrofrog -- though I'd bump this... is there any reason not to make a PR on the main APE repo and ask for feedback on astropy-dev? |
|
@astrofrog -- I should add that I can rough out an example Image subclass if you want... |
|
@perrygreenfield @cdeil @mwcraig @embray - thanks for all your comments so far! I'm going to close this and will open a PR on the real APE repository to open it for full review. |
Grammar and Style Edits to APE0.rst
No description provided.