[yt-users] HDF5 TypeError when writing LightRay

Joseph Tomlinson jmtomlinson95 at gmail.com
Mon Apr 24 13:59:53 PDT 2017


Nathan,

To just generate the error run http://paste.yt-project.org/show/7130/ after
downloading the hdf5 file I uploaded.
The generation of the hdf5 file requires the actual dataset I'm working
with, but it is generated with http://paste.yt-project.org/show/7131/.

Thanks,
Joe Tomlinson
Senior Undergraduate
Department of Physics, Drexel University




On Mon, Apr 24, 2017 at 4:51 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> Hi Joseph,
>
> I'm unfamiliar with the LightRay interface - can you make a short sample
> script that triggers the issue you're seeing? I want to make sure we're on
> the same page.
>
> -Nathan
>
> On Mon, Apr 24, 2017 at 3:49 PM, Joseph Tomlinson <jmtomlinson95 at gmail.com
> > wrote:
>
>> Nathan,
>>
>> I apologize if I was unclear. I am still having an issue even on the
>> latest dev version. I was having a separate issue on the stable branch that
>> I believe was the issue you linked me previously.
>> The issue I am currently having is that whenever yt tries to load a
>> LightRay from my dataset it throws the error
>>
>> AttributeError: 'str' object has no attribute 'astype'
>>
>> This occurs from simply loading the hdf5 file generated from a call to
>> make_light_ray. It should be easily reproducible by attempting to load the
>> file I uploaded at use.yt/upload/9fe32716.
>>
>> Thanks,
>> Joe Tomlinson
>> Senior Undergraduate
>> Department of Physics, Drexel University
>>
>>
>> On Mon, Apr 24, 2017 at 4:40 PM, Nathan Goldbaum <nathan12343 at gmail.com>
>> wrote:
>>
>>> You can use the yt curldrop to share the dataset:
>>>
>>> https://docs.hub.yt/services.html#curldrop
>>>
>>> But if it's as you said and the issue is fixed already (e.g. you do not
>>> have any issues when you build yt from latest version on the "yt" branch in
>>> the mercurial repository) then there's no need to go further, since the
>>> issue is fixed already. We will hopefully be able to do a yt 3.4 release
>>> soon after moving development to github, so that will get this fix out
>>> there in a more easily shareable fashion.
>>>
>>> -Nathan
>>>
>>> On Mon, Apr 24, 2017 at 3:34 PM, Joseph Tomlinson <
>>> jmtomlinson95 at gmail.com> wrote:
>>>
>>>> Nathan,
>>>>
>>>> That issue is very likely the problem that I was having with the stable
>>>> version.
>>>>
>>>> I tried to recreate the issue I am having with the dev version but the
>>>> issue does not occur for any of the public enzo datasets.
>>>>
>>>> The error occurs after the ray data has been saved and it reloads it .
>>>> The saved file is able to be read in h5py and seems correct.
>>>> A few layers down the error occurs in _parse_parameter_file() and I
>>>> think this may be the difference between the data I was given and the
>>>> public sets.
>>>> I can't really see the difference between the two myself. I've uploaded
>>>> the file here http://paste.yt-project.org/show/7129/ if it becomes
>>>> relevant.
>>>>
>>>> The script to generate the error is extremely basic, I didn't upload it
>>>> because its just two lines, making the LightRay then calling make_light_ray.
>>>> The error should be reproducible by simply trying to load the resultant
>>>> hdf5 file, is there somewhere you would prefer me to upload it? It's not
>>>> too large, less than 1MB.
>>>> Is there anything else I could provide to help diagnose the issue?
>>>>
>>>> Thanks,
>>>> Joe Tomlinson
>>>> Senior Undergraduate
>>>> Department of Physics, Drexel University
>>>>
>>>> On Mon, Apr 24, 2017 at 2:09 PM, Nathan Goldbaum <nathan12343 at gmail.com
>>>> > wrote:
>>>>
>>>>> Hi Joseph,
>>>>>
>>>>> I believe you're hitting this issue:
>>>>>
>>>>> https://bitbucket.org/yt_analysis/yt/issues/1330
>>>>>
>>>>> Which was fixed here:
>>>>>
>>>>> https://bitbucket.org/yt_analysis/yt/pull-requests/2541
>>>>>
>>>>> We haven't had a stable release since that was fixed. If you're
>>>>> running yt from a stable release, can you try installing the development
>>>>> version from source? If you're using conda you can also use the nightly
>>>>> binary builds:
>>>>>
>>>>> http://yt-project.org/docs/dev/installing.html#nightly-conda-builds
>>>>>
>>>>> If you are running a recent development version then Britton's fix
>>>>> might need to be eloborated upon. If so, can you create a self-contained,
>>>>> runnable example script that triggers the issue you're seeing (preferably
>>>>> making use of one of the public datasets on yt-project.org/data)?
>>>>>
>>>>> Best,
>>>>>
>>>>> Nathan Goldbaum
>>>>>
>>>>> On Mon, Apr 24, 2017 at 1:04 PM, Joseph Tomlinson <
>>>>> jmtomlinson95 at gmail.com> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I am trying to use the single dataset LightRay module but I am
>>>>>> running into an issue.
>>>>>> Whenever I use the data_filename parameter, which I believe is
>>>>>> necessary for use with AbsorptionSpectrum, I receive the following error.
>>>>>>
>>>>>> TypeError: Object dtype dtype('O') has no native HDF5 equivalent
>>>>>>
>>>>>> This error does not occur when I run the cookbook example so I am a
>>>>>> bit lost as to what to do.
>>>>>> I am running the latest stable version on anaconda and have tried
>>>>>> both h5py 2.7 and 2.6.
>>>>>> The simulation is a cosmological Enzo simulation.
>>>>>>
>>>>>> I have also tried using the nightly dev build which changes the error
>>>>>> from being on write to being on load with the following error.
>>>>>>
>>>>>> AttributeError: 'str' object has no attribute 'astype'
>>>>>> from line 326 in _restore_light_ray_solution
>>>>>> self.parameters[ksp3] = self.parameters[ksp3].astype(str)
>>>>>>
>>>>>> When using python 2.7 the error is the same but with 'unicode'
>>>>>> instead of 'str'.
>>>>>>
>>>>>> Any help would be greatly appreciated.
>>>>>>
>>>>>> Thanks,
>>>>>> Joe Tomlinson
>>>>>> Senior Undergraduate
>>>>>> Department of Physics, Drexel University
>>>>>>
>>>>>> _______________________________________________
>>>>>> yt-users mailing list
>>>>>> yt-users at lists.spacepope.org
>>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> yt-users mailing list
>>>>> yt-users at lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170424/562e9f2e/attachment-0001.htm>


More information about the yt-users mailing list