stilt.Project.fetch#

Project.fetch(sel=None)[source]#

Get the met files the unfinished simulations need, and return them.

For each met, gets the files that cover the time of every simulation in sel whose transport model has yet to run, as a run would ask for them (the hour after a run’s end too). With download, it downloads what is missing and crops it as it goes, so the runs that follow find every file and download nothing. A met without download is only checked: its missing files are reported, as check does. Several fetches, or a fetch beside runs, can share a met directory: arlmet writes each file under a temporary name and renames it into place when whole.

Parameters:

sel (Any) – The simulations to fetch for, as for status(). Defaults to all of them.

Returns:

met (its name under mets:), file, and message columns: a row for each file, with message empty, then a row for each window whose files could not be had, with file empty. No row has a message when every file is there. Empty when no simulation is left to run. stilt fetch prints it.

Return type:

DataFrame

Raises:
  • ValueError – If config.yaml or receptors.csv is invalid.

  • FileNotFoundError – If the directory of a met without download holds no ARL file, which names the output folder of its runs.

  • ImportError – If a met downloads and the download extra is not installed.

  • OSError – If a download fails for any reason but a missing file, such as a busy archive or a full disk, and so does a connection error of the download library. stilt fetch exits with 3 or 4.

Examples

>>> files = project.fetch()
>>> files.message.isna().all()  # True when every file is there
>>> project.run()  # downloads nothing