Height Of Male Models (iPhone)

from dataclasses import dataclass from datetime import datetime from typing import List, Optional, Dict import statistics @dataclass class MaleModel: id: str name: str height_cm: float # height in centimeters height_ft_in: Optional[str] = None # e.g., "6'1"" agency: Optional[str] = None category: Optional[str] = None # runway, commercial, fitness, etc. measurement_date: Optional[datetime] = None

def __init__(self, analyzer: MaleModelHeightAnalyzer): self.analyzer = analyzer self.heights = analyzer.heights height of male models

@staticmethod def cm_to_ft_in(cm: float) -> str: total_inches = cm / 2.54 feet = int(total_inches // 12) inches = round(total_inches % 12, 1) return f"{feet}'{inches}\"" 1) return f"{feet}'{inches}\"" def __init__(self

def __init__(self, models: List[MaleModel]): self.models = models self.heights = [m.height_cm for m in models] inches: float) -&gt

@staticmethod def ft_in_to_cm(ft: int, inches: float) -> float: return (ft * 12 + inches) * 2.54 class MaleModelHeightAnalyzer: """Feature for analyzing male model heights""" # Industry standard height ranges (cm) RUNWAY_MIN = 185 # 6'1" RUNWAY_MAX = 192 # 6'3.6" COMMERCIAL_MIN = 175 # 5'9" COMMERCIAL_MAX = 190 # 6'2.8" FITNESS_MIN = 178 # 5'10" FITNESS_MAX = 188 # 6'2"

def category_fit(self) -> Dict[str, Dict]: """Categorize models based on industry standards""" results = {} for model in self.models: fits = [] if self.RUNWAY_MIN <= model.height_cm <= self.RUNWAY_MAX: fits.append("runway") if self.COMMERCIAL_MIN <= model.height_cm <= self.COMMERCIAL_MAX: fits.append("commercial") if self.FITNESS_MIN <= model.height_cm <= self.FITNESS_MAX: fits.append("fitness") # Special classifications if model.height_cm < self.COMMERCIAL_MIN: fits.append("short_for_industry") elif model.height_cm > self.RUNWAY_MAX: fits.append("tall_for_industry") results[model.id] = { "name": model.name, "height_cm": model.height_cm, "height_ft_in": model.height_ft_in, "suitable_categories": fits, "is_ideal_runway": self.RUNWAY_MIN <= model.height_cm <= self.RUNWAY_MAX } return results