For the Dirichlet you shouldn’t need ordering, and you should sample one more entry and do a cumsum before scaling and discretizing. If you have ten entries to select from, the Dirichlet would give you something like [0.3, 0.2, 0.5]. Cumsum it and you get [0.3, 0.5, 1.0]. You always ignore the last entry (it’s one), and this gives you indexes 3 and 5 after you multiply by 10 and round.
Careful with the a parameter, if the entries are smaller than one you get a funny sparse prior (which is why you may have gotten only zeros). To have a prior of 3/10, 2/10, 5/10, you would use a=np.array([3, 2, 5]) * concentration, with concentration > 1. Higher values of concentration correspond to more and more informed priors. Uniform would simply be [1, 1, 1].