File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/power_grid_model/_core Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -651,8 +651,12 @@ def _extract_columnar_data(
651
651
"""
652
652
not_columnar_data_message = "Expected columnar data"
653
653
654
- if_is_batch = [2 , 3 ] if is_batch else [1 , 2 ]
655
- allowed_dims = (if_is_batch ) if is_batch is not None else [1 , 2 , 3 ]
654
+ if is_batch is None :
655
+ allowed_dims = [1 , 2 , 3 ]
656
+ elif is_batch :
657
+ allowed_dims = [2 , 3 ]
658
+ else :
659
+ allowed_dims = [1 , 2 ]
656
660
657
661
sub_data = data ["data" ] if is_sparse (data ) else data
658
662
@@ -684,6 +688,13 @@ def _extract_row_based_data(
684
688
if_is_batch = [2 ] if is_batch else [1 ]
685
689
allowed_dims = if_is_batch if is_batch is not None else [1 , 2 ]
686
690
691
+ if is_batch is None :
692
+ allowed_dims = [1 , 2 ]
693
+ elif is_batch :
694
+ allowed_dims = [2 ]
695
+ else :
696
+ allowed_dims = [1 ]
697
+
687
698
sub_data = data ["data" ] if is_sparse (data ) else data
688
699
689
700
if not isinstance (sub_data , np .ndarray ):
You can’t perform that action at this time.
0 commit comments