@@ -373,8 +373,7 @@ def _generate_grf(
373373 rng = _rng .rng_dispatcher (xp = xp )
374374
375375 # number of gls and number of fields
376- ngls = len (gls )
377- ngrf = nfields_from_nspectra (ngls )
376+ ngrf = nfields_from_nspectra (len (gls ))
378377
379378 # number of correlated fields if not specified
380379 if ncorr is None :
@@ -548,10 +547,10 @@ def getcl(
548547 i , j = j , i
549548 cl = cls [i * (i + 1 ) // 2 + i - j ]
550549 if lmax is not None :
551- if cl .size > lmax + 1 :
550+ if cl .shape [ 0 ] > lmax + 1 :
552551 cl = cl [: lmax + 1 ]
553552 else :
554- cl = xpx .pad (cl , (0 , lmax + 1 - cl .size ))
553+ cl = xpx .pad (cl , (0 , lmax + 1 - cl .shape [ 0 ] ))
555554 return cl # ty: ignore[invalid-return-type]
556555
557556
@@ -764,7 +763,7 @@ def compute_gaussian_spectra(
764763
765764 gls = []
766765 for i , j , cl in enumerate_spectra (spectra ):
767- gl = glass .grf .compute (cl , fields [i ], fields [j ]) if cl .size > 0 else 0 * cl
766+ gl = glass .grf .compute (cl , fields [i ], fields [j ]) if cl .shape [ 0 ] > 0 else 0 * cl
768767 gls .append (gl )
769768 return gls
770769
@@ -802,12 +801,12 @@ def solve_gaussian_spectra(
802801
803802 gls = []
804803 for i , j , cl in enumerate_spectra (spectra ):
805- if cl .size > 0 :
804+ if cl .shape [ 0 ] > 0 :
806805 # transformation pair
807806 t1 , t2 = fields [i ], fields [j ]
808807
809808 # set zero-padding of solver to 2N
810- pad = 2 * cl .size
809+ pad = 2 * cl .shape [ 0 ]
811810
812811 # if the desired monopole is zero, that is most likely
813812 # and artefact of the theory spectra -- the variance of the
@@ -1008,7 +1007,7 @@ def cov_from_spectra(
10081007 n = nfields_from_nspectra (len (spectra ))
10091008
10101009 # first case: maximum length in input spectra
1011- k = max ((cl .size for cl in spectra ), default = 0 ) if lmax is None else lmax + 1
1010+ k = max ((cl .shape [ 0 ] for cl in spectra ), default = 0 ) if lmax is None else lmax + 1
10121011
10131012 # this is the covariance matrix of the spectra
10141013 # the leading dimension is k, then it is a n-by-n covariance matrix
@@ -1020,7 +1019,7 @@ def cov_from_spectra(
10201019 # if the spectra are ragged, some entries at high ell may remain zero
10211020 # only fill the lower triangular part, everything is symmetric
10221021 for i , j , cl in enumerate_spectra (spectra ):
1023- size = min (k , cl .size )
1022+ size = min (k , cl .shape [ 0 ] )
10241023 cl_flat = xp .reshape (cl , (- 1 ,))
10251024 cov = xpx .at (cov )[:size , i , j ].set (cl_flat [:size ])
10261025 cov = xpx .at (cov )[:size , j , i ].set (cl_flat [:size ])
0 commit comments