Changeset 1224 in lmdz_wrf for trunk/tools/generic_tools.py
- Timestamp:
- Oct 20, 2016, 5:33:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r1222 r1224 312 312 Num= number of elements 313 313 >>> list_norepeatcombos(4) 314 [[0 , 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3], [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 2, 3]]314 [[0], [1], [2], [3], [0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3], [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [0, 1, 2, 3]] 315 315 """ 316 316 from math import factorial … … 318 318 319 319 listv = range(Num) 320 # Single values are also combinations! 321 combos = [] 322 for i in range(Num): 323 combos.append([i]) 320 324 321 325 samevals = [] … … 325 329 if searchInlist(samevals,iv): samevals.append(iv) 326 330 327 combos = []328 331 Nlvs = len(listv) 329 332 # Number of possible combinations … … 9750 9753 timestep.sort() 9751 9754 return timestep 9755 print timestep_conform(86400,3600,5) 9752 9756 9753 9757 #quit()
Note: See TracChangeset
for help on using the changeset viewer.