MCPcopy Create free account
hub / github.com/Derive-Risk/pyfair / _determine_func

Method _determine_func

pyfair/model/model_input.py:308–324  ·  view source on GitHub ↗

Checks keywords and returns the appropriate function object.

(self, **kwargs)

Source from the content-addressed store, hash-verified

306 return s.values
307
308 def _determine_func(self, **kwargs):
309 """Checks keywords and returns the appropriate function object."""
310 # Check whether keys are recognized
311 for key in kwargs.keys():
312 if key not in self._parameter_map.keys():
313 raise FairException('"{}"" is not a recognized keyword'.format(key))
314 # Check whether all keys go to same function via set comprension
315 functions = list(set([
316 self._parameter_map[key]
317 for key
318 in kwargs.keys()
319 ]))
320 if len(functions) > 1:
321 raise FairException('"{}" mixes incompatible keywords.'.format(str(kwargs.keys())))
322 else:
323 function = functions[0]
324 return function
325
326 def _gen_constant(self, count, **kwargs):
327 """Generates constant array of size `count`"""

Callers 1

_generate_singleMethod · 0.95

Calls 1

FairExceptionClass · 0.85

Tested by

no test coverage detected