From e426a4b217312ccaa4084cf0032540ec9df396c8 Mon Sep 17 00:00:00 2001 From: holl- Date: Thu, 29 Feb 2024 13:28:56 +0100 Subject: [PATCH] [geom] No Mesh variable attrs (temporary fix) --- phi/geom/_mesh.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phi/geom/_mesh.py b/phi/geom/_mesh.py index 113c83465..ec61b7d01 100644 --- a/phi/geom/_mesh.py +++ b/phi/geom/_mesh.py @@ -73,6 +73,7 @@ def __init__(self, vertices: Graph, # e_face = def __variable_attrs__(self): + return () return '_vertices', '_center', '_volume', '_faces', '_valid_mask', '_face_vertices', '_relative_face_distance', '_neighbor_offsets' @property @@ -255,6 +256,9 @@ def __getitem__(self, item): item: dict = slicing_dict(self, item) assert not spatial(self._polygons).only(tuple(item)), f"Cannot slice vertex lists ('{spatial(self._polygons)}') but got slicing dict {item}" assert not instance(self._vertices).only(tuple(item)), f"Slicing by vertex indices ('{instance(self._vertices)}') not supported but got slicing dict {item}" + cells = instance(self.shape).name + if cells in item and isinstance(item['cells'], int): + item[cells] = slice(item[cells], item[cells] + 1) vertices = self._vertices[item] polygons = self._polygons[item] vertex_count = self._vertex_count[item]