Skip to content

Commit

Permalink
Perform 2 * pi first in _get_ang_freq_grid (#47)
Browse files Browse the repository at this point in the history
Just to ensure this scalar multiplication occurs before graph
construction and is not added as operations in graph construction,
enforce the order of operations by treating `2 * pi` as a quantity
itself. This way we can be sure it is already computed before graph
construction begins and the scalar is merely inserted into the graph as
a single node.
  • Loading branch information
jakirkham committed Sep 1, 2018
1 parent 1050f32 commit e9b8315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dask_image/ndfourier/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _get_ang_freq_grid(shape, chunks, dtype=float):
pi = dtype(numpy.pi)

freq_grid = _get_freq_grid(shape, chunks, dtype=dtype)
ang_freq_grid = 2 * pi * freq_grid
ang_freq_grid = (2 * pi) * freq_grid

return ang_freq_grid

Expand Down

0 comments on commit e9b8315

Please sign in to comment.