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

Replacing AWSBraketJob with AmazonBraketTask #105

Merged
merged 24 commits into from
Jun 14, 2023

Conversation

robotAstray
Copy link
Contributor

Summary

This pull request aims to fix issue 45

Details and comments

  1. I have replaced AWSBraketJob with AmazonBraketTask in the code.

  2. And I have re-ran the notebooks docs/tutorials/0_tutorial_qiskit-braket-provider_overview.ipynb and docs/how_tos/2_how_to_retrieve_results_from_backend.ipynb to reflect these changes.

Note that I have installed the modified package locally on my machine to do the last step. Once this pull request is merged and qiskit-braket-provider is deployed, these changes will be visible to anybody installing the package via pip install qiskit-braket-provider.

@robotAstray
Copy link
Contributor Author

@JordanAWS would you kindly have a look and see if my solution is suitable for you?
Thank you.
robotAstray

@robotAstray
Copy link
Contributor Author

I will fix the mistakes and re-commit @JordanAWS

Copy link
Collaborator

@kshitijc kshitijc left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @robotAstray! Please make updates to fix the failing checks.

qiskit_braket_provider/__init__.py Show resolved Hide resolved
qiskit_braket_provider/providers/__init__.py Show resolved Hide resolved
qiskit_braket_provider/providers/braket_job.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@robotAstray robotAstray left a comment

Choose a reason for hiding this comment

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

re-formatting completed with black python

Copy link
Contributor Author

@robotAstray robotAstray left a comment

Choose a reason for hiding this comment

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

please note that I mistakenly re-names braket_job to braket_task indocs/tutorials/0_tutorial_qiskit-braket-provider_overview.ipynb so I fixed it in this commit by reverting to what we had previously.

@robotAstray
Copy link
Contributor Author

@kshitijc I think it should be ready. Thank you

Copy link
Collaborator

@kshitijc kshitijc left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @robotAstray! Could you please look at the failing checks and make updates to fix those as well?

qiskit_braket_provider/providers/braket_job.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/braket_job.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/braket_job.py Outdated Show resolved Hide resolved
@robotAstray
Copy link
Contributor Author

thank you for your message I will fix this now, and test

@robotAstray
Copy link
Contributor Author

I will check the formatting. And commit the changes

Copy link
Collaborator

@kshitijc kshitijc left a comment

Choose a reason for hiding this comment

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

Could you also please confirm whether you are able to successfully execute all notebooks in the tutorials and how-to folders?

tests/providers/test_braket_job.py Show resolved Hide resolved
@robotAstray
Copy link
Contributor Author

robotAstray commented Jun 13, 2023

Could you also please confirm whether you are able to successfully execute all notebooks in the tutorials and how-to folders?

I ran the notebooks prior I made all the latest changes by installing locally the package for qiskit-braket-provider mirroring the repository containing the modifications I have made. I will re-run all the notebooks again and confirm once done

@robotAstray
Copy link
Contributor Author

I will run the notebook and push the commits again when done.

@kshitijc
Copy link
Collaborator

Great! Could you please fix the failing style check as well?

@robotAstray
Copy link
Contributor Author

just a note, I am not able to run the 4_how_to_verbatim_circuits.ipynb notebook and I can see there were problems related to it prior I forked the repo so I will skip `4_how_to_verbatim_circuits.ipynb.

YOu can see in the following link that there were errors before https://github.com/qiskit-community/qiskit-braket-provider/blob/2434a9a29900972e5fe6dace3804384ee08d9df7/docs/how_tos/4_how_to_verbatim_circuits.ipynb

@robotAstray
Copy link
Contributor Author

robotAstray commented Jun 13, 2023

I have run tox -elint on the root folder and these were the results

lint: commands[3]> mypy --install-types --non-interactive .
qiskit_braket_provider/providers/braket_backend.py:252: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
qiskit_braket_provider/providers/braket_backend.py:255: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/providers/test_braket_backend.py:229: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/providers/test_braket_backend.py:230: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Success: no issues found in 19 source files
  lint: OK (15.66=setup[0.14]+cmd[0.76,8.77,5.13,0.85] seconds)
  congratulations :) (16.02 seconds)

I think now all checks should pass successfully (I hope) 🤞
update: 14th June 2023 (time: 00:24 - London):
This might be an issue:

mypy qiskit_braket_provider/providers/braket_backend.py --check-untyped-defs  

qiskit_braket_provider/providers/braket_backend.py:250: error: Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]")  [assignment]

@kshitijc
Copy link
Collaborator

Nice work @robotAstray! 👍

@kshitijc kshitijc merged commit ccd0db7 into qiskit-community:main Jun 14, 2023
robotAstray added a commit to robotAstray/qiskit-braket-provider that referenced this pull request Jun 14, 2023
* replacing AWSBraketJob with AmazonBraketTask

* run the notebooks containing AmazonBraketTask

* deprecation warning added for AWSBraketJob class

* formatting fixed

* re-add <JOB_ARN>

* fix breaking changes on /provider/__init__.py and __init__.py

* rename job_id to task_id argument for AmazonBraketTask()

* rename braket_jobs_states to braket_tasks_states

* add task_id method to access the task_id similar to the one we have in the JobV1 class

* adding tests for new class 'AmazonBraketTask' and old class 'AWSBraketJob'

* formatting test_braket_job.py

* correcting definition of AWSBraketJob

* rewriting line 184 in braket_job.py

* adding class docstring to AWSBraketJob

* standard import 'from warnings import warn'  placed before 'from braket.aws import AwsQuantumTask' (wrong-import-order)

* docstring fix in test_braket_job.py

* assert the job id in test_AWS_job() function in test_braket_job.py

* running how to notebook #0

* running how to notebook #1

* running how to notebook #2

* running how to notebook #3

* running how to notebook number 5

* running tutorial  notebook number 3

* tutorial number 0
robotAstray added a commit to robotAstray/qiskit-braket-provider that referenced this pull request Jun 14, 2023
Replacing AWSBraketJob with AmazonBraketTask (qiskit-community#105)
robotAstray added a commit to robotAstray/qiskit-braket-provider that referenced this pull request Jun 14, 2023
* replacing AWSBraketJob with AmazonBraketTask

* run the notebooks containing AmazonBraketTask

* deprecation warning added for AWSBraketJob class

* formatting fixed

* re-add <JOB_ARN>

* fix breaking changes on /provider/__init__.py and __init__.py

* rename job_id to task_id argument for AmazonBraketTask()

* rename braket_jobs_states to braket_tasks_states

* add task_id method to access the task_id similar to the one we have in the JobV1 class

* adding tests for new class 'AmazonBraketTask' and old class 'AWSBraketJob'

* formatting test_braket_job.py

* correcting definition of AWSBraketJob

* rewriting line 184 in braket_job.py

* adding class docstring to AWSBraketJob

* standard import 'from warnings import warn'  placed before 'from braket.aws import AwsQuantumTask' (wrong-import-order)

* docstring fix in test_braket_job.py

* assert the job id in test_AWS_job() function in test_braket_job.py

* running how to notebook #0

* running how to notebook #1

* running how to notebook #2

* running how to notebook #3

* running how to notebook number 5

* running tutorial  notebook number 3

* tutorial number 0
robotAstray added a commit to robotAstray/qiskit-braket-provider that referenced this pull request Jun 14, 2023
* replacing AWSBraketJob with AmazonBraketTask

* run the notebooks containing AmazonBraketTask

* deprecation warning added for AWSBraketJob class

* formatting fixed

* re-add <JOB_ARN>

* fix breaking changes on /provider/__init__.py and __init__.py

* rename job_id to task_id argument for AmazonBraketTask()

* rename braket_jobs_states to braket_tasks_states

* add task_id method to access the task_id similar to the one we have in the JobV1 class

* adding tests for new class 'AmazonBraketTask' and old class 'AWSBraketJob'

* formatting test_braket_job.py

* correcting definition of AWSBraketJob

* rewriting line 184 in braket_job.py

* adding class docstring to AWSBraketJob

* standard import 'from warnings import warn'  placed before 'from braket.aws import AwsQuantumTask' (wrong-import-order)

* docstring fix in test_braket_job.py

* assert the job id in test_AWS_job() function in test_braket_job.py

* running how to notebook #0

* running how to notebook #1

* running how to notebook #2

* running how to notebook #3

* running how to notebook number 5

* running tutorial  notebook number 3

* tutorial number 0
robotAstray added a commit to robotAstray/qiskit-braket-provider that referenced this pull request Jun 14, 2023
* replacing AWSBraketJob with AmazonBraketTask

* run the notebooks containing AmazonBraketTask

* deprecation warning added for AWSBraketJob class

* formatting fixed

* re-add <JOB_ARN>

* fix breaking changes on /provider/__init__.py and __init__.py

* rename job_id to task_id argument for AmazonBraketTask()

* rename braket_jobs_states to braket_tasks_states

* add task_id method to access the task_id similar to the one we have in the JobV1 class

* adding tests for new class 'AmazonBraketTask' and old class 'AWSBraketJob'

* formatting test_braket_job.py

* correcting definition of AWSBraketJob

* rewriting line 184 in braket_job.py

* adding class docstring to AWSBraketJob

* standard import 'from warnings import warn'  placed before 'from braket.aws import AwsQuantumTask' (wrong-import-order)

* docstring fix in test_braket_job.py

* assert the job id in test_AWS_job() function in test_braket_job.py

* running how to notebook #0

* running how to notebook #1

* running how to notebook #2

* running how to notebook #3

* running how to notebook number 5

* running tutorial  notebook number 3

* tutorial number 0
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.

Rename AWSBraketJob to AmazonBraketTask
2 participants