def create_bmi_model(self, engine, bmi_class=None, wrapper_kwargs=None):
        """initialize a bmi mode using an optional class"""
        if wrapper_kwargs is None:
            wrapper_kwargs = {}
        if bmi_class is None:
            wrapper_class = bmi.wrapper.BMIWrapper
        else:
            wrapper_class = self.import_from_string(bmi_class)
        try:
            """most models use engine as a first argument"""
            model = wrapper_class(
                engine,
                **wrapper_kwargs
            )
        except TypeError as e:
            """but old python engines are engines, so they don't, but they should """
            logger.warn(
                'Model wrapper %s does not accept engine as a first argument',
                wrapper_class
            )
            model = wrapper_class(
                **wrapper_kwargs
            )
        return model
def create_bmi_model ( self , engine , bmi_class = None , wrapper_kwargs = None ) : if wrapper_kwargs is None : wrapper_kwargs = { } if bmi_class is None : wrapper_class = bmi . wrapper . BMIWrapper else : wrapper_class = self . import_from_string ( bmi_class ) try : model = wrapper_class ( engine , ** wrapper_kwargs ) except TypeError as e : logger . warn ( 'Model wrapper %s does not accept engine as a first argument' , wrapper_class ) model = wrapper_class ( ** wrapper_kwargs ) return model
initialize a bmi mode using an optional class