@@ -943,11 +943,9 @@ def _draw_value(param, point=None, givens=None, size=None):
943
943
944
944
945
945
def _is_one_d (dist_shape ):
946
- if hasattr (dist_shape , "dshape" ) and dist_shape .dshape in ((), ( 0 , ), ( 1 ,)) :
946
+ if hasattr (dist_shape , "dshape" ) and dist_shape .dshape in { ( ), } :
947
947
return True
948
- elif hasattr (dist_shape , "shape" ) and dist_shape .shape in ((), (0 ,), (1 ,)):
949
- return True
950
- elif to_tuple (dist_shape ) == ():
948
+ elif hasattr (dist_shape , "shape" ) and dist_shape .shape in { (), }:
951
949
return True
952
950
return False
953
951
@@ -1069,6 +1067,7 @@ def generate_samples(generator, *args, **kwargs):
1069
1067
len (samples .shape ) > len (dist_shape )
1070
1068
and samples .shape [- len (dist_shape ) :] == dist_shape [- len (dist_shape ) :]
1071
1069
):
1070
+ raise ValueError (f"This SHOULD be unreachable code. DON'T MERGE UNTIL THIS ENTIRE BLOCK WAS REMOVED. { samples .shape } , { size_tup } " )
1072
1071
samples = samples .reshape (samples .shape [1 :])
1073
1072
1074
1073
if (
@@ -1077,5 +1076,6 @@ def generate_samples(generator, *args, **kwargs):
1077
1076
and samples .shape [- 1 ] == 1
1078
1077
and (samples .shape != size_tup or size_tup == tuple () or size_tup == (1 ,))
1079
1078
):
1079
+ raise ValueError (f"This SHOULD be unreachable code. DON'T MERGE UNTIL THIS ENTIRE BLOCK WAS REMOVED. { samples .shape } , { size_tup } " )
1080
1080
samples = samples .reshape (samples .shape [:- 1 ])
1081
1081
return np .asarray (samples )
0 commit comments