geoseeq 0.5.6a11__tar.gz → 0.5.6a13__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/PKG-INFO +1 -1
  2. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/main.py +1 -1
  3. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/upload/upload.py +12 -4
  4. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/file_upload.py +6 -3
  5. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/upload_download_manager.py +23 -12
  6. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq.egg-info/PKG-INFO +1 -1
  7. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/pyproject.toml +1 -1
  8. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/LICENSE +0 -0
  9. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/README.md +0 -0
  10. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/__init__.py +0 -0
  11. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/app.py +0 -0
  12. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/blob_constructors.py +0 -0
  13. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/bulk_creators.py +0 -0
  14. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/__init__.py +0 -0
  15. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/constants.py +0 -0
  16. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/copy.py +0 -0
  17. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/detail.py +0 -0
  18. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/download.py +0 -0
  19. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/fastq_utils.py +0 -0
  20. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/get_eula.py +0 -0
  21. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/manage.py +0 -0
  22. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/progress_bar.py +0 -0
  23. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/run.py +0 -0
  24. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/search.py +0 -0
  25. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/shared_params/__init__.py +0 -0
  26. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/shared_params/common_state.py +0 -0
  27. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/shared_params/config.py +0 -0
  28. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/shared_params/id_handlers.py +0 -0
  29. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/shared_params/obj_getters.py +0 -0
  30. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/shared_params/opts_and_args.py +0 -0
  31. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/upload/__init__.py +0 -0
  32. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/upload/upload_advanced.py +0 -0
  33. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/upload/upload_reads.py +0 -0
  34. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/user.py +0 -0
  35. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/utils.py +0 -0
  36. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/cli/view.py +0 -0
  37. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/constants.py +0 -0
  38. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/contrib/__init__.py +0 -0
  39. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/contrib/ncbi/__init__.py +0 -0
  40. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/contrib/ncbi/api.py +0 -0
  41. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/contrib/ncbi/bioproject.py +0 -0
  42. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/contrib/ncbi/cli.py +0 -0
  43. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/contrib/ncbi/setup_logging.py +0 -0
  44. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/file_system_cache.py +0 -0
  45. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/__init__.py +0 -0
  46. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/from_blobs.py +0 -0
  47. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/from_ids.py +0 -0
  48. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/from_names.py +0 -0
  49. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/from_uuids.py +0 -0
  50. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/resolvers.py +0 -0
  51. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/id_constructors/utils.py +0 -0
  52. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/knex.py +0 -0
  53. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/organization.py +0 -0
  54. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/pipeline.py +0 -0
  55. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/__init__.py +0 -0
  56. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/constants.py +0 -0
  57. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/highcharts.py +0 -0
  58. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/map/__init__.py +0 -0
  59. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/map/base_layer.py +0 -0
  60. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/map/map.py +0 -0
  61. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/map/overlay.py +0 -0
  62. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/plotting/selectable.py +0 -0
  63. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/project.py +0 -0
  64. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/remote_object.py +0 -0
  65. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/__init__.py +0 -0
  66. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/bioinfo.py +0 -0
  67. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/file_download.py +0 -0
  68. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/result_file.py +0 -0
  69. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/result_folder.py +0 -0
  70. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/result/utils.py +0 -0
  71. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/sample.py +0 -0
  72. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/search.py +0 -0
  73. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/user.py +0 -0
  74. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/utils.py +0 -0
  75. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/__init__.py +0 -0
  76. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/checksum.py +0 -0
  77. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/cli.py +0 -0
  78. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/clone.py +0 -0
  79. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/constants.py +0 -0
  80. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/vc_cache.py +0 -0
  81. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/vc_dir.py +0 -0
  82. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/vc_sample.py +0 -0
  83. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/vc/vc_stub.py +0 -0
  84. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq/work_orders.py +0 -0
  85. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq.egg-info/SOURCES.txt +0 -0
  86. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq.egg-info/dependency_links.txt +0 -0
  87. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq.egg-info/entry_points.txt +0 -0
  88. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/geoseeq.egg-info/top_level.txt +0 -0
  89. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/setup.cfg +0 -0
  90. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/setup.py +0 -0
  91. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/tests/__init__.py +0 -0
  92. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/tests/test_api_client.py +0 -0
  93. {geoseeq-0.5.6a11 → geoseeq-0.5.6a13}/tests/test_plotting.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geoseeq
