Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`bids_version` is always `None` since the switch to bids-validator-deno

Đang mở
#1,961 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
deno, python
Lĩnh vực
data

Hướng nghiên cứu

Start in dandi/files/bids.py at _validate(), which reads origin.standard_version, then check dandi/bids_validator_deno/_validator.py where that field is commented out. Decide with maintainers whether to read BIDSVersion from dataset_description.json or remove bids_version and get_validation_bids_version(). Done means bids_version is populated or cleanly dropped, and nwb.get_metadata() no longer triggers a deno validation run.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

BIDS bug

BIDSDatasetDescriptionAsset.bids_version is always None. So are BIDSAsset.get_validation_bids_version() and the bids_version key that dandi.metadata.nwb.get_metadata() adds for files in a BIDS dataset (shown by dandi ls).

_validate() takes it from self._dataset_errors[0].origin.standard_version:
https://github.com/dandi/dandi-cli/blob/ad8f64d9abeada4bf87b68eb1a69bea36895ba03/dandi/files/bids.py#L167-L170

But since #1599 switched to bids-validator-deno, the Origin never sets standard_version. It is commented out because BIDSVersion is not available from the validator:
https://github.com/dandi/dandi-cli/blob/ad8f64d9abeada4bf87b68eb1a69bea36895ba03/dandi/bids_validator_deno/_validator.py#L340-L350

Checked with bids-validator-deno 3.0.2 on ieeg_epilepsyNWB from bids-examples: all 76 results have origin.standard_version=None. Even before #1599, the version was set only if validation returned at least one result (if self._dataset_errors:).

Producing this None is not free: get_validation_bids_version() runs a full deno validation of the dataset when its results are not already cached. That is the case for every NWB file passed through nwb.get_metadata(), which creates a new BIDSDatasetDescriptionAsset each time.

Possible fixes:

  • read BIDSVersion from the dataset's dataset_description.json (the version the dataset declares), and/or expose the validator's schema version, which is already in origin.standard_schema_version;
  • or drop bids_version and get_validation_bids_version() if nothing needs them.

Found while reviewing #1958.

Ngôn ngữ chính
Python
Star
29
Fork
37
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dandi/dandi-cli

Tất cả issue của dandi/dandi-cli

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.