Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coherent interface builder: too strict tolerance in assert_allclose #3334

Closed
goodwilling opened this issue Sep 17, 2023 · 1 comment · Fixed by #3337
Closed

Coherent interface builder: too strict tolerance in assert_allclose #3334

goodwilling opened this issue Sep 17, 2023 · 1 comment · Fixed by #3337
Labels
analysis Concerning pymatgen.analysis bug

Comments

@goodwilling
Copy link

goodwilling commented Sep 17, 2023

Issue: Coherent Interface Builder Fails in pymatgen 2023.9.10 on Windows 10

Description

When building Si(100)/Au(100) interfaces using coherent_interface_builder on Windows 10, we encounter an AssertionError in pymatgen version 2023.9.10. The issue didn't exist in previous versions. We're using mp-149 for Si bulk and mp-81 for Au bulk structures.

Error Details

Here's the relevant stack trace:

pymatgen\analysis\interfaces\coherent_interfaces.py", line 217, in get_interfaces
    assert_allclose(
File numpy\testing\_private\utils.py, line 1504, in assert_allclose
    assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
File contextlib.py, line 81, in inner
    return func(*args, **kwds)
    ^^^^^^^^^^^^^^^^^^^
File numpy\testing\_private\utils.py, line 797, in assert_array_compare
    raise AssertionError(msg)

AssertionError Details:

  • Tolerance: rtol=1e-07, atol=0
  • Mismatched Elements: 3/6 (50%)
  • Max Absolute Difference: (4.4408921 \times 10^{-16})
Current Workaround

Explicitly setting atol to a small non-zero value in assert_allclose within pymatgen/analysis/interfaces/coherent_interface.py bypasses the error.


Please investigate why this issue has appeared in the latest version. Thank you.

@janosh janosh added bug analysis Concerning pymatgen.analysis labels Sep 17, 2023
@janosh
Copy link
Member

janosh commented Sep 17, 2023

This is due to #3253. Should be easy to fix by reinstating explicit atol=1e-08. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis Concerning pymatgen.analysis bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants