diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9d65765..6d0c9f36 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3.8 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-ast types: [file, python] @@ -18,7 +18,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.15.0 hooks: - id: pyupgrade args: ["--py38-plus"] @@ -30,12 +30,12 @@ repos: types: [file, python] args: ["--profile", "black", "--filter-files", "--gitignore"] - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.10.0 hooks: - id: black types: [file, python] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.35.0 + rev: v0.37.0 hooks: - id: markdownlint types: [file, markdown] diff --git a/scos_actions/__init__.py b/scos_actions/__init__.py index 9eaeb606..f0a00b37 100644 --- a/scos_actions/__init__.py +++ b/scos_actions/__init__.py @@ -1 +1 @@ -__version__ = "6.3.3" +__version__ = "6.4.0" diff --git a/scos_actions/actions/acquire_sea_data_product.py b/scos_actions/actions/acquire_sea_data_product.py index e9a46d9f..507cf501 100644 --- a/scos_actions/actions/acquire_sea_data_product.py +++ b/scos_actions/actions/acquire_sea_data_product.py @@ -575,7 +575,7 @@ def __call__(self, schedule_entry, task_id): [], ) result_tic = perf_counter() - for i, channel_data_process in enumerate(dp_procs): + for channel_data_process in dp_procs: # Retrieve object references for channel data channel_data_refs = ray.get(channel_data_process) channel_data = [] @@ -796,6 +796,7 @@ def capture_diagnostics(self, action_start_tic: float, cpu_speeds: list) -> None "python_version": sys.version.split()[0], "scos_sensor_version": SCOS_SENSOR_GIT_TAG, "scos_actions_version": SCOS_ACTIONS_VERSION, + "scos_tekrsa_version": self.sigan.plugin_version, "preselector_api_version": PRESELECTOR_API_VERSION, } @@ -822,22 +823,6 @@ def create_global_sensor_metadata(self): ntia_sensor.Sensor( sensor_spec=ntia_core.HardwareSpec( id=self.sensor_definition["sensor_spec"]["id"], - version=self.sensor_definition["sensor_spec"]["version"], - ), - preselector=ntia_sensor.Preselector( - preselector_spec=ntia_core.HardwareSpec( - id=self.sensor_definition["preselector"]["preselector_spec"][ - "id" - ] - ) - ), - signal_analyzer=ntia_sensor.SignalAnalyzer( - sigan_spec=ntia_core.HardwareSpec( - id=self.sensor_definition["signal_analyzer"]["sigan_spec"]["id"] - ) - ), - computer_spec=ntia_sensor.HardwareSpec( - id=self.sensor_definition["computer_spec"]["id"] ), sensor_sha512=SENSOR_DEFINITION_HASH, ) @@ -1059,8 +1044,8 @@ def get_sigmf_builder( sigmf_builder.set_num_channels(len(iter_params)) sigmf_builder.set_task(task_id) - # Mark data as UNCLASSIFIED - sigmf_builder.set_classification("UNCLASSIFIED") + # Mark data as CUI (basic) + sigmf_builder.set_classification("CUI") self.sigmf_builder = sigmf_builder diff --git a/scos_actions/hardware/mocks/mock_sigan.py b/scos_actions/hardware/mocks/mock_sigan.py index d6a18287..b1e82bca 100644 --- a/scos_actions/hardware/mocks/mock_sigan.py +++ b/scos_actions/hardware/mocks/mock_sigan.py @@ -4,6 +4,7 @@ import numpy as np +from scos_actions import __version__ as SCOS_ACTIONS_VERSION from scos_actions.hardware.sigan_iface import SignalAnalyzerInterface from scos_actions.utils import get_datetime_str_now @@ -36,6 +37,7 @@ def __init__(self, randomize_values=False): self._overload = False self._capture_time = None self._is_available = True + self._plugin_version = SCOS_ACTIONS_VERSION # Simulate returning less than the requested number of samples from # self.recv_num_samps @@ -50,6 +52,10 @@ def __init__(self, randomize_values=False): def is_available(self): return self._is_available + @property + def plugin_version(self): + return self._plugin_version + @property def sample_rate(self): return self._sample_rate diff --git a/scos_actions/hardware/sigan_iface.py b/scos_actions/hardware/sigan_iface.py index 0f525a4b..99e25ab9 100644 --- a/scos_actions/hardware/sigan_iface.py +++ b/scos_actions/hardware/sigan_iface.py @@ -64,6 +64,12 @@ def is_available(self) -> bool: """Returns True if sigan is initialized and ready for measurements.""" pass + @property + @abstractmethod + def plugin_version(self) -> str: + """Returns the version of the SCOS plugin defining this interface.""" + pass + @abstractmethod def acquire_time_domain_samples( self, diff --git a/scos_actions/metadata/sigmf_builder.py b/scos_actions/metadata/sigmf_builder.py index 2341d31d..6840e49f 100644 --- a/scos_actions/metadata/sigmf_builder.py +++ b/scos_actions/metadata/sigmf_builder.py @@ -27,7 +27,7 @@ }, { "name": "ntia-diagnostics", - "version": "v1.1.0", + "version": "v1.1.1", "optional": True, }, { diff --git a/scos_actions/metadata/structs/ntia_diagnostics.py b/scos_actions/metadata/structs/ntia_diagnostics.py index 35dce19c..e391e744 100644 --- a/scos_actions/metadata/structs/ntia_diagnostics.py +++ b/scos_actions/metadata/structs/ntia_diagnostics.py @@ -127,6 +127,7 @@ class Software(msgspec.Struct, **SIGMF_OBJECT_KWARGS): :param python_version: The Python version, as returned by `sys.version()`. :param scos_sensor_version: The SCOS Sensor version, as returned by `git describe --tags`. :param scos_actions_version: Version of `scos_actions` plugin. + :param scos_tekrs_version: Version of `scos_tekrsa` plugin. :param preselector_api_version: Version of the NTIA `preselector` package. """ @@ -134,6 +135,7 @@ class Software(msgspec.Struct, **SIGMF_OBJECT_KWARGS): python_version: Optional[str] = None scos_sensor_version: Optional[str] = None scos_actions_version: Optional[str] = None + scos_tekrsa_version: Optional[str] = None preselector_api_version: Optional[str] = None diff --git a/scos_actions/metadata/structs/ntia_sensor.py b/scos_actions/metadata/structs/ntia_sensor.py index 263c6754..c57f605f 100644 --- a/scos_actions/metadata/structs/ntia_sensor.py +++ b/scos_actions/metadata/structs/ntia_sensor.py @@ -31,20 +31,6 @@ class SignalAnalyzer(msgspec.Struct, **SIGMF_OBJECT_KWARGS): max_power: Optional[float] = None a2d_bits: Optional[int] = None - def __post_init__(self): - super().__post_init__() - # Define SigMF key names - self.obj_keys.update( - { - "sigan_spec": "sigan_spec", - "frequency_low": "frequency_low", - "frequency_high": "frequency_high", - "noise_figure": "noise_figure", - "max_power": "max_power", - "a2d_bits": "a2d_bits", - } - ) - class CalSource( msgspec.Struct, rename={"cal_source_type": "type"}, **SIGMF_OBJECT_KWARGS