ecmwf / pdbufr

High-level BUFR interface for ecCodes
Apache License 2.0
23 stars 8 forks source link

columns argument does not accept single values #26

Closed iainrussell closed 3 years ago

iainrussell commented 3 years ago

A filter expression such as this:

res = pdbufr.read_bufr(f,
    columns=('airTemperature'),
    filters={'heightOfSensorAboveLocalGroundOrDeckOfMarinePlatform': [2.0]},
    )

does not work because columns is interpreted as a single string rather than a tuple, and then pdbufr internally tries to turn it into a list, which in fact just creates ['a', 'i', 'r', 'T', 'e', 'm', 'p', 'e', 'r', 'a', 't', 'u', 'r', 'e'] rather than ['airTemperature'].

The current workaround is to ensure a proper tuple is passed, e.g. columns=('airTemperature',)

iainrussell commented 3 years ago

See #25