Make `DataConverter` accept a list of files to convert instead of only a directory
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 36/100
Hướng nghiên cứu
The issue identifies DataConverter.__call__ and GraphNeTFileReader.find_files() as the relevant entry points. Read those definitions and their tests to see how inputs are currently collected. Done means DataConverter accepts explicit file paths as well as directories and converts the selected files; the issue gives no test file to run.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
DataConverter accepts a single argument input_dir: Union[str, List[str]] which point to one or multiple directories. These directories are searched using the GraphNeTFileReader.find_files() method to create a list of file paths for conversion.
This construction appeals to a workflow where data files of interest are copied to a separate directory and all intended for conversion.
There are examples of use cases where converting all files in a directory is unwanted behavior.
Describe the solution you'd like
Make DataConverter accept a list of user-generated file paths for conversion, instead of assuming all files in the input_dir: Union[str, List[str]] should be converted.
We rename the input_dir: Union[str, List[str]] -> input: Union[str, List[str]] : A list of files and/or directories to convert
and then slightly adjust the DataConverter from
@final
def __call__(self, input_dir: Union[str, List[str]]) -> None:
"""Extract data from files in `input_dir` and save to disk.
Args:
input_dir: A directory that contains the input files.
The directory will be searched recursively for files
matching the file extension.
"""
# Get the file reader to produce a list of input files
# in the directory
input_files = self._file_reader.find_files(path=input_dir)
self._launch_jobs(input_files=input_files)
to
from path import isdir, isfile
@final
def __call__(self, input: Union[str, List[str]]) -> None:
"""Extract data from files in `input` and save to disk.
Args:
input: A list of file paths and/or directories containing files selected for conversion.
Directories are searched recursively, and all files in the directories will be converter.
"""
# Get the file reader to produce a list of input files
# in the directory
input_files = [path for path in input if isfile(path)]
directories_to_search = [path for path in input if isdir(path)]
files_from_directories = self._file_reader.find_files(path=directories_to_search)
input_files.extend(files_from_directories)
self._launch_jobs(input_files=input_files)
Additional context
Multiple people have mentioned a wish for this feature
- Ngôn ngữ chính
- Python
- Star
- 117
- Fork
- 115
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của graphnet-team/graphnet
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
graphnet-team/graphnet#933 ·
-
Spring cleanĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
graphnet-team/graphnet#927 · 1 bình luận ·
-
Time for a new version release v1.8.1Có thể làm lại được @Aske-Rosted đã nhận 75 ngày trước và không có pull request nào đang mở. Đang mởdecision
graphnet-team/graphnet#924 · 1 người được giao ·
-
Make kaggle checkpoints part of the CICó thể làm lại được @sevmag đã nhận 75 ngày trước và không có pull request nào đang mở. Đang mởbug
graphnet-team/graphnet#921 · 2 bình luận · 1 người được giao ·
-
decision deferred
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
graphnet-team/graphnet#919 ·
Tất cả issue của graphnet-team/graphnet
Issue tương tự
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
docling-project/docling-core#1067 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
correction metadata
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
acl-org/acl-anthology#11101 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] crewai tool create/install/login exit 0 when they failCó thể đã có người làm @Kiko0301 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vllm-project/compressed-tensors#1033 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
chore kaizen ui-rewrite
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
IBM/mcp-context-forge#7681 ·
Maintainer thường phản hồi trong vòng 2 ngày