Changeset 1975


Ignore:
Timestamp:
Sep 21, 2015 4:52:57 PM (6 years ago)
Author:
toby
Message:

Address unit test problem with MoveToUnitCell?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIspc.py

    r1958 r1975  
    10631063    :returns: XYZ - numpy array of new coordinates now 0 or greater and less than 1
    10641064    '''
    1065     XYZ = (xyz+10.)%1.
     1065    XYZ = (np.array(xyz)+10.)%1.
    10661066    cell = np.asarray(np.rint(xyz-XYZ),dtype=np.int32)
    10671067    return XYZ,cell
     
    30773077    _ReportTest()
    30783078    msg = "MoveToUnitCell failed"
    3079     assert (MoveToUnitCell([1,2,3]) == [0,0,0]).all, msg
    3080     assert (MoveToUnitCell([2,-1,-2]) == [0,0,0]).all, msg
    3081     assert abs(MoveToUnitCell(np.array([-.1]))[0]-0.9) < 1e-6, msg
    3082     assert abs(MoveToUnitCell(np.array([.1]))[0]-0.1) < 1e-6, msg
     3079    assert (MoveToUnitCell([1,2,3])[0] == [0,0,0]).all, msg
     3080    assert (MoveToUnitCell([2,-1,-2])[0] == [0,0,0]).all, msg
     3081    assert abs(MoveToUnitCell(np.array([-.1]))[0]-0.9)[0] < 1e-6, msg
     3082    assert abs(MoveToUnitCell(np.array([.1]))[0]-0.1)[0] < 1e-6, msg
    30833083selftestlist.append(test0)
    30843084
Note: See TracChangeset for help on using the changeset viewer.