I think it's probably worth checking that if dx or dy have `__call__` that they both do, in case the user decides to pass functions for dx or dy separately.  The docstring doesn't currently discuss this possibility, but it seems reasonable to allow it.  Just need to make sure they both are functions if so. 

Or you can pretty easily allow just one of them to be a function by doing
```
if not hasattr(dx, '__call__'): dx = lambda w: dx
if not hasattr(dy, '__call__'): dy = lambda w: dy
shift = lambda w: ... using dx(w) and dy(w)...
```