Skip to content

is_unknown_time for numpy arrays #814

@hyanwong

Description

@hyanwong

The current is_unknown_time() function only works one number at a time. It would be nice to be able to do

def is_unknown_time_array(a):
    np_unknown_time = np.float64(tskit.UNKNOWN_TIME)
    return a.view(np.uint64) == np_unknown_time.view(np.uint64)

e.g.

>>> a = np.full(10, tskit.UNKNOWN_TIME)
>>> np.all(is_unknown_time_array(a))
True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions