source:
issm/oecreview/Archive/26740-27031/ISSM-26901-26902.diff
Last change on this file was 27032, checked in by , 3 years ago | |
---|---|
File size: 1.3 KB |
-
../trunk-jpl/src/m/consistency/checkfield.py
113 113 114 114 else: 115 115 if len(np.shape(field)) < len(fieldsize): 116 md = md.checkmessage(options.getfieldvalue('message', "field {} has size {} but should be size {}".format(fieldname, np.shape(field), fieldsize))) 116 if fieldsize[-1] > 1: 117 md = md.checkmessage(options.getfieldvalue('message', "field {} has size {} but should be size {}".format(fieldname, np.shape(field), fieldsize))) 118 else: 119 #The last dimension is one that follows matlab 2D array regulation but usually not what we do in python, we allow the difference in shape only if the number of element is equal 120 if np.prod(np.shape(field)) != np.prod(fieldsize): 121 md = md.checkmessage(options.getfieldvalue('message', "field {} has size {} but should be size {}".format(fieldname, np.shape(field), fieldsize))) 117 122 else: 118 123 for i in range(np.size(fieldsize)): 119 124 if (not np.isnan(fieldsize[i])) and (np.shape(field)[i] != fieldsize[i]):
Note:
See TracBrowser
for help on using the repository browser.