geoseeq 0.5.6a9__tar.gz → 0.5.6a10__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/PKG-INFO +1 -1
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/download.py +8 -3
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/main.py +1 -1
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/file_upload.py +12 -6
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq.egg-info/PKG-INFO +1 -1
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/pyproject.toml +1 -1
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/LICENSE +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/README.md +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/app.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/blob_constructors.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/bulk_creators.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/constants.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/copy.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/detail.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/fastq_utils.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/get_eula.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/manage.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/progress_bar.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/run.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/search.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/shared_params/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/shared_params/common_state.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/shared_params/config.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/shared_params/id_handlers.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/shared_params/obj_getters.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/shared_params/opts_and_args.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/upload/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/upload/upload.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/upload/upload_advanced.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/upload/upload_reads.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/user.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/utils.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/cli/view.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/constants.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/contrib/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/contrib/ncbi/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/contrib/ncbi/api.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/contrib/ncbi/bioproject.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/contrib/ncbi/cli.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/contrib/ncbi/setup_logging.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/file_system_cache.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/from_blobs.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/from_ids.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/from_names.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/from_uuids.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/resolvers.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/id_constructors/utils.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/knex.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/organization.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/pipeline.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/constants.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/highcharts.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/map/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/map/base_layer.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/map/map.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/map/overlay.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/plotting/selectable.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/project.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/remote_object.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/bioinfo.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/file_download.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/result_file.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/result_folder.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/result/utils.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/sample.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/search.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/upload_download_manager.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/user.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/utils.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/checksum.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/cli.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/clone.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/constants.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/vc_cache.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/vc_dir.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/vc_sample.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/vc/vc_stub.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq/work_orders.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq.egg-info/SOURCES.txt +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq.egg-info/dependency_links.txt +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq.egg-info/entry_points.txt +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/geoseeq.egg-info/top_level.txt +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/setup.cfg +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/setup.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/tests/__init__.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/tests/test_api_client.py +0 -0
- {geoseeq-0.5.6a9 → geoseeq-0.5.6a10}/tests/test_plotting.py +0 -0
@@ -97,13 +97,14 @@ def cli_download_metadata(state, sample_ids):
|
|
97
97
|
|
98
98
|
|
99
99
|
cores_option = click.option('--cores', default=1, help='Number of downloads to run in parallel')
|
100
|
-
|
100
|
+
head_option = click.option('--head', default=None, type=int, help='Download the first N bytes of each file')
|
101
101
|
|
102
102
|
@cli_download.command("files")
|
103
103
|
@use_common_state
|
104
104
|
@cores_option
|
105
105
|
@click.option("--target-dir", default=".")
|
106
106
|
@yes_option
|
107
|
+
@head_option
|
107
108
|
@click.option("--download/--urls-only", default=True, help="Download files or just print urls")
|
108
109
|
@click.option("--folder-type", type=click.Choice(['all', 'sample', 'project'], case_sensitive=False), default="all", help='Download files from sample folders, project folders, or both')
|
109
110
|
@click.option("--folder-name", multiple=True, help='Filter folders for names that include this string. Case insensitive.')
|
@@ -120,6 +121,7 @@ def cli_download_files(
|
|
120
121
|
sample_name_includes,
|
121
122
|
target_dir,
|
122
123
|
yes,
|
124
|
+
head,
|
123
125
|
folder_type,
|
124
126
|
folder_name,
|
125
127
|
file_name,
|
@@ -213,6 +215,7 @@ def cli_download_files(
|
|
213
215
|
ignore_errors=ignore_errors,
|
214
216
|
log_level=state.log_level,
|
215
217
|
progress_tracker_factory=PBarManager().get_new_bar,
|
218
|
+
head=head,
|
216
219
|
)
|
217
220
|
for fname, url in response["links"].items():
|
218
221
|
download_manager.add_download(url, join(target_dir, fname))
|
@@ -230,11 +233,12 @@ def cli_download_files(
|
|
230
233
|
@cores_option
|
231
234
|
@click.option("-t", "--target-dir", default=".")
|
232
235
|
@yes_option
|
236
|
+
@head_option
|
233
237
|
@click.option("--download/--urls-only", default=True, help="Download files or just print urls")
|
234
238
|
@ignore_errors_option
|
235
239
|
@click.option('--hidden/--no-hidden', default=True, help='Download hidden files in folder')
|
236
240
|
@folder_ids_arg
|
237
|
-
def cli_download_folders(state, cores, target_dir, yes, download, ignore_errors, hidden, folder_ids):
|
241
|
+
def cli_download_folders(state, cores, target_dir, yes, head, download, ignore_errors, hidden, folder_ids):
|
238
242
|
"""Download entire folders from GeoSeeq.
|
239
243
|
|
240
244
|
This command downloads folders directly based on their ID. This is used for "manual"
|
@@ -267,6 +271,7 @@ def cli_download_folders(state, cores, target_dir, yes, download, ignore_errors,
|
|
267
271
|
ignore_errors=ignore_errors,
|
268
272
|
log_level=state.log_level,
|
269
273
|
progress_tracker_factory=PBarManager().get_new_bar,
|
274
|
+
head=head,
|
270
275
|
)
|
271
276
|
for result_folder in result_folders:
|
272
277
|
download_manager.add_result_folder_download(
|
@@ -286,7 +291,7 @@ def cli_download_folders(state, cores, target_dir, yes, download, ignore_errors,
|
|
286
291
|
@click.option("-n", "--file-name", multiple=True, help="File name to use for downloaded files. If set you must specify once per ID.")
|
287
292
|
@yes_option
|
288
293
|
@click.option("--download/--urls-only", default=True, help="Download files or just print urls")
|
289
|
-
@
|
294
|
+
@head_option
|
290
295
|
@ignore_errors_option
|
291
296
|
@click.argument("ids", nargs=-1)
|
292
297
|
def cli_download_ids(state, cores, target_dir, file_name, yes, download, head, ignore_errors, ids):
|
@@ -53,7 +53,7 @@ def version():
|
|
53
53
|
Use of this tool implies acceptance of the GeoSeeq End User License Agreement.
|
54
54
|
Run `geoseeq eula show` to view the EULA.
|
55
55
|
"""
|
56
|
-
click.echo('0.5.
|
56
|
+
click.echo('0.5.6a10') # remember to update setup
|
57
57
|
|
58
58
|
|
59
59
|
@main.group('advanced')
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import time
|
3
3
|
import json
|
4
4
|
import os
|
5
|
-
from os.path import basename, getsize, join, dirname, isfile
|
5
|
+
from os.path import basename, getsize, join, dirname, isfile, getctime
|
6
6
|
from pathlib import Path
|
7
7
|
|
8
8
|
import requests
|
@@ -49,7 +49,7 @@ class ResumableUploadTracker:
|
|
49
49
|
self.filepath = filepath
|
50
50
|
self.tracker_file = join(
|
51
51
|
GEOSEEQ_CACHE_DIR, 'upload',
|
52
|
-
tracker_file_prefix + f".{chunk_size}." + basename(filepath)
|
52
|
+
tracker_file_prefix + f".{chunk_size}.{getsize(filepath)}." + basename(filepath)
|
53
53
|
)
|
54
54
|
try:
|
55
55
|
os.makedirs(dirname(self.tracker_file), exist_ok=True)
|
@@ -64,7 +64,7 @@ class ResumableUploadTracker:
|
|
64
64
|
return
|
65
65
|
if self.upload_started:
|
66
66
|
raise GeoseeqGeneralError("Upload has already started.")
|
67
|
-
blob = dict(upload_id=upload_id, urls=urls)
|
67
|
+
blob = dict(upload_id=upload_id, urls=urls, start_time=time.time())
|
68
68
|
serialized = json.dumps(blob)
|
69
69
|
with open(self.tracker_file, "w") as f:
|
70
70
|
f.write(serialized + "\n")
|
@@ -89,6 +89,11 @@ class ResumableUploadTracker:
|
|
89
89
|
with open(self.tracker_file, "r") as f:
|
90
90
|
header_blob = json.loads(f.readline())
|
91
91
|
self.upload_id, self.urls = header_blob["upload_id"], header_blob["urls"]
|
92
|
+
start_time = header_blob["start_time"]
|
93
|
+
if (time.time() - start_time) > (60 * 60 * 23):
|
94
|
+
logger.warning(f"Tracker file {self.tracker_file} is too old. Deleting.")
|
95
|
+
os.remove(self.tracker_file)
|
96
|
+
return
|
92
97
|
self.upload_started = True
|
93
98
|
for line in f:
|
94
99
|
blob = json.loads(line)
|
@@ -161,14 +166,15 @@ class ResultFileUpload:
|
|
161
166
|
http_response.raise_for_status()
|
162
167
|
logger.debug(f"Upload for part {num + 1} succeeded.")
|
163
168
|
break
|
164
|
-
except requests.exceptions.HTTPError:
|
165
|
-
logger.
|
169
|
+
except (requests.exceptions.HTTPError, requests.exceptions.SSLError, requests.exceptions.ConnectionError) as e:
|
170
|
+
logger.debug(
|
166
171
|
f"Upload for part {num + 1} failed. Attempt {attempts + 1} of {max_retries}."
|
167
172
|
)
|
168
173
|
attempts += 1
|
169
174
|
if attempts == max_retries:
|
170
|
-
raise
|
175
|
+
raise e
|
171
176
|
time.sleep(10**attempts) # exponential backoff, (10 ** 2)s default max
|
177
|
+
|
172
178
|
etag = http_response.headers["ETag"].replace('"', "")
|
173
179
|
blob = {"ETag": etag, "PartNumber": num + 1}
|
174
180
|
if resumable_upload_tracker:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|