test_ride_power_profile.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:scikit-cycling 作者: scikit-cycling 项目源码 文件源码
def test_ridepp_fit_w_weight():
    filename = load_toy()[0]
    ride_rpp = RidePowerProfile(max_duration_profile=1, cyclist_weight=60.)
    ride_rpp.fit(filename)
    data = np.array([
        0., 500., 475.5, 469.33333333, 464., 463., 462.33333333, 461.71428571,
        455.875, 450.55555556, 447.3, 444.81818182, 442.08333333, 439.53846154,
        435.71428571, 432.06666667, 428.75, 424.35294118, 420.44444444,
        413.78947368, 409.9, 407.23809524, 402.5, 399.91304348, 396.45833333,
        394.76, 392.19230769, 388.62962963, 384.75, 380., 373.8, 367.70967742,
        362.96875, 357.90909091, 354.02941176, 349.68571429, 345.83333333,
        342.18918919, 338.36842105, 335.02564103, 331.375, 328.95121951,
        325.64285714, 322.37209302, 318.09090909, 315.15555556, 312.23913043,
        309.59574468, 307.08333333, 304.55102041, 301.9, 300.70588235, 300.5,
        299.90566038, 300.03703704, 298.92727273, 298.10714286, 297.56140351,
        296.48275862, 296.30508475
    ])
    assert_allclose(ride_rpp.data_, data)
    assert ride_rpp.data_norm_ == pytest.approx(data / 60.)
    assert ride_rpp.cyclist_weight == pytest.approx(60.)
    assert ride_rpp.max_duration_profile == 1
    assert ride_rpp.date_profile_ == date(2014, 5, 7)
    assert ride_rpp.filename_ == filename
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号