-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add path option to Configuration class #38
Comments
This is turning into a major change to the way configuration structure is defined. Originally, we wanted the ability to get the config for sub-modules directly: |
Discovered a related bug: When a Edit: fixed in dev branch. |
We need to decide on our priority between performance and type-checking. The more stream-lined implementation confuses the type-checker, and rewriting it to be both type-safe and fast will require significantly more work. for now i'm in favor of performance, and quieting the type-checker. Changes to the Configuration class mean we can probably drop the |
Fixes: #38 * The Configuration class now handles default values set in Config dataclasses. As a result, we no longer need the DataclassConfig source to lookup default values. * Improve Configuration repr for paths and child-configs * Remove DataclassConfig from example code and docs
Fixes: #38 * The Configuration class now handles default values set in Config dataclasses. As a result, we no longer need the DataclassConfig source to lookup default values. * Improve Configuration repr for paths and child-configs * Remove DataclassConfig from example code and docs
The
Configuration
class currently relies on the config_class__module__
attribute for its namespacing.While this is a reasonable default/fallback, esp. for simple modules, It forces some undesirable constraints on the structure of our configuration.
Proposed improvement:
Add a
path
parameter toConfiguration
.It should replace the
_mod_
property.Ensure that, given a Config Dataclass,
get_config
can find its path, and retrieve values using it. This may require adding a__path
attribute to the dataclass.Optional validation: Ensure the
config_class
path matches the path+name of the parent config.The text was updated successfully, but these errors were encountered: