fix composition extraction in the python script