openearth / nefis-python

NEFIS is a library of functions designed for scientific programs. These programs are characterised by their large volume of input and output data. NEFIS is able to store and retrieve large volumes of data on file or in shared memory. To achieve a good performance when storing and retrieving data, the files are self-describing binary direct access files.
GNU Lesser General Public License v3.0
15 stars 10 forks source link

3 of the make test failed - ValueError: Buffer dtype mismatch, expected 'int' but got 'long' #6

Open andiariffin opened 5 years ago

andiariffin commented 5 years ago

Description

I followed your steps to build the library. Upon running the make test command, the last 3 tests were failed. Trying to run nefis dump command also failed.

What I Did

$ make test

        elm_name = 'Elm 3'
        elm_type = 'INTEGER'
        elm_single_byte = 4
        elm_quantity = 'integers'
        elm_unit = '[-]'
        elm_description = 'Just integers'
        elm_count = 2
        #elm_data = np.arange(15).reshape(5,3)
        elm_dimensions = np.arange(elm_count).reshape(elm_count)
        elm_dimensions[0] = 20
        elm_dimensions[1] = 5
>       error = nefis.cnefis.defelm(fp, elm_name, elm_type, elm_single_byte, elm_quantity, elm_unit, elm_description, elm_count, elm_dimensions)

tests/test_putelt_integers.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   def defelm(fd, el_name, el_type, el_single_byte, el_quantity, el_unit, el_desc, el_dim_count, np.ndarray[int, ndim=1, mode="c"] el_dimensions):
E   ValueError: Buffer dtype mismatch, expected 'int' but got 'long'

nefis/cnefis.pyx:161: ValueError
----------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------

Library version: Deltares, NEFIS Version 5.09.00.64142 (Unknown), Jun 13 2019, 21:50:40

------------
put_integers.dat
put_integers.def

c
------------
================================================================================= 3 failed, 39 passed in 0.70 seconds ==================================================================================
make: *** [test] Error 1

$ nefis dump tests/data/trim-f34.def

Traceback (most recent call last):
  File "/home/sysadmin/.local/bin/nefis", line 11, in <module>
    load_entry_point('nefis', 'console_scripts', 'nefis')()
  File "/home/sysadmin/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/sysadmin/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/sysadmin/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/sysadmin/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/sysadmin/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/sysadmin/andi/nefis-python/nefis/cli.py", line 61, in dump
    click.echo(ds.dump_json())
  File "/home/sysadmin/andi/nefis-python/nefis/dataset.py", line 392, in dump_json
    variables = self.variables
  File "/home/sysadmin/andi/nefis-python/nefis/dataset.py", line 174, in variables
    el = elements[name]
KeyError: u'ITDATE'
louisXW commented 4 years ago

Hi andiariffin,

Have you fixed the error?

Best, Xia Wei