runtraj.Project.fetch#
- Project.fetch(sel=None, *, skip_existing=True)[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 (every one, with
skip_existing=False), as a run would ask for them (the met step at or after a run’s end too). Withdownload, it downloads what is missing and crops it as it goes, so the runs that follow find every file and download nothing. A met withoutdownloadis only checked: its missing files are reported, ascheckdoes. 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:
- Returns:
met(its name undermets:),file, andmessagecolumns: a row for each file, withmessageempty, then a row for each window whose files could not be had, withfileempty. No row has amessagewhen every file is there. Empty when no simulation is left to run.runtraj fetchprints it.- Return type:
- Raises:
ValueError – If
config.yamlorreleases.csvis invalid.FileNotFoundError – If the directory of a met without
downloadholds no ARL file, which names the output folder of its runs.ImportError – If a met downloads and the
downloadextra 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.
runtraj fetchexits with 3 or 4.
Examples
>>> files = project.fetch() >>> files.message.isna().all() # True when every file is there >>> project.run() # downloads nothing