Skip to content

yakut monitor crashes with TypeError when transfers occur with numpy 2.4.1 #123

@Keybinder

Description

@Keybinder

When running the "monitor" command with numpy 2.4.1, the program crashes with error TypeError: only 0-dimensional arrays can be converted to Python scalars upon receiving a transfer of any kind, which occurs instantly for non-anonymous monitoring. This can be narrowed down to yakut/cmd/monitor/_view.py, which converts numpy arrays to scalars in the last three lines of the following:

# TOTAL DATA RATE
        xfer_delta_by_node = xfer_delta.sum(axis=1)
        xfer_rates_by_node = xfer_rates.sum(axis=1)
        byte_rates_by_node = byte_rates.sum(axis=1)
        for ii, node_id in enumerate(online_states):
            x = node_id if node_id is not None else N_NODES
            sty = get_matrix_cell_style(None, None, int(xfer_delta_by_node[x]) > 0)
            tbl[row_total + 1, ii + 1] = render_xfer_rate(float(xfer_rates_by_node[x])), sty
            tbl[row_total + 2, ii + 1] = render_xfer_rate(float(byte_rates_by_node[x])), sty

This is deprecated, with the deprecation "Raise TypeError on attempt to convert array with ndim > 0 to scalar" expiring in numpy 2.4.1.

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