Skip to content

Commit 93822e6

Browse files
committed
removed redundant exception from linalg.norm
1 parent 5f716a7 commit 93822e6

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

code/numpy/linalg/linalg.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,7 @@ static mp_obj_t linalg_norm(size_t n_args, const mp_obj_t *pos_args, mp_map_t *k
365365

366366
mp_obj_t x = args[0].u_obj;
367367
mp_obj_t axis = args[1].u_obj;
368-
if((axis != mp_const_none) && (!MP_OBJ_IS_INT(axis))) {
369-
mp_raise_TypeError(translate("axis must be None, or an integer"));
370-
}
371-
372368

373-
// static mp_obj_t linalg_norm(mp_obj_t x) {
374369
mp_float_t dot = 0.0, value;
375370
size_t count = 1;
376371

code/ulab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include "user/user.h"
3535

36-
#define ULAB_VERSION 2.3.3
36+
#define ULAB_VERSION 2.3.4
3737
#define xstr(s) str(s)
3838
#define str(s) #s
3939
#define ULAB_VERSION_STRING xstr(ULAB_VERSION) xstr(-) xstr(ULAB_MAX_DIMS) xstr(D)

code/ulab_tools.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void *ndarray_set_float_function(uint8_t dtype) {
162162
shape_strides tools_reduce_axes(ndarray_obj_t *ndarray, mp_obj_t axis) {
163163
// TODO: replace numerical_reduce_axes with this function, wherever applicable
164164
if(!mp_obj_is_int(axis) & (axis != mp_const_none)) {
165-
mp_raise_TypeError(translate("axis must be an interable or ndarray"));
165+
mp_raise_TypeError(translate("axis must be None, or an integer"));
166166
}
167167
shape_strides _shape_strides;
168168
size_t *shape = m_new(size_t, ULAB_MAX_DIMS);

docs/ulab-change-log.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Tue, 9 Feb 2021
22

3+
version 2.3.4
4+
5+
removed redundant exception from linalg.norm, fixed exception message in tools_reduce_axes
6+
7+
Tue, 9 Feb 2021
8+
39
version 2.3.3
410

511
linalg.norm should now work with the axis keyword argument

0 commit comments

Comments
 (0)