3
- Version: 0.5.6a11
3
+ Version: 0.5.6a13
4
4
  Summary: GeoSeeq command line tools and python API
5
5
  Author: David C. Danko
6
6
  Author-email: "David C. Danko" <dcdanko@biotia.io>
@@ -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.6a11') # remember to update setup
56
+ click.echo('0.5.6a13') # remember to update setup
57
57
 
58
58
 
59
59
  @main.group('advanced')
@@ -25,6 +25,7 @@ from geoseeq.cli.shared_params import (
25
25
  project_or_sample_id_arg,
26
26
  handle_project_or_sample_id,
27
27
  no_new_versions_option,
28
+ ignore_errors_option,
28
29
  )
29
30
  from geoseeq.upload_download_manager import GeoSeeqUploadManager
30
31
 
@@ -36,8 +37,10 @@ hidden_option = click.option('--hidden/--no-hidden', default=False, help='Upload
36
37
 
37
38
  @click.command('files')
38
39
  @use_common_state
39
- @click.option('--cores', default=1, help='Number of uploads to run in parallel')
40
- @click.option('--threads-per-upload', default=4, help='Number of threads used to upload each file')
40
+ @click.option('--cores', default=1, help='Number of uploads to run in parallel', show_default=True)
41
+ @click.option('--threads-per-upload', default=4, help='Number of threads used to upload each file', show_default=True)
42
+ @click.option('--num-retries', default=3, help='Number of times to retry a failed upload', show_default=True)
43
+ @ignore_errors_option
41
44
  @yes_option
42
45
  @private_option
43
46
  @link_option
@@ -45,10 +48,11 @@ hidden_option = click.option('--hidden/--no-hidden', default=False, help='Upload
45
48
  @hidden_option
46
49
  @no_new_versions_option
47
50
  @click.option('-n', '--geoseeq-file-name', default=None, multiple=True,
48
- help='Specify a different name for the file on GeoSeeq than the local file name.')
51
+ help='Specify a different name for the file on GeoSeeq than the local file name.',
52
+ show_default=True)
49
53
  @folder_id_arg
50
54
  @click.argument('file_paths', type=click.Path(exists=True), nargs=-1)
51
- def cli_upload_file(state, cores, threads_per_upload, yes, private, link_type, recursive, hidden, no_new_versions, geoseeq_file_name, folder_id, file_paths):
55
+ def cli_upload_file(state, cores, threads_per_upload, num_retries, ignore_errors, yes, private, link_type, recursive, hidden, no_new_versions, geoseeq_file_name, folder_id, file_paths):
52
56
  """Upload files to GeoSeeq.
53
57
 
54
58
  This command uploads files to either a sample or project on GeoSeeq. It can be used to upload
@@ -93,6 +97,8 @@ def cli_upload_file(state, cores, threads_per_upload, yes, private, link_type, r
93
97
 
94
98
  ---
95
99
  """
100
+ if num_retries < 1:
101
+ raise click.UsageError('--num-retries must be at least 1')
96
102
  knex = state.get_knex()
97
103
  result_folder = handle_folder_id(knex, folder_id, yes=yes, private=private, create=True)
98
104
  if geoseeq_file_name:
@@ -113,6 +119,8 @@ def cli_upload_file(state, cores, threads_per_upload, yes, private, link_type, r
113
119
  log_level=state.log_level,
114
120
  no_new_versions=no_new_versions,
115
121
  use_cache=state.use_cache,
122
+ num_retries=num_retries,
123
+ ignore_errors=ignore_errors,
116
124
  )
117
125
  for geoseeq_file_name, file_path in name_pairs:
118
126
  if isfile(file_path):
@@ -4,7 +4,7 @@ import json
4
4
  import os
5
5
  from os.path import basename, getsize, join, dirname, isfile, getctime
6
6
  from pathlib import Path
7
-
7
+ from random import random
8
8
  import requests
9
9
 
10
10
  from geoseeq.knex import GeoseeqGeneralError
@@ -188,9 +188,12 @@ class ResultFileUpload:
188
188
  f"Upload for part {num + 1} failed. Attempt {attempts + 1} of {max_retries}."
189
189
  )
