def total_components_flux(flux, components, consumption=True):
direction = <NUM_LIT:1> if consumption else -<NUM_LIT:1><EOL>c_flux = [elem * flux * direction for elem in components]<EOL>return sum([flux for flux in c_flux if flux > <NUM_LIT:0>])<EOL>
Compute the total components consumption or production flux.

Parameters
----------
flux : float
    The reaction flux for the components.
components : list
    List of stoichiometrically weighted components.
consumption : bool, optional
    Whether to sum up consumption or production fluxes.