Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during generation of fixture data #138

Closed
alimanfoo opened this issue Nov 29, 2018 · 1 comment
Closed

Error during generation of fixture data #138

alimanfoo opened this issue Nov 29, 2018 · 1 comment
Milestone

Comments

@alimanfoo
Copy link
Member

Builds of the numcodecs-feedstock on conda-forge are currently failing for version 0.6.0 (conda-forge/numcodecs-feedstock#28). The problem is within the following test functions:

tests/test_astype.py::test_backwards_compatibility FAILED
tests/test_quantize.py::test_backwards_compatibility FAILED

The error message is:

                # one time encode and save array
                if not os.path.exists(enc_fn):  # pragma: no cover
                    enc = codec.encode(arr)
                    with open(enc_fn, mode='wb') as ef:
>                       ef.write(enc)
E                       ValueError: ndarray is not C-contiguous

I think what has happened here is that the fixture data are not being picked up during the conda-forge builds, and so they are being regenerated during the test run. Something has changed since the fixture data was originally generated, and so regeneration of fixture data for the astype and quantize codecs is failing, it looks like on cases where the encoded data returned by the codec is not C-contiguous. Needs a little investigation to determine appropriate fix.

@alimanfoo
Copy link
Member Author

I think what's happened here is that the input normalisation in the astype and quantize codecs has been relaxed slightly, during the work in #128. Previously in encode() inputs were flattened, but this wasn't strictly necessary, and so now inputs are just coerced to numpy arrays but not flattened. This means that return values from encode() may now also not be flattened, and so could possibly be in fortran order.

Should be possible to fix by modifying the check_backwards_compatibility() function to flatten before attempting to write to file. Should also be possible to verify this does not change the encoded data.

This was referenced Nov 29, 2018
@alimanfoo alimanfoo added this to the 0.6.1 milestone Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant