Skip to content

Commit

Permalink
for 4
Browse files Browse the repository at this point in the history
  • Loading branch information
RostislavHmelevski committed Jun 3, 2024
1 parent 01597de commit 60e0a77
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lab_6_pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit 60e0a77

Please sign in to comment.