portal 3.7.2__tar.gz → 3.7.3__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 (35) hide show
  1. {portal-3.7.2/portal.egg-info → portal-3.7.3}/PKG-INFO +14 -2
  2. {portal-3.7.2 → portal-3.7.3}/portal/__init__.py +1 -1
  3. {portal-3.7.2 → portal-3.7.3}/portal/packlib.py +6 -1
  4. {portal-3.7.2 → portal-3.7.3/portal.egg-info}/PKG-INFO +14 -2
  5. {portal-3.7.2 → portal-3.7.3}/tests/test_pack.py +1 -0
  6. {portal-3.7.2 → portal-3.7.3}/LICENSE +0 -0
  7. {portal-3.7.2 → portal-3.7.3}/MANIFEST.in +0 -0
  8. {portal-3.7.2 → portal-3.7.3}/README.md +0 -0
  9. {portal-3.7.2 → portal-3.7.3}/portal/batching.py +0 -0
  10. {portal-3.7.2 → portal-3.7.3}/portal/buffers.py +0 -0
  11. {portal-3.7.2 → portal-3.7.3}/portal/client.py +0 -0
  12. {portal-3.7.2 → portal-3.7.3}/portal/client_socket.py +0 -0
  13. {portal-3.7.2 → portal-3.7.3}/portal/contextlib.py +0 -0
  14. {portal-3.7.2 → portal-3.7.3}/portal/poollib.py +0 -0
  15. {portal-3.7.2 → portal-3.7.3}/portal/process.py +0 -0
  16. {portal-3.7.2 → portal-3.7.3}/portal/server.py +0 -0
  17. {portal-3.7.2 → portal-3.7.3}/portal/server_socket.py +0 -0
  18. {portal-3.7.2 → portal-3.7.3}/portal/sharray.py +0 -0
  19. {portal-3.7.2 → portal-3.7.3}/portal/thread.py +0 -0
  20. {portal-3.7.2 → portal-3.7.3}/portal/utils.py +0 -0
  21. {portal-3.7.2 → portal-3.7.3}/portal.egg-info/SOURCES.txt +0 -0
  22. {portal-3.7.2 → portal-3.7.3}/portal.egg-info/dependency_links.txt +0 -0
  23. {portal-3.7.2 → portal-3.7.3}/portal.egg-info/requires.txt +0 -0
  24. {portal-3.7.2 → portal-3.7.3}/portal.egg-info/top_level.txt +0 -0
  25. {portal-3.7.2 → portal-3.7.3}/pyproject.toml +0 -0
  26. {portal-3.7.2 → portal-3.7.3}/requirements.txt +0 -0
  27. {portal-3.7.2 → portal-3.7.3}/setup.cfg +0 -0
  28. {portal-3.7.2 → portal-3.7.3}/setup.py +0 -0
  29. {portal-3.7.2 → portal-3.7.3}/tests/test_batching.py +0 -0
  30. {portal-3.7.2 → portal-3.7.3}/tests/test_client.py +0 -0
  31. {portal-3.7.2 → portal-3.7.3}/tests/test_errfile.py +0 -0
  32. {portal-3.7.2 → portal-3.7.3}/tests/test_process.py +0 -0
  33. {portal-3.7.2 → portal-3.7.3}/tests/test_server.py +0 -0
  34. {portal-3.7.2 → portal-3.7.3}/tests/test_socket.py +0 -0
  35. {portal-3.7.2 → portal-3.7.3}/tests/test_thread.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: portal
3
- Version: 3.7.2
3
+ Version: 3.7.3
4
4
  Summary: Fast and reliable distributed systems in Python
5
5
  Home-page: http://github.com/danijar/portal
6
6
  Author: Danijar Hafner
@@ -10,6 +10,18 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
+ Requires-Dist: cloudpickle
14
+ Requires-Dist: msgpack
15
+ Requires-Dist: numpy
16
+ Requires-Dist: psutil
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: requires-dist
24
+ Dynamic: summary
13
25
 
14
26
  [![PyPI](https://img.shields.io/pypi/v/portal.svg)](https://pypi.python.org/pypi/portal/#history)
15
27
 
@@ -1,4 +1,4 @@
1
- __version__ = '3.7.2'
1
+ __version__ = '3.7.3'
2
2
 
3
3
  import multiprocessing as mp
4
4
  try:
@@ -1,3 +1,4 @@
1
+ import math
1
2
  import struct
2
3
 
3
4
  import msgpack
@@ -30,7 +31,8 @@ def pack(data):
30
31
  "Array is not contiguous in memory. Use " +
31
32
  "np.asarray(arr, order='C') before passing the data into pack().")
32
33
  specs.append(['array', value.shape, value.dtype.str])
33
- buffers.append(value.data.cast('c'))
34
+ buffer = value.data.cast('c') if value.size else b'\x00'
35
+ buffers.append(buffer)
34
36
  elif isinstance(value, sharray.SharedArray):
35
37
  specs.append(['sharray', *value.__getstate__()])
36
38
  buffers.append(b'\x00')
@@ -64,6 +66,9 @@ def unpack(buffer):
64
66
  leaves.append(buffer)
65
67
  elif spec[0] == 'array':
66
68
  shape, dtype = spec[1:]
69
+ if not math.prod(shape):
70
+ assert buffer == b'\x00'
71
+ buffer = b''
67
72
  leaves.append(np.frombuffer(buffer, dtype).reshape(shape))
68
73
  elif spec[0] == 'sharray':
69
74
  assert buffer == b'\x00'
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: portal
3
- Version: 3.7.2
3
+ Version: 3.7.3
4
4
  Summary: Fast and reliable distributed systems in Python
5
5
  Home-page: http://github.com/danijar/portal
6
6
  Author: Danijar Hafner
@@ -10,6 +10,18 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
+ Requires-Dist: cloudpickle
14
+ Requires-Dist: msgpack
15
+ Requires-Dist: numpy
16
+ Requires-Dist: psutil
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: requires-dist
24
+ Dynamic: summary
13
25
 
14
26
  [![PyPI](https://img.shields.io/pypi/v/portal.svg)](https://pypi.python.org/pypi/portal/#history)
15
27
 
@@ -10,6 +10,7 @@ class TestPack:
10
10
  bytes(7),
11
11
  {'foo': np.zeros((2, 4), np.float64), 'bar': np.asarray(1)},
12
12
  {'foo': [np.asarray(1), np.asarray(2)]},
13
+ {'foo': np.ones((128, 0, 5), np.int32)},
13
14
  'hello world',
14
15
  None,
15
16
  ])
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