190
190
  attempts += 1
191
- if attempts == max_retries:
191
+ if attempts >= max_retries:
192
192
  raise e
193
- time.sleep(10**attempts) # exponential backoff, (10 ** 2)s default max
193
+
194
+ retry_time = min(8 ** attempts, 120) # exponential backoff, max 120s
195
+ retry_time *= 0.8 + (random() * 0.4) # randomize to avoid thundering herd
196
+ time.sleep(retry_time)
194
197
 
195
198
  etag = http_response.headers["ETag"].replace('"', "")
196
199
  blob = {"ETag": etag, "PartNumber": num + 1}
@@ -21,19 +21,26 @@ def _make_in_process_logger(log_level):
21
21
  def _upload_one_file(args):
22
22
  (result_file, filepath, session, progress_tracker,
23
23
  link_type, overwrite, log_level, parallel_uploads,
24
- use_cache, no_new_versions, threads_per_upload) = args
24
+ use_cache, no_new_versions, threads_per_upload,
25
+ num_retries, ignore_errors) = args
25
26
  if parallel_uploads:
26
27
  _make_in_process_logger(log_level)
27
- if link_type == 'upload':
28
- # TODO: check checksums to see if the file is the same
29
- result_file.upload_file(
30
- filepath,
31
- session=session, overwrite=overwrite, progress_tracker=progress_tracker,
32
- threads=threads_per_upload, use_cache=use_cache,
33
- no_new_versions=no_new_versions
34
- )
35
- else:
36
- result_file.link_file(link_type, filepath)
28
+ try:
29
+ if link_type == 'upload':
30
+ # TODO: check checksums to see if the file is the same
31
+ result_file.upload_file(
32
+ filepath,
33
+ session=session, overwrite=overwrite, progress_tracker=progress_tracker,
34
+ threads=threads_per_upload, use_cache=use_cache,
35
+ no_new_versions=no_new_versions, max_retries=num_retries,
36
+ )
37
+ else:
38
+ result_file.link_file(link_type, filepath)
39
+ except Exception as e:
40
+ if ignore_errors:
41
+ logger.error(f"Error uploading {filepath}: {e}")
42
+ else:
43
+ raise e
37
44
  return result_file
38
45
 
39
46
 
@@ -48,6 +55,8 @@ class GeoSeeqUploadManager:
48
55
  log_level=logging.WARNING,
49
56
  overwrite=True,
50
57
  no_new_versions=False,
58
+ num_retries=3,
59
+ ignore_errors=False,
51
60
  use_cache=True):
52
61
  self.session = session
53
62
  self.n_parallel_uploads = n_parallel_uploads
@@ -59,6 +68,8 @@ class GeoSeeqUploadManager:
59
68
  self.no_new_versions = no_new_versions
60
69
  self.use_cache = use_cache
61
70
  self.threads_per_upload = threads_per_upload
71
+ self.num_retries = num_retries
72
+ self.ignore_errors = ignore_errors
62
73
 
63
74
  def add_result_file(self, result_file, local_path):
64
75
  self._result_files.append((result_file, local_path))
@@ -84,7 +95,7 @@ class GeoSeeqUploadManager:
84
95
  self.session, self.progress_tracker_factory(local_path),
85
96
  self.link_type, self.overwrite, self.log_level,
86
97
  self.n_parallel_uploads > 1, self.use_cache, self.no_new_versions,
87
- self.threads_per_upload
98
+ self.threads_per_upload, self.num_retries, self.ignore_errors
88
99
  ) for result_file, local_path in self._result_files
89
100
  ]
90
101
  out = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geoseeq
3
- Version: 0.5.6a11
3
+ Version: 0.5.6a13
4
4
  Summary: GeoSeeq command line tools and python API
5
5
  Author: David C. Danko
6
6
  Author-email: "David C. Danko" <dcdanko@biotia.io>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "geoseeq"
7
- version = "0.5.6a11"
7
+ version = "0.5.6a13"
8
8
  authors = [
9
9
  { name="David C. Danko", email="dcdanko@biotia.io" },
10
10
  ]
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