Changeset 1994 in lmdz_wrf for trunk/tools/generic_tools.py


Ignore:
Timestamp:
Jul 31, 2018, 9:06:06 PM (6 years ago)
Author:
lfita
Message:

Improving `auto_val_list', adding when a list with a single value is passed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r1993 r1994  
    1200512005    else:
    1200612006        autoval = []
    12007         for i in range(Nvals): autoval.append(retype(listchk[i], type(alist[0])))
     12007        if len(listchk) == 1:
     12008            if listchk[0] != 'auto':
     12009                for i in range(Nvals):
     12010                    autoval.append(retype(listchk[0], type(alist[0])))
     12011            else:
     12012                autoval = alist[0:Nvals]
     12013        else:
     12014            for i in range(Nvals): autoval.append(retype(listchk[i], type(alist[0])))
    1200812015
    1200912016    return autoval
     
    1201612023#print auto_val_list('#00FFAA', 3, colorsauto)
    1201712024#print auto_val_list(['2.3','2','3.4'], 3, np.arange(3.))
    12018 
    12019 quit()
    12020 
    12021 
    12022 
    1202312025
    1202412026def rectangular_spiral(Ntimes, dunits):
Note: See TracChangeset for help on using the changeset viewer.