merges in origin/master to synchronize the python2 and python3 codebases
adds appropriate from future imports to get around syntax differences in python2 and python3
fixes some minor version-specific issues (such as the fact that strings have iter in python3 but not python2, and that None is not comparable in python3)
adds integer floor division where necessary
I've verified that all unit tests pass on this branch in both python2.7 and python3.5, with the exception of one test (which also fails on master in python2.7):
Error the solver does not support this expression: (x in {0..10} + x in {0..10} + 0.5)
Type: <class 'Numberjack.Sum'>
Children: [<Numberjack.Variable object at 0x10e2e4f10>, <Numberjack.Variable object at 0x10e2e4590>] [<class 'Numberjack.Variable'>, <class 'Numberjack.Variable'>]
Params: [[1, 1], 0.5]
E..........................................................................................................
======================================================================
ERROR: testSuccess11 (tests.LinearTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rdeits/Projects/Numberjack/tests/LinearTest.py", line 159, in testSuccess11
solver = LinearTest.solver(te.model)
File "Numberjack/solvers/Mistral.py", line 977, in __init__
Numberjack.NBJ_STD_Solver.__init__(self, "Mistral", "Mistral", model, X, FD, clause_limit, encoding)
File "Numberjack/__init__.py", line 3138, in __init__
self.solver.add(self.load_expr(expr))
File "Numberjack/__init__.py", line 3249, in load_expr
arguments = [self.load_expr(child) for child in expr.get_children()]
File "Numberjack/__init__.py", line 3284, in load_expr
raise e
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_Mistral_Sum'.
Possible C/C++ prototypes are:
Mistral_Sum::Mistral_Sum(MistralExpArray &,MistralIntArray &,int const)
Mistral_Sum::Mistral_Sum(MistralExpArray &,MistralIntArray &)
Mistral_Sum::Mistral_Sum(Mistral_Expression *,Mistral_Expression *,MistralIntArray &,int const)
Mistral_Sum::Mistral_Sum(Mistral_Expression *,MistralIntArray &,int const)
Mistral_Sum::Mistral_Sum()
I've also verified that all of the examples in the examples/ folder run without error in python2 and python3, although I haven't actually verified their outputs against the problem descriptions.
This pull request makes the following changes:
I've verified that all unit tests pass on this branch in both python2.7 and python3.5, with the exception of one test (which also fails on master in python2.7):
I've also verified that all of the examples in the
examples/
folder run without error in python2 and python3, although I haven't actually verified their outputs against the problem descriptions.I hope you find this useful :smile: