Implement basic function for inheritance principle support within bidsschematools #1181
Labels
inheritance
schema-code
Updates or changes to the code used to parse, filter, and render the schema.
NB Originally was destined to be posted as reply in #102 but then I decided to make it a separate issue.
A single function cannot cover the entirety of the Inheritance Principle (IP below). I see different target needs:
get_metadata_files(path: Path) -> list[Path]
- given that data (metadata) inputpath
would provide all (available in the dataset) files in the order to be loaded to establish the metadata record. Such function would also be helpful for a validator mode to operate on a "partial BIDS dataset" (e.g. a single subj/ses) as we might need (per our discussion with @satra and @TheChymera ): IP 2-3.get_affected_files(path: Path) -> list[Path]
would be of great help to see which files would consider a given metadata filepath
due to inheritance principle. Such functionality would also be greatly useful for some hypotheticalbids move
so people could get informed while doing smth likebids move task-1_bold.json task-2_bold.json
on the top level and thus affecting files down under.get_metadata(path: Path) -> dict
- given the data (or even metadata?) file path, load all pertinent metadata. Internally usesget_metadata_files
first to get the list of files and then loads them: IP 5. Yet to be coded AFAIK inbidsschematools
.Given your work on #1003, do you think @TheChymera you could provide such
get_metadata_files(path: Path) -> list[Path]
implementation ofget_metadata_files
following the current set of IP rules?PS also filed #1180 which would eventually relate here as inheritance principle would require querying filesystem for availability of a particular filename.
The text was updated successfully, but these errors were encountered: