-
Notifications
You must be signed in to change notification settings - Fork 0
✨ add bigbio/docs/output.md to documentation for releae 1.5.0 #2
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
65f33f7
:sparkles: add bigbio/docs/output.md to documentation (locally)
enryH a8942b3
:bug: fix import
enryH 1046be2
:bug: need to pass a function defined in scope so Sphinx obj can be p…
enryH 8a70bb3
:bug: add dummy parameter for sphinx object
enryH 8aa174f
🔖 add version 1.5.0 and comment on Sphinx extension
enryH 18bedcb
:art: patch headline for quantms output
enryH bb238b5
:art: add timeout to download function
enryH 9f13f4b
:art: ensure file has content, raises error if download fails
enryH 1454446
:art: only print sucess message once
enryH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# build artifacts | ||
_build | ||
# downloaded from bigbio/quantms | ||
quantms_output.md |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Contents | |
usage | ||
introduction | ||
formats | ||
quantms_output | ||
preprocessing | ||
identification | ||
dda | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import requests | ||
|
||
OUTPUT_URL = ( | ||
"https://github.com/bigbio/quantms/raw/refs/heads/README_links/docs/output.md" | ||
enryH marked this conversation as resolved.
Show resolved
Hide resolved
enryH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
enryH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
def download_file(url, save_path, timeout=20): | ||
""" | ||
Download a file from a URL and save it to the specified path. | ||
|
||
Args: | ||
url (str): URL of the file to download | ||
save_path (str): Path where the downloaded file will be saved | ||
timeout (int): Timeout for the download request in seconds | ||
|
||
Returns: | ||
bool: True if download was successful, False otherwise | ||
""" | ||
|
||
# Send GET request | ||
response = requests.get(url, stream=True, timeout=timeout) | ||
response.raise_for_status() # Raise exception for HTTP errors | ||
|
||
# Write content to file | ||
with open(save_path, "wb") as f: | ||
for chunk in response.iter_content(chunk_size=8192): | ||
f.write(chunk) | ||
|
||
print(f"Successfully downloaded: {url} to {save_path}") | ||
return True | ||
enryH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
def download_output(output_path="quantms_output.md"): | ||
""" | ||
Download the output file from the specified URL and save it locally to use | ||
for Sphinx documentation purposes. | ||
""" | ||
# new folders would need to be created if necessary | ||
enryH marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
assert download_file(OUTPUT_URL, output_path) # prints success message | ||
|
||
with open(output_path, "r") as f: | ||
content = f.readlines() | ||
|
||
assert len(content) > 0, "Downloaded file is empty" | ||
|
||
content[0] = "# quantms outputs\n" | ||
|
||
with open(output_path, "w") as f: | ||
f.writelines(content) | ||
|
||
|
||
if __name__ == "__main__": | ||
download_output() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
sphinx | ||
furo | ||
myst-nb | ||
sphinx-new-tab-link | ||
sphinx-copybutton |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Importing
setup_docs
by filename may fail if the module search path changes. Consider addingdocs
tosys.path
or using an explicit path insertion inconf.py
to ensure the import always works.Copilot uses AI. Check for mistakes.