Skip to content

Commit

Permalink
Address issues by kbabioch
Browse files Browse the repository at this point in the history
  • Loading branch information
gerw committed Jul 22, 2023
1 parent 82e16ef commit 0775434
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion luxtronik/data_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def __init__(self):
self._data = {}

def __iter__(self):
"""Iterator for the data entries."""
return iter(self._data.items())

def parse(self, raw_data):
Expand All @@ -30,7 +31,13 @@ def parse(self, raw_data):
self._data[index] = entry

def _lookup(self, target, with_index=False):
"""Lookup entry by either id or name."""
"""
Lookup an entry
"target" could either be its id or its name.
In case "with_index" is set, also the index is returned.
"""
if isinstance(target, str):
try:
# Try to get entry by id
Expand Down
1 change: 1 addition & 0 deletions tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TestParameters:
def test_init(self):
"""Test cases for initialization"""
parameters = Parameters()
assert parameters.name == "Parameter"
assert parameters.safe
assert len(parameters.queue) == 0

Expand Down

0 comments on commit 0775434

Please sign in to comment.