Skip to content

Commit b04905e

Browse files
committed
fix keyword typo
1 parent 261e606 commit b04905e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

code/ndarray.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(ndarray_transpose_obj, ndarray_transpose);
19121912
mp_obj_t ndarray_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
19131913
static const mp_arg_t allowed_args[] = {
19141914
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_rom_obj = MP_ROM_NONE } },
1915-
{ MP_QSTR_axis, MP_ARG_OBJ, { .u_rom_obj = MP_ROM_NONE } },
1915+
{ MP_QSTR_axes, MP_ARG_OBJ, { .u_rom_obj = MP_ROM_NONE } },
19161916
};
19171917

19181918
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
@@ -1928,30 +1928,30 @@ mp_obj_t ndarray_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw
19281928
int32_t *strides = m_new(int32_t, self->ndim);
19291929
uint8_t *order = m_new(uint8_t, self->ndim);
19301930

1931-
mp_obj_t axis = args[1].u_obj;
1931+
mp_obj_t axes = args[1].u_obj;
19321932

1933-
if(axis == mp_const_none) {
1933+
if(axes == mp_const_none) {
19341934
// simply swap the order of the axes
19351935
for(uint8_t i = 0; i < self->ndim; i++) {
19361936
order[i] = self->ndim - 1 - i;
19371937
}
19381938
} else {
1939-
if(!mp_obj_is_type(axis, &mp_type_tuple)) {
1939+
if(!mp_obj_is_type(axes, &mp_type_tuple)) {
19401940
mp_raise_TypeError(MP_ERROR_TEXT("keyword argument must be tuple of integers"));
19411941
}
19421942
// start with the straight array, and then swap only those specified in the argument
19431943
for(uint8_t i = 0; i < self->ndim; i++) {
19441944
order[i] = i;
19451945
}
19461946

1947-
mp_obj_tuple_t *axes = MP_OBJ_TO_PTR(axis);
1947+
mp_obj_tuple_t *axes_tuple = MP_OBJ_TO_PTR(axes);
19481948

1949-
if(axes->len > self->ndim) {
1949+
if(axes_tuple->len > self->ndim) {
19501950
mp_raise_ValueError(MP_ERROR_TEXT("too many axes specified"));
19511951
}
19521952

1953-
for(uint8_t i = 0; i < axes->len; i++) {
1954-
int32_t ax = mp_obj_get_int(axes->items[i]);
1953+
for(uint8_t i = 0; i < axes_tuple->len; i++) {
1954+
int32_t ax = mp_obj_get_int(axes_tuple->items[i]);
19551955
if((ax >= self->ndim) || (ax < 0)) {
19561956
mp_raise_ValueError(MP_ERROR_TEXT("axis index out of bounds"));
19571957
} else {

0 commit comments

Comments
 (0)