The record is [(0,21.0),(1,21.5),(2,None),(3,22.0),(4,20.5)], where each pair is time [s] and temperature [°C].
Procedure
Convert each list item to a dictionary with time and temperature.
Calculate the count, mean, minimum, and maximum of samples excluding None.
Write a summarize function that leaves the original input unchanged.
Results to retain
A 5-row record table, 4 summary statistics, and function code.
summarize(rows) input: a list of dictionaries with time and temperature.
Variable to summarize: temperature.
Returned fields: valid sample count, mean, minimum, and maximum. Keep the same fields.
Items to record and points to check
t [s]
Temperature [°C]
Validity
Points to check
Did you avoid interpreting None as 0°C?
Is the original list unchanged after the function call?
2. Boundary values and empty input
Starting conditions
Convert each of the three inputs in cases in the code to the same list of dictionaries as in Activity 1, then pass them to summarize. Leave the empty list unchanged, and map the first value of each pair to time and the second to temperature.
Procedure
Define the behavior to return None for the mean when there are 0 valid samples.
Check that the returned fields are the same for one sample and multiple samples.
Use asserts to check empty input, input with missing values, and single-sample input separately.
Results to retain
A 3-row boundary value table and 3 passing asserts.
Items to record and points to check
Input type
Valid count
Mean
Reason for handling
Points to check
Does it avoid division by 0 for 0 samples?
Do the returned fields stay the same regardless of input size?
3. Organize repeated measurements in a function
Starting conditions
Compare the two devices and B=[19,None,20,21]. The temperature unit is the same as in the original data.
Procedure
Convert each device's temperature list to a list of dictionaries with time and temperature, and pass it to the same summarize function. Since these data have no times, use time=None and summarize only the temperatures.
Record each device's valid sample count, mean, and range in one table.
Briefly summarize what to check when comparing data with different sample counts and missing-value patterns.
Results to retain
A device comparison table and a brief interpretation.
Items to record and points to check
Device
Valid count
Mean [°C]
Minimum and maximum [°C]
Missing count
Points to check
Did you reuse a function instead of copying the same calculation code and modifying it separately?
Did you distinguish device differences from differences in sample composition?