Skip to content

numpy RuntimeWarning with v(int8) #13

@michaeljpeters

Description

@michaeljpeters

I'm running into this numpy RuntimeWarning when creating a v(int8) after upgrading numpy to 2.2.4. I think this could be caused by an overflow during negate since the INTS_ is an array of int64.

numpy==2.2.4
frame-fixtures==1.1.0
static-frame==2.18.1

Example:

>>> import frame_fixtures as ff
>>> 
>>> ff.parse(f"s(10,25)|v(int8)|i((IY,ID),(dtY,dtD))|c(IH,(str,int,float))")
/home/peters/.env311/lib/python3.11/site-packages/frame_fixtures/core.py:301: RuntimeWarning: overflow encountered in scalar multiply
  yield v.astype(dtype) * (-1 if v % 3 == 0 else 1)
<Frame>
<IndexHierarchy>                 zZbu    zZbu    zZbu    zZbu   ztsv   ... z2Oo   z2Oo   z2Oo    z2Oo   z5l6    <<U4>
                                 105269  105269  119909  119909 194224 ... 58768  58768  146284  146284 170440  <int64>
                                 3511.58 1175.36 2925.68 3408.8 647.9  ... 3917.0 121.12 2215.96 782.84 3772.28 <float64>
<IndexHierarchy>                                                       ...
36685            2258-03-21      47      -107    -64     -7     -112   ... -92    8      -88     99     -85
36685            2298-04-20      -61     59      -91     -51    108    ... 123    60     -50     37     34
5618             2501-10-08      -25     97      -3      12     -56    ... 33     81     -26     12     -17
5618             2441-04-14      -120    61      4       -122   -117   ... 97     -46    -58     79     25
93271            2234-04-07      -37     83      -7      108    31     ... -14    -113   56      -90    -28
93271            2210-12-26      -112    -35     -51     53     12     ... -38    -116   66      91     -96
32175            2224-04-06      108     33      12      101    110    ... -49    -29    65      94     -124
32175            2202-08-20      -56     -85     -122    -80    -62    ... -128   -92    40      74     -48
55990            2006-10-27      -117    34      108     101    73     ... 19     127    -32     -55    -97
55990            2450-09-20      31      -17     53      8      80     ... -95    19     -56     -87    -92
<datetime64[Y]>  <datetime64[D]> <int8>  <int8>  <int8>  <int8> <int8> ... <int8> <int8> <int8>  <int8> <int8>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions