shouldn't the min_stamp just be in a class level dictionary? and then lookup the date_unit, which you then default if date_unit is None; also lower case the date_unit (in case you are passed something else)