# Generic recipe Yamale schema definition.
# See https://github.com/23andMe/Yamale for help.

---
# Recipe schema
documentation: include('documentation')
datasets: list(include('dataset'), required=False)
preprocessors: map(map(), required=False)
diagnostics: map(include('diagnostic'), required=False)

---
# Recipe item definitions
documentation:
  title: str()
  description: str()
  authors: list(str(), min=1)
  projects: list(str(), required=False)
  references: list(str(), required=False)

dataset:
  dataset: str()
  project: str(required=False)
  start_year: int(required=False, min=0000, max=10000)
  end_year: int(required=False, min=0000, max=10000)
  ensemble: any(str(), list(str()), required=False)
  exp: any(str(), list(str()), required=False)
  mip: str(required=False)
  realm: str(required=False)
  shift: str(required=False)
  tier: int(min=1, max=3, required=False)
  type: str(required=False)

variable:
  project: str(required=False)
  start_year: int(required=False, min=0000, max=10000)
  end_year: int(required=False, min=0000, max=10000)
  ensemble: any(str(), list(str()), required=False)
  exp: any(str(), list(str()), required=False)
  mip: str(required=False)
  preprocessor: str(required=False)
  reference_dataset: str(required=False)
  alternative_dataset: str(required=False)
  fx_files: list(required=False)
  additional_datasets: list(include('dataset'), required=False)

# TODO: add preprocessor item

diagnostic:
  scripts: any(null(), map(include('script')))
  additional_datasets: list(include('dataset'), required=False)
  title: str(required=False)
  description: str(required=False)
  themes: list(str(), required=False)
  realms: list(str(), required=False)
  variables: map(include('variable'), null(), required=False)

script:
  script: str()
