forked from datalad/datalad-next
-
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.
Implement
EnsurePath.for_dataset()
and resolve against that dataset
This implements DataLad's standard path resolution approach (relative is relative to CWD, unless a `Dataset` instance is given). This now makes it possible to perform this standard resolution pattern during command parameter validation, like so: ```py \# example validator for a command with two args EnsureCommandParameterization( param_constraints=dict( dataset=EnsureDataset(), path=EnsurePath(), ), tailor_for_dataset=dict(path='dataset'), ) ``` This will: - cause the 'dataset' validator to run first - auto-generate an `EnsurePath` variant that resolves against that dataset - ensures that the command always receives absolute paths, resolved against the dataset whenever the rules require it. Closes datalad#270
- Loading branch information
Showing
2 changed files
with
73 additions
and
8 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
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