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

Test failure in test_bufr_read, too many values to unpack #25

Open
gerritholl opened this issue Feb 20, 2019 · 1 comment
Open

Test failure in test_bufr_read, too many values to unpack #25

gerritholl opened this issue Feb 20, 2019 · 1 comment

Comments

@gerritholl
Copy link
Member

When I run the unit test (after first making a workaround of #24),

Test reading data and data quality on Metop-A MHS BUFR file ... ERROR

======================================================================
ERROR: Test reading data and data quality on Metop-A MHS BUFR file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/gholl/checkouts/trollbufr/test/test.py", line 47, in test_bufr_read
    for k, m, (v, q) in report.next_data():
ValueError: too many values to unpack (expected 3)
-------------------- >> begin captured logging << --------------------
trollbufr: INFO: FILE /home/gholl/checkouts/trollbufr/test/metop_mhs.bufr
trollbufr: DEBUG: SEARCH AHL : 0 - 41 b'BUFR' : 1 matches > b'IEMX01 EUMP 150722'
trollbufr: DEBUG: LOADED 48598 B, 41 - 48639
trollbufr: INFO: SECT 0..5 DECODE
trollbufr: DEBUG: SECT_0         offs:8 len:8 = {'size': 48598, 'edition': 4}
trollbufr: DEBUG: SECT_1         offs:30 len:22 = {'master': 0, 'center': 254, 'subcenter': 0, 'update': 0, 'sect2': False, 'cat': 3, 'cat_int': 255, 'cat_loc': 11, 'mver': 13, 'lver': 0, 'datetime': datetime.datetime(2012, 5, 15, 7, 21)}
trollbufr: WARNING: not all arguments converted during string formatting
trollbufr: INFO: Table loaded: '/home/gholl/checkouts/trollbufr/test/bufrtables/B0000000000000013000.TXT'
trollbufr: WARNING: not all arguments converted during string formatting
trollbufr: INFO: Table loaded: '/home/gholl/checkouts/trollbufr/test/bufrtables/D0000000000000013000.TXT'
trollbufr: WARNING: 'utf-8' codec can't decode byte 0xc9 in position 6906: invalid continuation byte
trollbufr: DEBUG: SECT_3         offs:39 len:9 = {'subsets': 1800, 'obs': True, 'comp': True, 'descr': [310010]}
trollbufr: DEBUG: SECT_4         offs:48594 len:48555 = {'data_start': 43, 'data_end': 48594}
trollbufr: DEBUG: SECT_5         offs:48598 len:4 = {}
trollbufr: INFO: BUFR START
trollbufr: INFO: SUBSET #0
trollbufr: DEBUG: SUBSET START

skipping 500k lines...

trollbufr: DEBUG: EVAL-RV 033032: typ:4 width:24 ref:0 scal:0+0 val:(0)->(0)
trollbufr: DEBUG: OP 201132
trollbufr: DEBUG: OP 202129
trollbufr: DEBUG: OCTETS 012063:     w+a:12+4 fw:_ qual:0 bc:0  #45441
trollbufr: DEBUG: CSET  subnum (1799, 1800)  loc_width 16  min_val 16207  cwidth 14  cval 9251  rval 25458
trollbufr: DEBUG: EVAL-RV 012063: typ:2 width:16 ref:0 scal:1+1 val:(25458)->(254.58)
trollbufr: DEBUG: OP 202000
trollbufr: DEBUG: OP 201000
trollbufr: DEBUG: POP *3 3..3 (SEQ END)
trollbufr: DEBUG: POP *3 3..3 (RPL END)
trollbufr: DEBUG: POP *1 1..1 (SEQ END)
trollbufr: DEBUG: SUBSET END (48598B 48593/6)
trollbufr: INFO: BUFR END
trollbufr: INFO: BUFR START
trollbufr: INFO: SUBSET #0
trollbufr: DEBUG: SUBSET START
trollbufr: DEBUG: PUSH start -> *1 0..1
trollbufr: DEBUG: POP *1 0..1 (SUB)
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 19.922s

FAILED (errors=1)

This is on trollbufr 0.10.2. For the rest, my installed versions are:

INSTALLED VERSIONS
------------------
commit: None
python: 3.7.2 (default, Dec 29 2018, 06:19:36)
[GCC 7.3.0]
python-bits: 64
OS: Linux
OS-release: 4.12.14-lp150.12.45-default
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.utf8
LOCALE: en_GB.UTF-8
libhdf5: None
libnetcdf: None

xarray: 0.11.3
pandas: 0.24.1
numpy: 1.15.4
scipy: 1.2.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
cyordereddict: None
dask: 1.1.1
distributed: 1.25.3
matplotlib: 3.0.2
cartopy: None
seaborn: None
setuptools: 40.8.0
pip: 19.0.2
conda: None
pytest: None
IPython: 7.3.0
sphinx: 1.8.4

I've also tried it with Python 2.7, to check that it's not a Python2 vs Python3 issue.

@gerritholl
Copy link
Member Author

Regardless of the unit test failure, looking at the unit test, it looks like lines 57-64 are never reached:

trollbufr/test/test.py

Lines 47 to 64 in 96ee814

for k, m, (v, q) in report.next_data():
i += 1
if i >= 4:
# after first 3 descriptor/data sets just count
continue
if i <= 3:
# type-marker for first 3 descriptor is not None
self.assertIsNotNone(m)
continue
# assert descriptor, data value, quality
self.assertIsNone(m)
self.assertEqual(k, 8070)
self.assertEqual(v, 3)
self.assertIsNone(q)
# look-up and assert name and unit
kn, ku = bufr.get_tables().lookup_elem(k)
self.assertEqual(kn.strip(), "TOVS/ATOVS PRODUCT QUALIFIER")
self.assertEqual(ku.strip(), "CODE TABLE 8070")

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