From afbbfabe1a09b9f7fe2b7c7cc9f1acdea89f1f18 Mon Sep 17 00:00:00 2001 From: Will Gauvin Date: Mon, 3 Nov 2025 13:54:12 +1100 Subject: [PATCH 1/6] AT3-1090 fix rendering of PST flow through schema --- src/ska_telmodel/pst/schema.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ska_telmodel/pst/schema.py b/src/ska_telmodel/pst/schema.py index 42fc848a..4dcb8e0f 100644 --- a/src/ska_telmodel/pst/schema.py +++ b/src/ska_telmodel/pst/schema.py @@ -2007,6 +2007,8 @@ def _get_pst_requantisation_schema(version: str, strict: bool) -> TMSchema: default=1.0, ) + return elems + def _get_pst_ft_mode_schema(version: str, strict: bool) -> TMSchema: """ -- GitLab From 5869e1965a8db906d8c93604b80be28222f8d732 Mon Sep 17 00:00:00 2001 From: Will Gauvin Date: Mon, 3 Nov 2025 14:07:41 +1100 Subject: [PATCH 2/6] AT3-1090 add optional PST data dashboard destinations --- src/ska_telmodel/pst/examples.py | 38 +++++++++++--- src/ska_telmodel/pst/schema.py | 90 ++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 7 deletions(-) diff --git a/src/ska_telmodel/pst/examples.py b/src/ska_telmodel/pst/examples.py index ec9f211c..203d0732 100644 --- a/src/ska_telmodel/pst/examples.py +++ b/src/ska_telmodel/pst/examples.py @@ -1,5 +1,5 @@ import copy -from typing import Any, Callable, Dict +from typing import Any, Callable, Dict, Tuple from .._common import split_interface_version from .version import ( @@ -156,6 +156,12 @@ MID_PST_CONFIGURE_SCAN_COMMON = { ], } +VERSION_PST_INTERFACE: Dict[Tuple[int, int], str] = { + (2, 4): PST_CONFIG_VER2_4, + (2, 5): PST_CONFIG_VER2_5, + (3, 0): PST_CONFIG_VER3_0, +} + def _get_base_example( version: str, pst_processing_mode: str, frequency_band: str @@ -168,12 +174,9 @@ def _get_base_example( example["common"]["config_id"] += f"-{config_id_suffix}" example["common"]["frequency_band"] = frequency_band - if (major, minor) == (2, 4): - example["interface"] = PST_CONFIG_VER2_4 - elif (major, minor) == (2, 5): - example["interface"] = PST_CONFIG_VER2_5 - else: - example["interface"] = PST_CONFIG_VER3_0 + example["interface"] = VERSION_PST_INTERFACE.get( + (major, minor), PST_CONFIG_VER3_0 + ) return example @@ -205,6 +208,27 @@ def _get_scan_common_example( }, } + example["dashboard_destinations"] = [ + { + "data_type": "pst_bandpass", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-bandpass", + }, + { + "data_type": "pst_timeseries", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-timeseries", + }, + { + "data_type": "pst_histogram", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-histogram", + }, + ] + # remove deprecated fields del example["observation_mode"] del example["activation_time"] diff --git a/src/ska_telmodel/pst/schema.py b/src/ska_telmodel/pst/schema.py index 4dcb8e0f..6cb95b65 100644 --- a/src/ska_telmodel/pst/schema.py +++ b/src/ska_telmodel/pst/schema.py @@ -1286,6 +1286,18 @@ def _get_pst_scan_config_schema( elems.add_opt_field("pt", _get_pst_pt_mode_schema(version, strict)) elems.add_opt_field("df", _get_pst_df_mode_schema(version, strict)) elems.add_opt_field("ft", _get_pst_ft_mode_schema(version, strict)) + elems.add_opt_field( + "dashboard_destinations", + [_get_pst_data_dashboard_config(version, strict)], + description=cleandoc( + """ + An optional list of PST data dashboard configurations. + + If field is not set or the list is empty, then PST will + not attempt to send any messages the data dashboards. + """ + ), + ) return elems @@ -2115,3 +2127,81 @@ def _get_pst_equatorial_coordinates(version: str, strict: bool) -> TMSchema: ) return elems + + +def _get_pst_data_dashboard_config(version: str, strict: bool) -> TMSchema: + """ + Returns the schema for configuration for a PST data dashboard. + + The schema defines the following fields: + + * data_type - the type of data, and data dashboard, the config is for. + * host - the Kafka hostname or IP address to send messages to. + * port - the Kafka port number to send messages to. + * topic - the Kafka topic to send messages to. + + :param version: Interface version + :param strict: Schema strictness + :return: The JSON Schema for the PST statistic dashboard destination. + """ + elems = TMSchema.new( + "PST data dashboard destination configuration", + version, + strict, + description=cleandoc( + "Configuration for a PST data dashboard destination.", + ), + as_reference=True, + ) + + elems.add_field( + "data_type", + str, + description=cleandoc( + """ + The data type of the dashboard the configuration is for. + + This field should map with an agreed data type between the + SDP dashboards and PST. PST will ignore data types that + it does not know about rather that raising a semantic validation + error. + """ + ), + ) + elems.add_field( + "host", + str, + description=cleandoc( + """ + The Kafka destination host address for the PST dashboard data. + + This should either be the fully-qualified domain name or an IP + address that the PST beam deployment can reach. + + PST will log a warning if it is unable to connect to the Kafka + server and will not raise a semantic validation error. + """ + ), + ) + elems.add_field( + "port", + str, + description=cleandoc( + """ + The Kafka destination port number for the PST dashboard data. + + This is the port address of the Kafka instance that PST will + send dashboard messages to. + + PST will log a warning if it is unable to connect to the Kafka + server and will not raise a semantic validation error. + """ + ), + ) + elems.add_field( + "topic", + str, + description="The Kafka topic to send the dashboard message to.", + ) + + return elems -- GitLab From adabd8fa34096166a9e0eb56ead2fa16f1a8d8da Mon Sep 17 00:00:00 2001 From: Will Gauvin Date: Thu, 13 Nov 2025 09:06:47 +1100 Subject: [PATCH 3/6] AT3-1090 update PST schema to add an extra layer of indirection --- src/ska_telmodel/pst/examples.py | 42 ++++++++++---------- src/ska_telmodel/pst/schema.py | 68 +++++++++++++++++++++++++------- 2 files changed, 76 insertions(+), 34 deletions(-) diff --git a/src/ska_telmodel/pst/examples.py b/src/ska_telmodel/pst/examples.py index 203d0732..81c97eff 100644 --- a/src/ska_telmodel/pst/examples.py +++ b/src/ska_telmodel/pst/examples.py @@ -208,26 +208,28 @@ def _get_scan_common_example( }, } - example["dashboard_destinations"] = [ - { - "data_type": "pst_bandpass", - "host": "10.0.0.2", - "port": "9092", - "topic": "pst-bandpass", - }, - { - "data_type": "pst_timeseries", - "host": "10.0.0.2", - "port": "9092", - "topic": "pst-timeseries", - }, - { - "data_type": "pst_histogram", - "host": "10.0.0.2", - "port": "9092", - "topic": "pst-histogram", - }, - ] + example["destinations"] = { + "dashboards": [ + { + "data_type": "pst_bandpass", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-bandpass-pb-mvp01-20251105-00001", + }, + { + "data_type": "pst_timeseries", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-timeseries-pb-mvp01-20251105-00001", + }, + { + # this example shows using the default port number + "data_type": "pst_histogram", + "host": "10.0.0.2", + "topic": "pst-histogram-pb-mvp01-20251105-00001", + }, + ] + } # remove deprecated fields del example["observation_mode"] diff --git a/src/ska_telmodel/pst/schema.py b/src/ska_telmodel/pst/schema.py index 6cb95b65..e8d8770f 100644 --- a/src/ska_telmodel/pst/schema.py +++ b/src/ska_telmodel/pst/schema.py @@ -1286,18 +1286,7 @@ def _get_pst_scan_config_schema( elems.add_opt_field("pt", _get_pst_pt_mode_schema(version, strict)) elems.add_opt_field("df", _get_pst_df_mode_schema(version, strict)) elems.add_opt_field("ft", _get_pst_ft_mode_schema(version, strict)) - elems.add_opt_field( - "dashboard_destinations", - [_get_pst_data_dashboard_config(version, strict)], - description=cleandoc( - """ - An optional list of PST data dashboard configurations. - - If field is not set or the list is empty, then PST will - not attempt to send any messages the data dashboards. - """ - ), - ) + elems.add_opt_field("destinations", _get_pst_destinations(version, strict)) return elems @@ -2129,6 +2118,53 @@ def _get_pst_equatorial_coordinates(version: str, strict: bool) -> TMSchema: return elems +def _get_pst_destinations(version: str, strict: bool) -> TMSchema: + """ + Returns the schema for destination configuration for PST scans. + + This schema is designed to be extensible and all the fields are + optional. PST will treat the absence of a destination configuration + as that not send any data other than by the Data Lifecycle Management + (DLM) process does. + + The sort of destinations to be added here are: + + * SDP dashboard Kafka destinations + * SDP pipeline destinations + + :param version: Interface version + :param strict: Schema strictness + :return: The JSON schema for destination configuration for PST scans.. + """ + elems = TMSchema.new( + "PST destinations configuration", + version, + strict, + description=cleandoc( + """ + This is the configuration of destinations that PST can send + data to. This is designed to be extensible and all fields + are optional. + """, + ), + as_reference=True, + ) + elems.add_opt_field( + "dashboards", + [_get_pst_data_dashboard_config(version, strict)], + description=cleandoc( + """ + An optional list of PST data dashboard configurations. + + If field is not set or the list is empty, then PST will + not attempt to send any messages the data dashboards. + """ + ), + ) + + return elems + + def _get_pst_data_dashboard_config(version: str, strict: bool) -> TMSchema: """ Returns the schema for configuration for a PST data dashboard. @@ -2145,7 +2181,7 @@ def _get_pst_data_dashboard_config(version: str, strict: bool) -> TMSchema: :return: The JSON Schema for the PST statistic dashboard destination. """ elems = TMSchema.new( - "PST data dashboard destination configuration", + "PST dashboard destination configuration", version, strict, description=cleandoc( @@ -2183,13 +2219,16 @@ def _get_pst_data_dashboard_config(version: str, strict: bool) -> TMSchema: """ ), ) - elems.add_field( + elems.add_opt_field( "port", str, description=cleandoc( """ The Kafka destination port number for the PST dashboard data. + This field is optional and if not supplied PST will use the + default Kafka port of 9092. + This is the port address of the Kafka instance that PST will send dashboard messages to. @@ -2197,6 +2236,7 @@ def _get_pst_data_dashboard_config(version: str, strict: bool) -> TMSchema: server and will not raise a semantic validation error. """ ), + default="9092", ) elems.add_field( "topic", -- GitLab From 0565d8e334cada5f18c04f68195c6cdaf0cb65f5 Mon Sep 17 00:00:00 2001 From: Will Gauvin Date: Mon, 24 Nov 2025 14:11:03 +1100 Subject: [PATCH 4/6] AT3-1090 remove use of deprecated types in PST schema --- src/ska_telmodel/pst/examples.py | 6 +++--- src/ska_telmodel/pst/version.py | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ska_telmodel/pst/examples.py b/src/ska_telmodel/pst/examples.py index 81c97eff..91b94dca 100644 --- a/src/ska_telmodel/pst/examples.py +++ b/src/ska_telmodel/pst/examples.py @@ -1,5 +1,5 @@ import copy -from typing import Any, Callable, Dict, Tuple +from typing import Any, Callable from .._common import split_interface_version from .version import ( @@ -156,7 +156,7 @@ MID_PST_CONFIGURE_SCAN_COMMON = { ], } -VERSION_PST_INTERFACE: Dict[Tuple[int, int], str] = { +VERSION_PST_INTERFACE: dict[tuple[int, int], str] = { (2, 4): PST_CONFIG_VER2_4, (2, 5): PST_CONFIG_VER2_5, (3, 0): PST_CONFIG_VER3_0, @@ -366,7 +366,7 @@ def _get_df_example( return example -SCAN_TYPE_MAP: Dict[str, Callable[..., dict]] = { +SCAN_TYPE_MAP: dict[str, Callable[..., dict]] = { "pst_scan_vr": _get_vr_example, "pst_scan_pt": _get_pt_example, "pst_scan_ft": _get_ft_example, diff --git a/src/ska_telmodel/pst/version.py b/src/ska_telmodel/pst/version.py index 032cbb5a..242a7b11 100644 --- a/src/ska_telmodel/pst/version.py +++ b/src/ska_telmodel/pst/version.py @@ -1,5 +1,4 @@ from functools import partial -from typing import List, Union from .._common import interface_uri, split_interface_version @@ -25,7 +24,7 @@ pst_configure_uri = partial(interface_uri, PST_CONFIGURE_PREFIX) def check_interface_version( version: str, - allowed_prefixes: Union[str, List[str]] = _ALLOWED_URI_PREFIXES, + allowed_prefixes: str | list[str] = _ALLOWED_URI_PREFIXES, ) -> str: """ Check PST interface version. -- GitLab From 67a24eef047a4d9053613e2b61ec5eba1a298c87 Mon Sep 17 00:00:00 2001 From: Will Gauvin Date: Mon, 24 Nov 2025 14:27:38 +1100 Subject: [PATCH 5/6] AT3-1090 use v3.1 as PST schema version --- docs/src/schemas/csp/low/configure/index.rst | 1 + .../configure/ska-low-csp-configure-7.3.rst | 40 ++++++++++ .../schemas/csp/mid/configurescan/index.rst | 1 + .../configurescan/ska-csp-configure-8.3.rst | 44 +++++++++++ .../src/schemas/pst/ska-pst-configure-3.1.rst | 40 ++++++++++ docs/src/schemas/pst/ska-pst-configure.rst | 1 + src/ska_telmodel/csp/examples.py | 9 +++ src/ska_telmodel/csp/low_examples.py | 12 +++ src/ska_telmodel/csp/low_version.py | 1 + src/ska_telmodel/csp/version.py | 7 ++ src/ska_telmodel/pst/examples.py | 49 ++++++------ src/ska_telmodel/pst/version.py | 8 +- tests/test_csp_low_schemas.py | 74 +++++++++++++++---- tests/test_pst_schema.py | 14 +++- 14 files changed, 263 insertions(+), 38 deletions(-) create mode 100644 docs/src/schemas/csp/low/configure/ska-low-csp-configure-7.3.rst create mode 100644 docs/src/schemas/csp/mid/configurescan/ska-csp-configure-8.3.rst create mode 100644 docs/src/schemas/pst/ska-pst-configure-3.1.rst diff --git a/docs/src/schemas/csp/low/configure/index.rst b/docs/src/schemas/csp/low/configure/index.rst index 76a7f5a6..a8b511e9 100644 --- a/docs/src/schemas/csp/low/configure/index.rst +++ b/docs/src/schemas/csp/low/configure/index.rst @@ -9,6 +9,7 @@ Examples for the different versions of the configure schema :maxdepth: 1 :caption: LOW CSP configure examples + ska-low-csp-configure-7.3 ska-low-csp-configure-7.2 ska-low-csp-configure-7.1 ska-low-csp-configure-7.0 diff --git a/docs/src/schemas/csp/low/configure/ska-low-csp-configure-7.3.rst b/docs/src/schemas/csp/low/configure/ska-low-csp-configure-7.3.rst new file mode 100644 index 00000000..cc6657a4 --- /dev/null +++ b/docs/src/schemas/csp/low/configure/ska-low-csp-configure-7.3.rst @@ -0,0 +1,40 @@ +CSP configure 7.2 +================= + +JSON schema and example for CSP Low configure + +.. ska-schema:: https://schema.skao.int/ska-low-csp-configure/7.2 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 + + Example (TMC input for CBF 0.4 science_a visibility scan) + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 pss + + Example (CSP configuration for CBF 0.4, PSS 1.3 using pulsar search scan) + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 pss_pst_scan_vr + + Example (CSP configuration for CBF 0.4, PSS 1.3 using pulsar search scan, PST 3.0 using voltage recording scan) + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 pst_scan_pt + + Example (CSP configuration for CBF 0.4, PST 3.0 using pulsar timing scan) + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 pst_scan_ft + + Example (CSP configuration for CBF 0.4, PST 3.0 using flow through scan) + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 pst_scan_vr + + Example (CSP configuration for CBF 0.4, PST 3.0 using voltage recording scan) + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-configure/7.2 pst_scan_df + + Example (CSP configuration for CBF 0.4, PST 3.0 using detect filterbank scan) \ No newline at end of file diff --git a/docs/src/schemas/csp/mid/configurescan/index.rst b/docs/src/schemas/csp/mid/configurescan/index.rst index 205ffba6..b6d4846a 100644 --- a/docs/src/schemas/csp/mid/configurescan/index.rst +++ b/docs/src/schemas/csp/mid/configurescan/index.rst @@ -10,6 +10,7 @@ Examples for the different versions of the configurescan schema :maxdepth: 1 :caption: MID CSP configurescan examples + ska-csp-configure-8.3 ska-csp-configure-8.2 ska-csp-configure-8.1 ska-csp-configure-8.0 diff --git a/docs/src/schemas/csp/mid/configurescan/ska-csp-configure-8.3.rst b/docs/src/schemas/csp/mid/configurescan/ska-csp-configure-8.3.rst new file mode 100644 index 00000000..8a40a822 --- /dev/null +++ b/docs/src/schemas/csp/mid/configurescan/ska-csp-configure-8.3.rst @@ -0,0 +1,44 @@ + +CSP configurescan 8.2 +====================== + +JSON schema and example for CSP Mid configure + +.. ska-schema:: https://schema.skao.int/ska-csp-configurescan/8.2 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 + + Example (TMC input for science_a visibility scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 science_a + + Example (CSP configuration for CBF 6.0 using science_a visibility scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 cal_a + + Example (CSP configuration for CBF 6.0 using cal_a visibility scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 pss + + Example (CSP configuration for CBF 6.0 using PSS scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 pst_scan_pt + + Example (CSP configuration for CBF 6.0 and PST 3.0 pulsar timing scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 pst_scan_ft + + Example (CSP configuration for CBF 6.0 and PST 3.0 flow through scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 pst_scan_vr + + Example (CSP configuration for CBF 6.0 and PST 3.0 voltage recording scan) + + .. ska-schema-example:: https://schema.skao.int/ska-csp-configurescan/8.2 pst_scan_df + + Example (CSP configuration for CBF 6.0 and PST 3.0 using detect filterbank scan) diff --git a/docs/src/schemas/pst/ska-pst-configure-3.1.rst b/docs/src/schemas/pst/ska-pst-configure-3.1.rst new file mode 100644 index 00000000..89d1f809 --- /dev/null +++ b/docs/src/schemas/pst/ska-pst-configure-3.1.rst @@ -0,0 +1,40 @@ +JSON schema and example for Configure version 3.1 +================================================= +.. ska-schema:: https://schema.skao.int/ska-pst-configure/3.1 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 low_pst_scan_ft + + Example (LOW PST configuration for FLOW THROUGH scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 low_pst_scan_pt + + Example (LOW PST configuration for PULSAR TIMING scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 low_pst_scan_df + + Example (LOW PST configuration for DETECTED FILTERBANK scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 low_pst_scan_vr + + Example (LOW PST configuration for VOLTAGE RECORDER scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 mid_pst_scan_ft + + Example (MID PST configuration for FLOW THROUGH scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 mid_pst_scan_pt + + Example (MID PST configuration for PULSAR TIMING scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 mid_pst_scan_df + + Example (MID PST configuration for DETECTED FILTERBANK scan 3.1) + + .. ska-schema-example:: https://schema.skao.int/ska-pst-configure/3.1 mid_pst_scan_vr + + Example (MID PST configuration for VOLTAGE RECORDER scan 3.1) diff --git a/docs/src/schemas/pst/ska-pst-configure.rst b/docs/src/schemas/pst/ska-pst-configure.rst index 39f8b6e9..75c3ab2b 100644 --- a/docs/src/schemas/pst/ska-pst-configure.rst +++ b/docs/src/schemas/pst/ska-pst-configure.rst @@ -6,6 +6,7 @@ Examples for the different versions of the configure schema :maxdepth: 1 :caption: PST configure examples + ska-pst-configure-3.1 ska-pst-configure-3.0 ska-pst-configure-2.5 ska-pst-configure-2.4 diff --git a/src/ska_telmodel/csp/examples.py b/src/ska_telmodel/csp/examples.py index 74fbfb19..2b3db6fd 100644 --- a/src/ska_telmodel/csp/examples.py +++ b/src/ska_telmodel/csp/examples.py @@ -1101,6 +1101,13 @@ def get_csp_config_scan_8_2_example(version: str, scan: str = None) -> dict: return csp_config_8_2 +def get_csp_config_scan_8_3_example(version: str, scan: str = None) -> dict: + csp_config_8_3 = get_csp_config_scan_8_2_example(version, scan) + csp_config_8_3["interface"] = version + + return csp_config_8_3 + + def delete_config_pst_keys(json_example): """Remove PST schema attributes that are not needed in the csp schema.""" @@ -1190,6 +1197,8 @@ def get_csp_config_example(version: str, scan: str = None) -> dict: example = get_csp_config_scan_8_1_example(version, scan) elif version_number == "8.2": example = get_csp_config_scan_8_2_example(version, scan) + elif version_number == "8.3": + example = get_csp_config_scan_8_3_example(version, scan) else: raise ValueError(f"Could not generate example for schema {version}!") diff --git a/src/ska_telmodel/csp/low_examples.py b/src/ska_telmodel/csp/low_examples.py index 91cb3e0c..655258b4 100644 --- a/src/ska_telmodel/csp/low_examples.py +++ b/src/ska_telmodel/csp/low_examples.py @@ -335,6 +335,9 @@ def get_low_csp_assignresources_example(version: str): elif version.startswith(lowcsp_assignresources_uri(7, 2)): example = update_interface(LOW_CSP_ASSIGNRESOURCES_6_0, "7.2") return copy.deepcopy(example) + elif version.startswith(lowcsp_assignresources_uri(7, 3)): + example = update_interface(LOW_CSP_ASSIGNRESOURCES_6_0, "7.3") + return copy.deepcopy(example) raise ValueError(f"Could not generate example for schema {version})!") @@ -381,6 +384,9 @@ def get_low_csp_configure_example(version: str, scan_type=None): elif version.startswith(lowcsp_configure_uri(7, 2)): example = copy.deepcopy(LOW_CSP_CONFIGURE_5_0) csp_base_example = update_interface(example, "7.2") + elif version.startswith(lowcsp_configure_uri(7, 3)): + example = copy.deepcopy(LOW_CSP_CONFIGURE_5_0) + csp_base_example = update_interface(example, "7.3") else: raise ValueError(f"Could not generate example for schema {version})!") @@ -550,6 +556,9 @@ def get_low_csp_releaseresources_example(version: str): elif version.startswith(lowcsp_releaseresources_uri(7, 2)): example = update_interface(LOW_CSP_RELEASERESOURCES_6_0, "7.2") return copy.deepcopy(example) + elif version.startswith(lowcsp_releaseresources_uri(7, 3)): + example = update_interface(LOW_CSP_RELEASERESOURCES_6_0, "7.3") + return copy.deepcopy(example) raise ValueError(f"Could not generate example for schema {version})!") @@ -584,4 +593,7 @@ def get_low_csp_scan_example(version: str): elif version.startswith(lowcsp_scan_uri(7, 2)): example = update_interface(LOW_CSP_SCAN_4_0, "7.2") return copy.deepcopy(example) + elif version.startswith(lowcsp_scan_uri(7, 3)): + example = update_interface(LOW_CSP_SCAN_4_0, "7.3") + return copy.deepcopy(example) raise ValueError(f"Could not generate example for schema {version})!") diff --git a/src/ska_telmodel/csp/low_version.py b/src/ska_telmodel/csp/low_version.py index 39d9d6d5..348a141e 100644 --- a/src/ska_telmodel/csp/low_version.py +++ b/src/ska_telmodel/csp/low_version.py @@ -37,6 +37,7 @@ CompatibilityMap = { "7.0": {"lowcbf": "0.3", "pss": "1.2", "pst": "3.0"}, "7.1": {"lowcbf": "0.4", "pss": "1.2", "pst": "3.0"}, "7.2": {"lowcbf": "0.4", "pss": "1.3", "pst": "3.0"}, + "7.3": {"lowcbf": "0.4", "pss": "1.3", "pst": "3.1"}, } # note: v4.0 is not used by CBF device yet _ALLOWED_LOW_URI_PREFIXES = [ diff --git a/src/ska_telmodel/csp/version.py b/src/ska_telmodel/csp/version.py index 11bb139e..8b2adbe7 100644 --- a/src/ska_telmodel/csp/version.py +++ b/src/ska_telmodel/csp/version.py @@ -56,6 +56,7 @@ CSP_CONFIG_VER7_0 = CSP_CONFIGSCAN_PREFIX + "7.0" CSP_CONFIG_VER8_0 = CSP_CONFIGSCAN_PREFIX + "8.0" CSP_CONFIG_VER8_1 = CSP_CONFIGSCAN_PREFIX + "8.1" CSP_CONFIG_VER8_2 = CSP_CONFIGSCAN_PREFIX + "8.2" +CSP_CONFIG_VER8_3 = CSP_CONFIGSCAN_PREFIX + "8.3" # CSP configuration versions, chronologically sorted CSP_CONFIG_VERSIONS = sorted( @@ -80,6 +81,7 @@ CSP_CONFIG_VERSIONS = sorted( CSP_CONFIG_VER8_0, CSP_CONFIG_VER8_1, CSP_CONFIG_VER8_2, + CSP_CONFIG_VER8_3, ], key=split_interface_version, ) @@ -266,4 +268,9 @@ ConfigCompatibilityMap = { "pss": "1.3", "pst": "3.0", }, # PSS not supported by CBF + "8.3": { + "midcbf": "6.0", + "pss": "1.3", + "pst": "3.1", + }, # PSS not supported by CBF } diff --git a/src/ska_telmodel/pst/examples.py b/src/ska_telmodel/pst/examples.py index 91b94dca..5d9fb78c 100644 --- a/src/ska_telmodel/pst/examples.py +++ b/src/ska_telmodel/pst/examples.py @@ -6,6 +6,7 @@ from .version import ( PST_CONFIG_VER2_4, PST_CONFIG_VER2_5, PST_CONFIG_VER3_0, + PST_CONFIG_VER3_1, check_interface_version, ) @@ -160,6 +161,7 @@ VERSION_PST_INTERFACE: dict[tuple[int, int], str] = { (2, 4): PST_CONFIG_VER2_4, (2, 5): PST_CONFIG_VER2_5, (3, 0): PST_CONFIG_VER3_0, + (3, 1): PST_CONFIG_VER3_1, } @@ -175,7 +177,7 @@ def _get_base_example( example["common"]["frequency_band"] = frequency_band example["interface"] = VERSION_PST_INTERFACE.get( - (major, minor), PST_CONFIG_VER3_0 + (major, minor), PST_CONFIG_VER3_1 ) return example @@ -208,28 +210,29 @@ def _get_scan_common_example( }, } - example["destinations"] = { - "dashboards": [ - { - "data_type": "pst_bandpass", - "host": "10.0.0.2", - "port": "9092", - "topic": "pst-bandpass-pb-mvp01-20251105-00001", - }, - { - "data_type": "pst_timeseries", - "host": "10.0.0.2", - "port": "9092", - "topic": "pst-timeseries-pb-mvp01-20251105-00001", - }, - { - # this example shows using the default port number - "data_type": "pst_histogram", - "host": "10.0.0.2", - "topic": "pst-histogram-pb-mvp01-20251105-00001", - }, - ] - } + if (major, minor) >= (3, 1): + example["destinations"] = { + "dashboards": [ + { + "data_type": "pst_bandpass", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-bandpass-pb-mvp01-20251105-00001", + }, + { + "data_type": "pst_timeseries", + "host": "10.0.0.2", + "port": "9092", + "topic": "pst-timeseries-pb-mvp01-20251105-00001", + }, + { + # this example shows using the default port number + "data_type": "pst_histogram", + "host": "10.0.0.2", + "topic": "pst-histogram-pb-mvp01-20251105-00001", + }, + ] + } # remove deprecated fields del example["observation_mode"] diff --git a/src/ska_telmodel/pst/version.py b/src/ska_telmodel/pst/version.py index 242a7b11..b9d09950 100644 --- a/src/ska_telmodel/pst/version.py +++ b/src/ska_telmodel/pst/version.py @@ -8,9 +8,15 @@ PST_CONFIG_VER0 = PST_CONFIGURE_PREFIX + "0" PST_CONFIG_VER2_4 = PST_CONFIGURE_PREFIX + "2.4" PST_CONFIG_VER2_5 = PST_CONFIGURE_PREFIX + "2.5" PST_CONFIG_VER3_0 = PST_CONFIGURE_PREFIX + "3.0" +PST_CONFIG_VER3_1 = PST_CONFIGURE_PREFIX + "3.1" PST_CONFIG_VERSIONS = sorted( - [PST_CONFIG_VER2_4, PST_CONFIG_VER2_5, PST_CONFIG_VER3_0], + [ + PST_CONFIG_VER2_4, + PST_CONFIG_VER2_5, + PST_CONFIG_VER3_0, + PST_CONFIG_VER3_1, + ], key=split_interface_version, ) diff --git a/tests/test_csp_low_schemas.py b/tests/test_csp_low_schemas.py index e2fe62d4..4a194e89 100644 --- a/tests/test_csp_low_schemas.py +++ b/tests/test_csp_low_schemas.py @@ -21,7 +21,19 @@ from tests.test_csp_schemas import ( @pytest.mark.parametrize( "uri_version", - ["2.0", "3.0", "3.1", "3.2", "4.0", "5.0", "6.0", "7.0", "7.1", "7.2"], + [ + "2.0", + "3.0", + "3.1", + "3.2", + "4.0", + "5.0", + "6.0", + "7.0", + "7.1", + "7.2", + "7.3", + ], ) def test_low_csp_assignresources(uri_version): """ @@ -74,7 +86,19 @@ def test_low_csp_assignresources_invalid(): @pytest.mark.parametrize( "uri_version", - ["2.0", "3.0", "3.1", "3.2", "4.0", "5.0", "6.0", "7.0", "7.1", "7.2"], + [ + "2.0", + "3.0", + "3.1", + "3.2", + "4.0", + "5.0", + "6.0", + "7.0", + "7.1", + "7.2", + "7.3", + ], ) def test_low_csp_releaseresources(uri_version): """ @@ -112,7 +136,7 @@ def test_low_csp_releaseresources(uri_version): @pytest.mark.parametrize( "prefix", [LOWCSP_RELEASERESOURCES_PREFIX, LOWCSP_ASSIGNRESOURCES_PREFIX] ) -@pytest.mark.parametrize("csp_ver", ["5.0", "6.0", "7.0", "7.1", "7.2"]) +@pytest.mark.parametrize("csp_ver", ["5.0", "6.0", "7.0", "7.1", "7.2", "7.3"]) @pytest.mark.parametrize( "csp_field", [ @@ -152,7 +176,7 @@ def test_low_csp_releaseresources_invalid(): @pytest.mark.parametrize( - "csp_ver", ["3.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2"] + "csp_ver", ["3.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2", "7.3"] ) def test_low_csp_pst_scan_pulsar_timing_schema(csp_ver): """ @@ -166,7 +190,7 @@ def test_low_csp_pst_scan_pulsar_timing_schema(csp_ver): validate(uri_low_csp, csp_config_pst_pt, 2) -@pytest.mark.parametrize("csp_ver", ["5.0", "6.0", "7.0", "7.1", "7.2"]) +@pytest.mark.parametrize("csp_ver", ["5.0", "6.0", "7.0", "7.1", "7.2", "7.3"]) def test_low_csp_configure_with_scan_detected_filter(csp_ver): """ Test DETECT FILTER BANK configuration for (CSP => 5.0, PST => 3.0) @@ -179,7 +203,7 @@ def test_low_csp_configure_with_scan_detected_filter(csp_ver): @pytest.mark.parametrize( - "csp_ver", ["3.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2"] + "csp_ver", ["3.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2", "7.3"] ) def test_low_csp_pst_scan_flow_through_schema(csp_ver): """ @@ -202,7 +226,7 @@ def test_low_csp_pst_scan_flow_through_schema(csp_ver): @pytest.mark.parametrize( - "csp_ver", ["2.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2"] + "csp_ver", ["2.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2", "7.3"] ) def test_low_csp_pst_scan_voltage_recorder_schema(csp_ver): """ @@ -228,7 +252,7 @@ def test_low_csp_pst_scan_voltage_recorder_schema(csp_ver): @pytest.mark.parametrize( - "csp_ver", ["3.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2"] + "csp_ver", ["3.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2", "7.3"] ) def test_low_csp_pst_scan_dynamic_spectrum_schema(csp_ver): """ @@ -263,7 +287,19 @@ def test_low_csp_pst_scan_dynamic_spectrum_schema(csp_ver): @pytest.mark.parametrize( "uri_version", - ["2.0", "3.0", "3.1", "3.2", "4.0", "5.0", "6.0", "7.0", "7.1", "7.2"], + [ + "2.0", + "3.0", + "3.1", + "3.2", + "4.0", + "5.0", + "6.0", + "7.0", + "7.1", + "7.2", + "7.3", + ], ) def test_low_csp_scan(uri_version): """ @@ -302,7 +338,19 @@ def test_low_csp_invalid_scan(): @pytest.mark.parametrize( "uri_version", - ["2.0", "3.0", "3.1", "3.2", "4.0", "5.0", "6.0", "7.0", "7.1", "7.2"], + [ + "2.0", + "3.0", + "3.1", + "3.2", + "4.0", + "5.0", + "6.0", + "7.0", + "7.1", + "7.2", + "7.3", + ], ) def test_low_csp_configure(uri_version): """ @@ -352,7 +400,7 @@ def test_low_csp_invalid_configure(): @pytest.mark.parametrize( "uri_version", - ["3.0", "3.1", "3.2", "4.0", "5.0", "6.0", "7.0", "7.1", "7.2"], + ["3.0", "3.1", "3.2", "4.0", "5.0", "6.0", "7.0", "7.1", "7.2", "7.3"], ) def test_low_csp_configure_beam_id(uri_version): """Consistency check of the beam_ids attribute in CBF and PST examples""" @@ -530,7 +578,7 @@ def test_csp_low_delaymodel_station_beam_delays_key(uri_version, omitted_key): validate(low_delaymodel_uri, csp_low_delaymodel_erroneous, 2) -@pytest.mark.parametrize("csp_ver", ["7.0", "7.1"]) +@pytest.mark.parametrize("csp_ver", ["7.0", "7.1", "7.2", "7.3"]) def test_low_csp_pss_pst_scan_voltage_recorder_schema(csp_ver): """ Test FLOW THROUGH configuration for (CSP 3.0, PST 2.4, CBF 0.3/0.4 @@ -551,7 +599,7 @@ def test_low_csp_pss_pst_scan_voltage_recorder_schema(csp_ver): @pytest.mark.parametrize( - "csp_ver", ["2.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1"] + "csp_ver", ["2.0", "3.1", "3.2", "5.0", "6.0", "7.0", "7.1", "7.2", "7.3"] ) def test_low_csp_pss_schema(csp_ver): """ diff --git a/tests/test_pst_schema.py b/tests/test_pst_schema.py index 604e9275..fadd42ee 100644 --- a/tests/test_pst_schema.py +++ b/tests/test_pst_schema.py @@ -1,5 +1,6 @@ import pytest +from ska_telmodel._common import split_interface_version from ska_telmodel.pst.examples import get_pst_config_example from ska_telmodel.pst.version import ( PST_CONFIGURE_PREFIX, @@ -47,12 +48,18 @@ from ska_telmodel.schema import validate ("3.0", "mid_pst_scan_ft", "FLOW_THROUGH"), ("3.0", "mid_pst_scan_df", "DETECTED_FILTERBANK"), ("3.0", "mid_pst_scan_pt", "PULSAR_TIMING"), + ("3.1", "mid_pst_scan_vr", "VOLTAGE_RECORDER"), + ("3.1", "mid_pst_scan_ft", "FLOW_THROUGH"), + ("3.1", "mid_pst_scan_df", "DETECTED_FILTERBANK"), + ("3.1", "mid_pst_scan_pt", "PULSAR_TIMING"), ], ) def test_pst_configure_schema( pst_ver: str, scan_type: str, expected_pst_processing_mode: str ) -> None: uri = PST_CONFIGURE_PREFIX + pst_ver + (major, minor) = split_interface_version(uri) + scan_config = get_pst_config_example(uri, scan_type) assert ( scan_config["interface"] == uri @@ -73,6 +80,11 @@ def test_pst_configure_schema( else: assert scan_config["common"]["frequency_band"] == "low" + if (major, minor) >= (3, 1): + assert "destinations" in scan_config["pst"]["scan"] + else: + assert "destinations" not in scan_config["pst"]["scan"] + @pytest.mark.parametrize("pst_ver", ["1.0"]) def test_pst_schema_validation_with_invalid_version_low(pst_ver: str): @@ -109,7 +121,7 @@ def test_pst_schema_validation_with_invalid_prefix(pst_ver): validate(invalid_uri, pst_config_beam_ft, 2) -@pytest.mark.parametrize("pst_ver", ["2.4", "2.5", "3.0"]) +@pytest.mark.parametrize("pst_ver", ["2.4", "2.5", "3.0", "3.1"]) def test_pst_check_interface_version(pst_ver): """ Test to verify invalid PST version -- GitLab From 5cc2852930b05cd8182542f52975817b489583aa Mon Sep 17 00:00:00 2001 From: Will Gauvin Date: Thu, 11 Dec 2025 15:39:32 +1100 Subject: [PATCH 6/6] AT3-1090 fix broken docs build for CSP schemas --- .../ska-low-csp-assignresources-7.4.rst | 15 +++++++++++++++ .../schemas/csp/low/releaseresources/index.rst | 1 + .../ska-low-csp-releaseresources-7.4.rst | 15 +++++++++++++++ docs/src/schemas/csp/low/scan/index.rst | 2 ++ .../schemas/csp/low/scan/ska-low-csp-scan-7.3.rst | 15 +++++++++++++++ .../schemas/csp/low/scan/ska-low-csp-scan-7.4.rst | 15 +++++++++++++++ docs/src/schemas/csp/mid/configurescan/index.rst | 1 + 7 files changed, 64 insertions(+) create mode 100644 docs/src/schemas/csp/low/assignresources/ska-low-csp-assignresources-7.4.rst create mode 100644 docs/src/schemas/csp/low/releaseresources/ska-low-csp-releaseresources-7.4.rst create mode 100644 docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.3.rst create mode 100644 docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.4.rst diff --git a/docs/src/schemas/csp/low/assignresources/ska-low-csp-assignresources-7.4.rst b/docs/src/schemas/csp/low/assignresources/ska-low-csp-assignresources-7.4.rst new file mode 100644 index 00000000..4045332c --- /dev/null +++ b/docs/src/schemas/csp/low/assignresources/ska-low-csp-assignresources-7.4.rst @@ -0,0 +1,15 @@ +CSP assignresources 7.4 +======================= + +JSON schema and example for CSP Low assignresources + +.. ska-schema:: https://schema.skao.int/ska-low-csp-assignresources/7.4 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-assignresources/7.4 + + Example JSON (LOW CSP assignresources v. 7.4) diff --git a/docs/src/schemas/csp/low/releaseresources/index.rst b/docs/src/schemas/csp/low/releaseresources/index.rst index 0e415ae9..3c2a8685 100644 --- a/docs/src/schemas/csp/low/releaseresources/index.rst +++ b/docs/src/schemas/csp/low/releaseresources/index.rst @@ -9,6 +9,7 @@ Examples for the different versions of the releaseresources schema :maxdepth: 1 :caption: LOW CSP releaseresources examples + ska-low-csp-releaseresources-7.4 ska-low-csp-releaseresources-7.3 ska-low-csp-releaseresources-7.2 ska-low-csp-releaseresources-7.1 diff --git a/docs/src/schemas/csp/low/releaseresources/ska-low-csp-releaseresources-7.4.rst b/docs/src/schemas/csp/low/releaseresources/ska-low-csp-releaseresources-7.4.rst new file mode 100644 index 00000000..18d8b744 --- /dev/null +++ b/docs/src/schemas/csp/low/releaseresources/ska-low-csp-releaseresources-7.4.rst @@ -0,0 +1,15 @@ +CSP releaseresources 7.4 +======================== + +JSON schema and example for CSP Low releaseresources + +.. ska-schema:: https://schema.skao.int/ska-low-csp-releaseresources/7.4 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-releaseresources/7.4 + + Example JSON (LOW CSP releaseresources JSON v. 7.4) diff --git a/docs/src/schemas/csp/low/scan/index.rst b/docs/src/schemas/csp/low/scan/index.rst index f4ccb3bd..da90c85f 100644 --- a/docs/src/schemas/csp/low/scan/index.rst +++ b/docs/src/schemas/csp/low/scan/index.rst @@ -9,6 +9,8 @@ Examples for the different versions of the scan schema :maxdepth: 1 :caption: LOW CSP scan examples + ska-low-csp-scan-7.4 + ska-low-csp-scan-7.3 ska-low-csp-scan-7.2 ska-low-csp-scan-7.1 ska-low-csp-scan-7.0 diff --git a/docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.3.rst b/docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.3.rst new file mode 100644 index 00000000..14b4b86b --- /dev/null +++ b/docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.3.rst @@ -0,0 +1,15 @@ +CSP scan 7.3 +============ + +JSON schema and example for CSP Low scan + +.. ska-schema:: https://schema.skao.int/ska-low-csp-scan/7.3 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-scan/7.3 + + Example JSON (LOW CSP scan JSON v. 7.3) diff --git a/docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.4.rst b/docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.4.rst new file mode 100644 index 00000000..10000a82 --- /dev/null +++ b/docs/src/schemas/csp/low/scan/ska-low-csp-scan-7.4.rst @@ -0,0 +1,15 @@ +CSP scan 7.4 +============ + +JSON schema and example for CSP Low scan + +.. ska-schema:: https://schema.skao.int/ska-low-csp-scan/7.4 + :auto_reference: + :auto_target: + :lift_description: + :lift_definitions: + :lift_title: + + .. ska-schema-example:: https://schema.skao.int/ska-low-csp-scan/7.4 + + Example JSON (LOW CSP scan JSON v. 7.4) diff --git a/docs/src/schemas/csp/mid/configurescan/index.rst b/docs/src/schemas/csp/mid/configurescan/index.rst index b6d4846a..5a1dd50b 100644 --- a/docs/src/schemas/csp/mid/configurescan/index.rst +++ b/docs/src/schemas/csp/mid/configurescan/index.rst @@ -10,6 +10,7 @@ Examples for the different versions of the configurescan schema :maxdepth: 1 :caption: MID CSP configurescan examples + ska-csp-configure-8.4 ska-csp-configure-8.3 ska-csp-configure-8.2 ska-csp-configure-8.1 -- GitLab