-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #727 from padix-key/release-fix
Fix problems in current Biotite relase
- Loading branch information
Showing
5 changed files
with
40 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,29 @@ | ||
import os | ||
import numpy as np | ||
|
||
|
||
def setup_script(): | ||
""" | ||
Prepare API keys, formatting, etc. for running a tutorial or example script. | ||
""" | ||
# Import inside function as Biotite may not be known | ||
# at the time of function definition | ||
import biotite.application.blast as blast | ||
import biotite.database.entrez as entrez | ||
|
||
# Improve readability of large arrays | ||
np.set_printoptions(precision=2) | ||
|
||
# Use API key to increase request limit | ||
ncbi_api_key = os.environ.get("NCBI_API_KEY") | ||
if ncbi_api_key is not None and ncbi_api_key != "": | ||
entrez.set_api_key(ncbi_api_key) | ||
|
||
# Mock the BlastWebApp class | ||
# to allow subsequent BLAST calls when building the tutorial | ||
class MockedBlastApp(blast.BlastWebApp): | ||
def __init__(self, *args, **kwargs): | ||
kwargs["obey_rules"] = False | ||
super().__init__(*args, **kwargs) | ||
|
||
blast.BlastWebApp = MockedBlastApp |
This file contains 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,23 +1,7 @@ | ||
.. jupyter-execute:: | ||
.. jupyter-execute:: /preamble.py | ||
:hide-code: | ||
|
||
import os | ||
import numpy as np | ||
import biotite.database.entrez as entrez | ||
import biotite.application.blast as blast | ||
|
||
# Improve readability of large arrays | ||
np.set_printoptions(precision=2) | ||
|
||
# Use API key to increase request limit | ||
ncbi_api_key = os.environ.get("NCBI_API_KEY") | ||
if ncbi_api_key is not None and ncbi_api_key != "": | ||
entrez.set_api_key(ncbi_api_key) | ||
.. jupyter-execute:: | ||
:hide-code: | ||
|
||
# Mock the BlastWebApp class | ||
# to allow subsequent BLAST calls when building the tutorial | ||
class MockedBlastApp(blast.BlastWebApp): | ||
def __init__(self, *args, **kwargs): | ||
kwargs["obey_rules"] = False | ||
super().__init__(*args, **kwargs) | ||
blast.BlastWebApp = MockedBlastApp | ||
setup_script() |