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, andreceptors.csvwhen receptors are given. Withstarter=Trueit writes the commented starter config instead, to edit by hand, asstilt initdoes.- 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 starterconfig.yaml(stilt.config.STARTER_CONFIG) in place of a config. Without receptors,receptors.csvgets only its header.**settings (
Any) – Settings forProjectConfig, such asmets,variants,n_hours,numpar, andgrid.
- Raises:
FileExistsError – If the directory already has a
config.yaml. Open it withProject(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