Skip to content

Commit

Permalink
handle copy kwarg in asarray_ndim
Browse files Browse the repository at this point in the history
  • Loading branch information
alimanfoo authored Aug 30, 2024
1 parent 312fae6 commit 27cb332
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion allel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def asarray_ndim(a, *ndims, **kwargs):
"""
allow_none = kwargs.pop('allow_none', False)
copy = kwargs.pop("copy", False)
if a is None and allow_none:
return None
a = np.asarray(a, **kwargs)
if copy:
a = np.array(a, **kwargs)
else:
a = np.asarray(a, **kwargs)
if a.ndim not in ndims:
if len(ndims) > 1:
expect_str = 'one of %s' % str(ndims)
Expand Down

0 comments on commit 27cb332

Please sign in to comment.