def run(self):
<EOL>def compound_name(id):<EOL><INDENT>if id not in self._model.compounds:<EOL><INDENT>return id<EOL><DEDENT>return self._model.compounds[id].properties.get('<STR_LIT:name>', id)<EOL><DEDENT>exclude = set(self._args.exclude)<EOL>count = <NUM_LIT:0><EOL>unbalanced = <NUM_LIT:0><EOL>unchecked = <NUM_LIT:0><EOL>for reaction, charge in charge_balance(self._model):<EOL><INDENT>count += <NUM_LIT:1><EOL>if reaction.id in exclude or reaction.equation is None:<EOL><INDENT>continue<EOL><DEDENT>if math.isnan(charge):<EOL><INDENT>logger.debug('<STR_LIT>'<EOL>'<STR_LIT>'.format(reaction.id))<EOL>unchecked += <NUM_LIT:1><EOL><DEDENT>elif abs(charge) > self._args.epsilon:<EOL><INDENT>unbalanced += <NUM_LIT:1><EOL>rxt = reaction.equation.translated_compounds(compound_name)<EOL>print('<STR_LIT>'.format(reaction.id, charge, rxt))<EOL><DEDENT><DEDENT>logger.info('<STR_LIT>'.format(unbalanced, count))<EOL>logger.info('<STR_LIT>'.format(<EOL>unchecked, count))<EOL>logger.info('<STR_LIT>'.format(<EOL>len(exclude), count))<EOL>
Run charge balance command