Validation

cloudcasting.validation.validate(model: AbstractModel, data_path: list[str] | str, wandb_project_name: str, wandb_run_name: str, nan_to_num: bool = False, batch_size: int = 1, num_workers: int = 0, batch_limit: int | None = None) None

Run the full validation procedure on the model and log the results to wandb.

Parameters:
  • model (AbstractModel) – the model to be validated

  • data_path (str) – path to the validation data set

  • nan_to_num (bool, optional) – Whether to convert NaNs to -1. Defaults to False.

  • batch_size (int, optional) – Defaults to 1.

  • num_workers (int, optional) – Defaults to 0.

  • batch_limit (int | None, optional) – Defaults to None. For testing purposes only.

cloudcasting.validation.validate_from_config(config_file: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f349c697790>] = 'validate_config.yml', model_file: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f349e2cf110>] = 'model.py') None

CLI function to validate a model from a config file. Example templates of these files can be found at https://github.com/alan-turing-institute/ocf-model-template.

Parameters:
  • config_file (str) – Path to config file. Defaults to “validate_config.yml”.

  • model_file (str) – Path to Python file with model definition. Defaults to “model.py”.