microecs 0.3.6__tar.gz → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: microecs
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: MicroECS: Minimal Entity Component System (ECS) in python and numpy
5
5
  Home-page: https://gitlab.com/meehai/microecs
6
6
  License: MIT
@@ -79,11 +79,11 @@ class _Field(np.lib.mixins.NDArrayOperatorsMixin):
79
79
  pool_ix = int(np.searchsorted(self._bounds, key, side="right")) - 1
80
80
  return self.parts[pool_ix][key - self._bounds[pool_ix]]
81
81
 
82
- if not (isinstance(key, tuple) and key and key[0] == slice(None)):
83
- raise TypeError("Unsupported indexing. Use .numpy() for a proper array. To set items, use qr.attr[:, k]=xxx"
84
- ". For fancy indexing qr[i, 0:3, k], use qr[i][0:3, k].")
82
+ if key is Ellipsis or (isinstance(key, tuple) and key and (key[0] is Ellipsis or key[0] == slice(None))):
83
+ return _Field([part[key] for part in self.parts])
85
84
 
86
- return _Field([part[key] for part in self.parts])
85
+ raise TypeError("Unsupported indexing. Use .numpy() for a proper array. To set items, use qr.attr[:, k]=xxx. "
86
+ "For fancy indexing qr[i, 0:3, k], use qr[i][0:3, k].")
87
87
 
88
88
  def __iter__(self):
89
89
  for part in self.parts:
@@ -111,7 +111,7 @@ class QueryResult:
111
111
  if (data := self.__dict__.get("_data")) is not None and name in data:
112
112
  # the 'or' part is in case no pools match the query and we want qr.position[:] += 1 still to work (noop)
113
113
  return _Field(data[name] or [np.empty((0, *self._field_shapes[name]), self._field_dtypes[name])])
114
- raise AttributeError(name)
114
+ raise AttributeError(f"'{name}' not part of {self._fields}")
115
115
 
116
116
  def __setattr__(self, name, value):
117
117
  if (data := self.__dict__.get("_data")) is not None and name in data:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: microecs
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: MicroECS: Minimal Entity Component System (ECS) in python and numpy
5
5
  Home-page: https://gitlab.com/meehai/microecs
6
6
  License: MIT
@@ -3,7 +3,7 @@ from pathlib import Path
3
3
  from setuptools import setup, find_packages
4
4
 
5
5
  NAME = "microecs"
6
- VERSION = "0.3.6"
6
+ VERSION = "0.3.7"
7
7
  DESCRIPTION = "MicroECS: Minimal Entity Component System (ECS) in python and numpy"
8
8
  URL = "https://gitlab.com/meehai/microecs"
9
9
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes