Spaces:
Runtime error
Runtime error
File size: 897 Bytes
a03fc9e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
"""
Layout generator abstract interface
Define standard process for layout generation
"""
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Optional
class LayoutGenerator(ABC):
"""Layout generator base class"""
@abstractmethod
def generate(
self,
config_path: Path,
output_dir: Path,
seed: int = 0
) -> Path:
"""
Generate layout
Args:
config_path: Configuration file path
output_dir: Output directory
seed: Random seed
Returns:
Generated .blend file path
"""
pass
@abstractmethod
def validate_config(self, config_path: Path) -> bool:
"""Validate if configuration file is valid"""
pass
class GenerationError(Exception):
"""Layout generation error"""
pass
|