Skip to content
Snippets Groups Projects

Several fixes and refactorings to the interpolation methods

Closed David Schäfer requested to merge interpolation_fixes into develop
2 unresolved threads

Fixes #388 (closed), unfortunately the implementation of interpolateNANs with limit is not None is quite a bit slower, then the incorrect previous one. Any ideas to speed things up are highly appreciated, I couldn't find a better solution despite a few hours of trying.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
63 63 qc = SaQC(data, flags)
64 64 qc_lin_1 = qc.interpolateInvalid(field, method="linear", limit=2)
65 65 qc_lin_2 = qc.interpolateInvalid(field, method="linear", limit=3)
66 qc_lin_3 = qc.interpolateInvalid(field, method="linear", limit=4)
67 66
68 67 assert qc_lin_1.data[field][characteristics["missing"]].isna().all()
69 assert qc_lin_2.data[field][characteristics["missing"]].isna().all()
70 assert qc_lin_3.data[field][characteristics["missing"]].notna().all()
68 assert qc_lin_2.data[field][characteristics["missing"]].notna().all()
  • Bert Palm
    Bert Palm @palmb started a thread on the diff
  • 251 ),
    252 (
    253 None,
    254 None,
    255 "both",
    256 [np.nan, 0, np.nan, np.nan, np.nan, 4, np.nan],
    257 [0, 0, 1, 2, 3, 4, 4],
    258 ),
    259 ],
    260 )
    261 def test_interpolatNANs(limit, area, direction, data, expected):
    262
    263 got = interpolateNANs(
    264 pd.Series(data), limit=limit, limit_area=area, limit_direction=direction
    265 )
    266 assert got.equals(pd.Series(expected, dtype=float))
  • Please register or sign in to reply
    Loading