Skip to content

Setting Quantity item inconsistent #2959

@wkerzendorf

Description

@wkerzendorf

As expected

In [42]: test = np.arange(1000) * u.km

In [43]: test[300] = 1000
ERROR: UnitsError: '' (dimensionless) and 'km' (length) are not convertible [astropy.units.quantity]

UnitsError: '' (dimensionless) and 'km' (length) are not convertible

but

In [44]: test[300] = 0.0

In [45]: test[300]
Out[45]: <Quantity 0.0 km>

@mhvk any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions