Releases: aphp/confit
v0.9.0
Changelog
- Fix calling @validate_arguments on classes with wrapped
__init__
functions (e.g. accelerate loggers) - Enforce
auto_draft_in_config
parameter when a function is imported via entry points (i.e., apply precedence to function passed toRegistry.register
, instead of the one got from the entry point) - Add
default_config
option in CLI decorator
What's Changed
- feat: add default config option in CLI by @Thomzoy in #38
- fix: support @validate_arguments on classes with wrapped init by @percevalw in #37
Full Changelog: v0.8.0...v0.9.0
v0.8.0
Changelog
-
Added
auto_draft_in_config
parameter toregister(...)
function. This is meant for functions that can only be partially be instantiated by a user, because a required parameter will be provided by the library later.For instance:
- EDS-NLP's
ScheduledOptimizer
requires the pipeline parameters, which depends on the pipeline being trained - EDS-NLP's local trackers (like
csv
andjson
) requirelogging_dir
which might be defined in theedsnlp.train
function.
If a callable registered with
auto_draft_in_config=True
is resolved with missing required parameters, aDraft[ReturnType]
class is returned.
This class can then be instantiated via the draft.instantiate method.
We don't instantiate a Draft class via the__call__
method to avoid users mistakenly proceeding with a non instantiated class.
Instead, whenever a Draft an attribute or a method is requested on Draft class, outside the Draft few specific attrs/methods,
a message error is displayed explaining how this object is not instantiated yet.The user can also explicitly instantiate the Draft object via the
Class.draft
method for classes that have been wrapped withvalidate_arguments
. - EDS-NLP's
-
Added a
Validatable
class that can be inherited from to run avalidate
class method whenever the class is validated
Pull Requests
- feat: added allow_partial parameter by @percevalw in #34
- chore: bump version to 0.8.0 by @percevalw in #36
Full Changelog: v0.7.5...v0.8.0
v0.7.5
v0.7.4
Changelog
- Allow larger than 4096 bytes config files
- Escape tabs and newline when serializing to a config file
- Fix an infinite loop that occured when resolving a reference to a field with a null value
Pull Requests
- Fix/issue 26 : YAML Parsing for Large Config Files by @LucasDedieu in #28
- Fix: escape tabs and newline when serializing to a config file by @percevalw in #29
- Support reference to fields with null values by @percevalw in #30
- chore: bump version to 0.7.4 by @percevalw in #31
New Contributors
- @LucasDedieu made their first contribution in #28
Full Changelog: v0.7.3...v0.7.4
v0.7.3
Changelog
- Support interpolated seed in the config file (as a reminder, the seed is treated specifically by confit to initialize random generators before any object is resolved)
- Support if/else expressions in interpolation, and only resolve the relevant branch
Pull Requests
- Better interpolation by @percevalw in #25
- Bump version to 0.7.3 by @percevalw in #27
Full Changelog: v0.7.2...v0.7.3
v0.7.2
Changelog
- Seed the program BEFORE the config file is resolved and components have been instantiated, to ensure reproducibility.
Pull Request
- Seeded CLI by @percevalw in #24
Full Changelog: v0.7.1...v0.7.2
v0.7.1
Changelog
- Force utf-8 encoding when writing a config file (ini or yaml)
Pull Requests
- Fix encoding by @percevalw in #22
- chore: bump version to 0.7.1 by @percevalw in #23
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Changelog
Changed
- Aborting a script will now show the traceback
Fixed
- Confit should no longer cause pydantic v1 deprecation warnings
Pull Requests
- v0.7.0 by @percevalw in #21
Full Changelog: v0.6.0...v0.7.0
v0.6.0
Changelog
Fixed
- Support IPython autoreload on confit wrapped functions
- Support using config files with scripts without a dedicated section header
- Disable configparser interpolation (% symbol)
- Better support for escaped strings in config files
- Various registry-related fixes
Added
- Non-relevant fields (outside the script dedicated section) are no longer instantiated when running a script with a config file
- We now support loading and serializing configs in yaml syntax (
Confit.from_yaml_str
,Confit.to_yaml_str
,Confit.from_disk("___.yaml")
andConfit.to_disk("___.yaml")
)
Pull Requests
- Improvements by @percevalw in #19
- feat: support yaml syntax by @percevalw in #20
Full Changelog: v0.5.6...v0.6.0
v0.5.6
No change from v0.5.5.
Package is now distributed as source and wheel.
Full Changelog: v0.5.5...v0.5.6