Base Class — yaflux documentation

Skip to main content
`Ctrl`+`K`

# Base Class

class yaflux._base.Base(parameters=None)

  Bases: `object`

  Base class for analysis pipelines.

  This class provides a framework for defining and executing analysis pipelines.

  Parameters:

    parameters (Parameters) – The parameters for the analysis.

  results

    The current analysis results.

    Type:

      Results

  available_steps

    List all available steps for the analysis.

    Type:

      list[str]

  completed_steps

    List all completed steps for the analysis.

    Type:

      list[str]

  Attributes:
    `available_steps`

      List all available steps for the analysis.

    `completed_steps`

      List all completed steps for the analysis.

    `results`

      Get the current analysis results.

  Methods

  `execute`([target_step, force, panic_on_existing]) | Execute analysis steps in dependency order up to target_step.
  `execute_all`([force, panic_on_existing]) | Execute all available steps in the analysis.
  `get_step_info`(step_name) | Get information about a specific analysis step.
  `get_step_metadata`(step_name) | Get the metadata for a specific analysis step.
  `get_step_results`(step_name) | Get the results for a specific analysis step.
  `load`(filepath, *[, no_results, select, exclude]) | Load an analysis object from a file.
  `metadata_report`() | Return the metadata for all completed steps.
  `save`(filepath[, force]) | Save the analysis to a file.
  `visualize_dependencies`(**kwargs) | Create a clear visualization of step dependencies using Graphviz.

  property available_steps: list[str]

    List all available steps for the analysis.

  property completed_steps: list[str]

    List all completed steps for the analysis.

  execute(target_step=None, force=False, panic_on_existing=False)

    Execute analysis steps in dependency order up to target_step.

    Return type:

      `Any`

  execute_all(force=False, panic_on_existing=False)

    Execute all available steps in the analysis.

    Return type:

      `None`

  get_step_info(step_name)

    Get information about a specific analysis step.

    Return type:

      `dict`

  get_step_metadata(step_name)

    Get the metadata for a specific analysis step.

    Return type:

      `Metadata`

  get_step_results(step_name)

    Get the results for a specific analysis step.

    Return type:

      `Any`

  classmethod load(filepath, *, no_results=False, select=None, exclude=None)

    Load an analysis object from a file.

    Parameters:

      - filepath (str) – Path to the analysis file. If it ends in .yax, loads using yaflux archive format. Otherwise attempts to load as legacy pickle format.

      - no_results (bool, optional) – Only load metadata (yaflux archive format only), by default False

      - select (Optional[List[str]], optional) – Only load specific results (yaflux archive format only), by default None

      - exclude (Optional[List[str]], optional) – Skip specific results (yaflux archive format only), by default None

    Returns:

      The loaded analysis object

    Return type:

      Analysis

    Raises:

      ValueError – If selective loading is attempted with legacy pickle format

  metadata_report()

    Return the metadata for all completed steps.

    The report will be in the order that the steps were completed.

    For steps which were run more than once their order will be in the order they were run the first time.

    Return type:

      `list`[`dict`[`str`, `Any`]]

  property results: Results

    Get the current analysis results.

  save(filepath, force=False)

    Save the analysis to a file.

    If the filepath ends in .yax, saves in yaflux archive format.

    Parameters:

      - filepath (str) – Path to save the analysis

      - force (bool, optional) – Whether to overwrite existing file, by default False

  visualize_dependencies(**kwargs)

    Create a clear visualization of step dependencies using Graphviz.

    Parameters:

      **kwargs (dict) – Configuration options passed to GraphConfig

    Returns:

      The rendered graph object

    Return type:

      graphviz.Digraph