This version passes the tests with my pymatgen branch: a5e6bb1ec7d3005fcad25a82f1fff6e0009ed2e6