Resample #309

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants
@jbpoline
Member

jbpoline commented Feb 26, 2014

Pass some ndimage keyword arguments to the resampling routines. Useful if you need default value to something else than 0 for instance. Not all cases are covered.

@alexis-roche

This comment has been minimized.

Show comment
Hide comment
@alexis-roche

alexis-roche Mar 3, 2014

Why not using the double star idiom as in:

resample(..., **interp_param)

Why not using the double star idiom as in:

resample(..., **interp_param)

@jbpoline

This comment has been minimized.

Show comment
Hide comment
@jbpoline

jbpoline Mar 4, 2014

Owner

The reason for not doing **params was that "order" parameter is already a named arguments - and you could also have order in the dict. I think it's clearer with named argument (no previously used or unused parameters). But that's minor to me if you think strongly about it.

Owner

jbpoline commented on 9421793 Mar 4, 2014

The reason for not doing **params was that "order" parameter is already a named arguments - and you could also have order in the dict. I think it's clearer with named argument (no previously used or unused parameters). But that's minor to me if you think strongly about it.

@alexis-roche

This comment has been minimized.

Show comment
Hide comment
@alexis-roche

alexis-roche Mar 5, 2014

Member

Well, order could be implicitly included in interp_param without changing the function signature. I think that passing an explicit dictionary is not very pythonic, thus possibly confusing.

Member

alexis-roche commented Mar 5, 2014

Well, order could be implicitly included in interp_param without changing the function signature. I think that passing an explicit dictionary is not very pythonic, thus possibly confusing.

@@ -54,6 +54,11 @@ def resample(moving, transform=None, reference=None,
maps from world coordinates.
interp_order: int, optional
Spline interpolation order, defaults to 3.
+ interp_param: None or dict, optional

This comment has been minimized.

@bthirion

bthirion Mar 22, 2014

Contributor

Sorry, but I dislike this kind of argument for a function that does a relatively precise algorithmic operation. You should provide a list of explicit arguments instead of a dictionary. Otherwise, how can the use figure out what arguments to give ?

@bthirion

bthirion Mar 22, 2014

Contributor

Sorry, but I dislike this kind of argument for a function that does a relatively precise algorithmic operation. You should provide a list of explicit arguments instead of a dictionary. Otherwise, how can the use figure out what arguments to give ?

@matthew-brett

This comment has been minimized.

Show comment
Hide comment
@matthew-brett

matthew-brett Mar 26, 2014

Member

Ok - it looks like the assembled company prefer adding the explicit

mode='constant', cval=1.

to the function signature instead of interp_params. Is that right?

Member

matthew-brett commented Mar 26, 2014

Ok - it looks like the assembled company prefer adding the explicit

mode='constant', cval=1.

to the function signature instead of interp_params. Is that right?

@bthirion

This comment has been minimized.

Show comment
Hide comment
@bthirion

bthirion Mar 26, 2014

Contributor

Yes

Contributor

bthirion commented Mar 26, 2014

Yes

@matthew-brett

This comment has been minimized.

Show comment
Hide comment
@matthew-brett

matthew-brett Apr 10, 2014

Member

JB - would you mind making those changes?

Member

matthew-brett commented Apr 10, 2014

JB - would you mind making those changes?

@matthew-brett

This comment has been minimized.

Show comment
Hide comment
@matthew-brett

matthew-brett Apr 29, 2014

Member

JB - is there any chance you will get to this soon?

Member

matthew-brett commented Apr 29, 2014

JB - is there any chance you will get to this soon?

@matthew-brett

This comment has been minimized.

Show comment
Hide comment
@matthew-brett

matthew-brett Sep 6, 2015

Member

Closing this one in favor of #359 (same PR with refactoring on top).

Member

matthew-brett commented Sep 6, 2015

Closing this one in favor of #359 (same PR with refactoring on top).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment