Closed frankenjoe closed 3 years ago
Merging #14 (068fb81) into master (550c102) will not change coverage. The diff coverage is
100.0%
.
Impacted Files | Coverage Δ | |
---|---|---|
audobject/__init__.py | 100.0% <ø> (ø) |
|
audobject/core/decorator.py | 100.0% <100.0%> (ø) |
|
audobject/core/define.py | 100.0% <100.0%> (ø) |
|
audobject/core/object.py | 100.0% <100.0%> (ø) |
|
audobject/core/parameter.py | 100.0% <100.0%> (ø) |
|
audobject/core/resolver.py | 100.0% <100.0%> (ø) |
|
audobject/core/utils.py | 100.0% <100.0%> (ø) |
Great.
One question: if we store the same object as a YAML file at two different locations the YAML files will be slightly different (as the relative path is different), but when loading them the path will be nicely expanded and the resulting objects will be identical again. Could it ever be a problem that this produces two different YAML files? I don't see an issue here, but I wanted to ask.
Could it ever be a problem that this produces two different YAML files?
I would say it makes sense that the YAML files look different, since also their locations with respect to the referenced file is different.
This adds a feature - as simple as it sounds - I have been struggeling with for some time. It will be useful if a user wants to serialize objects that require input from external files (e.g. a file storing model weights etc.). If we would simply store the file path as it is, we get a YAML that is not be portable as it will not find the files once we move it to another location.
As a solution this adds
FilePathResolver
to properly save and recover files path arguments. Here's what it does:Example from the usage section: