Results 560 comments of Kai Mühlbauer

@aladinor Would you mind having a look here? If these changes help resolve #292, I'll add tests an finish up the PR.

Thanks @aladinor! I'll finish this the next days.

Thanks @ghiggi, I'll work with your small example for now. Let's see, if I can come up with something useful. But I have similar time constraints.

@keewis Yes, I'll have a closer look tomorrow.

Adding error log for verbosity: ```python FAILED xarray/tests/test_conventions.py::TestCFEncodedDataStore::test_roundtrip_mask_and_scale[dtype0-create_unsigned_masked_scaled_data-create_encoded_unsigned_masked_scaled_data] - OverflowError: Failed to decode variable 'x': Python integer -1 out of bounds for uint8 FAILED xarray/tests/test_conventions.py::TestCFEncodedDataStore::test_roundtrip_mask_and_scale[dtype1-create_unsigned_masked_scaled_data-create_encoded_unsigned_masked_scaled_data] - OverflowError: Failed to decode...

OK, that looks like some error using a combination of packed data and `_Unsigned`-attribute. I'm currently lacking a upstream-dev environment on my laptop and WiFi is bad while traveling. Xref:...

@keewis I have a local reproducer now, looking into this later today.

Citing from above link: _NetCDF-3 does not have unsigned integer primitive types._ The `_Unsigned` attribute was introduced, to notify any reading application, that the signed data on disk should be...

Now that you ask that, I'm a bit unsure. `_FillValue` is an attribute here, a scalar, so no arrays involved. To transform from uint to int, I've wrapped it into...

@keewis I'm not sure, if my fix is the ultimate solution. I'm on it with a better fitting solution today.