Skip to content

Commit

Permalink
formatting from black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Jan 24, 2024
1 parent 2bb96ac commit 4fb3df2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
5 changes: 4 additions & 1 deletion oresat_configs/_yaml_to_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import canopen
from yaml import load

try:
from yaml import CLoader as Loader
except ImportError:
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions oresat_configs/beacon_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import List

from yaml import load

try:
from yaml import CLoader as Loader
except ImportError:
Expand Down
1 change: 1 addition & 0 deletions oresat_configs/card_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 7 additions & 21 deletions oresat_configs/scripts/gen_xtce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -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():
Expand Down Expand Up @@ -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:
Expand All @@ -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(
Expand Down

0 comments on commit 4fb3df2

Please sign in to comment.