Skip to content

Commit

Permalink
Merge pull request #288 from DimitriPapadopoulos/PTC-W0015
Browse files Browse the repository at this point in the history
Unnecessary generator
  • Loading branch information
FrancescAlted authored Oct 16, 2024
2 parents e0ab2f7 + 11d1c45 commit 65b1d95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/blosc2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def compressor_list(plugins: bool = False) -> list:
"""
cap = blosc2.GLOBAL_REGISTERED_CODECS_STOP if plugins else blosc2.DEFINED_CODECS_STOP
return list(key for key in blosc2.Codec if key.value <= cap)
return [key for key in blosc2.Codec if key.value <= cap]


def set_blocksize(blocksize: int = 0) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/blosc2/lazyexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def validate_inputs(inputs: dict, out=None) -> tuple:
"You need to pass at least one array. Use blosc2.empty() if values are not really needed."
)

inputs = list(input for input in inputs.values() if hasattr(input, "shape"))
inputs = [input for input in inputs.values() if hasattr(input, "shape")]

# All array inputs should have a compatible shape
if len(inputs) > 1:
Expand All @@ -355,7 +355,7 @@ def validate_inputs(inputs: dict, out=None) -> tuple:
return ref.shape, None, None, False

# More checks specific of NDArray inputs
NDinputs = list(input for input in inputs if hasattr(input, "chunks"))
NDinputs = [input for input in inputs if hasattr(input, "chunks")]
if len(NDinputs) == 0:
# All inputs are NumPy arrays, so we cannot take the fast path
return inputs[0].shape, None, None, False
Expand Down

0 comments on commit 65b1d95

Please sign in to comment.