From fbf359e515f962dd5e079d7a13b5b7dc39339764 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Tue, 3 Oct 2023 13:38:33 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=B1=D0=B0=D0=B3=D0=B8=20=D1=81=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=B8=20=D1=81=D1=87=D0=B8=D1=82=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=B8=D1=81=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20(#5?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сloses #56, #57. --- statapp/models/fileslc_model.py | 3 ++- statapp/models/input_values_model.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/statapp/models/fileslc_model.py b/statapp/models/fileslc_model.py index 104a292..8a41b01 100644 --- a/statapp/models/fileslc_model.py +++ b/statapp/models/fileslc_model.py @@ -19,12 +19,13 @@ class FileSLCModel: self.file_name, _ = QFileDialog.getOpenFileName(None, "Загрузить файл", "", "Files (*.txt *.csv)") if self.file_name: try: - content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True) + content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True, ndmin=2) except ValueError as e: QMessageBox.warning \ (None, 'Ошибка', "Ошибка чтения файла!\nФайл нельзя открыть или файл неверного формата") + self.file_name = None return None return content diff --git a/statapp/models/input_values_model.py b/statapp/models/input_values_model.py index 6f5629c..0d770ea 100644 --- a/statapp/models/input_values_model.py +++ b/statapp/models/input_values_model.py @@ -10,7 +10,7 @@ class InputValuesModel(EditableTableModel): super().__init__(data) def getHorizontalHeader(self): - return yx_header(self.rowCount(QModelIndex())) + return yx_header(self.columnCount(QModelIndex())) def getY(self): return self._data[:, 0]