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, andreleases.csvwhen 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 ofProjectConfig:mets,models,stagesandvariants, andexecutionandoutput.
- 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.
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: