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.
Files changed (37) hide show
  1. {elements-3.3.0/elements.egg-info → elements-3.4.0}/PKG-INFO +1 -1
  2. {elements-3.3.0 → elements-3.4.0}/elements/__init__.py +1 -1
  3. {elements-3.3.0 → elements-3.4.0}/elements/path.py +57 -5
  4. {elements-3.3.0 → elements-3.4.0/elements.egg-info}/PKG-INFO +1 -1
  5. elements-3.4.0/elements.egg-info/requires.txt +5 -0
  6. {elements-3.3.0 → elements-3.4.0}/requirements-optional.txt +0 -3
  7. elements-3.4.0/requirements.txt +5 -0
  8. elements-3.3.0/elements.egg-info/requires.txt +0 -1
  9. elements-3.3.0/requirements.txt +0 -1
  10. {elements-3.3.0 → elements-3.4.0}/LICENSE +0 -0
  11. {elements-3.3.0 → elements-3.4.0}/MANIFEST.in +0 -0
  12. {elements-3.3.0 → elements-3.4.0}/README.md +0 -0
  13. {elements-3.3.0 → elements-3.4.0}/elements/agg.py +0 -0
  14. {elements-3.3.0 → elements-3.4.0}/elements/checkpoint.py +0 -0
  15. {elements-3.3.0 → elements-3.4.0}/elements/config.py +0 -0
  16. {elements-3.3.0 → elements-3.4.0}/elements/counter.py +0 -0
  17. {elements-3.3.0 → elements-3.4.0}/elements/flags.py +0 -0
  18. {elements-3.3.0 → elements-3.4.0}/elements/fps.py +0 -0
  19. {elements-3.3.0 → elements-3.4.0}/elements/logger.py +0 -0
  20. {elements-3.3.0 → elements-3.4.0}/elements/plotting.py +0 -0
  21. {elements-3.3.0 → elements-3.4.0}/elements/printing.py +0 -0
  22. {elements-3.3.0 → elements-3.4.0}/elements/rwlock.py +0 -0
  23. {elements-3.3.0 → elements-3.4.0}/elements/timer.py +0 -0
  24. {elements-3.3.0 → elements-3.4.0}/elements/tree.py +0 -0
  25. {elements-3.3.0 → elements-3.4.0}/elements/usage.py +0 -0
  26. {elements-3.3.0 → elements-3.4.0}/elements/utils.py +0 -0
  27. {elements-3.3.0 → elements-3.4.0}/elements/uuid.py +0 -0
  28. {elements-3.3.0 → elements-3.4.0}/elements/when.py +0 -0
  29. {elements-3.3.0 → elements-3.4.0}/elements.egg-info/SOURCES.txt +0 -0
  30. {elements-3.3.0 → elements-3.4.0}/elements.egg-info/dependency_links.txt +0 -0
  31. {elements-3.3.0 → elements-3.4.0}/elements.egg-info/top_level.txt +0 -0
  32. {elements-3.3.0 → elements-3.4.0}/setup.cfg +0 -0
  33. {elements-3.3.0 → elements-3.4.0}/setup.py +0 -0
  34. {elements-3.3.0 → elements-3.4.0}/tests/test_basics.py +0 -0
  35. {elements-3.3.0 → elements-3.4.0}/tests/test_flags.py +0 -0
  36. {elements-3.3.0 → elements-3.4.0}/tests/test_path.py +0 -0
  37. {elements-3.3.0 → elements-3.4.0}/tests/test_tree.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elements
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: Building blocks for productive research.
5
5
  Home-page: http://github.com/danijar/elements
6
6
  Classifier: Intended Audience :: Science/Research
@@ -1,4 +1,4 @@
1
- __version__ = '3.3.0'
1
+ __version__ = '3.4.0'
2
2
 
3
3
  from .agg import Agg
4
4
  from .checkpoint import Checkpoint
@@ -166,7 +166,60 @@ class LocalPath(Path):
166
166
  shutil.move(self, dest)
167
167
 
168
168
 
169
- class GFilePath(Path):
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 = type(self)(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
- (GFilePath, lambda path: path.startswith('gs://')),
292
+ (GCSPath, lambda path: path.startswith('gs://')),
293
+ (TFPath, lambda path: path.startswith('/cns/')),
242
294
  (LocalPath, lambda path: True),
243
295
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elements
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: Building blocks for productive research.
5
5
  Home-page: http://github.com/danijar/elements
6
6
  Classifier: Intended Audience :: Science/Research
@@ -0,0 +1,5 @@
1
+ colored
2
+ gcsfs
3
+ numpy
4
+ psutil
5
+ ruamel.yaml
@@ -1,9 +1,6 @@
1
- colored
2
1
  gputil
3
2
  matplotlib
4
3
  mlflow
5
- psutil
6
4
  pytest
7
- ruamel.yaml
8
5
  tensorflow-cpu
9
6
  wandb
@@ -0,0 +1,5 @@
1
+ colored
2
+ gcsfs
3
+ numpy
4
+ psutil
5
+ ruamel.yaml
@@ -1 +0,0 @@
1
- numpy
@@ -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