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). 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.

  • skip_existing (bool) – Leave out simulations whose particles exist. False gets the met files of every simulation in sel, for a run with skip_existing=False, which runs them all again.

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. runtraj fetch prints it.

Return type:

DataFrame

Raises:
  • ValueError – If config.yaml or releases.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. runtraj fetch exits with 3 or 4.

Examples

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