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

Update tests to avoid empty ExperimentData warning #1349

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

wshanks
Copy link
Collaborator

@wshanks wshanks commented Dec 19, 2023

Update fake backend to generate fake results for each circuit and update tests to run at least one circuit so that some results are generated. These changes avoid generating many instances of the recently added warning about running analysis on an empty experiment data object and also make the tests a little more realistic.

Copy link
Collaborator

@coruscating coruscating left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this.

@@ -55,12 +55,25 @@ def target(self) -> Target:
return self._target

def run(self, run_input, **options):
if not isinstance(run_input, list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we always submit circuits as lists even in the case of a single circuit, but this matches the behavior of IBMBackend so it's valid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That sounds right. Because the name was run_input instead of circuits, I wasn't sure what was possible, so I checked the other Backend classes and decided to handle QuantumCircuit and list[QuantumCircuit].

@wshanks wshanks added this pull request to the merge queue Jan 7, 2024
Merged via the queue into qiskit-community:main with commit 729014b Jan 7, 2024
11 checks passed
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 17, 2024
…1349)

Update fake backend to generate fake results for each circuit and update
tests to run at least one circuit so that some results are generated.
These changes avoid generating many instances of the recently added
warning about running analysis on an empty experiment data object and
also make the tests a little more realistic.
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