[yt-users] int/long error

Matthew Turk matthewturk at gmail.com
Mon Mar 19 10:52:15 PDT 2012


Hi Kaitlin,

Looking over the docs, yes -- that example is incorrect and I have
just updated it (
https://bitbucket.org/yt_analysis/cookbook/changeset/ec107f1da0b0 ).
The covering grid is based on integer indices, and you specify the
(relative-to-level) integer starting index and the extent in indices
in that level.  Thanks for pointing that out ...

-Matt

On Mon, Mar 19, 2012 at 1:47 PM, Kaitlin Kratter
<kaitlin.kratter at gmail.com> wrote:
> Hi Matt,
>
> Just to be clear, the left_edge arguments need to be int32s? I'm confused because the example had floats for the left and right edge values...
>
> By the way, the undergrad just left so it will take a little time to verify in any case.
>
> Best,
> Kaitlin
>
>
>
> On Mar 19, 2012, at 1:41 PM, Matthew Turk wrote:
>
>> Hi Stella,
>>
>> Thanks for the bug report -- in looking over the arguments to
>> covering_grid, the only one that is not manually cast (already) is
>> left_edge, which is the second argument (i.e., level, left_edge, dims,
>> ...).  Can you tell me if just casting *that* one to int32 fixes it?
>> If so, I'll commit/push that change.
>>
>> Best,
>>
>> Matt
>>
>> On Mon, Mar 19, 2012 at 12:02 PM, Stella Offner <soffner at cfa.harvard.edu> wrote:
>>> Hi,
>>>
>>> I'm encountering an int/long error in a new installation of yt, python,
>>> computer cluster etc:
>>>
>>> (yt-x86_64)[pjumper at hpcmanage ~]$ python covering_grid_test.py
>>> yt : [WARNING  ] 2012-03-19 18:42:59,135 Setting 1.0 in code units to be 1.0
>>> cm
>>> yt : [WARNING  ] 2012-03-19 18:42:59,135 No time units.  Setting 1.0 = 1
>>> second.
>>> yt : [INFO     ] 2012-03-19 18:42:59,136 Parameters:
>>> current_time              = 2.26390632737e+14
>>> yt : [INFO     ] 2012-03-19 18:42:59,136 Parameters:
>>> domain_dimensions         = [256, 256, 256]
>>> yt : [INFO     ] 2012-03-19 18:42:59,136 Parameters:
>>> domain_left_edge          = [ -3.09000000e+18  -3.09000000e+18
>>> -3.09000000e+18]
>>> yt : [INFO     ] 2012-03-19 18:42:59,136 Parameters:
>>> domain_right_edge         = [  3.09000000e+18   3.09000000e+18
>>> 3.09000000e+18]
>>> yt : [INFO     ] 2012-03-19 18:42:59,228 Adding unknown field density to
>>> list of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,228 Adding unknown field xmom to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,228 Adding unknown field ymom to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,228 Adding unknown field zmom to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,229 Adding unknown field eden to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,229 Adding unknown field frac1 to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,229 Adding unknown field rhof1 to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,229 Adding unknown field rhofe1 to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,229 Adding unknown field phi to list of
>>> fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,229 Adding unknown field phicorr to
>>> list of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,230 Adding unknown field test0 to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,230 Adding unknown field test1 to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,230 Adding unknown field test2 to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,230 Adding unknown field log_den to
>>> list of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,230 Adding unknown field pressure to
>>> list of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,230 Adding unknown field xvel to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,231 Adding unknown field yvel to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,231 Adding unknown field zvel to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,231 Adding unknown field ieng to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,231 Adding unknown field keng to list
>>> of fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,231 Adding unknown field cvt to list of
>>> fields
>>> yt : [INFO     ] 2012-03-19 18:42:59,296 Setting right_edge to [1.0, 1.0,
>>> 1.0]
>>> Traceback (most recent call last):
>>>   File "covering_grid_test.py", line 20, in <module>
>>>     dims=[128,128,128],
>>>   File
>>> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line
>>> 3331, in __init__
>>>     self._refresh_data()
>>>   File
>>> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line
>>> 3348, in _refresh_data
>>>     AMR3DData._refresh_data(self)
>>>   File
>>> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line
>>> 307, in _refresh_data
>>>     self.get_data()
>>>   File
>>> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line
>>> 3355, in get_data
>>>     self._get_list_of_grids()
>>>   File
>>> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line
>>> 3343, in _get_list_of_grids
>>>     self.right_edge + buffer, self.level)
>>>   File
>>> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/object_finding_mixin.py",
>>> line 214, in get_box_grids_below_level
>>>     self.grid_levels, mask)
>>>   File "misc_utilities.pyx", line 91, in
>>> yt.utilities.amr_utils.get_box_grids_below_level
>>> (yt/utilities/amr_utils.c:58776)
>>> ValueError: Buffer dtype mismatch, expected 'int32_t' but got 'long'
>>>
>>> It is possible to partially get around this by declaring all the input ints
>>> (e.g. dims=[128, 128, 128]) to covering_grid as type int32. However, doing
>>> this for all yt calls seems tedious. Is there an easier way of dealing with
>>> this issue?
>>>
>>> Thanks!
>>> Stella
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>



More information about the yt-users mailing list