mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-03-12 20:35:31 +08:00
refactor(configs, data_loading): improve code clarity and add docstrings
This commit is contained in:
@@ -26,8 +26,8 @@ class OutputConfig(BaseModel):
|
||||
|
||||
@field_validator("directory", mode="after")
|
||||
def convert_to_absolute(cls, v: Path) -> Path:
|
||||
"""
|
||||
Converts the path to an absolute path relative to the current working directory.
|
||||
"""Converts the path to an absolute path relative to the project root.
|
||||
|
||||
This works even if the path doesn't exist on disk.
|
||||
"""
|
||||
if v.is_absolute():
|
||||
@@ -55,8 +55,8 @@ class DatasetConfig(BaseModel):
|
||||
|
||||
@field_validator("dataset_root", "output_dir", mode="after")
|
||||
def convert_to_absolute(cls, v: Path) -> Path:
|
||||
"""
|
||||
Converts the path to an absolute path relative to the project root.
|
||||
"""Converts the path to an absolute path relative to the project root.
|
||||
|
||||
This works even if the path doesn't exist on disk.
|
||||
"""
|
||||
if v.is_absolute():
|
||||
|
||||
Reference in New Issue
Block a user