Module diskchef.maps.base
Expand source code
from dataclasses import dataclass
import logging
from typing import List, Union
from diskchef.chemistry.base import ChemistryBase
from diskchef.physics.base import PhysicsBase
from diskchef.lamda.line import Line
@dataclass
class MapBase:
"""The base class for map generation"""
chemistry: Union[ChemistryBase, PhysicsBase] = None
line_list: List[Line] = None
def __post_init__(self):
self.logger = logging.getLogger(__name__ + '.' + self.__class__.__qualname__)
self.logger.info("Creating an instance of %s", self.__class__.__qualname__)
self.logger.debug("With parameters: %s", self.__dict__)
@property
def table(self):
return self.chemistry.table
Classes
class MapBase (chemistry: Union[ChemistryBase, PhysicsBase] = None, line_list: List[Line] = None)
-
The base class for map generation
Expand source code
@dataclass class MapBase: """The base class for map generation""" chemistry: Union[ChemistryBase, PhysicsBase] = None line_list: List[Line] = None def __post_init__(self): self.logger = logging.getLogger(__name__ + '.' + self.__class__.__qualname__) self.logger.info("Creating an instance of %s", self.__class__.__qualname__) self.logger.debug("With parameters: %s", self.__dict__) @property def table(self): return self.chemistry.table
Subclasses
Class variables
var chemistry : Union[ChemistryBase, PhysicsBase]
var line_list : List[Line]
Instance variables
var table
-
Expand source code
@property def table(self): return self.chemistry.table