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: fixing sizing problem in some single atom workflows #3553

Merged
merged 3 commits into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nexus/lib/qmcpack_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
import os
import inspect
import keyword
import numpy as np
from numpy import fromstring,empty,array,float64,\
loadtxt,ndarray,dtype,sqrt,pi,arange,exp,eye,\
ceil,mod,dot,abs,identity,floor,linalg,where,isclose
Expand Down Expand Up @@ -3987,6 +3988,13 @@ def return_system(self,structure_only=False):
center = axes.sum(0)/2
#end if

# pos must be a 2D array, shape (N,3)
# reshape single atom case, shape (3,) as shape (1,3)
pos = np.asarray(pos)
if len(pos.flatten())==3:
pos.shape = (1,3)
#end if
Comment on lines +3993 to +3996
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment describing the special case being handled here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


structure = Structure(axes=axes,elem=elem,pos=pos,center=center,units='B')

for name,element in ions.groups.items():
Expand Down