forked from datalad/datalad-metalad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TMP: convert extract into ValidatedInterface, and adopt constraint va…
…lidation This is a demonstration how one existing command could adopt datalad-next's parameter constraint validation. It changes the baseclass to next's ValidatedInterface, and defines a validator with relevant parameter constraints: Specifically, the constraints are: - The provided datasets exists, or a dataset can be derived from the curdir - The path points to an existing file (ref datalad#354) - The extractorname is a string - The extractorargs is a mapping of key-value pairs This makes a dedicated check whether a file exists obsolete, and it could replace the checks that check_dataset() does (provided an additional constraint option in EnsureDataset() that allows to check for valid dataset IDs - I've created an issue about this in datalad/datalad-next#272). This change would introduce a dependency to datalad-next, and as parts of this PR were only tested with yet unreleased branches of datalad-next, it will not work right now unless you're on the right development version of datalad-next.
- Loading branch information
Showing
1 changed file
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters