diff --git a/oresat_configs/_yaml_to_od.py b/oresat_configs/_yaml_to_od.py index 55b3129..ecf01b7 100644 --- a/oresat_configs/_yaml_to_od.py +++ b/oresat_configs/_yaml_to_od.py @@ -6,6 +6,7 @@ import canopen from yaml import load + try: from yaml import CLoader as Loader except ImportError: @@ -132,7 +133,9 @@ def _make_rec(obj) -> canopen.objectdictionary.Record: for sub_obj in obj.subindexes: if sub_obj.subindex in rec.subindices: - raise ValueError(f"subindex 0x{sub_obj.subindex:X} aleady in record at record 0x{index:X}") + raise ValueError( + f"subindex 0x{sub_obj.subindex:X} aleady in record at record 0x{index:X}" + ) var = _make_var(sub_obj, index, sub_obj.subindex) rec.add_member(var) var0.default = sub_obj.subindex diff --git a/oresat_configs/beacon_config.py b/oresat_configs/beacon_config.py index f724da1..be3ff81 100644 --- a/oresat_configs/beacon_config.py +++ b/oresat_configs/beacon_config.py @@ -4,6 +4,7 @@ from typing import List from yaml import load + try: from yaml import CLoader as Loader except ImportError: diff --git a/oresat_configs/card_config.py b/oresat_configs/card_config.py index c55da4b..3813194 100644 --- a/oresat_configs/card_config.py +++ b/oresat_configs/card_config.py @@ -4,6 +4,7 @@ from typing import Any, Dict, List, Optional, Union from yaml import load + try: from yaml import CLoader as Loader except ImportError: diff --git a/oresat_configs/scripts/gen_xtce.py b/oresat_configs/scripts/gen_xtce.py index dea803d..5e939ca 100644 --- a/oresat_configs/scripts/gen_xtce.py +++ b/oresat_configs/scripts/gen_xtce.py @@ -124,11 +124,7 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): ) ET.SubElement(uint128_type, "UnitSet") bin_data_enc = ET.SubElement( - uint128_type, - "BinaryDataEncoding", - attrib={ - "bitOrder": "leastSignificantBitFirst" - } + uint128_type, "BinaryDataEncoding", attrib={"bitOrder": "leastSignificantBitFirst"} ) bin_data_enc_size = ET.SubElement( bin_data_enc, @@ -179,14 +175,10 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): }, ) unit_set = ET.SubElement(para_type, "UnitSet") - dt_len = DT_LEN[obj.data_type] # Length of the data type + dt_len = DT_LEN[obj.data_type] # Length of the data type # Integer-type encoding for Integers int_dt_enc = ET.SubElement( - para_type, - "IntegerDataEncoding", - attrib={ - "sizeInBits": str(dt_len) - } + para_type, "IntegerDataEncoding", attrib={"sizeInBits": str(dt_len)} ) elif obj.data_type in canopen.objectdictionary.UNSIGNED_TYPES and obj.value_descriptions: para_type = ET.SubElement( @@ -197,14 +189,10 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): }, ) unit_set = ET.SubElement(para_type, "UnitSet") - dt_len = DT_LEN[obj.data_type] # Length of the data type + dt_len = DT_LEN[obj.data_type] # Length of the data type # Integer-type encoding for enums int_dt_enc = ET.SubElement( - para_type, - "IntegerDataEncoding", - attrib={ - "sizeInBits": str(dt_len) - } + para_type, "IntegerDataEncoding", attrib={"sizeInBits": str(dt_len)} ) enum_list = ET.SubElement(para_type, "EnumerationList") for value, name in obj.value_descriptions.items(): @@ -293,7 +281,7 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): attrib={ "name": "ax25_header", "parameterTypeRef": "b128_type", - "shortDescription": "AX.25 Header" + "shortDescription": "AX.25 Header", }, ) for obj in config.beacon_def: @@ -319,9 +307,7 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): ET.SubElement( entry_list, "ParameterRefEntry", - attrib={ - "parameterRef": "ax25_header" - }, + attrib={"parameterRef": "ax25_header"}, ) for obj in config.beacon_def: ET.SubElement(