From 3f133b3bcbd899c503f8ec7c1bed5d81ca58398a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Fri, 10 Feb 2023 22:49:28 +0100 Subject: [PATCH] ref: commented out bad code and replaced with NotImplementedError (#5) --- igor2/struct.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/igor2/struct.py b/igor2/struct.py index ffba4b7..99a7681 100644 --- a/igor2/struct.py +++ b/igor2/struct.py @@ -201,11 +201,17 @@ def pack_data(self, data=None): for arg in self.pack_item(item): yield arg if items < self.item_count: - if f.default is None: - raise ValueError( - 'no default for {}.{}'.format(self, f)) - for i in range(self.item_count - items): - yield f.default + raise NotImplementedError( + "You have reached a bad state! Please copy the " + "code and data you used to get here and paste it at " + "https://github.com/AFM-analysis/igor2/issues/5") + # https://github.com/AFM-analysis/igor2/issues/5 + # Original code from W. Trevor King: + # if f.default is None: + # raise ValueError( + # 'no default for {}.{}'.format(self, f)) + # for i in range(self.item_count - items): + # yield f.default else: for index in self.indexes(): try: