From 70cd3d4cb556d087a73ef173cb25892892fe248d Mon Sep 17 00:00:00 2001 From: SS <66886825+EarlMilktea@users.noreply.github.com> Date: Sat, 23 Nov 2024 18:55:41 +0900 Subject: [PATCH] :recycle: Restore BaseM structure --- graphix/command.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/graphix/command.py b/graphix/command.py index 11c13c60..f602124f 100644 --- a/graphix/command.py +++ b/graphix/command.py @@ -51,10 +51,19 @@ class N(_KindChecker): @dataclasses.dataclass -class M(_KindChecker): - """Measurement command. By default the plane is set to 'XY', the angle to 0, empty domains and identity vop.""" +class BaseM: + """Base class for measurement command. + + This class does not contain any data except for the node to measure. + """ node: Node + + +@dataclasses.dataclass +class M(BaseM, _KindChecker): + """Measurement command. By default the plane is set to 'XY', the angle to 0, empty domains and identity vop.""" + plane: Plane = Plane.XY angle: float = 0.0 s_domain: set[Node] = dataclasses.field(default_factory=set) @@ -137,8 +146,6 @@ class T(_KindChecker): Command = Union[N, M, E, C, X, Z, S, T] Correction = Union[X, Z] -BaseM = M - @dataclasses.dataclass class MeasureUpdate: