diff options
| author | Sebastian Berg <sebastianb@nvidia.com> | 2022-12-02 11:52:40 +0100 |
|---|---|---|
| committer | Sebastian Berg <sebastianb@nvidia.com> | 2022-12-02 11:59:17 +0100 |
| commit | fd30908f5c82447c96190ef74443ebda34fd52db (patch) | |
| tree | a2b945ef6d331a7fe3c1be322c259efd409d969c /numpy/core/src/multiarray | |
| parent | ba9136f601ef3ede98bde4651e9d3ab7e742c3fb (diff) | |
| download | numpy-fd30908f5c82447c96190ef74443ebda34fd52db.tar.gz | |
DOC,TST: address review comments and improve test coverage
Co-authored-by: Marten van Kerkwijk <mhvk@astro.utoronto.ca>
Diffstat (limited to 'numpy/core/src/multiarray')
| -rw-r--r-- | numpy/core/src/multiarray/datetime.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c index 5fda3fddd..cdad2f65d 100644 --- a/numpy/core/src/multiarray/datetime.c +++ b/numpy/core/src/multiarray/datetime.c @@ -1622,13 +1622,15 @@ compute_datetime_metadata_greatest_common_divisor( return 0; -/* - * Note that the following errors do not use "InvalidPromotion", because they - * should promote (two datetimes should have a common datetime), but cannot. - * The promotion is thus valid, but fails. - * This is important, because `arr == arr` for these cannot reasonably return - * all ``False`` values. - */ + /* + * The following errors do not currently use "InvalidPromotion". This + * could be replaced (changing the OverflowError, though) with an explicit + * promotion error. + * This makes sense if we `arr_dt1 == arr_dt2` can reasonably return + * an array of all `False` (i.e. values cannot possible compare equal). + * (`==` relies on this around 2022-12. This reliance could be pushed into + * the `np.equal`/`np.not_equal` ufuncs, but the rule of thumb seems good) + */ incompatible_units: { PyObject *umeta1 = metastr_to_unicode(meta1, 0); if (umeta1 == NULL) { |
