geoseeq 0.5.6a5__tar.gz → 0.5.6a7__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/PKG-INFO +1 -1
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/main.py +1 -1
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/remote_object.py +9 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/file_download.py +29 -10
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq.egg-info/PKG-INFO +1 -1
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/pyproject.toml +1 -1
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/setup.py +1 -1
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/LICENSE +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/README.md +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/app.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/blob_constructors.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/bulk_creators.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/constants.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/copy.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/detail.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/download.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/fastq_utils.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/get_eula.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/manage.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/progress_bar.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/run.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/search.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/shared_params/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/shared_params/common_state.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/shared_params/config.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/shared_params/id_handlers.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/shared_params/obj_getters.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/shared_params/opts_and_args.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/upload/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/upload/upload.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/upload/upload_advanced.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/upload/upload_reads.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/user.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/utils.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/cli/view.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/constants.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/contrib/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/contrib/ncbi/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/contrib/ncbi/api.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/contrib/ncbi/bioproject.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/contrib/ncbi/cli.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/contrib/ncbi/setup_logging.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/file_system_cache.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/from_blobs.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/from_ids.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/from_names.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/from_uuids.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/resolvers.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/id_constructors/utils.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/knex.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/organization.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/pipeline.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/constants.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/highcharts.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/map/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/map/base_layer.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/map/map.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/map/overlay.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/plotting/selectable.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/project.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/bioinfo.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/file_upload.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/result_file.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/result_folder.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/result/utils.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/sample.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/search.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/upload_download_manager.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/user.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/utils.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/checksum.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/cli.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/clone.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/constants.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/vc_cache.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/vc_dir.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/vc_sample.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/vc/vc_stub.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq/work_orders.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq.egg-info/SOURCES.txt +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq.egg-info/dependency_links.txt +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq.egg-info/entry_points.txt +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/geoseeq.egg-info/top_level.txt +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/setup.cfg +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/tests/__init__.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/tests/test_api_client.py +0 -0
- {geoseeq-0.5.6a5 → geoseeq-0.5.6a7}/tests/test_plotting.py +0 -0
@@ -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.6a7') # remember to update setup
|
57
57
|
|
58
58
|
|
59
59
|
@main.group('advanced')
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import logging
|
2
|
+
from pandas import to_datetime
|
2
3
|
|
3
4
|
from requests.exceptions import HTTPError
|
4
5
|
|
@@ -57,6 +58,14 @@ class RemoteObject:
|
|
57
58
|
|
58
59
|
def cache_blob(self, blob):
|
59
60
|
return self.cache.cache_blob(self, blob)
|
61
|
+
|
62
|
+
@property
|
63
|
+
def updated_at_timestamp(self):
|
64
|
+
"""Return the updated_at field as a unix timestamp (in seconds).
|
65
|
+
|
66
|
+
timestamp from servercomes as a string: '2024-03-13T09:06:56.582551Z'
|
67
|
+
"""
|
68
|
+
return to_datetime(self.updated_at).timestamp()
|
60
69
|
|
61
70
|
def load_blob(self, blob, allow_overwrite=False):
|
62
71
|
logger.debug(f"Loading blob. {blob}")
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import urllib.request
|
3
3
|
import logging
|
4
4
|
import requests
|
5
|
-
from os.path import basename, getsize, join, isfile
|
5
|
+
from os.path import basename, getsize, join, isfile, getmtime
|
6
6
|
from pathlib import Path
|
7
7
|
from tempfile import NamedTemporaryFile
|
8
8
|
|
@@ -82,12 +82,30 @@ class ResultFileDownload:
|
|
82
82
|
return url
|
83
83
|
else:
|
84
84
|
return self.stored_data[key]
|
85
|
+
|
86
|
+
|
87
|
+
def _download_flag_path(self, filename, flag_suffix='.gs_downloaded'):
|
88
|
+
return filename + flag_suffix
|
89
|
+
|
90
|
+
def download_needs_update(self, filename, flag_suffix='.gs_downloaded', slack=5):
|
91
|
+
"""Return True if the file needs to be downloaded, False otherwise.
|
92
|
+
|
93
|
+
If either the file or the flag file does not exist, return True.
|
94
|
+
If the flag file is older than `updated_at` in the result, return True.
|
95
|
+
Otherwise, return False.
|
96
|
+
"""
|
97
|
+
if isfile(filename) and isfile(self._download_flag_path(filename, flag_suffix)):
|
98
|
+
if self.updated_at_timestamp - getmtime(self._download_flag_path(filename, flag_suffix)) > slack:
|
99
|
+
return True
|
100
|
+
return False
|
101
|
+
return True
|
85
102
|
|
86
103
|
def download(self, filename=None, flag_suffix='.gs_downloaded', cache=True, head=None, progress_tracker=None):
|
87
104
|
"""Return a local filepath to the file in this result. Download the file if necessary.
|
88
105
|
|
89
106
|
When the file is downloaded, it is cached in the result object. Subsequent calls to download
|
90
|
-
on this object will return the cached file unless cache=False is specified
|
107
|
+
on this object will return the cached file unless cache=False is specified or the file is updated
|
108
|
+
on the server.
|
91
109
|
|
92
110
|
A flag file is created when the file download is complete. Subsequent calls to download
|
93
111
|
will return the cached file if the flag file exists unless cache=False is specified.
|
@@ -101,13 +119,14 @@ class ResultFileDownload:
|
|
101
119
|
filename = self._cached_filename
|
102
120
|
|
103
121
|
blob_type = self.stored_data.get("__type__", "").lower()
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
122
|
+
needs_update = self.download_needs_update(filename, flag_suffix)
|
123
|
+
if not needs_update:
|
124
|
+
if cache and self._cached_filename:
|
125
|
+
return self._cached_filename
|
126
|
+
if cache and flag_suffix:
|
127
|
+
# check if file and flag file exist, if so, return filename
|
128
|
+
if isfile(filename) and isfile(self._download_flag_path(filename, flag_suffix)):
|
129
|
+
return filename
|
111
130
|
|
112
131
|
url = self.get_download_url()
|
113
132
|
filepath = download_url(
|
@@ -116,7 +135,7 @@ class ResultFileDownload:
|
|
116
135
|
)
|
117
136
|
if cache and flag_suffix:
|
118
137
|
# create flag file
|
119
|
-
open(
|
138
|
+
open(self._download_flag_path(filename, flag_suffix), 'a').close()
|
120
139
|
if cache:
|
121
140
|
self._cached_filename = filepath
|
122
141
|
return filepath
|
@@ -5,7 +5,7 @@ import setuptools
|
|
5
5
|
|
6
6
|
setuptools.setup(
|
7
7
|
name='geoseeq',
|
8
|
-
version='0.5.
|
8
|
+
version='0.5.6a7', # remember to update version string in CLI as well
|
9
9
|
author="David C. Danko",
|
10
10
|
author_email='dcdanko@biotia.io',
|
11
11
|
description=open('README.md').read(),
|
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
|