xobjects 0.7.1__tar.gz → 0.7.2__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 (61) hide show
  1. {xobjects-0.7.1/xobjects.egg-info → xobjects-0.7.2}/PKG-INFO +2 -1
  2. {xobjects-0.7.1 → xobjects-0.7.2}/pyproject.toml +1 -0
  3. {xobjects-0.7.1 → xobjects-0.7.2}/setup.py +1 -1
  4. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_kernel.py +10 -1
  5. xobjects-0.7.2/xobjects/_version.py +1 -0
  6. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context_cpu.py +2 -0
  7. {xobjects-0.7.1 → xobjects-0.7.2/xobjects.egg-info}/PKG-INFO +2 -1
  8. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/requires.txt +1 -0
  9. xobjects-0.7.1/xobjects/_version.py +0 -1
  10. {xobjects-0.7.1 → xobjects-0.7.2}/Architecture.md +0 -0
  11. {xobjects-0.7.1 → xobjects-0.7.2}/LICENSE +0 -0
  12. {xobjects-0.7.1 → xobjects-0.7.2}/MANIFEST.in +0 -0
  13. {xobjects-0.7.1 → xobjects-0.7.2}/README.md +0 -0
  14. {xobjects-0.7.1 → xobjects-0.7.2}/setup.cfg +0 -0
  15. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_align.py +0 -0
  16. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_array.py +0 -0
  17. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_buffer.py +0 -0
  18. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_capi.py +0 -0
  19. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_chunk.py +0 -0
  20. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_common.py +0 -0
  21. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_context_opencl.py +0 -0
  22. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_general.py +0 -0
  23. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_hybrid_class.py +0 -0
  24. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_linked_array.py +0 -0
  25. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_nplike_arrays.py +0 -0
  26. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_raw_union.py +0 -0
  27. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_ref.py +0 -0
  28. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_scalars.py +0 -0
  29. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_shared_memory.py +0 -0
  30. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_strides.py +0 -0
  31. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_string.py +0 -0
  32. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_struct.py +0 -0
  33. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_to_dict.py +0 -0
  34. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_typeutils.py +0 -0
  35. {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_unionref.py +0 -0
  36. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/__init__.py +0 -0
  37. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/_patch_pyopencl_array.py +0 -0
  38. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/array.py +0 -0
  39. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/capi.py +0 -0
  40. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context.py +0 -0
  41. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context_cupy.py +0 -0
  42. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context_pyopencl.py +0 -0
  43. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/general.py +0 -0
  44. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/headers/atomicadd.h +0 -0
  45. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/headers/common.h +0 -0
  46. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/hybrid_class.py +0 -0
  47. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/linkedarray.py +0 -0
  48. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/raw_union.py +0 -0
  49. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/ref.py +0 -0
  50. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/scalar.py +0 -0
  51. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/settings.py +0 -0
  52. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/specialize_source.py +0 -0
  53. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/string.py +0 -0
  54. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/struct.py +0 -0
  55. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/test_helpers.py +0 -0
  56. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/typeutils.py +0 -0
  57. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/union.py +0 -0
  58. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/SOURCES.txt +0 -0
  59. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/dependency_links.txt +0 -0
  60. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/entry_points.txt +0 -0
  61. {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xobjects
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: In-memory serialization and code generator for CPU and GPU
5
5
  Home-page: https://xsuite.readthedocs.io/
6
6
  Download-URL: https://pypi.python.org/pypi/xobjects
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: numpy
19
19
  Requires-Dist: cffi
20
+ Requires-Dist: setuptools
20
21
  Requires-Dist: scipy
21
22
  Provides-Extra: tests
22
23
  Requires-Dist: pytest; extra == "tests"
@@ -17,6 +17,7 @@ requires-python = ">=3.9"
17
17
  dependencies = [
18
18
  "numpy",
19
19
  "cffi",
20
+ "setuptools",
20
21
  "scipy"
21
22
  ]
22
23
  [project.urls]
@@ -23,7 +23,7 @@ setup(
23
23
  url="https://xsuite.readthedocs.io/",
24
24
  python_requires=">=3.7",
25
25
  setup_requires=[],
26
- install_requires=["numpy", "cffi", "scipy"],
26
+ install_requires=["numpy", "cffi", "setuptools", "scipy"],
27
27
  packages=["xobjects"],
28
28
  license="Apache 2.0",
29
29
  download_url="https://pypi.python.org/pypi/xobjects",
@@ -4,6 +4,7 @@
4
4
  # ########################################### #
5
5
 
6
6
  import cffi
7
+ import pickle
7
8
  import pytest
8
9
  import sysconfig
9
10
  from pathlib import Path
@@ -14,7 +15,8 @@ import xobjects as xo
14
15
  from xobjects.test_helpers import for_all_test_contexts, requires_context
15
16
 
16
17
 
17
- def test_kernel_cpu():
18
+ @pytest.mark.parametrize('pickle_context', [False, True])
19
+ def test_kernel_cpu(pickle_context):
18
20
  ctx = xo.ContextCpu()
19
21
  src_code = r"""
20
22
  double my_mul(const int n, const double* x1,
@@ -45,6 +47,13 @@ double my_mul(const int n, const double* x1,
45
47
 
46
48
  assert y == 285.0
47
49
 
50
+ if pickle_context:
51
+ restored = pickle.loads(pickle.dumps(ctx))
52
+ assert not restored.kernels
53
+ assert ctx.kernels.my_mul(n=len(a1), x1=a1, x2=a2) == 285.0
54
+ restored.add_kernels(sources=[src_code], kernels=kernel_descriptions)
55
+ assert restored.kernels.my_mul(n=len(a1), x1=a1, x2=a2) == 285.0
56
+
48
57
 
49
58
  @for_all_test_contexts
50
59
  def test_kernel_pointer_none_maps_to_null(test_context):
@@ -0,0 +1 @@
1
+ __version__ = "0.7.2"
@@ -96,6 +96,7 @@ def kernel_compilation_help_message():
96
96
 
97
97
  from .context import (
98
98
  Kernel,
99
+ KernelDict,
99
100
  ModuleNotAvailable,
100
101
  SourceType,
101
102
  XBuffer,
@@ -821,6 +822,7 @@ class ContextCpu(XContext):
821
822
 
822
823
  def __setstate__(self, state):
823
824
  self.__dict__.update(state)
825
+ self._kernels = KernelDict(self._kernels)
824
826
  self._buffers = weakref.WeakSet()
825
827
 
826
828
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xobjects
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: In-memory serialization and code generator for CPU and GPU
5
5
  Home-page: https://xsuite.readthedocs.io/
6
6
  Download-URL: https://pypi.python.org/pypi/xobjects
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: numpy
19
19
  Requires-Dist: cffi
20
+ Requires-Dist: setuptools
20
21
  Requires-Dist: scipy
21
22
  Provides-Extra: tests
22
23
  Requires-Dist: pytest; extra == "tests"
@@ -1,5 +1,6 @@
1
1
  numpy
2
2
  cffi
3
+ setuptools
3
4
  scipy
4
5
 
5
6
  [tests]
@@ -1 +0,0 @@
1
- __version__ = "0.7.1"
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