[Nexus-developers] bug (?) in nexus-4.2.1

Ray Osborn ROsborn at anl.gov
Mon Jan 23 14:31:39 GMT 2012


The problem can be fixed by changing the attribute call to 

>>> nf.putattr("signal",1, dtype='int32')

i.e, by casting the integer attribute as 32-bit. You are using a 64-bit version of python, but a 32-bit version of the API. 

There is a 64-bit version of the Python NeXus API that I think will be included in the next release, although I can't say for sure if this bug will be fixed by it. I am still using the older version with 64-bit Python, but the problem only seems to affect XML output.

Ray

On Jan 21, 2012, at 4:04 PM, Vadim Dyadkin wrote:

> Dear developers
> 
> Since the registration is closed, I write this letter.
> 
> I have started to sort out the nexus format and I have got a strange behavior 
> of this python example: 
> http://download.nexusformat.org/doc/html/Examples.html#Examples.NAPI
> It produces this xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
>  <NXroot NeXus_version="4.2.1" XML_version="mxml"
> file_name="next.nxs.xml"
> xmlns="http://definition.nexusformat.org/schema/3.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://definition.nexusformat.org/schema/3.1
> http://definition.nexusformat.org/schema/3.1/BASE.xsd"
> file_time="2012-01-21T01:37:29+04:00">
>    <NXentry name="entry">
>      <NXdata name="data">
>        <test NAPItype="NX_INT64[2,3,4]"
> signal="-99999999999999997748809823456034029568.000000">
>                                 0                        1 
>                                 2                        3 
>                                 4                        5 
>                                 6                        7 
>                                 8                        9 
>                                10                       11 
>                                12                       13 
>                                14                       15 
>                                16                       17 
>                                18                       19 
>                                20                       21 
>                                22                       23 
>        </test>
>      </NXdata>
>    </NXentry>
>  </NXroot>
> 
> Look at the signal attribute of the test field, it is a pure overflow. I am 
> not sure whether this is an error or I have done something wrong. I could not 
> test your trunk since the svn is only for the registered users. I use x86-64 
> linux-3.2.1, python-2.7.2, numpy-1.6.1, mini-xml-2.6, gcc-4.5.3
> 
> Best regards,
> Vadim
> _______________________________________________
> NeXus-developers mailing list
> NeXus-developers at nexusformat.org
> http://lists.nexusformat.org/mailman/listinfo/nexus-developers

-- 
Ray Osborn
Materials Science Division
Argonne National Laboratory
Argonne, IL 60439, USA
Phone: +1 (630) 252-9011
Email: ROsborn at anl.gov






More information about the NeXus-developers mailing list