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

fixing CI #420

Merged
merged 2 commits into from
May 24, 2021
Merged

fixing CI #420

merged 2 commits into from
May 24, 2021

Conversation

scarrazza
Copy link
Member

Fixes #418.

@scarrazza scarrazza requested a review from stavros11 May 24, 2021 10:58
Copy link
Member

@stavros11 stavros11 left a comment

Choose a reason for hiding this comment

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

Looks good to me and CI seems to pass.

@@ -12,7 +12,7 @@

def test_parallel_circuit_evaluation(backend):
"""Evaluate circuit for multiple input states."""
if 'GPU' in qibo.get_device() or os.name == 'nt': # pragma: no cover
if 'GPU' in qibo.get_device() or os.name == 'nt' or qibo.get_backend() == "tensorflow": # pragma: no cover
Copy link
Member

Choose a reason for hiding this comment

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

Optionally we could also cover the error cases here using:

with pytest.raises(RuntimeError):
    ...

instead of pytest.skip. This way we could remove # pragma: no cover from the errors above and include them in the coverage check.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about it, however then we need to wrap the parallel function call in a if/else condition, right? (and duplicate the test basically)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I am not sure if it is the best way but this is what I do in a few other tests where I check for similar errors. For these tests I think it is sufficient to do something like:

if 'GPU' in qibo.get_device() or os.name == 'nt' or qibo.get_backend() == "tensorflow":
    with pytest.raises(RuntimeError):
        r2 = parallel_execution(c, states=states, processes=2)
else:
    r2 = parallel_execution(c, states=states, processes=2)
    np.testing.assert_allclose(r1, r2)

so the code duplication is not that large. Not very necessary to do this though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, let's keep as it is, thanks.

@codecov
Copy link

codecov bot commented May 24, 2021

Codecov Report

❗ No coverage uploaded for pull request base (updocs112@85d2048). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             updocs112      #420   +/-   ##
=============================================
  Coverage             ?   100.00%           
=============================================
  Files                ?        79           
  Lines                ?     11401           
  Branches             ?         0           
=============================================
  Hits                 ?     11401           
  Misses               ?         0           
  Partials             ?         0           
Flag Coverage Δ
unittests 100.00% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85d2048...b18341b. Read the comment docs.

@scarrazza scarrazza merged commit 9c0276a into updocs112 May 24, 2021
@scarrazza scarrazza deleted the disableparallel branch July 10, 2021 17:01
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