[ase-users] Bug in ASE package

Ask Hjorth Larsen asklarsen at gmail.com
Fri May 15 14:41:34 CEST 2020


Good to know it was solved (replying to list so others will know.  Please
always reply to list).

Am Di., 12. Mai 2020 um 05:07 Uhr schrieb SHIBU MEHER <sm58 at iitbbs.ac.in>:

> Dear Hjorth,
> It was my mistake. I was taking the directions as 3x3 matrix. It should by
> a 3x4 matrix. It is workin fine with 3x4 matrix. I realized just now. Sorry
> for inconvenience.
>
> Sincerely,
> Shibu Meher
>
>
> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&> Sender
> notified by
> Mailtrack
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&> 12/05/20,
> 08:35:44
>
> On Sun, May 10, 2020 at 6:17 PM Ask Hjorth Larsen <asklarsen at gmail.com>
> wrote:
>
>> Dear Shibu,
>>
>> Am Sa., 9. Mai 2020 um 21:55 Uhr schrieb SHIBU MEHER via ase-users <
>> ase-users at listserv.fysik.dtu.dk>:
>>
>>> Hello,
>>> I found a bug in ase.lattice.hexagonal.find_direction.
>>> Using the given code. Following error is occurring.
>>> ValueError: not enough values to unpack (expected 4, got 3)
>>>
>>> To correct replace the for loop with following chunk.
>>> for obj in zip(directions,miller):
>>>             if obj[1] is not None:
>>>                 a = obj[0][0]
>>>                 b = obj[0][1]
>>>                 c = obj[0][2]
>>>                 d = obj[1]
>>>                 if a + b + c != 0:
>>>                     raise ValueError(
>>>                         ("(%d,%d,%d,%d) is not a valid hexagonal Miller
>>> " +
>>>                         "index, as the sum of the first three numbers " +
>>>                         "should be zero.") % (a,b,c,d))
>>>                 x = 4*a + 2*b
>>>                 y = 2*a + 4*b
>>>                 z = 3*d
>>>                 obj[i] = (x,y,z)
>>>
>>> Am I correct? This code now is working fine.
>>>
>>
>> A bit more context would be beneficial here (unless someone else is an
>> expert in this particular function and confirms).
>>
>> Do you have a small standalone example which should work, but fails due
>> to this error, and will work after applying this change?
>>
>> (You're also more than welcome to add that example as a unittest and open
>> a merge request with the fix.)
>>
>> Best regards
>> Ask
>>
>>
>
> ------------------------------
> *Disclaimer: *This email and any files transmitted with it are
> confidential and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in error please
> notify the system manager. This message contains confidential information
> and is intended only for the individual named. If you are not the named
> addressee you should not disseminate, distribute or copy this e-mail.
> Please notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system. If you are not
> the intended recipient you are notified that disclosing, copying,
> distributing or taking any action in reliance on the contents of this
> information is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200515/f68ec6f2/attachment.html>


More information about the ase-users mailing list