Closed frankenjoe closed 2 years ago
Merging #18 (c8ef10a) into master (c99f281) will not change coverage. The diff coverage is
100.0%
.
Impacted Files | Coverage Δ | |
---|---|---|
audobject/__init__.py | 100.0% <ø> (ø) |
|
audobject/core/resolver.py | 100.0% <100.0%> (ø) |
If, I'm running the code example in an ipython
shell, I get:
/home/audeering.local/hwierstorf/git/audeering/audobject/audobject/core/object.py:260: RuntimeWarning: Could not determine a version for module '__main__'.
RuntimeWarning,
and the resulting YAML looks like this:
$__main__.MyObjectWithFunction:
func: "def add(a, b):\n return a + b\n"
Not sure if this is a problem, just wanted to point that out. So maybe it would make sense to disable the versioning for the user functions altogether?
So maybe it would make sense to disable the versioning for the user functions altogether?
You always get the warning when you locally define a class, this is not related to using functions.
To avoid it, you can try: __version__ = '1.0.0'
in your shell
Ah, ok, sorry I missed that. The problem is not that we deal with user defined functions, but that I defined the class also locally.
Adds a new class
FunctionResolver
that allows it to serialize (lambda) functions.