[yt-svn] [yt_analysis/yt] Fix StreamHandler refine_by to support arrays (issue #385)

astrofrog issues-reply at bitbucket.org
Wed May 30 04:42:50 PDT 2012


--- you can reply above this line ---

New issue 385: Fix StreamHandler refine_by to support arrays
https://bitbucket.org/yt_analysis/yt/issue/385/fix-streamhandler-refine_by-to-support

astrofrog:

I am using the StreamHandler to specify a custom AMR grid to be visualized in yt, and I am setting the refine_by ratio with e.g.:

    
{{{
handler.refine_by = 2
}}}

Ideally, I would like this value to be a function of the level, e.g.

{{{
handler.refine_by = np.array([4,2,2,4])
}}}

for a 5-level AMR grid.

Looking at the yt code, it seems that some places allow for refine_by to
be an array, e.g. lines 370-373 in grid_patch.py:

{{{
try:
    rf = self.pf.refine_by[child.Level-1]
except TypeError:
    rf = self.pf.refine_by
}}}

but if I try and specify an array, I hit an error on line 133 of hiearchy.py:

{{{
if self.pf.refine_by != 2 and hasattr(self, 'proj') and \
}}}

which assumes refine_by is a scalar value. If I fix this (by only
testing if refine_by is a scalar), I run into an issue at

{{{
self.dds = self.Parent.dds / self.pf.refine_by
}}}

which also seems to assume that refine_by should be a scalar. Would it be possible to fix this so that refine_by can be set to an array?


Responsible: MatthewTurk
--

This is an issue notification from bitbucket.org. You are receiving
this either because you are the owner of the issue, or you are
following the issue.



More information about the yt-svn mailing list