Changeset 9191
- Timestamp:
- Jun 18, 2014, 6:42:46 PM (10 years ago)
- Location:
- trunk/anuga_core/source/anuga/utilities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/utilities/plot_utils.py
r9190 r9191 236 236 inds='max' # 237 237 else: 238 inds=list(timeSlices) 238 try: 239 inds=list(timeSlices) 240 except: 241 inds=[timeSlices] 239 242 240 243 if(inds is not 'max'): … … 421 424 inds='max' # 422 425 else: 423 inds=list(timeSlices) 426 try: 427 inds=list(timeSlices) 428 except: 429 inds=[timeSlices] 424 430 425 431 if(inds is not 'max'): … … 873 879 if(swwFile is not None): 874 880 # Read in ANUGA outputs 881 882 # Ensure myTimeStep is a list 883 if type(myTimeStep)!=list: 884 myTimeStep=[myTimeStep] 885 875 886 if(verbose): 876 887 print 'Reading sww File ...' … … 890 901 myTimeStep=range(len(p2.time)) 891 902 892 # Ensure myTimeStep is a list893 if type(myTimeStep)!=list:894 myTimeStep=[myTimeStep]895 903 896 904 if(verbose): -
trunk/anuga_core/source/anuga/utilities/test_plot_utils.py
r9160 r9191 164 164 self.everything_equal(pc_12, 0, p2, 0) 165 165 self.everything_equal(pc_12, 1, p2, 3) 166 167 168 # Try getting some time-slices, and checking all is as intended 169 p_12a=util.get_output('test_plot_utils.sww', timeSlices=3) 170 pc_12a=util.get_centroids(p_12a,velocity_extrapolation=ve) 171 172 #print p_12a.timeSlices 173 #print pc_12a.timeSlices 174 assert(p_12a.timeSlices==[3]) 175 assert(pc_12a.timeSlices==[3]) 176 177 self.everything_equal(p_12a, 0, p, 3) 178 self.everything_equal(pc_12a, 0, p2, 3) 179 180 181 # Try getting some time-slices, and checking all is as intended 182 p_12b=util.get_output('test_plot_utils.sww') 183 pc_12b=util.get_centroids(p_12b,velocity_extrapolation=ve, timeSlices=3) 184 185 #print p_12b.timeSlices 186 #print pc_12b.timeSlices 187 assert(p_12b.timeSlices==[0, 1, 2, 3, 4, 5]) 188 assert(pc_12b.timeSlices==[3]) 189 190 self.everything_equal(p_12b, 0, p, 0) 191 self.everything_equal(p_12b, 5, p, 5) 192 self.everything_equal(pc_12b, 0, p2, 3) 193 166 194 167 195 # Check we can get the 'last' time, and it is correct
Note: See TracChangeset
for help on using the changeset viewer.