microecs 0.2.2__tar.gz → 0.2.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.
- {microecs-0.2.2 → microecs-0.2.3}/PKG-INFO +1 -1
- {microecs-0.2.2 → microecs-0.2.3}/microecs/query_result.py +8 -2
- {microecs-0.2.2 → microecs-0.2.3}/microecs/system.py +1 -1
- {microecs-0.2.2 → microecs-0.2.3}/microecs.egg-info/PKG-INFO +1 -1
- {microecs-0.2.2 → microecs-0.2.3}/setup.py +1 -1
- {microecs-0.2.2 → microecs-0.2.3}/LICENSE.TXT +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/README.md +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs/__init__.py +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs/component.py +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs/pool.py +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs/utils.py +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs/world.py +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs.egg-info/SOURCES.txt +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs.egg-info/dependency_links.txt +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs.egg-info/requires.txt +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/microecs.egg-info/top_level.txt +0 -0
- {microecs-0.2.2 → microecs-0.2.3}/setup.cfg +0 -0
|
@@ -70,10 +70,16 @@ class _Field(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
70
70
|
for v, chunk in zip(views, np.split(full, np.cumsum(self._lens)[:-1])):
|
|
71
71
|
v[:] = chunk
|
|
72
72
|
|
|
73
|
-
# qr.position[:, 0] (or any >1 axis as well as slices not exact indices) is allowed. qr.position[0] is not.
|
|
74
73
|
def __getitem__(self, key):
|
|
74
|
+
if isinstance(key, (int, np.integer)): # qr.position[i] -> entity i's row, from its own pool
|
|
75
|
+
key = range(self.len)[key] # numpy's exact int-index rule, for free: wraps neg, raises on OOB
|
|
76
|
+
pool_ix = int(np.searchsorted(self._bounds, key, side="right")) - 1
|
|
77
|
+
return self.parts[pool_ix][key - self._bounds[pool_ix]]
|
|
78
|
+
|
|
75
79
|
if not (isinstance(key, tuple) and key and key[0] == slice(None)):
|
|
76
|
-
raise TypeError("
|
|
80
|
+
raise TypeError("Unsupported indexing. Use .numpy() for a proper array. To set items, use qr.attr[:, k]=xxx"
|
|
81
|
+
". For fancy indexing qr[i, 0:3, k], use qr[i][0:3, k].")
|
|
82
|
+
|
|
77
83
|
return _Field([part[key] for part in self.parts])
|
|
78
84
|
|
|
79
85
|
def __iter__(self):
|
|
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
|