resgroup / wind-up

A tool to assess yield uplift of wind turbines
BSD 3-Clause "New" or "Revised" License
14 stars 2 forks source link

speed up analysis #20

Open aclerc opened 1 week ago

aclerc commented 1 week ago

Running a full wind up analysis is relatively slow. I have not profiled yet.

aclerc commented 1 week ago

maybe speeding up existing tests is a good place to start, test_detrend.py and test_pp_analysis.py are probably the important ones because these calculations run for every test-reference pair.

izofat commented 1 week ago

@aclerc

==================== slowest durations =======================
15.79s call     tests/test_optimize_northing.py::test_auto_northing_corrections
6.97s call     tests/test_northing.py::test_apply_northing_corrections
5.74s call     tests/test_detrend.py::test_calc_wsratio_v_wd_scen
3.72s call     tests/test_reanalysis_data.py::test_add_reanalysis_data
1.11s call     tests/test_long_term.py::test_calc_windfarm_lt_dfs_raw_filt
0.40s call     tests/test_pp_analysis.py::test_pre_post_pp_analysis_with_reversal
0.29s call     tests/test_scada_funcs.py::test_filter_rpm_and_pt
0.26s call     tests/test_detrend.py::test_apply_wsratio_v_wd_scen_pre
0.25s call     tests/test_long_term.py::test_calc_turbine_lt_dfs_raw_filt
0.23s call     tests/test_waking_state.py::test_add_waking_state
0.21s call     tests/test_detrend.py::test_apply_wsratio_v_wd_scen_post
0.18s call     tests/test_windspeed_drift.py::test_check_windspeed_drift
0.14s call     tests/test_ws_est.py::test_ws_est
0.11s call     tests/test_detrend.py::test_check_applied_detrend
0.08s call     tests/test_combine_results.py::test_brt_t16_pitch
0.04s call     tests/test_main_analysis.py::test_toggle_pairing_filter_method_any_within_timedelta
0.04s call     tests/test_combine_results.py::test_brt_t16_pitch_no_auto_choose
0.04s call     tests/test_power_curve.py::test_calc_pc_and_rated_ws

test_calc_wsratio_v_wd_scen function seems like the problem I am on it. I will check test_auto_northing_corrections and test_apply_northing_corrections later.