# There's no point using LVM and unconditionally filling the
# VG with a single LV, but we should use more of a smaller
# disk to avoid the user running into out of space errors
# earlier than they probably expect to.
if vg.size < 10 * (2 << 30):
# Use all of a small (<10G) disk.
lv_size = vg.size
elif vg.size < 20 * (2 << 30):
# Use 10G of a smallish (<20G) disk.
lv_size = 10 * (2 << 30)
elif vg.size < 200 * (2 << 30):
# Use half of a larger (<200G) disk.
lv_size = vg.size // 2
# Use at most 100G of a large disk.
lv_size = 100 * (2 << 30)
The rationale is that LVM is a volume management layer; there’s no point in using LVM if your intent is to only have a single filesystem that uses the whole partition. Furthermore, it is trivial for the user to expand a volume post-install, but very difficult to shrink a volume post-install if more space is needed.
The above logic maximizes the chances that LVM will be useful to the user, while also being mindful of disk space issues.