[ase-users] tuple in atoms.center ?
Matt Addicoat
madd.cluster at gmail.com
Sun May 4 20:34:22 CEST 2014
Ah, that's what I'd missed! I'd never thought of passing axes sequentially.
And yes, I'd never tried out a 1-D periodic system, which would fail my
little hack. Thanks for clearing that up for me.
Warm Regards,
Matt
On 2/05/2014 10:42 pm, Peterson, Andrew wrote:
> 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
> <mailto: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
> <mailto: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/20140504/bb7d908e/attachment.html>
More information about the ase-users
mailing list