rockdoc / cdlparser

A python module for parsing files encoded in netCDF's common data form language (CDL)
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

Incorrect handling of fill values for record variables #18

Closed rockdoc closed 11 years ago

rockdoc commented 11 years ago

In the case of record variables which contain fill values (using '_' in the data block), an error is thrown if the specification of the data for the unlimited dimension appears after the record variable in the data block. If the unlimited dimension data precedes the record variable in the data block then all is well.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cdlparser.py", line 177, in parse_file
    return self.parse_text(data, ncfile=ncfile)
  File "cdlparser.py", line 204, in parse_text
    self.parser.parse(input=cdltext, lexer=self.lexer)
  File "/Users/phil/lib/python/ply/yacc.py", line 265, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "/Users/phil/lib/python/ply/yacc.py", line 971, in parseopt_notrack
    p.callable(pslice)
  File "cdlparser.py", line 639, in p_datadecl
    self.write_var_data(var, arr)
  File "cdlparser.py", line 812, in write_var_data
    raise CDLContentError(errmsg)
cdlparser.CDLContentError: Error attempting to write data array for variable tas
Exception details are as follows:
could not convert string to float: _