Skip to content

Commit 3b3f33d

Browse files
committed
New NoGeomError when geometry is missing
1 parent 03d3e16 commit 3b3f33d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

stagpy/error.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Sequence
88
from os import PathLike
99
from .stagyydata import StagyyData
10+
from ._step import Step
1011

1112

1213
class StagpyError(Exception):
@@ -34,6 +35,19 @@ def __init__(self, sdat: StagyyData):
3435
super().__init__(f'no snapshot found for {sdat}')
3536

3637

38+
class NoGeomError(StagpyError):
39+
"""Raised when no geometry info can be found.
40+
41+
Attributes:
42+
step: the :class:`~stagpy._step.Step` instance for which no geometry
43+
was found.
44+
"""
45+
46+
def __init__(self, step: Step):
47+
self.step = step
48+
super().__init__(f"no geometry info found for {step!r}")
49+
50+
3751
class NoParFileError(StagpyError):
3852
"""Raised when no par file can be found.
3953

0 commit comments

Comments
 (0)