Skip to content

Commit 9b7cfbd

Browse files
Fix KpointsData constructor
1 parent 6b999f8 commit 9b7cfbd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/aiida/orm/nodes/data/array/kpoints.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ def __init__(
8484
**kwargs,
8585
):
8686
super().__init__(**kwargs)
87-
self.cell = cell
88-
self.pbc = (pbc1, pbc2, pbc3)
87+
if cell is not None:
88+
self.cell = cell
89+
if any(pbc is not None for pbc in (pbc1, pbc2, pbc3)):
90+
self.pbc = (pbc1 or False, pbc2 or False, pbc3 or False)
8991
if labels is not None and label_numbers is not None:
9092
if len(labels) != len(label_numbers):
9193
raise ValueError('Labels and label numbers must have the same length')
@@ -144,7 +146,6 @@ def pbc(self):
144146
:return: a tuple of three booleans, each one tells if there are periodic
145147
boundary conditions for the i-th real-space direction (i=1,2,3)
146148
"""
147-
# return copy.deepcopy(self._pbc)
148149
return (self.base.attributes.get('pbc1'), self.base.attributes.get('pbc2'), self.base.attributes.get('pbc3'))
149150

150151
@pbc.setter

0 commit comments

Comments
 (0)