Skip to content

Commit 0ff4388

Browse files
committed
Added catching for partially written files (Permission error) and also iterations where there are only NaN values, such that we skip it for conversion
1 parent 017cf35 commit 0ff4388

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pyNexafs/gui/widgets/converter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ def calculation_single(
540540
for j, column in enumerate(copy_parser.data.T):
541541
nan_values = np.isnan(column)
542542
if nan_values.any():
543+
if not (True in nan_values and False in nan_values):
544+
# All NaN values, skip.
545+
continue
543546
# Uses linear interpolation to fill in NaN values.
544547
if j == x_idx:
545548
# Assume equal separation between x values

pyNexafs/gui/widgets/fileloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ def update_table(self):
937937
os.path.join(self.directory, file), header_only=True
938938
)
939939
# Catch unimplemented and import errors.
940-
except (NotImplementedError, ImportError) as e:
940+
except (NotImplementedError, ImportError, PermissionError) as e:
941941
self._parser_headers[file] = None
942942
if self.progress_bar is not None:
943943
# self.progress_bar.setValue(int((i + 1) / files_len * 100))

0 commit comments

Comments
 (0)