How about we just offer both: if the bin edges are given (my code) they are used and all other parameters ignored, otherwise we calculate the bin edges (your code)?