Skip to content

Commit

Permalink
KCLayout to proxy Layout, make each layout a library layout to allow …
Browse files Browse the repository at this point in the history
…inserting library cells
  • Loading branch information
sebastian-goeldi committed Aug 9, 2023
1 parent b5146bc commit b77a02d
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 151 deletions.
21 changes: 10 additions & 11 deletions src/kfactory/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import loguru
from loguru import logger as logger
from pydantic import BaseModel, Field
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict

if TYPE_CHECKING:
from loguru import Logger
Expand Down Expand Up @@ -90,9 +90,17 @@ def get_affinity() -> int:
return threads


class Settings(BaseSettings):
class Settings(
BaseSettings,
):
"""KFactory settings object."""

model_config = SettingsConfigDict(
arbitrary_types_allowed=True,
env_prefix="kfactory_",
env_nested_delimiter="_",
)

n_threads: int = get_affinity()
logger: ClassVar[Logger] = logger
logfilter: LogFilter = Field(default_factory=LogFilter)
Expand All @@ -105,15 +113,6 @@ def __init__(self, **data: Any):
self.logger.add(sys.stdout, format=tracing_formatter, filter=self.logfilter)
self.logger.info("LogLevel: {}", self.logfilter.level)

class Config:
"""Pydantic settings."""

validation = False
arbitrary_types_allowed = True
# fields = {"logger": {"exclude": True}}
env_prefix = "kfactory_"
env_nested_delimiter = "_"


config = Settings()

Expand Down
Loading

0 comments on commit b77a02d

Please sign in to comment.