Documentation
Documentation
API Reference
API Reference
stop
cauldron.project.stop()
Stops the execution of the project at the current step immediately
without raising an error. Use this to abort running the project in
situations where some critical branching action should prevent the
project from continuing to run.
A custom display message to include in the display for the stop
action. This message is ignored if silent is set to True.
When True nothing will be shown in the notebook display when the
step is stopped. When False, the notebook display will include
information relating to the stopped action.
Background
It can sometimes be useful to stop the running of a project at a specific
point within a step before all of the code has been executed. The reason may
be conditional, or it may be that you want to debug a portion of the project
without running the rest of it. Whatever the reason, this is the function to
use for such a process.
Basic Usage
01
02
03
04
05
06
07
08
09
import cauldron as cd
print('This will appear in the notebook')
cd.project.stop()
print('This will not appear because it will never run')
The stop function can be useful when used conditionally:
01
02
03
04
05
06
07
08
09
10
11
import cauldron as cd
import pandas as pd
df = pd.read_csv('example_data.csv')
if len(df) == 0:
cd.project.stop()
cd.shared.df = df