-
Notifications
You must be signed in to change notification settings - Fork 17
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 #122 from adaptyvbio/extra_dependency
Make some dependencies optional
- Loading branch information
Showing
11 changed files
with
244 additions
and
32 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 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,39 @@ | ||
{ | ||
"channeldata_version": 1, | ||
"packages": { | ||
"proteinflow": { | ||
"activate.d": false, | ||
"binary_prefix": false, | ||
"deactivate.d": false, | ||
"description": null, | ||
"dev_url": "https://github.com/adaptyvbio/ProteinFlow", | ||
"doc_source_url": null, | ||
"doc_url": "https://adaptyvbio.github.io/ProteinFlow/", | ||
"home": "https://github.com/adaptyvbio/ProteinFlow", | ||
"icon_hash": null, | ||
"icon_url": null, | ||
"identifiers": null, | ||
"keywords": null, | ||
"license": "BSD-3-Clause", | ||
"post_link": false, | ||
"pre_link": false, | ||
"pre_unlink": false, | ||
"recipe_origin": null, | ||
"run_exports": {}, | ||
"source_git_url": "https://github.com/adaptyvbio/ProteinFlow.git", | ||
"source_url": null, | ||
"subdirs": [ | ||
"linux-64" | ||
], | ||
"summary": "Versatile pipeline for processing protein structure data for deep learning applications.", | ||
"tags": null, | ||
"text_prefix": true, | ||
"timestamp": 1700064405, | ||
"version": "2.4.1" | ||
} | ||
}, | ||
"subdirs": [ | ||
"linux-64", | ||
"noarch" | ||
] | ||
} |
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,90 @@ | ||
<html> | ||
<head> | ||
<title>proteinflow</title> | ||
<style type="text/css"> | ||
a, a:active { | ||
text-decoration: none; color: blue; | ||
} | ||
a:visited { | ||
color: #48468F; | ||
} | ||
a:hover, a:focus { | ||
text-decoration: underline; color: red; | ||
} | ||
body { | ||
background-color: #F5F5F5; | ||
} | ||
h2 { | ||
margin-bottom: 12px; | ||
} | ||
th, td { | ||
font: 100% monospace; text-align: left; | ||
} | ||
th { | ||
font-weight: bold; padding-right: 14px; padding-bottom: 3px; | ||
} | ||
th.tight { | ||
padding-right: 6px; | ||
} | ||
td { | ||
padding-right: 14px; | ||
} | ||
td.tight { | ||
padding-right: 8px; | ||
} | ||
td.s, th.s { | ||
text-align: right; | ||
} | ||
td.summary { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
td.packagename { | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
max-width: 180px; | ||
padding-right: 8px; | ||
} | ||
td.version { | ||
//white-space: nowrap; | ||
overflow: hidden; | ||
max-width: 90px; | ||
padding-right: 8px; | ||
} | ||
table { | ||
background-color: white; | ||
border-top: 1px solid #646464; | ||
border-bottom: 1px solid #646464; | ||
padding-top: 10px; | ||
padding-bottom: 14px; | ||
} | ||
address { | ||
color: #787878; | ||
padding-top: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2>proteinflow</h2> | ||
<h3><a href="rss.xml">RSS Feed</a> <a href="channeldata.json">channeldata.json</a></h3> | ||
<a href="linux-64">linux-64</a> <a href="noarch">noarch</a> <table> | ||
<tr> | ||
<th style="padding-right:18px;">Package</th> | ||
<th>Latest Version</th> | ||
<th>Doc</th> | ||
<th>Dev</th> | ||
<th>License</th> | ||
<th class="tight">linux-64</th><th class="tight">noarch</th> <th>Summary</th> | ||
</tr> | ||
<tr> | ||
<td class="packagename"><a href="https://github.com/adaptyvbio/ProteinFlow" alt="proteinflow">proteinflow</a></td> | ||
<td class="version">2.4.1</td> | ||
<td><a href="https://adaptyvbio.github.io/ProteinFlow/">doc</a></td> | ||
<td><a href="https://github.com/adaptyvbio/ProteinFlow">dev</a></td> | ||
<td class="tight">BSD-3-Clause</td> | ||
<td>X</td><td></td> <td class="summary">Versatile pipeline for processing protein structure data for deep...</td> | ||
</tr> </table> | ||
<address>Updated: 2023-11-15 16:08:06 +0000 - Files: 1</address> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,7 @@ | |
"split": False, | ||
"cli": False, | ||
"ligand": False, | ||
"extra": False, | ||
} | ||
__docformat__ = "numpy" | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Handling optional dependencies.""" | ||
|
||
try: | ||
import py3Dmol | ||
except ImportError: | ||
pass | ||
|
||
import sys | ||
|
||
|
||
def requires_extra(module_name, install_name=None): | ||
"""Generate a decorator to require an optional dependency for the given function. | ||
Parameters | ||
---------- | ||
module_name : str | ||
Name of the module to check for | ||
install_name : str, optional | ||
Name of the module to install if it is not found. If not specified, `module_name` is used | ||
""" | ||
if install_name is None: | ||
install_name = module_name | ||
|
||
def decorator(func): | ||
def wrapper(*args, **kwargs): | ||
if module_name not in sys.modules: | ||
raise ImportError( | ||
f"{install_name} must be installed to use this function. " | ||
f"Install it with `pip install {install_name}` or together with most other optional dependencies with `pip install proteinflow[processing]`." | ||
) | ||
return func(*args, **kwargs) | ||
|
||
return wrapper | ||
|
||
return decorator | ||
|
||
|
||
@requires_extra("py3Dmol") | ||
def _get_view(canvas_size): | ||
return py3Dmol.view(width=canvas_size[0], height=canvas_size[1]) |
Oops, something went wrong.