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

Method __call__

src/wrf/util.py:495–508  ·  view source on GitHub ↗
(self, wrfin)

Source from the content-addressed store, hash-verified

493 self.varnames = varnames
494
495 def __call__(self, wrfin):
496 if is_multi_file(wrfin):
497 if not is_mapping(wrfin):
498 wrfin = next(iter(wrfin))
499 else:
500 entry = wrfin[next(iter(viewkeys(wrfin)))]
501 return self(entry)
502
503 for varname in self.varnames:
504 if varname in wrfin.variables:
505 return varname
506
507 raise ValueError("{} are not valid variable names".format(
508 self.varnames))
509
510
511# This should look like:

Callers

nothing calls this directly

Calls 3

is_multi_fileFunction · 0.85
is_mappingFunction · 0.85
viewkeysFunction · 0.85

Tested by

no test coverage detected