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

Add test coverage for LKokkos #485

Merged
merged 37 commits into from
Sep 6, 2023
Merged

Add test coverage for LKokkos #485

merged 37 commits into from
Sep 6, 2023

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented Aug 25, 2023

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:
The LKokkos backend has lower coverage than PennyLane and LQubit. Codecov oftentimes fails as LKokkos' coverage does not meet the target.

Description of the Change:

  • Add tests, parametrization with GENERATE (gate inverse in particular to target the inverse branch of functors), etc.
  • Enums defined in GateOperation.hpp start at 1 (previously 0). ::BEGIN is introduced in a few places where it was assumed 0 accordingly.
  • Enable pre-commit hooks to format all Python files and linting of all Python source files.

Benefits:
Better test coverage.

Possible Drawbacks:

Related GitHub Issues:

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +6.02% 🎉

Comparison is base (869bbb8) 93.04% compared to head (3d0d6ce) 99.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #485      +/-   ##
==========================================
+ Coverage   93.04%   99.07%   +6.02%     
==========================================
  Files         142      142              
  Lines       16278    16485     +207     
==========================================
+ Hits        15146    16332    +1186     
+ Misses       1132      153     -979     
Files Changed Coverage Δ
...s/lightning_kokkos/measurements/ExpValFunctors.hpp 100.00% <ø> (+43.06%) ⬆️
...ghtning_kokkos/measurements/MeasurementsKokkos.hpp 98.15% <ø> (+3.68%) ⬆️
...tning_qubit/gates/tests/Test_OpToMemberFuncPtr.cpp 18.46% <ø> (ø)
pennylane_lightning/core/_version.py 100.00% <100.00%> (ø)
.../simulators/lightning_kokkos/StateVectorKokkos.hpp 99.76% <100.00%> (+5.99%) ⬆️
...s/gates/tests/Test_StateVectorKokkos_Generator.cpp 100.00% <100.00%> (ø)
...os/gates/tests/Test_StateVectorKokkos_NonParam.cpp 100.00% <100.00%> (ø)
...okkos/gates/tests/Test_StateVectorKokkos_Param.cpp 100.00% <100.00%> (ø)
...asurements/tests/Test_StateVectorKokkos_Expval.cpp 100.00% <100.00%> (ø)
...surements/tests/Test_StateVectorKokkos_Measure.cpp 100.00% <100.00%> (ø)
... and 2 more

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vincentmr vincentmr marked this pull request as ready for review August 29, 2023 16:31
Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

I notice that you are excluding some parts from the coverage checks.
Could you please elaborate on why?

@vincentmr vincentmr requested a review from mlxd August 29, 2023 17:24
@vincentmr vincentmr mentioned this pull request Aug 29, 2023
5 tasks
@vincentmr vincentmr requested a review from AmintorDusko August 30, 2023 21:04
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @vincentmr

Just a few comments

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

You did a nice work so far.

@vincentmr vincentmr requested review from mlxd and AmintorDusko August 31, 2023 13:41
Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

Good work on that! I will approve it now, but please check if, without the coverage exclusion zone, we still pass the coverage checks. I think it is better not to add it, if not needed.

@vincentmr vincentmr changed the title Add tests for Identity and Hadamard expvals. Add tests for coverage for LKokkos Aug 31, 2023
@vincentmr vincentmr changed the title Add tests for coverage for LKokkos Add test coverage for LKokkos Aug 31, 2023
@vincentmr vincentmr mentioned this pull request Aug 31, 2023
5 tasks
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @vincentmr

@vincentmr vincentmr merged commit 8eed6f2 into master Sep 6, 2023
@vincentmr vincentmr deleted the testing/codecov branch September 6, 2023 13:47
maliasadi added a commit that referenced this pull request Oct 16, 2023
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.

3 participants