runtraj.Project.init#

classmethod Project.init(path, releases=None, *, config=None, **settings)[source]#

Make a new project and return it.

Writes config.yaml, with the settings given, and releases.csv when releases are given. The settings are written as given: a transport model runs with its own defaults for the settings they leave out.

Parameters:
  • path (str | Path) – Project directory. It is created if needed.

  • releases (runtraj.releases.Release | Iterable[runtraj.releases.Release] | str | Path | None) – Releases, or the path of a releases CSV to copy them from.

  • config (runtraj.config.ProjectConfig | None) – The settings. Or give them as keywords instead.

  • **settings (Any) – The blocks of ProjectConfig: mets, models, stages and variants, and execution and output.

Raises:
  • FileExistsError – If the directory already has a config.yaml. Open it with Project(path) instead, and edit the file to change settings.

  • TypeError – If both config and keyword settings are given.

  • ValueError – If a variant’s settings are invalid, or releases is given but holds none (an empty list, or a CSV file with only its header). Nothing is written.

Return type:

Self