Optimization create_rndm_selections
Previous versions of the method ketos.data_handling.selection_table.create_rndm_selections
were painfully slow when generating large amounts of samples (10000+) to the points that it was a major bottleneck when creating a new dataset with the method.
I made several changes to method both improving readability (it should be easier to understand and follow the code) as well as to the efficiency. It is now significantly faster when trying to generate a large amount of selections.
In my tests, when trying to generate 200000+ selections it now takes 17 s
as opposed to the 331 s
it took before. So by about a factor of 20 in this case. With fewer selections, there is still an improvement but it is not as significant.
From my tests, the code is working exactly the same.