from dataclasses import dataclass, field


@dataclass
class ProjectConfig:
    data_dir: str = field(
        default="TODO: update data dir",
        metadata={"help": "Base directory for data."},
    )
    models_dir: str = field(
        default="TODO: update models dir",
        metadata={"help": "Base directory for models."},
    )
    results_dir: str = field(
        default="TODO: update results dir",
        metadata={"help": "Base directory for results."},
    )

    @property
    def data_raw_dir(self) -> str:
        return f"{self.data_dir}/raw"

    @property
    def data_interim_dir(self) -> str:
        return f"{self.data_dir}/interim"

    @property
    def data_processed_dir(self) -> str:
        return f"{self.data_dir}/processed"

    @property
    def data_static_raw_dir(self) -> str:
        return f"{self.data_dir}/static/raw"
    
    @property
    def models_base_dir(self) -> str:
        return f"{self.models_dir}/base"
    
    @property
    def models_pretrained_dir(self) -> str:
        return f"{self.models_dir}/pretrained"
    
    @property
    def models_finetuned_dir(self) -> str:
        return f"{self.models_dir}/finetuned"
    


@dataclass
class DeviceConfig:
    num_gpus: int = field(default=1, metadata={"help": "Number of GPUs to use."})
    gpu_memory_utilization: float = field(
        default=0.9, metadata={"help": "Fraction of GPU memory to utilize."}
    )
    enforce_eager: bool = field(
        default=True, metadata={"help": "Whether to enforce eager execution."}
    )
