asdf icon indicating copy to clipboard operation
asdf copied to clipboard

pytest plugin failed to catch a round-trip bug

Open eslavich opened this issue 5 years ago • 0 comments

The ndarray-1.0.0 schema includes the following example:

    - An inline structured array, where the types of each column are
      automatically detected
    - |
        !core/ndarray-1.0.0
          [[M110, 110, 205, And],
           [ M31,  31, 224, And],
           [ M32,  32, 221, And],
           [M103, 103, 581, Cas]]

This example doesn't actually round-trip correctly; when the array is written back out, the integers are all converted to string:

array: !core/ndarray-1.0.0
  data:
  - [M110, '110', '205', And]
  - [M31, '31', '224', And]
  - [M32, '32', '221', And]
  - [M103, '103', '581', Cas]
  datatype: [ucs4, 4]
  shape: [4, 4]

but the pytest plugin that tests the example doesn't complain. Perhaps there is something we can do to make it more strict?

eslavich avatar Feb 03 '21 02:02 eslavich