Skip to content

Sort is missing as part of simplification #45

@BracketJohn

Description

@BracketJohn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions