Skip to content

Commit

Permalink
BUG(fields): infer correct lmax in effective_cls()
Browse files Browse the repository at this point in the history
Fixes a bug in the `effective_cls()` function that caused the returned
arrays to be 1 entry too long.

Fixed: A bug in `effective_cls()` that caused arrays to be one entry too
  long if `lmax` was not given explicitly.
  • Loading branch information
ntessore committed Feb 28, 2024
1 parent 67a5721 commit 2f933aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glass/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def effective_cls(cls, weights1, weights2=None, *, lmax=None):

# find lmax if not given
if lmax is None:
lmax = max(map(len, cls), default=-1)
lmax = max(map(len, cls), default=0) - 1

# broadcast weights1 such that its shape ends in n
weights1 = np.asanyarray(weights1)
Expand Down

0 comments on commit 2f933aa

Please sign in to comment.