Repository navigation
Conversation
fe0d9f1 to
567cf5f
Compare
| return LArray(np.empty_like(array.data, dtype, order), array.axes, title) | ||
|
|
||
|
|
||
| # No need to add @_check_axes_argument, `axes` argument will be checked in empty |
There was a problem hiding this comment.
I think it is needed, because what needs to be checked is fill_value.
There was a problem hiding this comment.
It will return an error if fill_value is an integer. But I can test if fill_value is not an Axis before to call empty inside full
There was a problem hiding this comment.
ok, so rather than "no need to add...", the comment should be something like: "we cannot use ... because an integer fill_value would be considered as an error"
| if len(args) > 1 and isinstance(args[1], (int, Axis)): | ||
| raise ValueError("If you want to pass several axes or dimension lengths to {}, " | ||
| "you must pass them as a list (using []) or tuple (using()).".format(func.__name__)) | ||
| return func(*args, **kwargs) |
There was a problem hiding this comment.
when wrapping a function, you need to copy its __name__ and __doc__ and possibly other stuff, or preferably, use functools.wraps on the wrapper.
567cf5f to
f8783ba
Compare
| FO | 0 | 1 | ||
| """ | ||
| if isinstance(fill_value, Axis): | ||
| raise TypeError("`fill_value` must be a numeric value") |
There was a problem hiding this comment.
wouldn't it be better to raise the same error than other creation functions?
| return LArray(np.empty_like(array.data, dtype, order), array.axes, title) | ||
|
|
||
|
|
||
| # No need to add @_check_axes_argument, `axes` argument will be checked in empty |
There was a problem hiding this comment.
ok, so rather than "no need to add...", the comment should be something like: "we cannot use ... because an integer fill_value would be considered as an error"
…d as func(axis1, axis2, ...) instead of func([axis1, axis2], ...)
f8783ba to
30226ad
Compare
|
LGTM |
fix #203