Repository navigation
Merge imageutils functionality into astropy core - #3201
Conversation
2b9ec49 to
cbbec4d
Compare
e7fcb3e to
b422aaa
Compare
|
@cdeil @eteq - given that the normalization stuff applies to arrays of any dimension, should it be its own top-level package? What about other parts of this PR? Here are remaining to-dos for this PR:
|
There was a problem hiding this comment.
Maybe this function could have a more specific name, like get_overlap or get_overlap_slices? (or just overlap_slices, where the get_ is implied?)
|
I realize this is a WIP, but adding some comments anyways.... :D |
|
@embray - thanks, this is helpful! The contents are actually fine for review, it's more questions to do with organization and docs that are WIP :) |
There was a problem hiding this comment.
I guess this should add an abstractmethod for get_limits, or instead make an abstractproperty called just limits.
There was a problem hiding this comment.
I'd like to leave get_limits because it is something that is computed on-the-fly and may take a non-trivial time in some cases, but happy to change if more people are in favor of a property.
There was a problem hiding this comment.
Yeah, I don't think that's really the way to think of properties, IMO. This is debatable though.
There was a problem hiding this comment.
On second thought, I misinterpreted what this is doing, and that it could return values dependent on the data. In that case this is fine.
|
Just saw this now: I do agree that the display stuff is not specific to images and thus should be in a separate module. Since it is somewhat specifc to Bit higher-level: I was not part of the telecon, but I don't understand the rush to add this as a new package. Do we really want to offer long-term support for something this new? It seems ideal to start working on this after 1.0 is released. |
|
@mhvk - sorry, I should clarify, most of the normalization code is matplotlib-agnostic, and can be used with n-dimensional arrays. It is true that in practice it will be used with images though. Also, we aren't calling all features in 1.0 "LTS" so it's fine to put this in 1.0. Several packages are depending on this functionality, so it's good to get it in the core and it will mature very fast there. A lot of this is intended for affiliated packages, rather than to be used directly by users. |
|
Another thing to bear in mind in the discussion of where this should all go. |
There was a problem hiding this comment.
There's no reason to put raise NotImplementedError in an abstractmethod (since it won't be called in the first place if it's not implemented). Better is to just put a docstring and leave the rest empty (in fact, subclasses can still, in principle, call super().get_limits(), which in this case would result in raising NotImplementedError even though it is implemented).
|
Thinking about this a bit more, maybe @larrybradley @cdeil @adonath @eteq @hamogu - what do you think? @mhvk - just to clarify about your comment on starting to work on this after 1.0, I should say that this has already been worked on for a few months outside of the core, so it's not like it's all untested code. The difficult part is just figuring out where it should go in the core. If we don't reach an agreement on where things should go in the core, then we have two options:
|
|
I would prefer to keep array utils in I'm also +1 to get this into |
|
Agreed that we don't need a new namespace for the array manipulation routines. I think those are not 2-D specific (even though many are written as such), and hence in my opinion are more natural in The stretch and normalization routines are 2-D specific, but even more they are for displaying arrays, not for manipulating them, and the classes are also seem specific to matplotlib. It does seem that so far in |
There was a problem hiding this comment.
Hey ... it takes data and mask ... why not @supports_nddata?
(I'm not seriously suggesting to do this by tomorrow ... but there's a few functions in this PR that might be candidates for a future PR.)
|
@cdeil - I've added a short paragraph about |
|
@cdeil - thanks for the detailed review! I think I managed to keep up. One unresolved issue is related to the script but I think that could be a more general bug and may be better addressed in a separate issue. Does anyone else want to review this before tomorrow evening? :) |
|
@astrofrog -- I'll try to give this a look Friday |
|
This looks great to me, thanks @astrofrog ! |
There was a problem hiding this comment.
-> astropy.visualization.scripts.fits2bitmap
There was a problem hiding this comment.
Ahh, thanks! @cdeil, this explains the weird behavior with the script :)
|
@mhvk - just for info the transforms now use the |
There was a problem hiding this comment.
These imports should be moved inside the function to minimize the chances of at-import ``ImportError`s
|
I think I'm happy with this aside from the one comment above. I'm not a fan of the fact that this now introduces a module that triggers an error on import if you don't have an optional dep ( |
…nal) even if matplotlib is not installed.
|
This can be merged once Travis and AppVeyor pass |
|
Checked over this again and it's good to go (and no objections above) so merging! |
Merge imageutils functionality into astropy core
There was a problem hiding this comment.
👍 This was going to be my suggestion but looks like you're way ahead on that ;)
This is a WIP, but is the PR to merge
imageutilsinto the Astropy core package.Notes:
astropy/imageutilsThis is not ready for review or merging, and still needs updates to the docs, tests to pass, etc.
cc @larrybradley @cdeil @adonath @eteq @hamogu @ejeschke