Skip to content

Commit

Permalink
gh-447: make sure dz gives the same results as nbins (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy authored Nov 21, 2024
1 parent d5f4fd8 commit 6fbeb97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glass/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def fixed_zbins(
if nbins is not None and dz is None:
zbinedges = np.linspace(zmin, zmax, nbins + 1)
elif nbins is None and dz is not None:
zbinedges = np.arange(zmin, zmax, dz)
zbinedges = np.arange(zmin, np.nextafter(zmax + dz, zmax), dz)
else:
msg = "exactly one of nbins and dz must be given"
raise ValueError(msg)
Expand Down

0 comments on commit 6fbeb97

Please sign in to comment.