File tree Expand file tree Collapse file tree
autoarray/structures/grids Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,21 +40,23 @@ def convert_grid_1d(
4040
4141 grid_1d = grid_2d_util .convert_grid (grid = grid_1d )
4242
43- is_native = grid_1d . shape [ 0 ] == mask_1d . shape_native [ 0 ]
43+ is_numpy = True if isinstance ( grid_1d , np . ndarray ) else False
4444
45- mask_1d = jnp . array ( mask_1d .array )
45+ is_native = grid_1d . shape [ 0 ] == mask_1d .shape_native [ 0 ]
4646
4747 if is_native == store_native :
48- return grid_1d
48+ grid_1d = grid_1d
4949 elif not store_native :
50- return grid_1d_slim_from (
50+ grid_1d = grid_1d_slim_from (
5151 grid_1d_native = grid_1d ,
5252 mask_1d = mask_1d ,
5353 )
54- return grid_1d_native_from (
55- grid_1d_slim = grid_1d ,
56- mask_1d = mask_1d ,
57- )
54+ else :
55+ grid_1d = grid_1d_native_from (
56+ grid_1d_slim = grid_1d ,
57+ mask_1d = mask_1d ,
58+ )
59+ return np .array (grid_1d ) if is_numpy else jnp .array (grid_1d )
5860
5961
6062def grid_1d_slim_via_shape_slim_from (
You can’t perform that action at this time.
0 commit comments