Skip to content

FixedScaleOffset flattens arrays, breaking further image codecs #852

Description

@raphaeljolivet

I've just noticed that FixedScaleOffset flattens arrays on encoding.

This is not stated in the documentation

This breaks further images encoding in the pipeline.

Minimal test to reproduce:

import numpy as np
from numcodecs import FixedScaleOffset
shape = (8, 4, 5)

x = (200.0 + np.arange(np.prod(shape), dtype=np.float32).reshape(shape) * 0.001)
fso = FixedScaleOffset(offset=200.0, scale=1000.0, dtype="<f4", astype="<u2")

# Expected  (8, 4, 5)
# Actuel (160, )
print(fso.shape)

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