Opto-electronic and thermoelectric properties of MgIn2X4 (X = S, Se) spinels via ab-initio calculations.