def to_mass_fraction(molar_ratio, massfrac_denominator, numerator_mass, denominator_mass):
return molar_ratio * massfrac_denominator * numerator_mass / denominator_mass<EOL>
Converts per-mass concentrations to molar elemental ratios.

Be careful with units.

Parameters
----------
molar_ratio : float or array-like
    The molar ratio of elements.
massfrac_denominator : float or array-like
    The mass fraction of the denominator element
numerator_mass, denominator_mass : float or array-like
    The atomic mass of the numerator and denominator.

Returns
-------
float or array-like : The mass fraction of the numerator element.