Skip to content

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

@andiariffin

Description

@andiariffin
  • Nefis version: 0.4.0
  • Python version: 2.7.5
  • Operating System: CentOS 7.6.1810

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions