Fix and harden abacuslite ASE interface#7588
Conversation
|
noted. Regards. |
| # we should raise a ValueError | ||
| param_cache_ = {} | ||
| def normalize_keyword_value(value): | ||
| if isinstance(value, bool): |
There was a problem hiding this comment.
I don't understand what happens here. Does it happen that the 'True' or 'true' string is treated as an iterable which yields 'T r u e' or 't r u e' eventually in ABACUS INPUT file?
There was a problem hiding this comment.
The string case remains scalar: "true" is not treated as an iterable and is not split into characters.
I simplified the comparison helper in 762919f so it matches the INPUT writer behavior. Python bool values are normalized to ABACUS switch values "1"/"0"; list/tuple/set values are compared by joining their plain string elements; scalar strings stay unchanged. I also added regression coverage for bool equivalence, false bool conflicts, scalar string handling, and iterable comparison semantics.
Summary
This PR hardens the vendored
abacusliteASE interface and ports the ATST-Tools fixes that are suitable for upstream ABACUS:*.bak.Nfiles and ignore non-canonical suffixes.dipolefrom the advertised ASE implemented properties.FixAtoms/FixCartesianASE constraints to ABACUS mobility flags.Fixes #7540
Fixes #7544
Fixes #7546
Tests
Run from
interfaces/ASE_interface/abacusliteafterpython3 -m pip install -e ../ --no-deps:python3 ./io/generalio.py -vpython3 ./io/legacyio.py -vpython3 ./io/latestio.py -vpython3 ./utils/ksampling.py -vpython3 core.py TestAbacusCalculator.test_version_number_check TestAbacusCalculator.test_property_keywords_reject_conflicting_user_parameters TestAbacusCalculator.test_property_keywords_reject_conflicting_properties TestAbacusCalculator.test_dipole_property_is_not_implemented -vgit diff --check -- interfaces/ASE_interface/abacuslite/core.py interfaces/ASE_interface/abacuslite/io/generalio.py interfaces/ASE_interface/abacuslite/io/legacyio.py interfaces/ASE_interface/abacuslite/io/latestio.pyThe local shell did not have
abacusormpirunin PATH, so the full calculator execution test remains covered by upstream CI.