Open sarthakpati opened 8 months ago
Hi @sarthakpati can you please assign this issue to me.
Thanks, done.
Stale issue message
Stale issue message
Hi @vedik2002, are you still working on this?
Stale issue message
Hey @vedik2002 are you still working on this?
Hi @sarthakpati can please remove me from this issue.
Here are a few viable alternatives to our current configuration management system:
Data Classes:
dataclasses
module [ref] provides a decorator and functions for automatically adding special methods to user-defined classes. This can make your code cleaner and more efficient when dealing with a large number of parameters.
from dataclasses import dataclass
@dataclass class Parameters: param1: int param2: float param3: str
Named Tuples:
collections.namedtuple
module [ref] can be used to create tuple subclasses with named fields. This can be faster than dictionaries for certain operations.
from collections import namedtuple
Parameters = namedtuple('Parameters', ['param1', 'param2', 'param3']) params = Parameters(param1=1, param2=2.0, param3='three')
Did you have something else in mind, @VukW?
I'd prefer to stick to pydantic models (BaseModel, BaseSettings) as they actually give the same experience and simplicity as dataclass but with additional handy tools like custom fields validation, runtime type checking, etc
@sarthakpati yes, exactly
Cool, thanks. 👍🏽
Is your feature request related to a problem? Please describe. Currently, the configuration parsing is done by a single submodule [ref], which is creates issues with maintenance as more functionality is introduced.
Describe the solution you'd like Using a configuration validation mechanism that is more standardized would make the developer and user experience much better. Some examples are (and this is by no means an exhaustive list):
Describe alternatives you've considered N.A.
Additional context It would make sense to eventually move GaNDLF's various functionalities to something like Hydra, and this could potentially be a good starting point.