File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,18 @@ def __init__(
73
73
self ._lll_matrix_mappings : dict [float , tuple [np .ndarray , np .ndarray ]] = {}
74
74
self ._lll_inverse = None
75
75
76
- self .pbc = pbc
76
+ self ._pbc = tuple (bool (item ) for item in pbc )
77
+
78
+ @property
79
+ def pbc (self ) -> tuple [bool , bool , bool ]:
80
+ """Tuple defining the periodicity of the Lattice."""
81
+ return self ._pbc # type:ignore[return-value]
82
+
83
+ @pbc .setter
84
+ def pbc (self , pbc : tuple [bool , bool , bool ]) -> None :
85
+ if len (pbc ) != 3 or any (item not in {True , False } for item in pbc ):
86
+ raise ValueError (f"pbc must be a tuple of three True/False values, got { pbc } " )
87
+ self ._pbc = tuple (bool (item ) for item in pbc )
77
88
78
89
def __repr__ (self ) -> str :
79
90
return "\n " .join (
You can’t perform that action at this time.
0 commit comments