Skip to content

Commit

Permalink
Fix checks whether alloc arguments are omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
philsmt committed Mar 29, 2021
1 parent 8cf52e3 commit e729be7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pasha/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def _resolve_alloc(shape, dtype, order, like):
memory order.
"""
if like is not None:
shape = shape or like.shape
dtype = dtype or like.dtype
shape = shape if shape is not None else like.shape
dtype = dtype if dtype is not None else like.dtype

try:
if order is None:
Expand All @@ -76,8 +76,8 @@ def _resolve_alloc(shape, dtype, order, like):
raise ValueError('array shape must be specified')

else:
dtype = dtype or np.float64
order = order or 'C'
dtype = dtype if dtype is not None else np.float64
order = order if order is not None else 'C'

if isinstance(shape, int):
shape = (shape,)
Expand Down
1 change: 0 additions & 1 deletion pasha/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from pasha.functor import Functor



@pytest.mark.parametrize(
'ctx_cls', [MapContext, ProcessContext],
ids=['MapContext', 'ProcessContext'])
Expand Down

0 comments on commit e729be7

Please sign in to comment.