Skip to content

Commit

Permalink
Minor compile fixes: comma and new-line at end of files (#550)
Browse files Browse the repository at this point in the history
* Fix missing comma in type definition

Signed-off-by: Damien George <damien@micropython.org>

* Make sure all files have a new-line at the end

Some very old compilers don't like files without a new-line at the end.

Signed-off-by: Damien George <damien@micropython.org>

* Use math.isclose for universal_functions expm1 test

Signed-off-by: Damien George <damien@micropython.org>

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Sep 30, 2022
1 parent 5ccfa5c commit 41fcf1d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/numpy/io/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ MP_DECLARE_CONST_FUN_OBJ_KW(io_loadtxt_obj);
MP_DECLARE_CONST_FUN_OBJ_2(io_save_obj);
MP_DECLARE_CONST_FUN_OBJ_KW(io_savetxt_obj);

#endif
#endif
2 changes: 1 addition & 1 deletion code/numpy/ndarray/ndarray_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ mp_obj_t ndarray_get_flatiterator(mp_obj_t , mp_obj_iter_buf_t *);
mp_obj_t ndarray_flatiter_make_new(mp_obj_t );
mp_obj_t ndarray_flatiter_next(mp_obj_t );

#endif
#endif
3 changes: 2 additions & 1 deletion code/ulab.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ const mp_obj_type_t ulab_ndarray_type = {
{ &mp_type_type },
.flags = MP_TYPE_FLAG_EXTENDED
#if defined(MP_TYPE_FLAG_EQ_CHECKS_OTHER_TYPE) && defined(MP_TYPE_FLAG_EQ_HAS_NEQ_TEST)
| MP_TYPE_FLAG_EQ_CHECKS_OTHER_TYPE | MP_TYPE_FLAG_EQ_HAS_NEQ_TEST,
| MP_TYPE_FLAG_EQ_CHECKS_OTHER_TYPE | MP_TYPE_FLAG_EQ_HAS_NEQ_TEST
#endif
,
.name = MP_QSTR_ndarray,
.print = ndarray_print,
.make_new = ndarray_make_new,
Expand Down
2 changes: 1 addition & 1 deletion code/ulab_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ bool ulab_tools_mp_obj_is_scalar(mp_obj_t obj) {
return false;
}
#endif
}
}
2 changes: 1 addition & 1 deletion tests/1d/numpy/universal_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
print(np.log2(2**1))

print(np.log10(10**1))
print(np.exp(1) - np.expm1(1))
print(math.isclose(np.exp(1) - np.expm1(1), 1))

x = np.array([-1, +1, +1, -1])
y = np.array([-1, -1, +1, +1])
Expand Down
2 changes: 1 addition & 1 deletion tests/1d/numpy/universal_functions.py.exp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ True
1.0
1.0
1.0
1.0
True
[True, True, True, True]
[True, True, True, True, True]
[True, True, True, True, True]
Expand Down

0 comments on commit 41fcf1d

Please sign in to comment.