geoseeq 0.6.12.dev1__py3-none-any.whl → 0.6.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geoseeq/cli/main.py +1 -1
- geoseeq/id_constructors/from_ids.py +4 -0
- geoseeq/knex.py +4 -0
- geoseeq/upload_download_manager.py +17 -17
- {geoseeq-0.6.12.dev1.dist-info → geoseeq-0.6.13.dist-info}/METADATA +1 -1
- {geoseeq-0.6.12.dev1.dist-info → geoseeq-0.6.13.dist-info}/RECORD +10 -10
- {geoseeq-0.6.12.dev1.dist-info → geoseeq-0.6.13.dist-info}/LICENSE +0 -0
- {geoseeq-0.6.12.dev1.dist-info → geoseeq-0.6.13.dist-info}/WHEEL +0 -0
- {geoseeq-0.6.12.dev1.dist-info → geoseeq-0.6.13.dist-info}/entry_points.txt +0 -0
- {geoseeq-0.6.12.dev1.dist-info → geoseeq-0.6.13.dist-info}/top_level.txt +0 -0
geoseeq/cli/main.py
CHANGED
@@ -54,7 +54,7 @@ def version():
|
|
54
54
|
Use of this tool implies acceptance of the GeoSeeq End User License Agreement.
|
55
55
|
Run `geoseeq eula show` to view the EULA.
|
56
56
|
"""
|
57
|
-
click.echo('0.6.
|
57
|
+
click.echo('0.6.13') # remember to update pyproject.toml
|
58
58
|
|
59
59
|
|
60
60
|
@main.group('advanced')
|
@@ -1,4 +1,5 @@
|
|
1
1
|
from geoseeq import GeoseeqNotFoundError
|
2
|
+
import logging
|
2
3
|
from .from_uuids import (
|
3
4
|
org_from_uuid,
|
4
5
|
project_from_uuid,
|
@@ -24,9 +25,12 @@ from .from_names import (
|
|
24
25
|
from .utils import is_grn_or_uuid, is_name
|
25
26
|
from geoseeq.knex import with_knex
|
26
27
|
|
28
|
+
logger = logging.getLogger("geoseeq_api") # Same name as calling module
|
29
|
+
|
27
30
|
|
28
31
|
def _generic_from_id(knex, id, from_uuid_func, from_name_func):
|
29
32
|
"""Return the object which the id points to."""
|
33
|
+
logger.debug(f'Getting object from id: {id}, knex: {knex}, from_uuid_func: {from_uuid_func}, from_name_func: {from_name_func}')
|
30
34
|
if is_grn_or_uuid(id):
|
31
35
|
id = id.split(':')[-1] # if this is a GRN, get the UUID. Won't hurt if it's already a UUID.
|
32
36
|
return from_uuid_func(knex, id)
|
geoseeq/knex.py
CHANGED
@@ -222,16 +222,20 @@ class Knex:
|
|
222
222
|
def with_knex(func):
|
223
223
|
def wrapper(*args, **kwargs):
|
224
224
|
# check if any of the arguments are a knex instance
|
225
|
+
logger.debug(f"Checking for knex in args: {args}, kwargs: {kwargs}")
|
225
226
|
any_knex = any([isinstance(arg, Knex) for arg in args])
|
226
227
|
if any_knex:
|
228
|
+
logger.debug("knex found in args args: {args}, kwargs: {kwargs}")
|
227
229
|
return func(*args, **kwargs)
|
228
230
|
else:
|
231
|
+
logger.debug("knex not found in args args: {args}, kwargs: {kwargs}")
|
229
232
|
varnames = [
|
230
233
|
varname for varname in func.__code__.co_varnames
|
231
234
|
if varname != "knex"
|
232
235
|
]
|
233
236
|
kwargs.update(zip(varnames, args))
|
234
237
|
if "knex" not in kwargs:
|
238
|
+
logger.debug("knex not found in kwargs args: {args}, kwargs: {kwargs}")
|
235
239
|
profile = kwargs.pop("profile", "")
|
236
240
|
kwargs['knex'] = Knex.load_profile(profile=profile)
|
237
241
|
# reorder kwargs to match the function signature
|
@@ -127,22 +127,21 @@ class GeoSeeqUploadManager:
|
|
127
127
|
|
128
128
|
|
129
129
|
def _download_one_file(args):
|
130
|
-
|
130
|
+
url, file_path, key, callback, pbar, ignore_errors, head, log_level, parallel_downloads = args
|
131
131
|
if parallel_downloads:
|
132
132
|
_make_in_process_logger(log_level)
|
133
|
-
if
|
134
|
-
|
133
|
+
if dirname(file_path):
|
134
|
+
makedirs(dirname(file_path), exist_ok=True)
|
135
|
+
if isinstance(url, ResultFile):
|
136
|
+
local_path = url.download(filename=file_path, progress_tracker=pbar, head=head)
|
135
137
|
else:
|
136
|
-
url = original_url
|
137
|
-
try:
|
138
|
-
if dirname(file_path):
|
139
|
-
makedirs(dirname(file_path), exist_ok=True)
|
140
138
|
local_path = download_url(url, filename=file_path, progress_tracker=pbar, head=head)
|
139
|
+
try:
|
141
140
|
if callback is not None:
|
142
141
|
callback_result = callback(local_path)
|
143
142
|
else:
|
144
143
|
callback_result = None
|
145
|
-
return local_path,
|
144
|
+
return local_path, key, callback_result
|
146
145
|
except Exception as e:
|
147
146
|
if ignore_errors:
|
148
147
|
logger.error(f"Error downloading {url}: {e}")
|
@@ -161,13 +160,13 @@ class GeoSeeqDownloadManager:
|
|
161
160
|
self._result_files = []
|
162
161
|
|
163
162
|
|
164
|
-
def add_download(self, url, file_path=None, progress_tracker=None, callback=None):
|
163
|
+
def add_download(self, url, file_path=None, progress_tracker=None, callback=None, key=None):
|
165
164
|
if not file_path:
|
166
165
|
if isinstance(url, ResultFile):
|
167
166
|
file_path = url.get_local_filename()
|
168
167
|
else:
|
169
168
|
raise ValueError("file_path must be provided if url is not a ResultFile object.")
|
170
|
-
self._result_files.append((url, file_path, callback))
|
169
|
+
self._result_files.append((url, file_path, key, callback))
|
171
170
|
|
172
171
|
|
173
172
|
def add_result_folder_download(self, result_folder, local_folder_path, hidden_files=True):
|
@@ -178,14 +177,14 @@ class GeoSeeqDownloadManager:
|
|
178
177
|
|
179
178
|
def get_preview_string(self):
|
180
179
|
out = ["Download Preview:"]
|
181
|
-
for url, file_path, _ in self._result_files:
|
180
|
+
for url, file_path, _, _ in self._result_files:
|
182
181
|
out.append(f"{url} -> {file_path}")
|
183
182
|
return "\n".join(out)
|
184
183
|
|
185
184
|
def get_url_string(self):
|
186
185
|
self._convert_result_files_to_urls()
|
187
186
|
out = []
|
188
|
-
for url, _, _ in self._result_files:
|
187
|
+
for url, _, _, _ in self._result_files:
|
189
188
|
out.append(url)
|
190
189
|
return "\n".join(out)
|
191
190
|
|
@@ -195,23 +194,24 @@ class GeoSeeqDownloadManager:
|
|
195
194
|
def _convert_result_files_to_urls(self):
|
196
195
|
self._result_files = [(
|
197
196
|
url.get_download_url() if isinstance(url, ResultFile) else url,
|
198
|
-
url, # original url
|
199
197
|
file_path,
|
198
|
+
key,
|
200
199
|
callback
|
201
|
-
) for url, file_path, callback in self._result_files]
|
200
|
+
) for url, file_path, key, callback in self._result_files]
|
202
201
|
|
203
202
|
def download_files(self):
|
204
|
-
"""Return a list of 3-ples (local_path,
|
203
|
+
"""Return a list of 3-ples (local_path, key, callback_result).
|
205
204
|
|
205
|
+
If no key was provided the key is None
|
206
206
|
If no callback was provided with the file callback result is None
|
207
207
|
"""
|
208
208
|
self._convert_result_files_to_urls()
|
209
209
|
download_args = [(
|
210
|
-
url,
|
210
|
+
url, file_path, key, callback,
|
211
211
|
self.progress_tracker_factory(file_path),
|
212
212
|
self.ignore_errors, self.head, self.log_level,
|
213
213
|
self.n_parallel_downloads > 1
|
214
|
-
) for url,
|
214
|
+
) for url, file_path, key, callback in self._result_files]
|
215
215
|
out = []
|
216
216
|
if self.n_parallel_downloads == 1:
|
217
217
|
logger.info(f"Downloading files in series.")
|
@@ -4,14 +4,14 @@ geoseeq/blob_constructors.py,sha256=AkWpDQY0EdGMxF1p6eRspyHKubcUdiW4it-_Q7S2QWk,
|
|
4
4
|
geoseeq/bulk_creators.py,sha256=pdn-Dv7yv5SFv-PfDuQbuOnw2W4-BfIfRJVRAhM8U6s,2115
|
5
5
|
geoseeq/constants.py,sha256=z_ninEd7WsS5DaLntdR-sqAFib6Ie22jlhPKzLvLerw,449
|
6
6
|
geoseeq/file_system_cache.py,sha256=HzVZWtwLD2fjWWSo_UfWmGeBltm9He4lP_OqzKwNGWg,4138
|
7
|
-
geoseeq/knex.py,sha256=
|
7
|
+
geoseeq/knex.py,sha256=zcjafsmUn9SC3LlRnvvaXpr-pHYZ0IXk7LpzuUoE3MI,8312
|
8
8
|
geoseeq/organization.py,sha256=bJkYL8_D-k6IYAaii2ZbxjwYnXy6lvu6iLXscxKlA3w,2542
|
9
9
|
geoseeq/pipeline.py,sha256=89mhWaecsKnm6tyRkdkaVp4dmZh62_v42Ze0oXf8OTY,9873
|
10
10
|
geoseeq/project.py,sha256=kN6m1N4Tlud7saU03Sbir-oIBnXet_Cwi2OVVdaeag0,13929
|
11
11
|
geoseeq/remote_object.py,sha256=GYN6PKU7Zz3htIdpFjfZiFejzGqqJHbJyKlefM1Eixk,7151
|
12
12
|
geoseeq/sample.py,sha256=nlvmSy2WmiOMamkulNRloFPX7E9jVs34m1vO1PSOrHU,8336
|
13
13
|
geoseeq/search.py,sha256=gawad6Cx5FxJBPlYkXWb-UKAO-UC0_yhvyU9Ca1kaNI,3388
|
14
|
-
geoseeq/upload_download_manager.py,sha256=
|
14
|
+
geoseeq/upload_download_manager.py,sha256=TCdTKtQTPIakVuvpXa0OHgOBy7mtV0gHBqHDJYc2UO0,9361
|
15
15
|
geoseeq/user.py,sha256=tol8i1UGLRrbMw5jeJDnna1ikRgrCDd50Jxz0a1lSgg,690
|
16
16
|
geoseeq/utils.py,sha256=ZXpWb2MetUIeLrExiXb7IaOXYrW1pvrdP3o0KWzbwCs,4035
|
17
17
|
geoseeq/work_orders.py,sha256=5uLVVfdKE8qh4gGaHkdBpXJGRTujuSg59knWCqEET4A,8071
|
@@ -22,7 +22,7 @@ geoseeq/cli/detail.py,sha256=q8Suu-j2k18knfSVFG-SWWGNsKM-n8y9RMA3LcIIi9Y,4132
|
|
22
22
|
geoseeq/cli/download.py,sha256=W3OswqpHg1thzW6CJ7IcSS0Te2LA2WfgYISQMSl4GQg,18921
|
23
23
|
geoseeq/cli/fastq_utils.py,sha256=-bmeQLaiMBm57zWOF0R5OlWTU0_3sh1JBC1RYw2BOFM,3083
|
24
24
|
geoseeq/cli/get_eula.py,sha256=79mbUwyiF7O1r0g6UTxG9kJGQEqKuH805E6eLkPC6Y4,997
|
25
|
-
geoseeq/cli/main.py,sha256=
|
25
|
+
geoseeq/cli/main.py,sha256=3ocIYX6j1YMNFqxXoLCbcfFdUubBC06r1y-c6g0bIak,3918
|
26
26
|
geoseeq/cli/manage.py,sha256=wGXAcVaXqE5JQEU8Jh6OlHr02nB396bpS_SFcOZdrEo,5929
|
27
27
|
geoseeq/cli/progress_bar.py,sha256=p1Xl01nkYxSBZCB30ue2verIIi22W93m3ZAMAxipD0g,738
|
28
28
|
geoseeq/cli/project.py,sha256=V5SdXm2Hwo2lxrkpwRDedw-mAE4XnM2uwT-Gj1D90VQ,3030
|
@@ -50,7 +50,7 @@ geoseeq/contrib/ncbi/cli.py,sha256=j9zEcaZPTryK3a4xluRxigcJKDhRpRxbp3KZSx-Bfhk,2
|
|
50
50
|
geoseeq/contrib/ncbi/setup_logging.py,sha256=Tp1bY1U0f-o739aHpvVYriG2qdd1lFvCYBXZeXQgt-w,175
|
51
51
|
geoseeq/id_constructors/__init__.py,sha256=w5E0PNQ9UuAxBeZbDI7KBnUoERd85gGz3nScz45bd2o,126
|
52
52
|
geoseeq/id_constructors/from_blobs.py,sha256=aj7M7NRpKGs3u3xUvuFJwmJdFeIcJPmaI2_bhwbFfEs,5702
|
53
|
-
geoseeq/id_constructors/from_ids.py,sha256=
|
53
|
+
geoseeq/id_constructors/from_ids.py,sha256=vwv_R1uZ5hdeUvpKmNLOTz02PCvwfd6yQ7aAXqi0hZo,3372
|
54
54
|
geoseeq/id_constructors/from_names.py,sha256=RqgFjDsAwQcidMkZwX7oB00OvBAKTiilHYetTPogJ40,4174
|
55
55
|
geoseeq/id_constructors/from_uuids.py,sha256=5NrQoRBNBfiB48SIB6QFZvO0lxNrxAHbu1MDkNRSu_4,3305
|
56
56
|
geoseeq/id_constructors/resolvers.py,sha256=8hp5xJSCoZrAXtMT54Hp4okt63l909XqJU3IQx-VCgc,2676
|
@@ -85,9 +85,9 @@ geoseeq/vc/vc_stub.py,sha256=IQr8dI0zsWKVAeY_5ybDD6n49_3othcgfHS3P0O9tuY,3110
|
|
85
85
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
86
86
|
tests/test_api_client.py,sha256=TS5njc5pcPP_Ycy-ljcfPVT1hQRBsFVdQ0lCqBmoesU,12810
|
87
87
|
tests/test_plotting.py,sha256=TcTu-2ARr8sxZJ7wPQxmbs3-gHw7uRvsgrhhhg0qKik,784
|
88
|
-
geoseeq-0.6.
|
89
|
-
geoseeq-0.6.
|
90
|
-
geoseeq-0.6.
|
91
|
-
geoseeq-0.6.
|
92
|
-
geoseeq-0.6.
|
93
|
-
geoseeq-0.6.
|
88
|
+
geoseeq-0.6.13.dist-info/LICENSE,sha256=IuhIl1XCxXLPLJT_coN1CNqQU4Khlq7x4IdW7ioOJD8,1067
|
89
|
+
geoseeq-0.6.13.dist-info/METADATA,sha256=yt0Gn0_0cxRUm4UuiWaDm_uF2epCCktxslPiD3S6Bd4,4932
|
90
|
+
geoseeq-0.6.13.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
91
|
+
geoseeq-0.6.13.dist-info/entry_points.txt,sha256=yF-6KDM8zXib4Al0qn49TX-qM7PUkWUIcYtsgt36rjM,45
|
92
|
+
geoseeq-0.6.13.dist-info/top_level.txt,sha256=zZk7mmeaqAYqFJG8nq2DTgSQPbflRjJwkDIhNURPDEU,14
|
93
|
+
geoseeq-0.6.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|