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

Raising a warning for running analysis on an empty ExperimentData object #1313

Merged
merged 8 commits into from
Nov 13, 2023

Conversation

ItamarGoldman
Copy link
Contributor

@ItamarGoldman ItamarGoldman commented Nov 6, 2023

Summary

Added a warning for the user if the ExperimentData data is empty before running an analysis and if the data couldn't be retrieved.

Details and comments

Some details that should be in this section include:

  • The user will get an un-inductive error regarding the analysis while the reason it was raised is because the analysis doesn't have data to analyze from the experiment. We can see an example in ProcessTomography analysis gives UnboundLocalError: local variable 'num_cond' referenced before assignment #1182 .
  • A solution that was suggested was to raise an error that says the user is trying to run analysis on empty ExperimentData object but the team didn't want to constraint the user to run analysis only if the experiment has data so we decided that raising a warning is enough.

Changes:

  • Added warning before analysis if ExperimentData.data() is empty.

PR checklist (delete when all criteria are met)

  • I have read the contributing guide CONTRIBUTING.md.
  • I have added a release note file using reno if this change needs to be documented in the release notes.

@ItamarGoldman ItamarGoldman self-assigned this Nov 6, 2023
@ItamarGoldman ItamarGoldman added this pull request to the merge queue Nov 13, 2023
Merged via the queue into qiskit-community:main with commit 2307d0e Nov 13, 2023
10 checks passed
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 17, 2024
…bject (qiskit-community#1313)

### Summary

Added a warning for the user if the `ExperimentData` data is empty
before running an analysis and if the data couldn't be retrieved.

### Details and comments

Some details that should be in this section include:

- The user will get an un-inductive error regarding the analysis while
the reason it was raised is because the analysis doesn't have data to
analyze from the experiment. We can see an example in qiskit-community#1182 .
- A solution that was suggested was to raise an error that says the user
is trying to run analysis on empty `ExperimentData` object but the team
didn't want to constraint the user to run analysis only if the
experiment has data so we decided that raising a warning is enough.

Changes:
- [x] Added warning before analysis if `ExperimentData.data()` is empty.

### PR checklist (delete when all criteria are met)

- [x] I have read the contributing guide `CONTRIBUTING.md`.
- [x] I have added a release note file using `reno` if this change needs
to be documented in the release notes.

---------

Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>
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