generated from datalad/datalad-extension-template
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement resolve_path as a constraint #270
Comments
yes, that would be nice! I just ran into that |
EnsurePathInDataset
mih
added a commit
to mih/datalad-next
that referenced
this issue
Mar 2, 2023
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
mih
added a commit
to mih/datalad-next
that referenced
this issue
Mar 3, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With #260 merged, we can enhance
EnsurePath
to automatically perform DataLad-unique way of resolving relative paths.The text was updated successfully, but these errors were encountered: