elements 3.9.2__tar.gz → 3.9.4__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.9.2/elements.egg-info → elements-3.9.4}/PKG-INFO +1 -1
  2. {elements-3.9.2 → elements-3.9.4}/elements/__init__.py +1 -1
  3. {elements-3.9.2 → elements-3.9.4}/elements/path.py +9 -4
  4. {elements-3.9.2 → elements-3.9.4/elements.egg-info}/PKG-INFO +1 -1
  5. {elements-3.9.2 → elements-3.9.4}/LICENSE +0 -0
  6. {elements-3.9.2 → elements-3.9.4}/MANIFEST.in +0 -0
  7. {elements-3.9.2 → elements-3.9.4}/README.md +0 -0
  8. {elements-3.9.2 → elements-3.9.4}/elements/agg.py +0 -0
  9. {elements-3.9.2 → elements-3.9.4}/elements/checkpoint.py +0 -0
  10. {elements-3.9.2 → elements-3.9.4}/elements/config.py +0 -0
  11. {elements-3.9.2 → elements-3.9.4}/elements/counter.py +0 -0
  12. {elements-3.9.2 → elements-3.9.4}/elements/flags.py +0 -0
  13. {elements-3.9.2 → elements-3.9.4}/elements/fps.py +0 -0
  14. {elements-3.9.2 → elements-3.9.4}/elements/logger.py +0 -0
  15. {elements-3.9.2 → elements-3.9.4}/elements/plotting.py +0 -0
  16. {elements-3.9.2 → elements-3.9.4}/elements/printing.py +0 -0
  17. {elements-3.9.2 → elements-3.9.4}/elements/rwlock.py +0 -0
  18. {elements-3.9.2 → elements-3.9.4}/elements/space.py +0 -0
  19. {elements-3.9.2 → elements-3.9.4}/elements/timer.py +0 -0
  20. {elements-3.9.2 → elements-3.9.4}/elements/tree.py +0 -0
  21. {elements-3.9.2 → elements-3.9.4}/elements/usage.py +0 -0
  22. {elements-3.9.2 → elements-3.9.4}/elements/utils.py +0 -0
  23. {elements-3.9.2 → elements-3.9.4}/elements/uuid.py +0 -0
  24. {elements-3.9.2 → elements-3.9.4}/elements/when.py +0 -0
  25. {elements-3.9.2 → elements-3.9.4}/elements.egg-info/SOURCES.txt +0 -0
  26. {elements-3.9.2 → elements-3.9.4}/elements.egg-info/dependency_links.txt +0 -0
  27. {elements-3.9.2 → elements-3.9.4}/elements.egg-info/requires.txt +0 -0
  28. {elements-3.9.2 → elements-3.9.4}/elements.egg-info/top_level.txt +0 -0
  29. {elements-3.9.2 → elements-3.9.4}/requirements-optional.txt +0 -0
  30. {elements-3.9.2 → elements-3.9.4}/requirements.txt +0 -0
  31. {elements-3.9.2 → elements-3.9.4}/setup.cfg +0 -0
  32. {elements-3.9.2 → elements-3.9.4}/setup.py +0 -0
  33. {elements-3.9.2 → elements-3.9.4}/tests/test_basics.py +0 -0
  34. {elements-3.9.2 → elements-3.9.4}/tests/test_checkpoint.py +0 -0
  35. {elements-3.9.2 → elements-3.9.4}/tests/test_flags.py +0 -0
  36. {elements-3.9.2 → elements-3.9.4}/tests/test_path.py +0 -0
  37. {elements-3.9.2 → elements-3.9.4}/tests/test_tree.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elements
3
- Version: 3.9.2
3
+ Version: 3.9.4
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.9.2'
1
+ __version__ = '3.9.4'
2
2
 
3
3
  from .agg import Agg
4
4
  from .checkpoint import Checkpoint, Saveable
@@ -1,4 +1,3 @@
1
- import contextlib
2
1
  import fnmatch
3
2
  import glob as globlib
4
3
  import os
@@ -282,9 +281,9 @@ class GCSPath(Path):
282
281
  def open(self, mode='r'):
283
282
  assert self.blob, 'is a directory'
284
283
  if 'w' in mode:
285
- return self.blob.open(mode, chunk_size=1024 * 1024, ignore_flush=True)
284
+ return self.blob.open(mode, ignore_flush=True)
286
285
  else:
287
- return self.blob.open(mode, chunk_size=1024 * 1024)
286
+ return self.blob.open(mode)
288
287
 
289
288
  def read(self, mode='r'):
290
289
  assert self.blob, 'is a directory'
@@ -345,7 +344,8 @@ class GCSPath(Path):
345
344
  else:
346
345
  folders.append(child)
347
346
  results = [x.rstrip('/') for x in folders + filenames]
348
- results = sorted(fnmatch.filter(results, prefix + pattern.rstrip('/')))
347
+ results = fnmatch.filter(results, prefix + pattern.rstrip('/'))
348
+ results = sorted(set(results))
349
349
  return [type(self)(f'gs://{self.bucket.name}/{x}') for x in results]
350
350
 
351
351
  def exists(self):
@@ -384,9 +384,14 @@ class GCSPath(Path):
384
384
  folder.upload_from_string(b'')
385
385
 
386
386
  def remove(self, recursive=False):
387
+ isdir = self.isdir()
387
388
  if recursive:
389
+ from google.cloud import storage
390
+ assert isdir
388
391
  for child in self.glob('**'):
389
392
  child.remove()
393
+ if isdir:
394
+ storage.Blob(self.blob.name + '/', self.bucket).delete()
390
395
  else:
391
396
  self.blob.delete(self.client)
392
397
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elements
3
- Version: 3.9.2
3
+ Version: 3.9.4
4
4
  Summary: Building blocks for productive research.
5
5
  Home-page: http://github.com/danijar/elements
6
6
  Classifier: Intended Audience :: Science/Research
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