File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3624,17 +3624,22 @@ def asarray(array: np.ndarray | blosc2.C2Array, **kwargs: Any) -> NDArray:
3624
3624
3625
3625
3626
3626
def _check_ndarray_kwargs (** kwargs ): # noqa: C901
3627
- if "storage" in kwargs :
3627
+ storage = kwargs .get ("storage" )
3628
+ if storage is not None :
3628
3629
for key in kwargs :
3629
3630
if key in list (blosc2 .Storage .__annotations__ ):
3630
3631
raise AttributeError (
3631
3632
"Cannot pass both `storage` and other kwargs already included in Storage"
3632
3633
)
3633
- storage = kwargs .get ("storage" )
3634
3634
if isinstance (storage , blosc2 .Storage ):
3635
3635
kwargs = {** kwargs , ** asdict (storage )}
3636
3636
else :
3637
3637
kwargs = {** kwargs , ** storage }
3638
+ else :
3639
+ # Add the default storage values as long as they are not already passed
3640
+ storage_dflts = asdict (blosc2 .Storage (urlpath = kwargs .get ("urlpath" ))) # urlpath can affect defaults
3641
+ not_passed = {k : v for k , v in storage_dflts .items () if k not in kwargs }
3642
+ kwargs = {** kwargs , ** not_passed }
3638
3643
3639
3644
supported_keys = [
3640
3645
"chunks" ,
You can’t perform that action at this time.
0 commit comments