Conditional DataLoader / variable number of DataLoaders

Hi, I try to describe my problem / my desired solution.

I have a large dataset, where the samples have varying conditions. I would like to create DataLoaders which load only samples of particular condition for further modeling.

Now the condition is coded via filename and I can extract a list of indices for condition 1 to condition M.
For the next file (different type of samples) I have condition 1 to condition N.

Thus if I work with Subset() I need to find a way how to design a variable number of DataLoaders per type of samples.

What I have in mind is to create a dictionary with something like type_of_sample : num_of_conditions and then append DataLoaders with selection via Subset to a list, which I would iterate in some later stage.

Is there any more elegant way, which does not feel like whacky tinkering?