Changeset 6132
- Timestamp:
- Jan 9, 2009, 4:10:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r6130 r6132 1094 1094 1095 1095 # Loop through entries and compose polygons 1096 past_ids = {} 1097 last_id = None 1096 1098 for i, id in enumerate(X['id']): 1099 1100 # Check for duplicate polygons 1101 if id in past_ids: 1102 msg = 'Polygon %s was duplicated in line %d' % (id, i) 1103 raise Exception, msg 1097 1104 1098 1105 if id not in polygons: … … 1101 1108 if values is not None: 1102 1109 values[id] = X[value_name][i] 1110 1111 # Keep track of previous polygon ids 1112 if last_id is not None: 1113 past_ids[last_id] = i 1103 1114 1104 1115 # Append this point to current polygon … … 1107 1118 1108 1119 # Check that value is the same across each polygon 1109 assert values[id] == X[value_name][i] 1120 msg = 'Values must be the same across each polygon.' 1121 msg += 'I got %s in line %d but it should have been %s' % (X[value_name][i], i, values[id]) 1122 assert values[id] == X[value_name][i], msg 1123 1124 last_id = id 1110 1125 1111 1126 return polygons, values
Note: See TracChangeset
for help on using the changeset viewer.