from app.models import Dewar


def calculate_number_of_pucks(dewar: Dewar) -> int:
    return len(dewar.pucks) if dewar.pucks else 0


def calculate_number_of_samples(dewar: Dewar) -> int:
    if not dewar.pucks:
        return 0
    return sum(len(puck.positions) for puck in dewar.pucks)
