Skip to content
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

Sort is missing as part of simplification #45

Open
BracketJohn opened this issue Aug 25, 2018 · 0 comments
Open

Sort is missing as part of simplification #45

BracketJohn opened this issue Aug 25, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@BracketJohn
Copy link
Owner

This currently does not hold:

def test_simplify_order(are_asts_equal):
    """Test whether order is also irrelevant."""
    ast_one = Node(gpflow.kernels.Sum, full_name='Sum')
    Node(gpflow.kernels.RBF, parent=ast_one, full_name='rbf')
    Node(gpflow.kernels.Constant, parent=ast_one, full_name='constant')

    ast_two = Node(gpflow.kernels.Sum, full_name='Sum')
    Node(gpflow.kernels.Constant, parent=ast_two, full_name='constant')
    Node(gpflow.kernels.RBF, parent=ast_two, full_name='rbf')

    simpl_one = simplify(ast_one)
    simpl_two = simplify(ast_two)

    assert are_asts_equal(simpl_one, simpl_two)

To fix this:

  • sort has to be implemented,
  • conftest.py::are_asts_equal has to get the following addition:
         	if lvl_order_ast_one != lvl_order_ast_two:
     	        return False
    
    This could be part of another if block, maybe we don't need to check order every time.
@BracketJohn BracketJohn added the bug Something isn't working label Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant