Beispiel #1
0
 def test_kpa_to_mpa(self):
     df1 = pd.DataFrame({
         "soil_pressure": [0.0, 0.25, 0.75],
         "water_pressure": [0.0, 0.0, 4.905]
     })
     v = utils.kpa_to_mpa(df1, ["soil_pressure", "water_pressure"])
     df = pd.DataFrame({
         "soil_pressure": [0.0, 0.00025, 0.00075],
         "water_pressure": [0.0, 0.0, 0.004905],
     })
     assert_frame_equal(v, df)
Beispiel #2
0
 def test_kpa_to_mpa(self):
     df1 = pl.DataFrame({
         "soil_pressure": [0.0, 0.25, 0.75],
         "water_pressure": [0.0, 0.0, 4.905]
     })
     v = utils.kpa_to_mpa(df1, ["soil_pressure", "water_pressure"])
     df = pl.DataFrame({
         "soil_pressure": [0.0, 0.00025, 0.00075],
         "water_pressure": [0.0, 0.0, 0.004905],
     })
     # TODO: replace with frame_equal when rounding is supported
     # assert df_calculated.frame_equal(df, null_equal=True)
     for column in df.columns:
         assert v[column].round(6) == df[column]