Skip to content

Commit

Permalink
Switch back to maintained bitarray package
Browse files Browse the repository at this point in the history
The `bitarray-hardbyte` package on PyPI stopped being updated back in
2022 when its packaging improvements were reintegrated into the main
`bitarray` project, see
ilanschnell/bitarray#165 (comment)

There doesn't seem to be a reason to depend on the `bitarray-hardbyte` package
which is no longer maintained. We now depend on the current release of
`bitarray` (2.9.2) which among other things initializes new arrays to
zero, which could help avoid some obscure bugs. This guaranteed
initialization is now used in two places where a temporary `[False,
False...]` array was previously constructed just to initialize a
`bitarray`.
  • Loading branch information
jonathanperret committed Jun 27, 2024
1 parent 1ca126e commit c34da0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PyInstaller==6.4.0
Pillow==10
pyserial==3.5
sliplib==0.6.2
bitarray-hardbyte==2.3.8
bitarray==2.9.2
simpleaudio==1.0.4
wave==0.0.2
numpy==1.26.4
Expand Down
2 changes: 1 addition & 1 deletion src/main/python/main/ayab/engine/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def __update_status(self, line_number: int, color: int, bits: bitarray) -> None:
def select_needles_API6(
self, color: int, row_index: int, blank_line: bool
) -> bitarray:
bits = bitarray([False] * self.machine.width, endian="little")
bits = bitarray(self.machine.width, endian="little")

# select needles flanking the pattern
# if necessary to knit the background color
Expand Down
2 changes: 1 addition & 1 deletion src/main/python/main/ayab/engine/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __convert(self) -> None:
[0 for i in range(self.__num_colors)] for j in range(self.__pat_height)
] # unused
self.__pattern_expanded = [
bitarray([False] * self.__pat_width)
bitarray(self.__pat_width)
for j in range(self.__num_colors * self.__pat_height)
]

Expand Down

0 comments on commit c34da0b

Please sign in to comment.