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

Stable/0.3/enhance exception handling of user, task, backend #54

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

chensgit169
Copy link
Collaborator

  1. add 502 status code exception report in Task.send(), add some TODO
  2. add 'None' exception report in Task.retrieve()
  3. replace json.load(response.txt) with response.json()
  4. replace default user=User() from the very beginning by initializing only when user unset
  5. added license by the way

Copy link
Collaborator

@Zhaoyilunnn Zhaoyilunnn left a comment

Choose a reason for hiding this comment

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

Generally this looks good to me.
In the future, suggest to

  1. Stable branch only accept bug fix (I think this PR is an enhancement rather than bug fix)
  2. New features go to master, bug fixes from stable branch will be regularly merged into master

def get_chip_info(self, user=User()):
# update api-token, a patch to be deleted in the future
api_token = user._load_account_token()
def get_chip_info(self, user: User = None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

better to use Optional[User] next time

@@ -141,14 +153,14 @@ def submit(self,

def run(self,
qc: QuantumCircuit,
measure_base: List = []) -> ExecResult:
measure_base: List = None) -> ExecResult:
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

Comment on lines +228 to +229
import pprint
pprint.pprint(res_dict)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to print this info for users each time?


return ExecResult(res_dict, measures)

def retrieve_group(self,
group: str,
history: Dict = {},
history: Dict = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

use Optional

@Zhaoyilunnn Zhaoyilunnn merged commit 46981a6 into ScQ-Cloud:stable/0.3 Aug 15, 2023
48 checks passed
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