You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears as though the nice_cntr_levels function ultimately returns the number of steps, instead of the step size. Consequently, we get very misleading behavior when we pass the returnLevels argument. For example, if we pass lmin = 0, lmax = 457.8073, and specify a max step size of max_steps=15, we get back 41 levels:
At this point in the code, cints is a list of candidate number of steps, while t is a list of candidate step sizes. Thus, the numpy.where call correctly finds the index we want. However, the return statements use cints, where they should be indexing into the t list, which represents the candidate list of step sizes. Replacing this block with the following gives me the expected behavior:
It appears as though the
nice_cntr_levels
function ultimately returns the number of steps, instead of the step size. Consequently, we get very misleading behavior when we pass thereturnLevels
argument. For example, if we passlmin = 0, lmax = 457.8073
, and specify a max step size ofmax_steps=15
, we get back 41 levels:The reason for this is the following block of code in
nice_cntr_levels
:At this point in the code,
cints
is a list of candidate number of steps, whilet
is a list of candidate step sizes. Thus, thenumpy.where
call correctly finds the index we want. However, thereturn
statements usecints
, where they should be indexing into thet
list, which represents the candidate list of step sizes. Replacing this block with the following gives me the expected behavior:And demonstrating the same example:
The text was updated successfully, but these errors were encountered: