Python cartesian product and conditions?
In Python I am using the itertools.product() function to generate input parameters for a simulation. I have a test function that requires 4 input parameters a1, a2, b1 and b2. I use the following code generate the parameters. Example: params = itertools.product(range(10,41,2), range(10,41,2), range(0, 2), range(5, 31, 5)) … which gives me 3072 combinations. Unfortunately some combinations logically make no sense. E. g. if a2 is larger than a1 the test results are useless, also when b1 equals 0 the value of b2 is completely irrelevant – so it wouldn’t make sense to test such combinations. Is