Skip to content

Commit a5d72ff

Browse files
committed
Fixes empty background and excluded regions check
1 parent 5400e05 commit a5d72ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/easydiffraction/experiments/experiment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ def as_cif(self, max_points: Optional[int] = None) -> str:
127127
cif_lines += ["", self.linked_crystal.as_cif()]
128128

129129
# Background points
130-
if hasattr(self, "background") and self.background:
130+
if hasattr(self, "background") and self.background._items:
131131
cif_lines += ["", self.background.as_cif()]
132132

133133
# Excluded regions
134-
if hasattr(self, "excluded_regions") and self.excluded_regions:
134+
if hasattr(self, "excluded_regions") and self.excluded_regions._items:
135135
cif_lines += ["", self.excluded_regions.as_cif()]
136136

137137
# Measured data

0 commit comments

Comments
 (0)