def create_model(self):
properties = {<EOL>'<STR_LIT:name>': self.name,<EOL>'<STR_LIT>': self.biomass_reaction,<EOL>'<STR_LIT>': self.extracellular_compartment,<EOL>'<STR_LIT>': self.default_compartment,<EOL>'<STR_LIT>': self.default_flux_limit<EOL>}<EOL>if self.context is not None:<EOL><INDENT>git_version = util.git_try_describe(self.context.basepath)<EOL>properties['<STR_LIT>'] = git_version<EOL><DEDENT>model = NativeModel(properties)<EOL>compartment_iter, boundaries = self.parse_compartments()<EOL>for compartment in compartment_iter:<EOL><INDENT>model.compartments.add_entry(compartment)<EOL><DEDENT>model.compartment_boundaries.update(boundaries)<EOL>for compound in self.parse_compounds():<EOL><INDENT>if compound.id in model.compounds:<EOL><INDENT>existing_entry = model.compounds[compound.id]<EOL>common_props = set(compound.properties).intersection(<EOL>existing_entry.properties).difference({'<STR_LIT:id>'})<EOL>if len(common_props) > <NUM_LIT:0>:<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>compound.id, compound.filemark, common_props))<EOL><DEDENT>properties = dict(compound.properties)<EOL>properties.update(existing_entry.properties)<EOL>compound = CompoundEntry(<EOL>properties, filemark=compound.filemark)<EOL><DEDENT>model.compounds.add_entry(compound)<EOL><DEDENT>for reaction in self.parse_reactions():<EOL><INDENT>if reaction.id in model.reactions:<EOL><INDENT>existing_entry = model.reactions[reaction.id]<EOL>common_props = set(reaction.properties).intersection(<EOL>existing_entry.properties).difference({'<STR_LIT:id>'})<EOL>if len(common_props) > <NUM_LIT:0>:<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>reaction.id, reaction.filemark, common_props))<EOL><DEDENT>properties = dict(reaction.properties)<EOL>properties.update(existing_entry.properties)<EOL>reaction = ReactionEntry(<EOL>properties, filemark=reaction.filemark)<EOL><DEDENT>model.reactions.add_entry(reaction)<EOL><DEDENT>for exchange_def in self.parse_exchange():<EOL><INDENT>model.exchange[exchange_def[<NUM_LIT:0>]] = exchange_def<EOL><DEDENT>for limit in self.parse_limits():<EOL><INDENT>model.limits[limit[<NUM_LIT:0>]] = limit<EOL><DEDENT>if self.has_model_definition():<EOL><INDENT>for model_reaction in self.parse_model():<EOL><INDENT>model.model[model_reaction] = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for reaction in model.reactions:<EOL><INDENT>model.model[reaction.id] = None<EOL><DEDENT><DEDENT>return model<EOL>
Return :class:`NativeModel` fully loaded into memory.