[yt-dev] Sequence of buff_size

Yi-Hao Chen ychen at astro.wisc.edu
Fri Apr 1 08:19:57 PDT 2016


Hi all,

Running this test script
http://paste.yt-project.org/show/6379/
will result in this image
https://slack-files.com/T042F73QM-F0X0YJE3V-4a579d9431

Apparently, the sequence of buff_size is switched so that

set_buff_size((8,4))

gives a 4 by 8 image.

I have traced down the codes and found the following lines are the cause of
the problem.
https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/utilities/lib/pixelization_routines.pyx?at=yt&fileviewer=file-view-default#pixelization_routines.pyx-61

https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/utilities/lib/pixelization_routines.pyx?at=yt&fileviewer=file-view-default#pixelization_routines.pyx-216

If rows=nx and cols=ny, the two functions (pixelize_cartesian and
pixelize_off_axis_cartesian) should take rows first and then cols.

The same API has been around in _MPL.c since 2010 and thus changing it will
be backward incompatible.

However, to be consistent with other parts of the code (e.g. here
<https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/visualization/fixed_resolution.py?at=yt&fileviewer=file-view-default#fixed_resolution.py-374>,
here
<https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/visualization/fixed_resolution.py?at=yt&fileviewer=file-view-default#fixed_resolution.py-249>,
here
<https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/data_objects/data_containers.py?at=yt&fileviewer=file-view-default#data_containers.py-1388>,
and here
<https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/analysis_modules/sunyaev_zeldovich/projection.py?at=yt&fileviewer=file-view-default#projection.py-184>),
in which buff_size = (nx, ny) is assumed and used, I propose to change the
behavior of the above two functions.

What do you think? Anyone has other suggestions?

Thanks!
Yi-Hao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20160401/f9b5d42b/attachment.htm>


More information about the yt-dev mailing list