Keck-DataReductionPipelines / MosfireDRP

http://keck-datareductionpipelines.github.io/MosfireDRP
10 stars 13 forks source link

DRP Fails Due to TypeError on numpy >1.12 #73

Closed joshwalawender closed 7 years ago

joshwalawender commented 7 years ago

The long warned of deprecation in numpy where it would previously accept arrays indexed by floats has happened and the DeprecationWarnings

VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future

have turned in to TypeErrors, e.g.:

TypeError: slice indices must be integers or None or have an index method

This was first noted in #72 .

I am working on a PR to fix this.

lucarizzi commented 7 years ago

Josh

I might be wrong but the actual problem is not that we are using non-integer arrays but that we are using masked arrays.

If you use a masked array of integers we get the same error.

We can probably verify

Nick Konidaris pointed this out recently, maybe in a different bug report.

We should see if that is the problem and if so, wrap the masked array with a function that make them look like regular arrays.

I can dig out the details

Luca

On May 19, 2017, at 12:26 PM, Josh Walawender notifications@github.com wrote:

The long warned of deprecation in numpy where it would previously accept arrays indexed by floats has happened and the DeprecationWarnings

VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future have turned in to TypeErrors, e.g.:

TypeError: slice indices must be integers or None or have an index method This was first noted in #72 .

I am working on a PR to fix this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

joshwalawender commented 7 years ago

Hi Luca,

It's the fact that the array index values are floats instead of ints, not the array values themselves. I'm working through the pipeline and already have a version which works in at least some subset of situations. Am running some other data through now to catch other code paths.

-Josh

lucarizzi commented 7 years ago

Sure, I was referring to the array indexes as well.

In some cases, we mask the array of indexes (not the values).

See:

https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/70 https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/70

and the comment from Nick

Luca

On May 19, 2017, at 12:43 PM, Josh Walawender notifications@github.com wrote:

Hi Luca,

It's the fact that the array index values are floats instead of ints, not the array values themselves. I'm working through the pipeline and already have a version which works in at least some subset of situations. Am running some other data through now to catch other code paths.

-Josh

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/73#issuecomment-302827307, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgCnSA908F0AKzL1d7bjIjbTQRyEOf5ks5r7hr7gaJpZM4NhE-M.

joshwalawender commented 7 years ago

Closing because the TypeError has been fixed in the latest version of the DRP in the dev branch (see PR #76).