replaced a print (python2) with warnings.warn and a couple of pep-8 changes