Source code for ramble.language.workflow_manager_language

# Copyright 2022-2025 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

from typing import Optional

import ramble.language.shared_language


[docs] class WorkflowManagerMeta(ramble.language.shared_language.SharedMeta): _directive_names = set() _directives_to_be_executed = []
workflow_manager_directive = WorkflowManagerMeta.directive
[docs] @workflow_manager_directive("wm_vars") def workflow_manager_variable( name: str, default, description: str, values: Optional[list] = None, ): """Define a variable for this wm Args: name: Name of variable default: Default value if the variable is not defined description: Description of the variable values: Optional list of suggested values for this variable """ def _define_wm_variable(wm): import ramble.workload wm.wm_vars[name] = ramble.workload.WorkloadVariable( name, default=default, description=description, values=values, ) return _define_wm_variable