xobjects 0.5.5__tar.gz → 0.5.7__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.
- {xobjects-0.5.5/xobjects.egg-info → xobjects-0.5.7}/PKG-INFO +1 -1
- xobjects-0.5.7/xobjects/_version.py +1 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/general.py +7 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/hybrid_class.py +11 -3
- {xobjects-0.5.5 → xobjects-0.5.7/xobjects.egg-info}/PKG-INFO +1 -1
- xobjects-0.5.5/xobjects/_version.py +0 -1
- {xobjects-0.5.5 → xobjects-0.5.7}/LICENSE +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/pyproject.toml +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/setup.cfg +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/setup.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_align.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_array.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_buffer.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_capi.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_chunk.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_context_opencl.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_hybrid_class.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_kernel.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_linked_array.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_nplike_arrays.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_ref.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_scalars.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_shared_memory.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_strides.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_string.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_struct.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_to_dict.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_typeutils.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/tests/test_unionref.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/__init__.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/_patch_pyopencl_array.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/array.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/capi.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/context.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/context_cpu.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/context_cupy.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/context_pyopencl.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/linkedarray.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/ref.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/scalar.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/specialize_source.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/string.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/struct.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/test_helpers.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/typeutils.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects/union.py +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects.egg-info/SOURCES.txt +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects.egg-info/dependency_links.txt +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects.egg-info/requires.txt +0 -0
- {xobjects-0.5.5 → xobjects-0.5.7}/xobjects.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.7"
|
|
@@ -18,6 +18,13 @@ _print = Print()
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def assert_allclose(a, b, rtol=0, atol=0, max_outliers=0):
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
if a == b: # if this passes we return without raising
|
|
24
|
+
return
|
|
25
|
+
except:
|
|
26
|
+
pass
|
|
27
|
+
|
|
21
28
|
if hasattr(a, "get"):
|
|
22
29
|
a = a.get()
|
|
23
30
|
if hasattr(b, "get"):
|
|
@@ -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 += [
|
|
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 +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
|
|
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
|