I'm not too sure what would be best here, but I think there are some inconsistencies in the way the results of the clist/cls/cwc/... are returned. You can get:
nothing (NoneType) returned, and nothing printed
nothing (NoneType) returned, and some printed stuff (human readable output)
a list, and some printed stuff
nothing (NoneType) returned and a (possibly extremely long) printed list
I guess the initial idea is to display cache diagnostics that the user can read. It would be nice if a script could also use the results, which is not possible when the functions returns nothing (e.g NoneType)
# No result (not even an empty list), and nothing printed
>>> res_p1 = clist(age='+1', count=True)
>>> type(res_p1)
<class 'NoneType'>
# A list, and something printed
>>> res_m1 = clist(age='-1')
Filtered objects = cache content
>>> type(res_m1)
<class 'list'>
>>> len(res_m1)
624
# No result, and something printed
>>> res_m1 = clist(age='-1', count=True)
Number of files found: 624
>>> type(res_m1)
<class 'NoneType'>
# No result, and something printed
>>> cwc(age='-1')
Number of files found: 624
>>> type(cwc(age='-1'))
Number of files found: 624
<class 'NoneType'>
# No result, and some giant printed output
>>> cwc(age='-1', CRS=True)
[ lots and lots and lots of removed output ]
minus(space_average(ccdo(ccdo(llbox(ds('CMIP6%%tas%1401-1500%global%/bdd%MPI-ESM1-2-LR%MPI-M%PMIP%Amon%midHolocene%r1i1p1f1%gn%latest'),latmax=90,latmin=0,lonmax=360,lonmin=0),operator='ymonavg'),operator='timmean -seltimestep,6,7,8,9')),space_average(ccdo(ccdo(llbox(ds('CMIP6%%tas%2750-2849%global%/bdd%MPI-ESM1-2-LR%MPI-M%CMIP%Amon%piControl%r1i1p1f1%gn%latest'),latmax=90,latmin=0,lonmax=360,lonmin=0),operator='ymonavg'),operator='timmean -seltimestep,6,7,8,9')))
<class 'NoneType'>
I'm not too sure what would be best here, but I think there are some inconsistencies in the way the results of the
clist/cls/cwc/...
are returned. You can get:NoneType
) returned, and nothing printedNoneType
) returned, and some printed stuff (human readable output)NoneType
) returned and a (possibly extremely long) printed listI guess the initial idea is to display cache diagnostics that the user can read. It would be nice if a script could also use the results, which is not possible when the functions returns nothing (e.g NoneType)