Skip to content

properties.basic.GettableProperty.equal fail on numpy arrays on modern numpy #294

@redhog

Description

@redhog

Comparing elements of numpy arrays of different sizes have long given deprecation warnings, and in modern numpy it fails with an exception. To handle this case, change https://github.com/seequent/properties/blob/dev/properties/basic.py#L264 to:

def equal(self, value_a, value_b):
    try:
        equal = value_a == value_b
    except:
        return False
    if hasattr(equal, '__iter__'):
        return all(equal)
    return equal

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