Skip to content

Commit 1433c8a

Browse files
authored
Marker: Finalize (pals-project#42)
Remove the construction notice from `Marker`. - improve docstring - introduce `ThinElement` helper class See pals-project/pals#98
1 parent a4d9f23 commit 1433c8a

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/pals/kinds/Marker.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from typing import Literal
22

3-
from .mixin import BaseElement
4-
from .utils import under_construction
3+
from .mixin import ThinElement
54

65

7-
@under_construction("Marker")
8-
class Marker(BaseElement):
9-
"""Zero length element to mark a particular position"""
6+
class Marker(ThinElement):
7+
"""Zero length element to mark a particular position
8+
9+
The main purpose of this thin element is to name a position in the beamline.
10+
"""
1011

1112
# Discriminator field
1213
kind: Literal["Marker"] = "Marker"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import Literal
2+
3+
from . import BaseElement
4+
5+
6+
class ThinElement(BaseElement):
7+
"""A thin base element with zero segment length"""
8+
9+
# Discriminator field
10+
kind: Literal["ThinElement"] = "ThinElement"
11+
12+
# Segment length in meters (m)
13+
# always 0 for thin elements, not modifiable
14+
length: Literal[0.0] = 0.0

src/pals/kinds/mixin/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from .BaseElement import BaseElement # noqa: F401
22
from .ThickElement import ThickElement # noqa: F401
3+
from .ThinElement import ThinElement # noqa: F401

0 commit comments

Comments
 (0)