spectre.support.RunNext

Functions

run_next(next_entrypoint, input_file_path, cwd)

Run the next entrypoint specified in the input file metadata

working_directory(cwd)

Temporarily change the working directory to 'cwd'.

spectre.support.RunNext.run_next(next_entrypoint: dict, input_file_path: Path, cwd: Path)

Run the next entrypoint specified in the input file metadata

Invokes the Python function specified in the ‘Next’ section of the input file metadata. It can be specified like this:

 ```yaml # Input file metadata Next:

Run: spectre.Pipelines.Bbh.Inspiral:start_inspiral With:

# Arguments to pass to the function submit: True

— # Rest of the input file ```

The function will be invoked in the cwd directory (’–input-run-dir’ / ‘-i’), which defaults to the directory of the input file. The following special values can be used for the arguments:

  • ‘__file__’: The (absolute) path of the input file.

  • ‘None’: The Python value None.

Parameters:
  • next_entrypoint

    The Python function to run. Must be a dictionary with the following keys: - “Run”: The Python module and function to run, separated by a colon.

    For example, “spectre.Pipelines.Bbh.Ringdown:start_ringdown”.

    • ”With”: A dictionary of arguments to pass to the function.

  • input_file_path – Path to the input file that specified the entrypoint. Used to resolve ‘__file__’ in the entrypoint arguments.

  • cwd – The working directory in which to run the entrypoint. Used to resolve relative paths in the entrypoint arguments.

spectre.support.RunNext.working_directory(cwd: Path)

Temporarily change the working directory to ‘cwd’.