Closed ikowalec closed 1 year ago
OK - does that introduce a minimum dependence from us on the ASE version number? This is something we need to consider anyway at some point for the calculator, I guess...
From: Igor Kowalec @.> Sent: 09 August 2023 13:52 To: logsdail/carmm @.> Cc: Andrew Logsdail @.>; Review requested @.> Subject: Re: [logsdail/carmm] Assertion for surface-adsorbate distance in bond_length_scan (PR #122)
External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu ddolenni.
@ikowalec commented on this pull request.
In carmm/build/neb/bond_length_scan.pyhttps://github.com/logsdail/carmm/pull/122#discussion_r1288435817:
@@ -81,12 +86,12 @@ def take_second(n):
for i in range(1, n_steps+1):
# operate on a deepcopy for intended functionality
Yes, in previous versions atoms.copy() was providing a shallow copy and now it is a completely new instance, so using copy library can be avoided
— Reply to this email directly, view it on GitHubhttps://github.com/logsdail/carmm/pull/122#discussion_r1288435817, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMK4MYKIXEENPWLMXRFRPLXUOB2BANCNFSM6AAAAAA3JYVWPQ. You are receiving this because your review was requested.Message ID: @.***>
OK - does that introduce a minimum dependence from us on the ASE version number? This is something we need to consider anyway at some point for the calculator, I guess... ____ From: Igor Kowalec @.> Sent: 09 August 2023 13:52 To: logsdail/carmm @.> Cc: Andrew Logsdail @.>; Review requested @.> Subject: Re: [logsdail/carmm] Assertion for surface-adsorbate distance in bond_length_scan (PR #122) External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu ddolenni. @ikowalec commented on this pull request. ____ In carmm/build/neb/bond_length_scan.py<#122 (comment)>: @@ -81,12 +86,12 @@ def take_second(n): for i in range(1, n_steps+1): # operate on a deepcopy for intended functionality - atoms = copy.deepcopy(atoms) + atoms = atoms.copy() Yes, in previous versions atoms.copy() was providing a shallow copy and now it is a completely new instance, so using copy library can be avoided — Reply to this email directly, view it on GitHub<#122 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMK4MYKIXEENPWLMXRFRPLXUOB2BANCNFSM6AAAAAA3JYVWPQ. You are receiving this because your review was requested.Message ID: @.***>
Re: codebase, the deepcopy
can copy the calculator, but it is generally frowned upon as per: https://gitlab.com/gpatom/ase-gpatom/-/issues/8 For copying Atoms
objects we should be using the dedicated Atoms.copy()
function. It drops the calculator altogether, so a new one might have to be generated if required.
OK, thanks for clarifying. I think historically .copy() returned a pointer not a new object, hence this legacy exists in our code!
From: Igor Kowalec @.> Sent: 09 August 2023 14:34 To: logsdail/carmm @.> Cc: Andrew Logsdail @.>; Review requested @.> Subject: Re: [logsdail/carmm] Assertion for surface-adsorbate distance in bond_length_scan (PR #122)
OK - does that introduce a minimum dependence from us on the ASE version number? This is something we need to consider anyway at some point for the calculator, I guess... ____ From: Igor Kowalec @.> Sent: 09 August 2023 13:52 To: logsdail/carmm @.> Cc: Andrew Logsdail @.>; Review requested @.> Subject: Re: [logsdail/carmm] Assertion for surface-adsorbate distance in bond_length_scan (PR #122https://github.com/logsdail/carmm/pull/122) External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu ddolenni. @ikowalechttps://github.com/ikowalec commented on this pull request. ____ In carmm/build/neb/bond_length_scan.py<#122 (comment)https://github.com/logsdail/carmm/pull/122#discussion_r1288435817>: @@ -81,12 +86,12 @@ def take_second(n): for i in range(1, n_steps+1): # operate on a deepcopy for intended functionality - atoms = copy.deepcopy(atoms) + atoms = atoms.copy() Yes, in previous versions atoms.copy() was providing a shallow copy and now it is a completely new instance, so using copy library can be avoided — Reply to this email directly, view it on GitHub<#122 (comment)https://github.com/logsdail/carmm/pull/122#discussion_r1288435817>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMK4MYKIXEENPWLMXRFRPLXUOB2BANCNFSM6AAAAAA3JYVWPQ. You are receiving this because your review was requested.Message ID: @.***>
Re: codebase, the deepcopy can copy the calculator, but it is generally frowned upon as per: https://gitlab.com/gpatom/ase-gpatom/-/issues/8 For copying Atoms objects we should be using the dedicated Atoms.copy() function. It drops the calculator altogether, so a new one might have to be generated if required.
— Reply to this email directly, view it on GitHubhttps://github.com/logsdail/carmm/pull/122#issuecomment-1671338402, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMK4M2FUTWBF57EXVEEEOLXUOGWFANCNFSM6AAAAAA3JYVWPQ. You are receiving this because your review was requested.Message ID: @.***>
Maybe note in the code as a TODO? Just so we have the edge case noted in case it recurs - we shouldn't just leave known issues undocumented.
From: Igor Kowalec @.> Sent: 09 August 2023 14:39 To: logsdail/carmm @.> Cc: Andrew Logsdail @.>; Review requested @.> Subject: Re: [logsdail/carmm] Assertion for surface-adsorbate distance in bond_length_scan (PR #122)
External email to Cardiff University - Take care when replying/opening attachments or links. Nid ebost mewnol o Brifysgol Caerdydd yw hwn - Cymerwch ofal wrth ateb/agor atodiadau neu ddolenni.
@ikowalec commented on this pull request.
In carmm/build/neb/bond_length_scan.pyhttps://github.com/logsdail/carmm/pull/122#discussion_r1288500521:
# retrieve z-coordinate for z_bias
if z_bias:
Define a list of atom chemical symbols and their count
Take the z coordinate of the most abundant element in the surface slab
- chem_symbol_count = [[x, atoms.get_chemical_symbols().count(x)] for x in set(atoms.get_chemical_symbols())]
Sort the list by the count
- chem_symbol_count.sort(key=lambda k: k[1])
- surf_z_list = [atom.z for atom in atoms if atom.symbol == chem_symbol_count[-1][0] and atom.tag > 0]
I removed the use of tags and replaced them with avoiding z-coordinates of atoms being moved. The only edge case I can think of is e.g. metal oxides with more oxygen than metal and large adsorbates containing oxygen, where not all oxygens are being moved. Then potentially the dynamically applied z_bias might be incorrect, but can always be replaced by a float.
— Reply to this email directly, view it on GitHubhttps://github.com/logsdail/carmm/pull/122#discussion_r1288500521, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMK4MY2F432QIYWK6TGZA3XUOHJPANCNFSM6AAAAAA3JYVWPQ. You are receiving this because your review was requested.Message ID: @.***>
Codecov Report
84.08% <100.00%> (+0.23%)
Flags with carried forward coverage won't be shown. Click here to find out more.
94.11% <100.00%> (+11.09%)
100.00% <100.00%> (ø)