Closed vishal-ph closed 1 year ago
Hey, this sound like something a newbie like me can do. Please assign me this issue.
Hi, Can I work on this issue?
Hello, thanks for your interest in contributing to OpenQAOA!
We encourage you to collaborate on this issue, otherwise, feel free to make an attempt individually and raise a PR to openqaoa/dev
branch.
Thank you @vishal-ph, Since it's a good first issue I will like to try it alone.
Hi @vishal-ph, can you check and confirm if I am using correct naming conventions for test files or not? Also the example 01_workflows_example.ipynb is using MaximumCut and NumberPartition both. Under which problem test file should I keep it in?
@vishal-ph , I have moved all the tests into different files. Kindly heck my PR if it's ready for merge with dev branch or not.
@vishal-ph any updates?
@devilkiller-ag, I have added my comments on the PR itself
@vishal-ph The path is tests/test_problems.py
right, not src/openqaoa-core/tests/test_problems.py
?
So, we want it to be broken into tests/test_problems/test_*.py
? (where * is a problem class)
@vishal-ph the hyphen in folder name 'openqaoa-core' is causing an import problem. Python import statemens follows standard naming conventions, where module names shoukd consist of letters, digits and underscores only. Can I rename it to 'openqaoa_core'?
@Newtech66, no, the path is correct. You will need to look at the dev
branch. Note the comment at the end of issue description
@devilkiller-ag, yes, you are right about the import name conventions. However, openqaoa-core is just the name of the module, the import statement still works with openqaoa
. Similarly for the remaining plug-ins, they are imported with underscores in the names. For instance, openqaoa-qiskit
will be imported as openqaoa_qiskit
.
So, please refrain from implementing any name changes
@vishal-ph Ok, so all the new files should live in the same path as test_problems.py
? Not a subfolder ./test_problems/
right?
@Newtech66 Yes, that's correct. Although eventually, we would want to put all the problem class tests in the test_problems
folder as you suggested. This would then require updating the test workflows, so that can be done later.
Fixed in PR #254
Issue Description
Describe the solution you'd like:
src/openqaoa-core/tests/test_problems.py
into different files containing relevant tests for each problem class defined in OpenQAOAsrc/openqaoa-core/openqaoa_core/problems/
.Create a new folder in
test_problems
and create scripts consisting of specific tests corresponding to that problem class. For e.g. createtest_maximumcut.py
and put all tests corresponding to maximum_cut.py in this fileNOTE: Please branch out of
openqaoa/dev
and make the PR toopenqaoa/dev