Build a RecipeInput object.

def build_recipe_input(self, ob, dal):
        """Build a RecipeInput object."""

        result = {}
        # We have to decide if the ob input
        # is a plain description (ObservingBlock)
        # or if it contains the nested results (Obsres)
        #
        # it has to contain the tags corresponding to the observing modes...
        ob_query_skip = False
        ob_query_field = 'obresult'

        if isinstance(ob, ObservingBlock):
            import numina.types.obsresult as obtype
            # We have to build an Obsres
            for key, req in self.requirements().items():
                if isinstance(req.type, obtype.ObservationResultType):
                    ob_query_field = key
                    ob_query_skip = True
                    query_option = self.query_options.get(key)

                    # print('req for ob is named', key, query_option)
                    new_or = ObservationResult()
                    new_or.__dict__ = ob.__dict__
                    obsres = req.query(dal, new_or, options=query_option)
                    tagger = self.mode.tagger
                    if tagger is not None:
                        self.logger.debug('Use mode tagger to fill tags in OB')
                        obsres.tags = tagger(obsres)
                    else:
                        obsres.tags = None
                    break
            else:
                # nothing to do
                obsres = ob
        else:
            obsres = ob

        # Get tags_names per REQ
        self.logger.debug('getting query fields per REQ')
        qfields = set()
        for key, req in self.requirements().items():
            tag_n = req.tag_names()
            self.logger.debug("%s has these query fields %s", key, tag_n)
            qfields.update(tag_n)

        if obsres.tags is None:
            self.logger.debug('running recipe tagger')
            self.logger.debug('with query fields %s', qfields)
            if qfields:
                obsres.tags = self.obsres_extractor(obsres, qfields)
            else:
                obsres.tags = {}

        for key, req in self.requirements().items():

            try:
                query_option = self.query_options.get(key)
                if key == ob_query_field and ob_query_skip:
                    result[key] = obsres
                else:
                    result[key] = req.query(dal, obsres, options=query_option)
            except NoResultFound as notfound:
                req.on_query_not_found(notfound)

        return self.create_input(**result)