elements 3.3.0__tar.gz → 3.4.0__tar.gz
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.
- {elements-3.3.0/elements.egg-info → elements-3.4.0}/PKG-INFO +1 -1
- {elements-3.3.0 → elements-3.4.0}/elements/__init__.py +1 -1
- {elements-3.3.0 → elements-3.4.0}/elements/path.py +57 -5
- {elements-3.3.0 → elements-3.4.0/elements.egg-info}/PKG-INFO +1 -1
- elements-3.4.0/elements.egg-info/requires.txt +5 -0
- {elements-3.3.0 → elements-3.4.0}/requirements-optional.txt +0 -3
- elements-3.4.0/requirements.txt +5 -0
- elements-3.3.0/elements.egg-info/requires.txt +0 -1
- elements-3.3.0/requirements.txt +0 -1
- {elements-3.3.0 → elements-3.4.0}/LICENSE +0 -0
- {elements-3.3.0 → elements-3.4.0}/MANIFEST.in +0 -0
- {elements-3.3.0 → elements-3.4.0}/README.md +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/agg.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/checkpoint.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/config.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/counter.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/flags.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/fps.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/logger.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/plotting.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/printing.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/rwlock.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/timer.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/tree.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/usage.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/utils.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/uuid.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements/when.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements.egg-info/SOURCES.txt +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements.egg-info/dependency_links.txt +0 -0
- {elements-3.3.0 → elements-3.4.0}/elements.egg-info/top_level.txt +0 -0
- {elements-3.3.0 → elements-3.4.0}/setup.cfg +0 -0
- {elements-3.3.0 → elements-3.4.0}/setup.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/tests/test_basics.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/tests/test_flags.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/tests/test_path.py +0 -0
- {elements-3.3.0 → elements-3.4.0}/tests/test_tree.py +0 -0
|
@@ -166,7 +166,60 @@ class LocalPath(Path):
|
|
|
166
166
|
shutil.move(self, dest)
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
class
|
|
169
|
+
class GCSPath(Path):
|
|
170
|
+
|
|
171
|
+
__slots__ = ('_path',)
|
|
172
|
+
|
|
173
|
+
fs = None
|
|
174
|
+
|
|
175
|
+
def __init__(self, path):
|
|
176
|
+
path = str(path)
|
|
177
|
+
if not (path.startswith('/') or '://' in path):
|
|
178
|
+
path = os.path.abspath(os.path.expanduser(path))
|
|
179
|
+
super().__init__(path)
|
|
180
|
+
if not type(self).fs:
|
|
181
|
+
import gcsfs
|
|
182
|
+
type(self).fs = gcsfs.GCSFileSystem()
|
|
183
|
+
|
|
184
|
+
@contextlib.contextmanager
|
|
185
|
+
def open(self, mode='r'):
|
|
186
|
+
yield self.fs.open(str(self), mode)
|
|
187
|
+
|
|
188
|
+
def absolute(self):
|
|
189
|
+
return self
|
|
190
|
+
|
|
191
|
+
def glob(self, pattern):
|
|
192
|
+
for path in self.fs.glob(f'{str(self)}/{pattern}'):
|
|
193
|
+
yield type(self)(path)
|
|
194
|
+
|
|
195
|
+
def exists(self):
|
|
196
|
+
return self.fs.exists(str(self))
|
|
197
|
+
|
|
198
|
+
def isfile(self):
|
|
199
|
+
return self.fs.isfile(str(self))
|
|
200
|
+
|
|
201
|
+
def isdir(self):
|
|
202
|
+
return self.fs.isdir(str(self))
|
|
203
|
+
|
|
204
|
+
def mkdirs(self):
|
|
205
|
+
self.fs.makedirs(str(self), exist_ok=True)
|
|
206
|
+
|
|
207
|
+
def remove(self):
|
|
208
|
+
self.fs.rm(str(self), recursive=False)
|
|
209
|
+
|
|
210
|
+
def rmtree(self):
|
|
211
|
+
self.fs.rm(str(self), recursive=True)
|
|
212
|
+
|
|
213
|
+
def copy(self, dest):
|
|
214
|
+
dest = Path(dest)
|
|
215
|
+
self.fs.copy(str(self), str(dest), recursive=True)
|
|
216
|
+
|
|
217
|
+
def move(self, dest):
|
|
218
|
+
dest = Path(dest)
|
|
219
|
+
self.fs.mv(self, str(dest), recursive=True)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class TFPath(Path):
|
|
170
223
|
|
|
171
224
|
__slots__ = ('_path',)
|
|
172
225
|
|
|
@@ -220,7 +273,7 @@ class GFilePath(Path):
|
|
|
220
273
|
self.gfile.rmtree(str(self))
|
|
221
274
|
|
|
222
275
|
def copy(self, dest):
|
|
223
|
-
dest =
|
|
276
|
+
dest = Path(dest)
|
|
224
277
|
if self.isfile():
|
|
225
278
|
self.gfile.copy(str(self), str(dest), overwrite=True)
|
|
226
279
|
else:
|
|
@@ -232,12 +285,11 @@ class GFilePath(Path):
|
|
|
232
285
|
|
|
233
286
|
def move(self, dest):
|
|
234
287
|
dest = Path(dest)
|
|
235
|
-
if dest.isdir():
|
|
236
|
-
dest.rmtree()
|
|
237
288
|
self.gfile.rename(self, str(dest), overwrite=True)
|
|
238
289
|
|
|
239
290
|
|
|
240
291
|
Path.filesystems = [
|
|
241
|
-
(
|
|
292
|
+
(GCSPath, lambda path: path.startswith('gs://')),
|
|
293
|
+
(TFPath, lambda path: path.startswith('/cns/')),
|
|
242
294
|
(LocalPath, lambda path: True),
|
|
243
295
|
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
numpy
|
elements-3.3.0/requirements.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
numpy
|
|
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
|