Skip to content

Commit

Permalink
Fix cparams overriding code
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Dec 27, 2024
1 parent d894ffd commit 4a74bf0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 7 additions & 3 deletions src/blosc2/lazyexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2627,12 +2627,16 @@ def compute(self, item=None, **kwargs):
# Do copy to avoid modifying the original parameters
aux_kwargs = copy.deepcopy(self.kwargs)
# Update is not recursive
cparams = aux_kwargs.get("cparams", {})
aux_cparams = aux_kwargs.get("cparams", {})
if isinstance(aux_cparams, blosc2.CParams):
# Convert to dictionary
aux_cparams = asdict(aux_cparams)
cparams = kwargs.get("cparams", {})
if isinstance(cparams, blosc2.CParams):
# Convert to dictionary
cparams = asdict(cparams)
cparams.update(kwargs.get("cparams", {}))
aux_kwargs["cparams"] = cparams
aux_cparams.update(cparams)
aux_kwargs["cparams"] = aux_cparams
dparams = aux_kwargs.get("dparams", {})
if isinstance(dparams, blosc2.DParams):
# Convert to dictionary
Expand Down
4 changes: 0 additions & 4 deletions src/blosc2/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3185,10 +3185,6 @@ def linspace_fill(inputs, output, offset):
# C order is guaranteed, and no reshape is needed
return lazyarr.compute(**kwargs)

if len(shape) == 1:
# C order is guaranteed, and no reshape is needed
return lazyarr.compute(**kwargs)

# In principle, when c_order is False, the intermediate array wouldn't be needed,
# but this is faster; see arange() for more details.
larr = lazyarr.compute() # intermediate array
Expand Down

0 comments on commit 4a74bf0

Please sign in to comment.