Skip to content
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

On-demand constraint-tailoring to dataset arguments #260

Merged
merged 2 commits into from
Feb 24, 2023

Commits on Feb 24, 2023

  1. Configuration menu
    Copy the full SHA
    de72f55 View commit details
    Browse the repository at this point in the history
  2. On-demand constraint-tailoring to dataset arguments

    This exposes a, so far dormant, feature of the `Constraint` class to
    parameter validation: constraint tailoring for particular datasets.
    
    `EnsureCommandParameterization` learned a `tailor_for_dataset` parameter
    that can be used to identify which parameters' constraints should be
    tailored for which `Dataset` instances. Tailoring will only be actually
    done under the following conditions:
    
    - the dataset-providing parameters need to evaluate to a
      DatasetParameter instance, typically via `EnsureDataset`
      (all regular conditions apply, e.g. a default `None` not being processed
      etc)
    - the to-be-tailored parameter `Constraint` needs to implement its
      `for_dataset()` method to perform a tailoring.
    
    A test with some custom-made constraints is included. At the moment,
    no production-ready constraints do implement `for_dataset()`. However,
    now that a consumer for that is available, it makes more sense to
    address related issues, such as:
    
    - datalad#193
    - datalad#131
    
    Closes datalad#200
    mih committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    9c8f713 View commit details
    Browse the repository at this point in the history