As implemented currently "component 0" represents net charge, and can
hence be negative. (which would not have been the case if e.g. 0 had
been chosen to represent e.g. number of electrons).
We add a special check for a component only existing on one side: if it's
present with both positive and negative sign, then the equation can still
be balanced.
Add failing test
Fix gh-158: balance_stoichiometry({'Zn'}, {'Zn+2', 'e-'})
As implemented currently "component 0" represents net charge, and can hence be negative. (which would not have been the case if e.g. 0 had been chosen to represent e.g. number of electrons).
We add a special check for a component only existing on one side: if it's present with both positive and negative sign, then the equation can still be balanced.