-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrapper to upload a reference and fix bugs in search (#6)
- Loading branch information
Showing
4 changed files
with
95 additions
and
12 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,88 @@ | ||
from gypsum_client import cache_directory, rest_url, upload_directory | ||
|
||
__author__ = "Jayaram Kancherla" | ||
__copyright__ = "Jayaram Kancherla" | ||
__license__ = "MIT" | ||
|
||
|
||
def upload_reference( | ||
directory: str, | ||
name: str, | ||
version: str, | ||
package: str = "celldex", | ||
cache_dir: str = cache_directory(), | ||
deduplicate: bool = True, | ||
probation: bool = False, | ||
url: str = rest_url(), | ||
token: str = None, | ||
concurrent: int = 1, | ||
abort_failed: bool = True, | ||
): | ||
"""Upload the reference dataset to the gypsum bucket. | ||
This is a wrapper around | ||
:py:func:`~gypsum_client.upload_file_actions.upload_directory` | ||
specific to the `celldex` package. | ||
See Also: | ||
:py:func:`~gypsum_client.upload_file_actions.upload_directory`, | ||
to upload a directory to the gypsum backend. | ||
Args: | ||
Name: | ||
Reference dataset name. | ||
version: | ||
Version name for the reference. | ||
directory: | ||
Path to a directory containing the ``files`` to be uploaded. | ||
This directory is assumed to correspond to a version of an asset. | ||
cache_dir: | ||
Path to the cache for saving files, e.g., in | ||
:py:func:`~gypsum_client.save_operations.save_version`. | ||
Used to convert symbolic links to upload links,see | ||
:py:func:`~gypsum_client.prepare_directory_for_upload.prepare_directory_upload`. | ||
deduplicate: | ||
Whether the backend should attempt deduplication of ``files`` | ||
in the immediately previous version. | ||
Defaults to True. | ||
probation: | ||
Whether to perform a probational upload. | ||
Defaults to False. | ||
url: | ||
URL of the gypsum REST API. | ||
token: | ||
GitHub access token to authenticate to the gypsum REST API. | ||
concurrent: | ||
Number of concurrent downloads. | ||
Defaults to 1. | ||
abort_failed: | ||
Whether to abort the upload on any failure. | ||
Setting this to `False` can be helpful for diagnosing upload problems. | ||
Returns: | ||
`True` if successfull, otherwise `False`. | ||
""" | ||
return upload_directory( | ||
directory, | ||
package, | ||
name, | ||
version, | ||
cache_dir=cache_dir, | ||
deduplicate=deduplicate, | ||
probation=probation, | ||
url=url, | ||
token=token, | ||
concurrent=concurrent, | ||
abort_failed=abort_failed, | ||
) |
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