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 for alphanumerical.

  • sources (str, optional) — path to a shared sources config file.

  • language (str, optional) — language tag (e.g. "pt-br").

Interaction keys

  • 0 at the letter filter or at the numbered list — skip the current field.

  • ENTER at the letter filter — show all entries.

  • s at the project confirmation — skip all optional fields and create immediately.

  • b after a filtered list — go back to the letter filter.

  • q at 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

get_arguments()

Parse command-line arguments.

main()

run(source)

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 source attribute.

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 via main() 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 a folder key pointing to the branch folder. Optional config keys: folder_system, separator, sources, language.

losalamos.tools.new_project.main() None[source]#