[ase-users] tuple in atoms.center ?
Peterson, Andrew
andrew_peterson at brown.edu
Fri May 2 22:42:25 CEST 2014
I just checked in a version that allows you to pass in a list/tuple. I
think the old version's intention was that you'd call center sequentially
if you wanted it on two axes, but this is a little clearer for the user now.
Note we couldn't change that line to "tuple(axis)" as it would crash if
axis is not iterable; e.g., if axis=0 is passed. Thus, the new version
checks if it is iterable then converts to a tuple if not.
Andy
On Thu, May 1, 2014 at 10:44 AM, Matt Addicoat <madd.cluster at gmail.com>wrote:
> Hi,
>
> In the center function, if no axis is passed, a tuple, (0,1,2) is
> created. If you do pass as axis, the else block is clearly meaning to
> also create a tuple from whatever is passed as the axes parameter.
>
> However when I pass a list; [0, 1], it actually creates a tuple of one
> element; ([0, 1],) and the subsequent np.dot fails.
>
> Changing the line:
>
> axes = (axis,)
>
> to
> axes = tuple(axis)
>
> creates the expected tuple; (0,1) and everything else appears to work fine.
>
> Is this a minor bug? If not, how should one pass the axes to this function?
>
> Warm Regards,
> Matt
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
--
Andrew Peterson
Assistant Professor
Brown University School of Engineering
Barus & Holley 247
184 Hope Street
Providence, RI 02912
(401) 863-2153
http://brown.edu/go/catalyst
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20140502/bdc8dd5a/attachment.html>
More information about the ase-users
mailing list