ska_tmc_subarraynode.input_validator module

This module is for validationg the input strings for the repository

class ska_tmc_subarraynode.input_validator.ConfigureValidator(component_manager, logger=<Logger ska_tmc_subarraynode.input_validator (WARNING)>)

Bases: object

Class to validate the input string of Configure command of Subarray Node

check_pattern_in_partial_configure(partial_config)

This method checks pattern provided in partial configure. It raises error if pattern name not supported by TMC.

Parameters

partial_config (Dict) – partial configuration data

Return type

None

loads(input_string)

Validates the input string received as an argument of Configure command. If the request is correct, returns the Serialized JSON string. The ska-tmc-cdm is used to validate the JSON.

Parameters

input_string (str) – A JSON string

Returns

Serialized JSON string if successful.

Return type

str

Raises

InvalidJSONError – When the JSON string is not formatted properly.

validate_groups_key_data(group_list)

Validate the trajectory pattern and receptors in the provided holography configuration.

This method checks the trajectory pattern for each group in the provided list. If an unsupported pattern is provided, the command is rejected.

It also validates receptors based on the number of groups. If there are multiple groups, receptors must be provided for each group.

Parameters

group_list (list) – A list containing groups with configuration data, including trajectory and receptors information.

Raises

InvalidJSONError – If the validation fails.

Return type

None

verify_json_with_keys(input_json, telescope)

Verify the given json to check if it contains all the expected keys for a configure json.

Parameters
  • input_json (dict) – The input json for the Configure command.

  • telescope (str) – The telescope type, either “LOW” or “MID”.

Raises

InvalidJSONError – If the json is missing any of the expected keys.

Return type

None

verify_receptor_in_assigned_resources(receptors)

Verify if receptors are in assigned_resources.

Parameters

receptors (List) – List of receptors to be verified.

Raises

InvalidJSONError – If the receptors are not in assigned_resources.

Return type

None

class ska_tmc_subarraynode.input_validator.ScanValidator(logger=<Logger ska_tmc_subarraynode.input_validator (WARNING)>)

Bases: object

Class to validate the input string of Scan command of Subarray Node

loads(input_string)

Validates the input string received as an argument of Scan command. If the request is correct, returns the Serialized JSON string. The ska-tmc-cdm is used to validate the JSON.

Parameters

input_string (str) – A JSON string

Returns

Serialized JSON string if successful.

Return type

str

Raises

InvalidJSONError – When the JSON string is not formatted properly.