Python Testing and Project Tools
Replace the sensor input
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.
Context for this challenge
Look up source_name in sources, then filter those records using temperature_c and limit_c. With recording selected and a limit of 25, return the complete south record. Changing the source must change the result without changing the alert rule.
The sensor is unavailable, but the report still needs a repeatable input.
Look up one name retrieves the records under source_name. Read temperature_c, check the alert limit, and keep the matching original records.
Examples and results
- Recorded and device readings
- recording
- house
- north
- temperature_c
- 18
- house
- south
- temperature_c
- 25
house temperature_c north 18 south 25 - device
- house
- north
- temperature_c
- 30
- house
- south
- temperature_c
- 19
house temperature_c north 30 south 19
- Alert limit in C
25
- Source name to use
recording
- Required result
- house
- south
- temperature_c
- 25
house temperature_c south 25
- Recorded and device readings
- recording
- house
- north
- temperature_c
- 18
- house
- south
- temperature_c
- 25
house temperature_c north 18 south 25 - device
- house
- south
- temperature_c
- 29
- house
- north
- temperature_c
- 31
house temperature_c south 29 north 31
- Alert limit in C
30
- Source name to use
device
- Required result
- house
- north
- temperature_c
- 31
house temperature_c north 31
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
Both sources are supplied local records. The blocks do not contact a sensor. The Python collector also handles calibration, per-record limits and a complete report payload. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
A replacement source has no alerts
This check uses the pieces from “Build with the recorded input”.
BOTIE
- Recorded and device readings
- recording
- house
- north
- temperature_c
- 20
- house
- south
- temperature_c
- 24
house temperature_c north 20 south 24 - device
- house
- north
- temperature_c
- 40
house temperature_c north 40
- Alert limit in C
25
- Source name to use
recording
Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
What would still need checking against the actual sensor?
Replace the input source without copying the report calculation.
Both sources are supplied local records. The blocks do not contact a sensor. The Python collector also handles calibration, per-record limits and a complete report payload.