Skip to content

Commit

Permalink
MNT: apply code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed May 8, 2024
1 parent 2e82f75 commit 18a3404
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions numpy/_core/src/multiarray/arraytypes.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ static int
PyArray_Descr *descr = PyArray_DescrFromType(NPY_@TYPE@);
int promotion_state = get_npy_promotion_state();
if (promotion_state == NPY_USE_LEGACY_PROMOTION || (
get_npy_promotion_state() == NPY_USE_WEAK_PROMOTION_AND_WARN
&& !npy_give_promotion_warnings())) {
promotion_state == NPY_USE_WEAK_PROMOTION_AND_WARN
&& !npy_give_promotion_warnings())) {
/*
* This path will be taken both for the "promotion" case such as
* `uint8_arr + 123` as well as the assignment case.
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/multiarray/convert_datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ NPY_NO_EXPORT PyObject *NO_NEP50_WARNING_CTX = NULL;
NPY_NO_EXPORT PyObject *npy_DTypePromotionError = NULL;
NPY_NO_EXPORT PyObject *npy_UFuncNoLoopError = NULL;

NPY_NO_EXPORT NPY_TLS int npy_promotion_state = NPY_USE_LEGACY_PROMOTION;
static NPY_TLS int npy_promotion_state = NPY_USE_LEGACY_PROMOTION;

NPY_NO_EXPORT int
get_npy_promotion_state() {
Expand Down
1 change: 0 additions & 1 deletion numpy/_core/src/multiarray/convert_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ extern NPY_NO_EXPORT npy_intp REQUIRED_STR_LEN[];
#define NPY_USE_WEAK_PROMOTION 1
#define NPY_USE_WEAK_PROMOTION_AND_WARN 2

extern NPY_NO_EXPORT NPY_TLS int npy_promotion_state;
extern NPY_NO_EXPORT PyObject *NO_NEP50_WARNING_CTX;
extern NPY_NO_EXPORT PyObject *npy_DTypePromotionError;
extern NPY_NO_EXPORT PyObject *npy_UFuncNoLoopError;
Expand Down

0 comments on commit 18a3404

Please sign in to comment.