ParameterGen Class

class ska_mid_cbf_mcs.testing.param_gen.test_param_gen.ParameterGen(seed: Any, max_subarrays: int, max_vcc_all_bands: int, max_vcc_units: int, max_fsp_units: int, test_data_path: Path, sys_param_template_path: Path)[source]

Bases: object

An abstract base class for Mid.CBF test parameter generation.

parameter_output: List[Dict[str, Any]]
generate_sys_parameters(vcc_ids: List[int], k_range: Tuple[int], tm_data: Dict[str, Any] | None = None) Dict[str, Any][source]

Generate InitSysParam input from template.

Only generates one set of sys params per ParameterGen instance.

abstract generate_parameters() Dict[str, Any][source]

To be overriden in child class

Generates test parameters based on inputs specific to the test suite

ControllerParameterGen Class

class ska_mid_cbf_mcs.testing.param_gen.controller_param_gen.ControllerParameterGen(*args: Any, set_resource_admin_mode_path: Path, **kwargs: Any)[source]

Bases: ParameterGen

A class for Mid.CBF subarray test parameter generation.

resource_admin_mode_gen(vcc_unit_ids: List[int], fsp_unit_ids: List[int]) Dict[str, Any][source]
generate_parameter_dict(vcc_ids: List[int], fsp_unit_ids: List[int], k_range: Tuple[int], tm_data: Dict[str, Any] | None = None) Dict[str, Any][source]

Generate one set of all controller test input parameters.

Parameters:
  • vcc_unit_ids – list of VCC unit IDs to use in parameter generation

  • fsp_unit_ids – list of FSP unit IDs to use in parameter generation

  • k_range – range of k values to use in parameter generation

  • tm_data – optional param to set alternate source for sys params

generate_parameters(pytest_params: Dict[str, Any]) Dict[str, Any][source]

Generate all subarray test input parameters.

Parameters:

pytest_params – the dict of pytest params that defines the basic parameter generation values contains: “vcc_ids”, “fsp_unit_ids”, “k_range” and optionally “tm_data”

SubarrayParameterGen Class

class ska_mid_cbf_mcs.testing.param_gen.subarray_param_gen.SubarrayParameterGen(*args: Any, configure_scan_template_path: Path, scan_template_path: Path, end_scan_template_path: Path, delay_model_template_path: Path, assign_resources_template_path: Path, release_resources_template_path: Path, **kwargs: Any)[source]

Bases: ParameterGen

A class for Mid.CBF subarray test parameter generation.

generate_parameter_dict(sub_id: int, frequency_band: str, vcc_ids: List[int], fsp_modes: Dict[int, ObsMode], scan: bool, end_scan: bool, delay_model: bool, assign_resources: bool, release_resources: bool) Dict[str, Any][source]

Generate one set of all subarray test input parameters.

Parameters:
  • sub_id – a subarray ID to use in parameter generation

  • frequency_band – a frequency band to use in parameter generation

  • vcc_ids – a list of VCCs to use in parameter generation

  • fsp_modes – a dict of FSP IDs and ObsModes to use in parameter generation

  • scan – set to True to generate Scan command data

  • end_scan – set to True to generate Scan command data

  • delay_model – set to True to generate delay model data

  • assign_resources – set to True to generate delay model data

  • release_resources – set to True to generate delay model data

generate_parameters(pytest_params: Dict[str, Any], scan: bool = False, end_scan: bool = False, delay_model: bool = False, assign_resources: bool = False, release_resources: bool = False) Dict[str, Any][source]

Generate all subarray test input parameters.

Parameters:
  • pytest_params – the dict of pytest params that defines the basic parameter generation values contains: “sub_id”, “frequency_band”, “vcc_ids” and “fsp_modes”

  • delay_model – set to True to generate delay model data

Parameter Generation Helpers

ska_mid_cbf_mcs.testing.param_gen.parameter_generation.scan_config_gen(template_path: Path) Dict[str, Any][source]

Generate Scan input from template.

ska_mid_cbf_mcs.testing.param_gen.parameter_generation.delay_model_gen(template_path: Path, subarray_id: int, dish_ids: List[str]) Dict[str, Any][source]

Generate delay model from template.

Parameters:
  • subarray_id – ID of destination subarray

  • dish_ids – list of DISH IDs to generate coefficients for

ska_mid_cbf_mcs.testing.param_gen.parameter_generation.configure_scan_config_gen(template_path: Path, subarray_id: int, frequency_band: str, fsp_modes: Dict[int, ObsMode], dish_ids: List[str]) Dict[str, Any][source]

Generates the configure scan configuration as a dict.

Parameters:
  • template_path – path to configure scan JSON template

  • subarray_id – subarray ID to use for configuration

  • frequency_band – frequency band to use for configuration

  • fsp_modes – map of FSP IDs and ObsMode values to use for configuration

  • dish_ids – list of DISH IDs to use for configuration

ska_mid_cbf_mcs.testing.param_gen.parameter_generation.assign_or_release_resources_gen(template_path: Path, dish_ids: List[str]) Dict[str, Any][source]

generates the dictionary for AssignResources or ReleaseResources because the two commands have the same structure (just different interface names).