Skip to content

Commit 5688c91

Browse files
santisolerjcapriot
andauthored
Simplify error message
Co-authored-by: Joseph Capriotti <[email protected]>
1 parent f228901 commit 5688c91

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

discretize/_extensions/tree_ext.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7002,14 +7002,12 @@ cdef class _TreeMesh:
70027002
"""
70037003
Raise error if mesh is not finalized.
70047004
"""
7005-
object_name = "property" if is_property else "method"
70067005
if not self.finalized:
70077006
msg = (
7008-
f"The `{method}` {object_name} "
7009-
"cannot be accessed before the mesh is finalized. "
7007+
f"`{type(self).__name__}.{method}` requires a finalized mesh. "
70107008
"Use the `finalize()` method to finalize it."
70117009
)
7012-
raise AttributeError(msg)
7010+
raise TreeMeshNotFinalizedError(msg)
70137011

70147012
def _require_ndarray_with_dim(self, name, arr, ndim=1, dtype=None, requirements=None):
70157013
"""Returns an ndarray that has dim along it's last dimension, with ndim dims,

0 commit comments

Comments
 (0)