-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insufficient combination when filter function is specified? #2
Comments
Hello, @kmaehashi
from allpairspy import AllPairs
numpy = ['1.9', '1.10', '1.11', '1.12', '1.13', '1.14']
python = ['2.7', '3.4', '3.5', '3.6']
os = ["Linux", "Windows", "macOS"]
def _validate(row):
numpy, python = row[0], row[1]
valid = []
if numpy == '1.9':
valid = ['2.7', '3.4']
elif numpy == '1.10':
valid = ['2.7', '3.4']
elif numpy == '1.11':
valid = ['2.7', '3.4', '3.5']
elif numpy == '1.12':
valid = ['2.7', '3.4', '3.5', '3.6']
elif numpy == '1.13':
valid = ['2.7', '3.4', '3.5', '3.6']
elif numpy == '1.14':
valid = ['2.7', '3.4', '3.5', '3.6']
return python in valid
def _filter_func(row):
if len(row) > 2:
stat = _validate(row)
#print('Valid? ', row, ' -> ', stat)
return stat
return True
if __name__ == '__main__':
for i, pairs in enumerate(AllPairs([numpy, python, os], filter_func=_filter_func)):
print(i, ':', pairs)
from allpairspy import AllPairs
from itertools import product
numpy = ['1.9', '1.10', '1.11', '1.12', '1.13', '1.14']
python = ['2.7', '3.4', '3.5', '3.6']
def _validate(numpy, python):
valid = []
if numpy == '1.9':
valid = ['2.7', '3.4']
elif numpy == '1.10':
valid = ['2.7', '3.4']
elif numpy == '1.11':
valid = ['2.7', '3.4', '3.5']
elif numpy == '1.12':
valid = ['2.7', '3.4', '3.5', '3.6']
elif numpy == '1.13':
valid = ['2.7', '3.4', '3.5', '3.6']
elif numpy == '1.14':
valid = ['2.7', '3.4', '3.5', '3.6']
return python in valid
def _filter_func(row):
return _validate(*row)
if __name__ == '__main__':
for i, pairs in enumerate(filter(_filter_func, product(numpy, python))):
print(i, ':', pairs)
|
@thombashi Thank you for your help.
|
@kmaehashi |
@thombashi Thanks for the quick response! |
@kmaehashi |
Hello, any progress on this issue? |
Sorry to keep you waiting. |
@thombashi
Are there any plans to fix it? |
Fixed in this PR. For @kmaehashi's original input the result is:
|
Using AllPairs 2.5.0 some combinations are missing from the result once filtering is used. This refers to thombashi/allpairspy#2 thombashi/allpairspy#10
Code:
Desired Output:
Actual Output:
|
Hello, thank you for providing a great library!
I tried to use filter function to cut invalid combination, but it seems generated combinations are insufficient.
I got:
It seems Python 3.5/3.6 variations are totally ignored. Am I missing something?
Any suggestions are welcome. Thanks in advance!
The text was updated successfully, but these errors were encountered: