This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Improves Grover's Algorithm tutorials#1483
Merged
Eric-Arellano merged 5 commits intoQiskit:masterfrom Jul 26, 2023
Merged
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Merged
Collaborator
Eric-Arellano
left a comment
There was a problem hiding this comment.
How come all the diagrams changed? Should this PR only fix the deprecated link to the textbook?
Co-authored-by: Eric Arellano <[email protected]>
Contributor
Author
I have reran all the cells in my local machine so that would have changed all the diagrams into SVGs. That won't be a problem. Look at this comment to get more context. |
Contributor
Author
|
This PR is ready for Review |
Eric-Arellano
approved these changes
Jul 26, 2023
Eric-Arellano
pushed a commit
that referenced
this pull request
Jul 26, 2023
<!--⚠️ If you do not respect this template, your pull request will be closed.⚠️ Your pull request title should be short detailed and understandable for all.⚠️ If your pull request fixes an open issue, please link to the issue. ✅ I have added the tests to cover my changes. ✅ I have updated the documentation accordingly. ✅ I have read the CONTRIBUTING document. --> ### Summary I have coded a script which (when directory is specified) checks for the broken links in the Jupyter notebooks and tells its exact place and the error it shows. ``` import os import nbformat as nbf import re import requests # Code to populate file_list with relevant .ipynb files file_list = [] for root, dirs, files in os.walk("qiskit-tutorials/tutorials/"): for file in files: if file.endswith(".ipynb"): file_list.append(os.path.join(root, file)) # Including the relative path of the file INLINE_LINK_RE = re.compile(r'\[([^\]]+)\]\(([^)]+)\)') for file_path in file_list: try: with open(file_path) as file: nb = nbf.read(file, 4) except OSError as e: print(f"Error occurred while reading file: {file_path}") print("Error message:", str(e)) print() continue for cell in nb["cells"]: if cell["cell_type"] != "markdown": continue links = list(INLINE_LINK_RE.findall(cell["source"])) for link in links: if not link: continue link_text, link_url = link if link_url.lower().endswith(('.png', '.jpg', '.jpeg', '.gif')): continue # Skip image links try: response = requests.get(link_url) if response.status_code != 200: print(f"Broken link found in file: {file_path}") print(f"Link: {link_text}") print(f"URL: {link_url}") print("HTTP status code:", response.status_code) print() except requests.RequestException as e: print(f"Error occurred while checking link in file: {file_path}") print(f"Link: {link_text}") print(f"URL: {link_url}") print("Error message:", str(e)) print() ``` ### Details and comments This code is part of QAMP Project [Issues in Qiskit Tutorials #37](qiskit-advocate/qamp-spring-23#37) which can read many files at once and can find broken links with their exact position and error code it is showing. I ran this above code throughout the repo and checked each and every Jupyter notebook files, based on the output I have fixed many links. This PR is just the Last PR of the of project, which fixes the remaining broken links. All the other broken links are already fixed in the past PRs which are made throughout this project. #1445 #1446 #1467 #1483 #1484. This project also fixes #1402
ElePT
pushed a commit
to ElePT/qiskit-algorithms
that referenced
this pull request
Aug 17, 2023
<!--⚠️ If you do not respect this template, your pull request will be closed.⚠️ Your pull request title should be short detailed and understandable for all.⚠️ If your pull request fixes an open issue, please link to the issue. ✅ I have added the tests to cover my changes. ✅ I have updated the documentation accordingly. ✅ I have read the CONTRIBUTING document. --> ### Summary This PR will Improve [tutorials/algorithms/06_grover](https://qiskit.org/documentation/tutorials/algorithms/06_grover.html) ### Details and comments fixes Qiskit/qiskit-tutorials#1407 Part of Qiskit/qiskit-tutorials#1401 --------- Co-authored-by: Eric Arellano <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR will Improve tutorials/algorithms/06_grover
Details and comments
fixes #1407
Part of #1401