use warnings.warn() instead of raise for DeprecationWarning