MCPcopy Create free account
hub / github.com/NCAR/wrf-python / is_multi_file

Function is_multi_file

src/wrf/util.py:122–145  ·  view source on GitHub ↗

Return True if the input argument is an iterable. Args: wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ iterable): WRF-ARW NetCDF data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile` or an iterable sequence of the aforementioned ty

(wrfin)

Source from the content-addressed store, hash-verified

120
121
122def is_multi_file(wrfin):
123 """Return True if the input argument is an iterable.
124
125 Args:
126
127 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
128 iterable): WRF-ARW NetCDF
129 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
130 or an iterable sequence of the aforementioned types.
131
132 Returns:
133
134 :obj:`bool`: True if the input is an iterable. False if the input
135 is a single NetCDF file object.
136
137 """
138 if isinstance(wrfin, Dataset):
139 is_iterable = False
140 elif isinstance(wrfin, Iterable):
141 is_iterable = True
142 else:
143 is_iterable = False
144
145 return (is_iterable and not isstr(wrfin))
146
147
148def has_time_coord(wrfnc):

Callers 12

extract_proj_paramsFunction · 0.90
_get_proj_paramsFunction · 0.85
get_iterableFunction · 0.85
__call__Method · 0.85
is_moving_domainFunction · 0.85
extract_global_attrsFunction · 0.85
extract_dimFunction · 0.85
_get_coord_namesFunction · 0.85
_extract_varFunction · 0.85
extract_timesFunction · 0.85
is_standard_wrf_varFunction · 0.85
get_idFunction · 0.85

Calls 1

isstrFunction · 0.85

Tested by 1

extract_proj_paramsFunction · 0.72