losalamos.tools.new_project#
Create a new numbered project inside a branch folder.
Accepts a branch folder path directly, or a config file whose folder key
points to the branch folder. Metadata fields are filled in interactively,
and losalamos.new_project() is called. Branch and vault navigation is
handled by the higher-level losalamos.tools.manage_vault tool.
Shell usage
python -m losalamos.tools.new_project path/to/branch/folder
python -m losalamos.tools.new_project path/to/config.toml
Config file keys (when passing a config file)
folder(str, required) — path to the branch folder.folder_system(str, optional) —"default"or"alphanumerical". Defaults to"default".separator(str, optional) — string between branch name and number, e.g."_"→Research_001. Ignored foralphanumerical.sources(str, optional) — path to a shared sources config file.language(str, optional) — language tag (e.g."pt-br").
Interaction keys
0at the letter filter or at the numbered list — skip the current field.ENTERat the letter filter — show all entries.sat the project confirmation — skip all optional fields and create immediately.bafter a filtered list — go back to the letter filter.qat any prompt — abort and exit.
Config file — default system
folder = "C:/My Drive/projects/Research"
folder_system = "default"
separator = "_"
sources = "C:/vault/sources.toml"
language = "pt-br"
folder: C:/My Drive/projects/Research
folder_system: default
separator: "_"
sources: C:/vault/sources.toml
language: pt-br
{
"folder": "C:/My Drive/projects/Research",
"folder_system": "default",
"separator": "_",
"sources": "C:/vault/sources.toml",
"language": "pt-br"
}
Config file — alphanumerical system
folder = "C:/My Drive/projects/C000"
folder_system = "alphanumerical"
sources = "C:/vault/sources.toml"
folder: C:/My Drive/projects/C000
folder_system: alphanumerical
sources: C:/vault/sources.toml
{
"folder": "C:/My Drive/projects/C000",
"folder_system": "alphanumerical",
"sources": "C:/vault/sources.toml"
}
Functions
Parse command-line arguments. |
|
|
|
|
Create a new numbered project inside a branch folder. |
- losalamos.tools.new_project.get_arguments()[source]#
Parse command-line arguments.
- Returns:
Parsed argument namespace with a
sourceattribute.
- losalamos.tools.new_project.run(source: str) None[source]#
Create a new numbered project inside a branch folder.
Can be called directly (e.g. from
losalamos.tools.manage_vault) or viamain()when invoked from the command line.- Parameters:
source (str) – Path to the branch folder, or path to a config file (
.yaml/.toml/.json) with at minimum afolderkey pointing to the branch folder. Optional config keys:folder_system,separator,sources,language.