feat: Refactor path properties in Settings class to use proj_root
This commit is contained in:
parent
3ac432567b
commit
5e5f14f5fa
|
|
@ -42,33 +42,39 @@ class Settings(BaseSettings):
|
||||||
extra="ignore",
|
extra="ignore",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def proj_root(self) -> Path:
|
||||||
|
return Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def data_path(self) -> Path:
|
def data_path(self) -> Path:
|
||||||
return Path(self.data_path_)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.data_path_
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def models_path(self) -> Path:
|
def models_path(self) -> Path:
|
||||||
return Path(self.models_path_)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.models_path_
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def processed_path(self) -> Path:
|
def processed_path(self) -> Path:
|
||||||
return Path(self.processed_path_)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.processed_path_
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def raw_path(self) -> Path:
|
def raw_path(self) -> Path:
|
||||||
return Path(self.raw_path_)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.raw_path_
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def interim_path(self) -> Path:
|
def interim_path(self) -> Path:
|
||||||
return Path(self.interim_path_)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.interim_path_
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def external_path(self) -> Path:
|
def external_path(self) -> Path:
|
||||||
return Path(self.external_path_)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.external_path_
|
||||||
@property
|
|
||||||
def proj_root(self) -> Path:
|
|
||||||
return Path(__file__).resolve().parents[1]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def database_url(self) -> str:
|
def database_url(self) -> str:
|
||||||
|
|
@ -144,7 +150,7 @@ class Settings(BaseSettings):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def kubeconfig_path(self) -> Path:
|
def kubeconfig_path(self) -> Path:
|
||||||
return Path(self.kubeconfig_path)
|
proj_root = self.proj_root
|
||||||
|
return proj_root / self.kubeconfig_path
|
||||||
|
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
Loading…
Reference in New Issue