From 60e0a77a3a818fe5ea2ddabf219c7ee62c1b6858 Mon Sep 17 00:00:00 2001 From: RostislavHmelevski Date: Mon, 3 Jun 2024 07:35:40 +0300 Subject: [PATCH] for 4 --- lab_6_pipeline/pipeline.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lab_6_pipeline/pipeline.py b/lab_6_pipeline/pipeline.py index a08c6ed..8cffe3d 100644 --- a/lab_6_pipeline/pipeline.py +++ b/lab_6_pipeline/pipeline.py @@ -75,12 +75,11 @@ def _validate_dataset(self) -> None: sorted_raw_files = sorted(raw_files, key=get_article_id_from_filepath) sorted_meta_files = sorted(meta_files, key=get_article_id_from_filepath) - for ind, (raw, meta) in enumerate(iterable=zip(sorted_raw_files, sorted_meta_files), start=1): - if ind != get_article_id_from_filepath(raw) \ - or ind != get_article_id_from_filepath(meta) \ - or not raw.stat().st_size \ - or not meta.stat().st_size: - raise InconsistentDatasetError() + for index, (meta, raw) in enumerate(zip(sorted_meta_files, sorted_raw_files), 1): + if index != get_article_id_from_filepath(meta) \ + or index != get_article_id_from_filepath(raw) \ + or not meta.stat().st_size or not raw.stat().st_size: + raise InconsistentDatasetError def _scan_dataset(self) -> None: """