Python Testing and Project Tools
Stop an import from running the report
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
Return the rows that need moving behind the main entry point: kind must be "report run" and when must be "import". Match each field separately, require both decisions, then keep those rows. The first result should identify Read readings.csv.
A caller wants the calculation, but importing it also starts the report.
Read kind and when from the same rows. Configure one text matcher for report run and another for import. Require both, then keep the original steps.
Examples and results
- Steps currently performed by the report module
- step
- Define summarize_alerts
- kind
- definition
- when
- import
- step
- Read readings.csv
- kind
- report run
- when
- import
- step
- Print the report
- kind
- report run
- when
- main
step kind when Define summarize_alerts definition import Read readings.csv report run import Print the report report run main - Required result
- step
- Read readings.csv
- kind
- report run
- when
- import
step kind when Read readings.csv report run import
- Steps currently performed by the report module
- step
- Define summarize_alerts
- kind
- definition
- when
- import
- step
- Read readings.csv
- kind
- report run
- when
- main
- step
- Print the report
- kind
- report run
- when
- main
step kind when Define summarize_alerts definition import Read readings.csv report run main Print the report report run main - Required result
[]
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
The rows describe a small Python module. These blocks inspect that description; the Python challenge separates reusable helpers from the application entry point. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
A new delivery step runs too early
This check uses the pieces from “Find report work that runs during import”.
BOTIE
- Steps currently performed by the report module
- step
- Define convert_report
- kind
- definition
- when
- import
- step
- Read the new batch
- kind
- report run
- when
- import
- step
- Send the completed report
- kind
- report run
- when
- import
step kind when Define convert_report definition import Read the new batch report run import Send the completed report report run import
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.
Which actions belong in the entry point of your own report program?
Keep reusable definitions available without starting the application.
The rows describe a small Python module. These blocks inspect that description; the Python challenge separates reusable helpers from the application entry point.