Skip to content

Commit

Permalink
Make variable name consistent with parameter names, fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed Nov 6, 2023
1 parent d6e1728 commit 0d56dd2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions leo_fw/leo_fw/nodes/parameter_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ def __init__(self, executor: MultiThreadedExecutor) -> None:
)
self.declare_parameter("override_params_file_path", "")

self.default_param_file: str = (
self.default_params_file: str = (
self.get_parameter("default_params_file_path")
.get_parameter_value()
.string_value
)
self.override_param_file: str = (
self.override_params_file: str = (
self.get_parameter("override_params_file_path")
.get_parameter_value()
.string_value
Expand Down Expand Up @@ -116,19 +116,19 @@ def __init__(self, executor: MultiThreadedExecutor) -> None:
self.send_params(boot_firmware=False)

def load_yaml_configs(self) -> None:
if self.default_param_file == "":
if self.default_params_file == "":
self.get_logger().error("Path to file with default parameters is empty!")
raise UserWarning("Path to file with default parameters is empty!")

with open(self.default_param_file, "r", encoding="utf-8") as file:
with open(self.default_params_file, "r", encoding="utf-8") as file:
try:
self.default_config: dict = yaml.safe_load(file)
except yaml.YAMLError as exc:
self.get_logger().error(exc)
raise

if self.override_param_file != "":
with open(self.override_param_file, "r", encoding="utf-8") as file:
if self.override_params_file != "":
with open(self.override_params_file, "r", encoding="utf-8") as file:
try:
self.override_config: dict = yaml.safe_load(file)
except yaml.YAMLError as exc:
Expand All @@ -140,8 +140,8 @@ def load_yaml_configs(self) -> None:
def parse_yaml_configs(
self,
param_name_prefix: str = "",
default_dict: dict = None,
override_dict: dict = None,
default_dict: Optional[dict] = None,
override_dict: Optional[dict] = None,
) -> None:
if default_dict is None:
default_dict = self.default_config
Expand Down

0 comments on commit 0d56dd2

Please sign in to comment.