Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\threading.py", line 911, in _bootstrap_inner
self.run()
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\threading.py", line 859, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 278, in _parallel_receive_loop
self.receive_message()
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 102, in receive_message
self._message_received(message)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 82, in _message_received
self._state.receive_message(message)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 51, in receive_message
message.received_by(self)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\hardware_messages.py", line 355, in received_by
visitor.receive_line_request(self)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 474, in receive_line_request
self._next(KnittingLine, message.line_number)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 193, in _next
self._communication.state = state_class(self._communication, *args)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 180, in state
self._state.enter()
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\states.py", line 513, in enter
self._communication.send(LineConfirmation, self._line_number)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\__init__.py", line 148, in send
message.send()
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\host_messages.py", line 52, in send
self._file.write(self.as_bytes())
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\host_messages.py", line 48, in as_bytes
return bytes([self.MESSAGE_ID]) + self.content_bytes()
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\host_messages.py", line 145, in content_bytes
return get_message(self._line_number)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\cache.py", line 67, in get_line_configuration_message
line_bytes += bytes([self.is_last(line_number)])
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\cache.py", line 35, in is_last
return self.get(line_number + 1) is None
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\communication\cache.py", line 26, in get
self._get_cache[line_number] = self._get(line_number)
File "C:\Users\cheche\Documents\programmiertes\kniitting\KivyInstaller\lib\site-packages\AYABInterface\interaction.py", line 88, in _get_needle_positions
color_index = colors.index(color)
ValueError: 'black' is not in list
Hints:
Interaction.colors only takes the first row into account
Solution:
The number of colors is required and useful for many applications.
In knittingpattern add the following methods:
[x] Instruction.colors
[x] Row.colors
[x] KnittingPattern.colors
[x] Make sure we return a list and not a set with a fixed order of colors.
[x] Assume the colors are not order-able. List them in order of appearance.
Also,
[x] Interaction.colors should be KnittingPattern.colors
This error happened while knitting:
Hints:
Interaction.colors
only takes the first row into accountSolution:
The number of colors is required and useful for many applications. In knittingpattern add the following methods:
Instruction.colors
Row.colors
KnittingPattern.colors
Also,
Interaction.colors
should beKnittingPattern.colors