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

Nexus: Better handling tiling matrix #5343

Merged
merged 4 commits into from
Feb 27, 2025
Merged

Conversation

kayahans
Copy link
Contributor

When general 3x3 tiling matrices are used, existing conditionals do not work as intended.

Here is the error message I received when using a 3x3 numpy array as a tiling matrix:

 File "/ccsopen/home/ksu/SOFTWARE/qmcpack/latest/qmcpack/nexus/lib/physical_system.py", line 739, in generate_physical_system
    if tiling!=None and tiling!=(1,1,1) and structure.has_folded():
       ^^^^^^^^^^^^
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

When comparing to None, it is recommended to use is or is not.

What type(s) of changes does this code introduce?

  • Bugfix

Does this introduce a breaking change?

  • No. All tests passed with nxs-test

What systems has this change been tested on?

MacOS 15.3.1

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'
  • No. Code added or changed in the PR has been clang-formatted
  • No. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • No. Documentation has been added (if appropriate)

Copy link
Contributor

@prckent prckent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ye-luo
Copy link
Contributor

ye-luo commented Feb 27, 2025

Test this please

@ye-luo ye-luo enabled auto-merge February 27, 2025 03:23
@ye-luo ye-luo merged commit 3be33a3 into QMCPACK:develop Feb 27, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants