Reword the comments in the test suite
Each comment is one sentence or two short ones joined by "=>", without a final period.
This commit is contained in:
parent
0f69709226
commit
bca4250b4d
3 changed files with 39 additions and 59 deletions
|
|
@ -27,8 +27,7 @@ def horizontal_datetime_index():
|
|||
index = pd.Index(gen)
|
||||
index.name = "start_at"
|
||||
|
||||
# Sanity check.
|
||||
# `+1` as both the `START` and `END` day are included.
|
||||
# `n_days` includes both the `START` and `END` day => `+1`
|
||||
n_days = (test_config.END - test_config.START).days + 1
|
||||
assert len(index) == n_days
|
||||
|
||||
|
|
@ -63,8 +62,7 @@ def vertical_datetime_index():
|
|||
index = pd.Index(gen)
|
||||
index.name = "start_at"
|
||||
|
||||
# Sanity check: n_days * n_number_of_opening_hours.
|
||||
# `+1` as both the `START` and `END` day are included.
|
||||
# `n_days` includes both the `START` and `END` day => `+1`
|
||||
n_days = (test_config.END - test_config.START).days + 1
|
||||
assert len(index) == n_days * 12
|
||||
|
||||
|
|
@ -122,8 +120,7 @@ def order_totals(good_pixel_id):
|
|||
|
||||
df = pd.DataFrame(data={"n_orders": 1}, index=index)
|
||||
|
||||
# Sanity check: n_pixels * n_time_steps_per_day * n_days.
|
||||
# `+1` as both the `START` and `END` day are included.
|
||||
# `n_days` includes both the `START` and `END` day => `+1`
|
||||
n_days = (test_config.END - test_config.START).days + 1
|
||||
assert len(df) == 2 * 12 * n_days
|
||||
|
||||
|
|
|
|||
|
|
@ -125,8 +125,7 @@ class TestAggregateOrders:
|
|||
|
||||
result = oh.aggregate_orders()
|
||||
|
||||
# Even though there are only 10 orders, there are 12 rows in the `DataFrame`.
|
||||
# That is so as `0`s are filled in for hours without any demand at the end.
|
||||
# `0`s fill the hours without demand at the end => 12 rows from 10 orders
|
||||
assert len(result) == 12
|
||||
assert result["n_orders"].min() == 0
|
||||
assert result["n_orders"].max() == 1
|
||||
|
|
@ -241,8 +240,7 @@ class TestAggregateOrders:
|
|||
|
||||
result = oh.aggregate_orders()
|
||||
|
||||
# The resulting `DataFrame` has 24 rows for the 24 30-minute time steps.
|
||||
# The rows' values are `0` and `1` alternating.
|
||||
# 24 rows for the 24 30-minute time steps, alternating between `0` and `1`
|
||||
assert len(result) == 24
|
||||
assert result["n_orders"].min() == 0
|
||||
assert result["n_orders"].max() == 1
|
||||
|
|
@ -314,7 +312,7 @@ class TestAggregateOrders:
|
|||
"""A persisted `Grid` with two `Pixel` objects."""
|
||||
# One `Address` in the lower-left `Pixel`, ...
|
||||
address1 = make_address(latitude=48.8357377, longitude=2.2517412)
|
||||
# ... and another one in the upper-right one.
|
||||
# ... and another one in the upper-right one
|
||||
address2 = make_address(latitude=48.8898312, longitude=2.4357622)
|
||||
|
||||
addresses_mock.return_value = [address1, address2]
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class TestChooseTacticalModel:
|
|||
data = order_history._data
|
||||
data.loc[:, "n_orders"] = 1
|
||||
|
||||
# ... and we set three additional time steps per day to `0`.
|
||||
# ... and we set three additional time steps per day to `0`
|
||||
data.loc[
|
||||
# all `Pixel`s, all `Order`s in time steps starting at 11 am
|
||||
(slice(None), slice(data.index.levels[1][0], None, 12)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue