Constrained least-squares fitting with Python