Earlier I thought you couldn't be in the 95th percentile if there were fewer than 20 unique values in a vector. You can! But you can't if there are fewer than 20 values total in a vector. Therefore we should be filtering out nparts < 20, not skew_unique or simpson_unique < 20. This doesn't affect anything to like the 6th decimal place, but to get it right.
Earlier I thought you couldn't be in the 95th percentile if there were fewer than 20 unique values in a vector. You can! But you can't if there are fewer than 20 values total in a vector. Therefore we should be filtering out nparts < 20, not skew_unique or simpson_unique < 20. This doesn't affect anything to like the 6th decimal place, but to get it right.