Last active
September 20, 2015 16:55
-
-
Save canismarko/b13423db18df04eb4c21 to your computer and use it in GitHub Desktop.
pyGSAS Unit Test Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/GSASIIspc.py b/GSASIIspc.py | |
index 8c3cda3..a95e101 100644 | |
--- a/GSASIIspc.py | |
+++ b/GSASIIspc.py | |
@@ -1062,7 +1062,11 @@ def MoveToUnitCell(xyz): | |
:param xyz: a list or numpy array of fractional coordinates | |
:returns: XYZ - numpy array of new coordinates now 0 or greater and less than 1 | |
''' | |
- XYZ = (xyz+10.)%1. | |
+ try: | |
+ XYZ = (xyz+10.)%1. | |
+ except TypeError: | |
+ # Fall-back to list comprehension | |
+ XYZ = np.array([(c+10)%1 for c in xyz]) | |
cell = np.asarray(np.rint(xyz-XYZ),dtype=np.int32) | |
return XYZ,cell | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment