Skip to content

Allow passing arguments to treewidth solver and use exit codes depending on test results#3

Open
jmeintrup wants to merge 2 commits intoholgerdell:masterfrom
jmeintrup:master
Open

Allow passing arguments to treewidth solver and use exit codes depending on test results#3
jmeintrup wants to merge 2 commits intoholgerdell:masterfrom
jmeintrup:master

Conversation

@jmeintrup
Copy link
Copy Markdown

@jmeintrup jmeintrup commented Feb 20, 2021

Allow adding CLI arguments to the solver executable

  • Changes the API of the autotest-tw-solver to use '++full' instead of '--full'
  • Adds the option to add arguments to the solver executable with the '++' prefix
  • Adds exit codes according to level of failure: 1 for non-optimal but valid, 2 for invalid,
    0 for all valid and all optimal. Other codes are used for internal failures.

Allow adding CLI arguments to the solver executable
- Changes the API of the autotest-tw-solver to use '++full' instead of '--full'
- Adds the option to add arguments to the solver executable with the '++' prefix
- Adds exit codes according to level of failure: 1 for non-optimal but valid, 2 for invalid, 
0 for all valid and all optimal. Other codes are used for internal failures.
Copy link
Copy Markdown
Owner

@holgerdell holgerdell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request! I have some questions about it before I accept it

print("All tree decompositions were optimal")
else:
print("{:d} tree decompositions were not optimal".format(total_nonoptimal))
if exit_code == 0:
Copy link
Copy Markdown
Owner

@holgerdell holgerdell Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not exit directly without setting an exit_code variable?

)
parser.add_argument(
"--full",
"++full",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why switch to ++?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this somehow standard for testing frameworks?

--full run test on all graphs with min-degree 3 and at most 8 vertices

++full run test on all graphs with min-degree 3 and at most 8 vertices
++ any number of arguments that get passed on to the treewidth solver
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the interface now like this? ./autotest-tw-solver.py mysolver ++--twsolveroption1
Maybe a nicer interface would be: ./autotest-tw-solver.py [--full] <solver> [arguments for solver] so that solver arguments can be given as-is, without having to prepend ++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants