xobjects 0.5.5__tar.gz → 0.5.6__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 (50) hide show
  1. {xobjects-0.5.5/xobjects.egg-info → xobjects-0.5.6}/PKG-INFO +1 -1
  2. xobjects-0.5.6/xobjects/_version.py +1 -0
  3. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/hybrid_class.py +11 -3
  4. {xobjects-0.5.5 → xobjects-0.5.6/xobjects.egg-info}/PKG-INFO +1 -1
  5. xobjects-0.5.5/xobjects/_version.py +0 -1
  6. {xobjects-0.5.5 → xobjects-0.5.6}/LICENSE +0 -0
  7. {xobjects-0.5.5 → xobjects-0.5.6}/pyproject.toml +0 -0
  8. {xobjects-0.5.5 → xobjects-0.5.6}/setup.cfg +0 -0
  9. {xobjects-0.5.5 → xobjects-0.5.6}/setup.py +0 -0
  10. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_align.py +0 -0
  11. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_array.py +0 -0
  12. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_buffer.py +0 -0
  13. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_capi.py +0 -0
  14. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_chunk.py +0 -0
  15. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_context_opencl.py +0 -0
  16. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_hybrid_class.py +0 -0
  17. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_kernel.py +0 -0
  18. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_linked_array.py +0 -0
  19. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_nplike_arrays.py +0 -0
  20. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_ref.py +0 -0
  21. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_scalars.py +0 -0
  22. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_shared_memory.py +0 -0
  23. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_strides.py +0 -0
  24. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_string.py +0 -0
  25. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_struct.py +0 -0
  26. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_to_dict.py +0 -0
  27. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_typeutils.py +0 -0
  28. {xobjects-0.5.5 → xobjects-0.5.6}/tests/test_unionref.py +0 -0
  29. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/__init__.py +0 -0
  30. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/_patch_pyopencl_array.py +0 -0
  31. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/array.py +0 -0
  32. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/capi.py +0 -0
  33. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/context.py +0 -0
  34. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/context_cpu.py +0 -0
  35. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/context_cupy.py +0 -0
  36. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/context_pyopencl.py +0 -0
  37. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/general.py +0 -0
  38. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/linkedarray.py +0 -0
  39. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/ref.py +0 -0
  40. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/scalar.py +0 -0
  41. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/specialize_source.py +0 -0
  42. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/string.py +0 -0
  43. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/struct.py +0 -0
  44. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/test_helpers.py +0 -0
  45. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/typeutils.py +0 -0
  46. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects/union.py +0 -0
  47. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects.egg-info/SOURCES.txt +0 -0
  48. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects.egg-info/dependency_links.txt +0 -0
  49. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects.egg-info/requires.txt +0 -0
  50. {xobjects-0.5.5 → xobjects-0.5.6}/xobjects.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xobjects
3
- Version: 0.5.5
3
+ Version: 0.5.6
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
@@ -0,0 +1 @@
1
+ __version__ = "0.5.6"
@@ -40,7 +40,6 @@ class _FieldOfDressed:
40
40
  if self.isnplikearray:
41
41
  self.__get__(container=container)[:] = value
42
42
  elif hasattr(value, "_xobject"): # value is a dressed xobject
43
-
44
43
  # Copy xobject data from value inside self._xobject
45
44
  # (unless same memory area or Ref and same buffer,
46
45
  # in the latter case reference mechanism is used)
@@ -390,14 +389,17 @@ class HybridClass(metaclass=MetaHybridClass):
390
389
  return self._xobject.compile_kernels(*args, **kwargs)
391
390
 
392
391
  def __repr__(self):
393
-
394
392
  if hasattr(self, "_repr_fields"):
395
393
  fnames = self._repr_fields
396
394
  else:
397
395
  fnames = []
398
396
  if hasattr(self, "_add_to_repr"):
399
397
  fnames += self._add_to_repr
400
- fnames += [fname for fname in self._fields]
398
+ fnames += [
399
+ fname
400
+ for fname in self._xofields.keys()
401
+ if not fname.startswith("_")
402
+ ]
401
403
  if hasattr(self, "_skip_in_repr"):
402
404
  fnames = [ff for ff in fnames if ff not in self._skip_in_repr]
403
405
 
@@ -406,6 +408,12 @@ class HybridClass(metaclass=MetaHybridClass):
406
408
  vv = getattr(self, fname)
407
409
  if isinstance(vv, float):
408
410
  vvrepr = f"{vv:.3g}"
411
+ elif isinstance(vv, np.ndarray):
412
+ vvrepr = repr(vv)
413
+ # kill "array("
414
+ vvrepr = vvrepr.split("(", 1)[1]
415
+ # kill trailing ")"
416
+ vvrepr = vvrepr.rsplit(")", 1)[0]
409
417
  else:
410
418
  vvrepr = repr(vv)
411
419
  args.append(f"{fname}={vvrepr}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xobjects
3
- Version: 0.5.5
3
+ Version: 0.5.6
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
@@ -1 +0,0 @@
1
- __version__ = "0.5.5"
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