stilt.Project.init#

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

Make a new project and return it.

Writes config.yaml, with only the settings given, and receptors.csv when receptors are given. With starter=True it writes the commented starter config instead, to edit by hand, as stilt init does.

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

  • receptors (stilt.receptor.Receptor | Iterable[stilt.receptor.Receptor] | str | Path | None) – Receptors, or the path of a receptors CSV to copy them from.

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

  • starter (bool) – Write the commented starter config.yaml (stilt.config.STARTER_CONFIG) in place of a config. Without receptors, receptors.csv gets only its header.

  • **settings (Any) – Settings for ProjectConfig, such as mets, variants, n_hours, numpar, and grid.

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, or either is given with starter=True.

  • ValueError – If a variant’s settings are invalid. Nothing is written.

Return type:

Project