Closed ali-tny closed 4 years ago
Merging #26 into master will increase coverage by
0.02%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #26 +/- ##
==========================================
+ Coverage 88.68% 88.70% +0.02%
==========================================
Files 34 34
Lines 1723 1727 +4
==========================================
+ Hits 1528 1532 +4
Misses 195 195
Impacted Files | Coverage Δ | |
---|---|---|
timeserio/pipeline/multipipeline.py | 90.32% <100.00%> (+1.43%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b23d49b...32d6baa. Read the comment docs.
MultiPipeline uses
__getattr__
to expose subpipelines stored in the dictMutliPipeline.pipelines
as attributes, so sklearn can access them when using.get_params
and.set_params
. However,__getattr__
is only called if the attribute isn't found in theobjects .__dict__
- so if a whole pipeline is overwritten withpipeline.set_params
, it silently creates a new attribute that is accessed instead of the original subpipeline with usinggetattr
, but the original pipeline remains unchanged when accessed viapipeline.pipelines
(which is how it's called in.transform
or.fit
).In other words, using
.set_params
for an entire subpipeline causes.get_params
to show different parameters to what's being called in the code.This change adds a failing test & a fix: implementing
__setattr__
so that the attributes and pipelines are always in sync regardless of how they are updated.