Skip to content

AttributeError: module 'numpy' has no attribute 'astype' in ems2png #27

@erpri

Description

@erpri

Hi there.

Just found a small bug in ems2png tool. It fails generating png files with AttributeError: module 'numpy' has no attribute 'astype' when processing VTR files.

Location:
Line 85 in src/ems2png/main.py.

Current (broken) code:

img_data = np.astype(np.sqrt(data_interp.T - min_val) * vmul, np.uint16)

Fix, that worked for me (Python 3.10, NumPy 1.26.4, Ubuntu 22.04):

img_data = np.array(np.sqrt(data_interp.T - min_val) * vmul, dtype=np.uint16)

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